feat(hubspot): Implement create contact action

This commit is contained in:
Vitalii Mykytiuk
2023-09-05 12:29:03 +03:00
committed by Faruk AYDIN
parent 9fbc9d59f5
commit 8ea8067788
14 changed files with 217 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import verifyCredentials from "./verify-credentials";
import isStillVerified from "./is-still-verified";
export default {
fields: [
{
key: 'accessToken',
label: 'Access Token',
type: 'string' as const,
required: true,
readOnly: false,
value: null,
placeholder: null,
description: null,
clickToCopy: false,
},
],
verifyCredentials,
isStillVerified
};

View File

@@ -0,0 +1,9 @@
import { IGlobalVariable } from '@automatisch/types';
import verifyCredentials from "./verify-credentials";
const isStillVerified = async ($: IGlobalVariable) => {
await verifyCredentials($);
return true;
};
export default isStillVerified;

View File

@@ -0,0 +1,12 @@
import { IGlobalVariable } from '@automatisch/types';
const verifyCredentials = async ($: IGlobalVariable) => {
await $.http.get(
`/crm/v3/objects/contacts?limit=1`,
);
await $.auth.set({
screenName: $.auth.data?.displayName,
});
};
export default verifyCredentials;