@workbuddy/piece-workbuddy-edge 1.0.32 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/index.d.ts.map +1 -1
- package/src/index.js +76 -14
- package/src/index.js.map +1 -1
- package/src/index.ts +139 -10
- package/src/lib/actions/crm-companies.d.ts +1 -0
- package/src/lib/actions/crm-companies.d.ts.map +1 -1
- package/src/lib/actions/crm-companies.js +9 -0
- package/src/lib/actions/crm-companies.js.map +1 -1
- package/src/lib/actions/crm-companies.ts +11 -0
- package/src/lib/actions/crm-contacts.d.ts +25 -0
- package/src/lib/actions/crm-contacts.d.ts.map +1 -1
- package/src/lib/actions/crm-contacts.js +135 -3
- package/src/lib/actions/crm-contacts.js.map +1 -1
- package/src/lib/actions/crm-contacts.ts +149 -2
- package/src/lib/actions/crm-contractors.d.ts +110 -0
- package/src/lib/actions/crm-contractors.d.ts.map +1 -1
- package/src/lib/actions/crm-contractors.js +585 -2
- package/src/lib/actions/crm-contractors.js.map +1 -1
- package/src/lib/actions/crm-contractors.ts +631 -1
- package/src/lib/actions/crm-customers.d.ts +94 -0
- package/src/lib/actions/crm-customers.d.ts.map +1 -1
- package/src/lib/actions/crm-customers.js +504 -3
- package/src/lib/actions/crm-customers.js.map +1 -1
- package/src/lib/actions/crm-customers.ts +545 -2
- package/src/lib/actions/crm-external-users.js +1 -1
- package/src/lib/actions/crm-external-users.js.map +1 -1
- package/src/lib/actions/crm-external-users.ts +1 -1
- package/src/lib/actions/crm-invites.d.ts +1 -0
- package/src/lib/actions/crm-invites.d.ts.map +1 -1
- package/src/lib/actions/crm-invites.js +9 -0
- package/src/lib/actions/crm-invites.js.map +1 -1
- package/src/lib/actions/crm-invites.ts +11 -0
- package/src/lib/actions/crm-sites.d.ts +10 -0
- package/src/lib/actions/crm-sites.d.ts.map +1 -1
- package/src/lib/actions/crm-sites.js +59 -3
- package/src/lib/actions/crm-sites.js.map +1 -1
- package/src/lib/actions/crm-sites.ts +70 -2
- package/src/lib/actions/crm-suppliers.d.ts +64 -0
- package/src/lib/actions/crm-suppliers.d.ts.map +1 -1
- package/src/lib/actions/crm-suppliers.js +352 -2
- package/src/lib/actions/crm-suppliers.js.map +1 -1
- package/src/lib/actions/crm-suppliers.ts +376 -1
- package/src/lib/actions/index.d.ts +7 -1
- package/src/lib/actions/index.d.ts.map +1 -1
- package/src/lib/actions/index.js +7 -1
- package/src/lib/actions/index.js.map +1 -1
- package/src/lib/actions/index.ts +7 -1
- package/src/lib/actions/items.d.ts +8 -0
- package/src/lib/actions/items.d.ts.map +1 -0
- package/src/lib/actions/items.js +42 -0
- package/src/lib/actions/items.js.map +1 -0
- package/src/lib/actions/items.ts +45 -0
- package/src/lib/actions/jobs-activities.d.ts +4 -3
- package/src/lib/actions/jobs-activities.d.ts.map +1 -1
- package/src/lib/actions/jobs-activities.js +19 -12
- package/src/lib/actions/jobs-activities.js.map +1 -1
- package/src/lib/actions/jobs-activities.ts +19 -12
- package/src/lib/actions/jobs-tasks.d.ts +0 -2
- package/src/lib/actions/jobs-tasks.d.ts.map +1 -1
- package/src/lib/actions/jobs-tasks.js +0 -12
- package/src/lib/actions/jobs-tasks.js.map +1 -1
- package/src/lib/actions/jobs-tasks.ts +0 -12
- package/src/lib/actions/jobs.d.ts +87 -1
- package/src/lib/actions/jobs.d.ts.map +1 -1
- package/src/lib/actions/jobs.js +495 -7
- package/src/lib/actions/jobs.js.map +1 -1
- package/src/lib/actions/jobs.ts +523 -6
- package/src/lib/actions/mcp.d.ts +3 -3
- package/src/lib/actions/mcp.d.ts.map +1 -1
- package/src/lib/actions/mcp.js +9 -9
- package/src/lib/actions/mcp.js.map +1 -1
- package/src/lib/actions/mcp.ts +8 -8
- package/src/lib/actions/pending-items.d.ts +8 -0
- package/src/lib/actions/pending-items.d.ts.map +1 -0
- package/src/lib/actions/pending-items.js +42 -0
- package/src/lib/actions/pending-items.js.map +1 -0
- package/src/lib/actions/pending-items.ts +45 -0
- package/src/lib/actions/settings-custom-fields.d.ts +21 -0
- package/src/lib/actions/settings-custom-fields.d.ts.map +1 -0
- package/src/lib/actions/settings-custom-fields.js +95 -0
- package/src/lib/actions/settings-custom-fields.js.map +1 -0
- package/src/lib/actions/settings-custom-fields.ts +107 -0
- package/src/lib/actions/settings-items.d.ts +136 -0
- package/src/lib/actions/settings-items.d.ts.map +1 -0
- package/src/lib/actions/settings-items.js +772 -0
- package/src/lib/actions/settings-items.js.map +1 -0
- package/src/lib/actions/settings-items.ts +818 -0
- package/src/lib/actions/{settings.d.ts → settings-reference-data.d.ts} +33 -10
- package/src/lib/actions/settings-reference-data.d.ts.map +1 -0
- package/src/lib/actions/settings-reference-data.js +423 -0
- package/src/lib/actions/settings-reference-data.js.map +1 -0
- package/src/lib/actions/settings-reference-data.ts +496 -0
- package/src/lib/actions/settings-templates.d.ts +15 -0
- package/src/lib/actions/settings-templates.d.ts.map +1 -0
- package/src/lib/actions/settings-templates.js +75 -0
- package/src/lib/actions/settings-templates.js.map +1 -0
- package/src/lib/actions/settings-templates.ts +79 -0
- package/src/lib/actions/stages-activities.d.ts +4 -3
- package/src/lib/actions/stages-activities.d.ts.map +1 -1
- package/src/lib/actions/stages-activities.js +19 -12
- package/src/lib/actions/stages-activities.js.map +1 -1
- package/src/lib/actions/stages-activities.ts +19 -12
- package/src/lib/actions/stages-pending-items.d.ts +75 -0
- package/src/lib/actions/stages-pending-items.d.ts.map +1 -0
- package/src/lib/actions/stages-pending-items.js +370 -0
- package/src/lib/actions/stages-pending-items.js.map +1 -0
- package/src/lib/actions/stages-pending-items.ts +404 -0
- package/src/lib/actions/stages-resources.d.ts.map +1 -1
- package/src/lib/actions/stages-resources.js +5 -8
- package/src/lib/actions/stages-resources.js.map +1 -1
- package/src/lib/actions/stages-resources.ts +8 -8
- package/src/lib/actions/stages-tasks.d.ts +0 -2
- package/src/lib/actions/stages-tasks.d.ts.map +1 -1
- package/src/lib/actions/stages-tasks.js +0 -12
- package/src/lib/actions/stages-tasks.js.map +1 -1
- package/src/lib/actions/stages-tasks.ts +0 -12
- package/src/lib/actions/stages.d.ts +20 -3
- package/src/lib/actions/stages.d.ts.map +1 -1
- package/src/lib/actions/stages.js +103 -21
- package/src/lib/actions/stages.js.map +1 -1
- package/src/lib/actions/stages.ts +116 -20
- package/src/lib/actions/webhooks-v2.js +11 -11
- package/src/lib/actions/webhooks-v2.js.map +1 -1
- package/src/lib/actions/webhooks-v2.ts +11 -11
- package/src/lib/actions/settings.d.ts.map +0 -1
- package/src/lib/actions/settings.js +0 -257
- package/src/lib/actions/settings.js.map +0 -1
- package/src/lib/actions/settings.ts +0 -301
|
@@ -3,10 +3,30 @@ export declare const PublicCrmCustomerController_list: import("@activepieces/pie
|
|
|
3
3
|
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
4
4
|
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
5
5
|
}>, {
|
|
6
|
+
search: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
|
+
integrationId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
6
8
|
status: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
7
9
|
cursor: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
8
10
|
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
9
11
|
}>;
|
|
12
|
+
export declare const PublicCrmCustomerController_create: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
13
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
14
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
15
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
16
|
+
}>, {
|
|
17
|
+
name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
18
|
+
address: import("@activepieces/pieces-framework").JsonProperty<true>;
|
|
19
|
+
contact: import("@activepieces/pieces-framework").JsonProperty<true>;
|
|
20
|
+
type: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
21
|
+
legalName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
22
|
+
phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
23
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
24
|
+
website: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
25
|
+
integrationId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
26
|
+
notes: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
27
|
+
customFields: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
28
|
+
socialNetwork: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
29
|
+
}>;
|
|
10
30
|
export declare const PublicCrmCustomerController_getById: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
11
31
|
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
12
32
|
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
@@ -14,6 +34,42 @@ export declare const PublicCrmCustomerController_getById: import("@activepieces/
|
|
|
14
34
|
}>, {
|
|
15
35
|
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
16
36
|
}>;
|
|
37
|
+
export declare const PublicCrmCustomerController_update: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
38
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
39
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
40
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
41
|
+
}>, {
|
|
42
|
+
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
43
|
+
name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
44
|
+
legalName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
45
|
+
phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
46
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
47
|
+
website: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
48
|
+
integrationId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
49
|
+
address: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
50
|
+
primarySite: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
51
|
+
owner: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
52
|
+
labels: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
53
|
+
notes: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
54
|
+
customFields: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
55
|
+
socialNetwork: import("@activepieces/pieces-framework").JsonProperty<false>;
|
|
56
|
+
}>;
|
|
57
|
+
export declare const PublicCrmCustomerController_delete: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
58
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
59
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
60
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
61
|
+
}>, {
|
|
62
|
+
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
63
|
+
}>;
|
|
64
|
+
export declare const PublicCrmCustomerController_updateStatus: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
65
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
66
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
67
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
68
|
+
}>, {
|
|
69
|
+
id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
70
|
+
statusId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
71
|
+
note: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
72
|
+
}>;
|
|
17
73
|
export declare const PublicCrmCustomerController_listContacts: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
18
74
|
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
19
75
|
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
@@ -23,6 +79,44 @@ export declare const PublicCrmCustomerController_listContacts: import("@activepi
|
|
|
23
79
|
cursor: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
24
80
|
limit: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
25
81
|
}>;
|
|
82
|
+
export declare const PublicCrmCustomerController_createContact: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
83
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
84
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
85
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
86
|
+
}>, {
|
|
87
|
+
customerId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
88
|
+
firstName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
89
|
+
lastName: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
90
|
+
login: import("@activepieces/pieces-framework").CheckboxProperty<true>;
|
|
91
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
92
|
+
phone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
93
|
+
mobile: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
94
|
+
title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
95
|
+
note: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
96
|
+
integrationId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
97
|
+
roleId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
98
|
+
sendEmail: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
99
|
+
autoDispatch: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
100
|
+
}>;
|
|
101
|
+
export declare const PublicCrmCustomerController_deleteContact: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
102
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
103
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
104
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
105
|
+
}>, {
|
|
106
|
+
customerId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
107
|
+
contactId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
108
|
+
}>;
|
|
109
|
+
export declare const PublicCrmCustomerController_inviteContact: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
110
|
+
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
111
|
+
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
112
|
+
clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
113
|
+
}>, {
|
|
114
|
+
customerId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
115
|
+
contactId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
116
|
+
roleId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
117
|
+
email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
118
|
+
sendEmail: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
119
|
+
}>;
|
|
26
120
|
export declare const PublicCrmCustomerController_listSites: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
27
121
|
baseUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
28
122
|
clientId: import("@activepieces/pieces-framework").ShortTextProperty<true>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crm-customers.d.ts","sourceRoot":"","sources":["crm-customers.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gCAAgC
|
|
1
|
+
{"version":3,"file":"crm-customers.d.ts","sourceRoot":"","sources":["crm-customers.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gCAAgC;;;;;;;;;;EAgF3C,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;EA6G7C,CAAC;AAEH,eAAO,MAAM,mCAAmC;;;;;;EA8B9C,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;EAqH7C,CAAC;AAEH,eAAO,MAAM,kCAAkC;;;;;;EA8B7C,CAAC;AAEH,eAAO,MAAM,wCAAwC;;;;;;;;EAkDnD,CAAC;AAEH,eAAO,MAAM,wCAAwC;;;;;;;;EAoDnD,CAAC;AAEH,eAAO,MAAM,yCAAyC;;;;;;;;;;;;;;;;;;EA4GpD,CAAC;AAEH,eAAO,MAAM,yCAAyC;;;;;;;EAmCpD,CAAC;AAEH,eAAO,MAAM,yCAAyC;;;;;;;;;;EA0DpD,CAAC;AAEH,eAAO,MAAM,qCAAqC;;;;;;;;EAoDhD,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PublicCrmCustomerController_listSites = exports.PublicCrmCustomerController_listContacts = exports.PublicCrmCustomerController_getById = exports.PublicCrmCustomerController_list = void 0;
|
|
3
|
+
exports.PublicCrmCustomerController_listSites = exports.PublicCrmCustomerController_inviteContact = exports.PublicCrmCustomerController_deleteContact = exports.PublicCrmCustomerController_createContact = exports.PublicCrmCustomerController_listContacts = exports.PublicCrmCustomerController_updateStatus = exports.PublicCrmCustomerController_delete = exports.PublicCrmCustomerController_update = exports.PublicCrmCustomerController_getById = exports.PublicCrmCustomerController_create = exports.PublicCrmCustomerController_list = void 0;
|
|
4
4
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
5
5
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
6
6
|
const auth_1 = require("../auth");
|
|
@@ -10,6 +10,16 @@ exports.PublicCrmCustomerController_list = (0, pieces_framework_1.createAction)(
|
|
|
10
10
|
displayName: 'List customers',
|
|
11
11
|
description: '',
|
|
12
12
|
props: {
|
|
13
|
+
search: pieces_framework_1.Property.ShortText({
|
|
14
|
+
displayName: 'Search',
|
|
15
|
+
description: 'Search by name, phone, email or legal name',
|
|
16
|
+
required: false,
|
|
17
|
+
}),
|
|
18
|
+
integrationId: pieces_framework_1.Property.ShortText({
|
|
19
|
+
displayName: 'Integration Id',
|
|
20
|
+
description: 'Filter by external integration identifier',
|
|
21
|
+
required: false,
|
|
22
|
+
}),
|
|
13
23
|
status: pieces_framework_1.Property.ShortText({
|
|
14
24
|
displayName: 'Status',
|
|
15
25
|
description: 'Filter by status (e.g. Active, Inactive). Default: Active only',
|
|
@@ -31,6 +41,14 @@ exports.PublicCrmCustomerController_list = (0, pieces_framework_1.createAction)(
|
|
|
31
41
|
const baseUrl = context.auth.props.baseUrl;
|
|
32
42
|
const url = `${baseUrl}/customers`;
|
|
33
43
|
const queryParams = new URLSearchParams();
|
|
44
|
+
if (context.propsValue.search !== undefined &&
|
|
45
|
+
context.propsValue.search !== null &&
|
|
46
|
+
context.propsValue.search !== '')
|
|
47
|
+
queryParams.append('search', String(context.propsValue.search));
|
|
48
|
+
if (context.propsValue.integrationId !== undefined &&
|
|
49
|
+
context.propsValue.integrationId !== null &&
|
|
50
|
+
context.propsValue.integrationId !== '')
|
|
51
|
+
queryParams.append('integrationId', String(context.propsValue.integrationId));
|
|
34
52
|
if (context.propsValue.status !== undefined &&
|
|
35
53
|
context.propsValue.status !== null &&
|
|
36
54
|
context.propsValue.status !== '')
|
|
@@ -55,6 +73,112 @@ exports.PublicCrmCustomerController_list = (0, pieces_framework_1.createAction)(
|
|
|
55
73
|
return response.body;
|
|
56
74
|
},
|
|
57
75
|
});
|
|
76
|
+
exports.PublicCrmCustomerController_create = (0, pieces_framework_1.createAction)({
|
|
77
|
+
name: 'PublicCrmCustomerController_create',
|
|
78
|
+
auth: auth_1.workbuddyAuth,
|
|
79
|
+
displayName: 'Create customer',
|
|
80
|
+
description: '',
|
|
81
|
+
props: {
|
|
82
|
+
name: pieces_framework_1.Property.ShortText({
|
|
83
|
+
displayName: 'Name',
|
|
84
|
+
description: 'Display name',
|
|
85
|
+
required: true,
|
|
86
|
+
}),
|
|
87
|
+
address: pieces_framework_1.Property.Json({
|
|
88
|
+
displayName: 'Address',
|
|
89
|
+
description: '',
|
|
90
|
+
required: true,
|
|
91
|
+
}),
|
|
92
|
+
contact: pieces_framework_1.Property.Json({
|
|
93
|
+
displayName: 'Contact',
|
|
94
|
+
description: 'Inline contact object — alternative to contactId',
|
|
95
|
+
required: true,
|
|
96
|
+
}),
|
|
97
|
+
type: pieces_framework_1.Property.StaticDropdown({
|
|
98
|
+
displayName: 'Type',
|
|
99
|
+
description: '',
|
|
100
|
+
required: true,
|
|
101
|
+
options: {
|
|
102
|
+
options: [
|
|
103
|
+
{ label: 'Service Provider', value: 'Service Provider' },
|
|
104
|
+
{ label: 'Business', value: 'Business' },
|
|
105
|
+
{ label: 'Residential', value: 'Residential' },
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
}),
|
|
109
|
+
legalName: pieces_framework_1.Property.ShortText({
|
|
110
|
+
displayName: 'Legal Name',
|
|
111
|
+
description: '',
|
|
112
|
+
required: false,
|
|
113
|
+
}),
|
|
114
|
+
phone: pieces_framework_1.Property.ShortText({
|
|
115
|
+
displayName: 'Phone',
|
|
116
|
+
description: 'Phone number',
|
|
117
|
+
required: false,
|
|
118
|
+
}),
|
|
119
|
+
email: pieces_framework_1.Property.ShortText({
|
|
120
|
+
displayName: 'Email',
|
|
121
|
+
description: 'Email address',
|
|
122
|
+
required: false,
|
|
123
|
+
}),
|
|
124
|
+
website: pieces_framework_1.Property.ShortText({
|
|
125
|
+
displayName: 'Website',
|
|
126
|
+
description: '',
|
|
127
|
+
required: false,
|
|
128
|
+
}),
|
|
129
|
+
integrationId: pieces_framework_1.Property.ShortText({
|
|
130
|
+
displayName: 'Integration Id',
|
|
131
|
+
description: 'integration ID',
|
|
132
|
+
required: false,
|
|
133
|
+
}),
|
|
134
|
+
notes: pieces_framework_1.Property.LongText({
|
|
135
|
+
displayName: 'Notes',
|
|
136
|
+
description: 'Additional notes or comments',
|
|
137
|
+
required: false,
|
|
138
|
+
}),
|
|
139
|
+
customFields: pieces_framework_1.Property.Json({
|
|
140
|
+
displayName: 'Custom Fields',
|
|
141
|
+
description: 'Custom fields as key-value pairs — validated against tenant field definitions',
|
|
142
|
+
required: false,
|
|
143
|
+
}),
|
|
144
|
+
socialNetwork: pieces_framework_1.Property.Json({
|
|
145
|
+
displayName: 'Social Network',
|
|
146
|
+
description: '',
|
|
147
|
+
required: false,
|
|
148
|
+
}),
|
|
149
|
+
},
|
|
150
|
+
async run(context) {
|
|
151
|
+
const token = await (0, auth_1.getAccessToken)(context.auth);
|
|
152
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
153
|
+
const url = `${baseUrl}/api/v2/public/customers`;
|
|
154
|
+
const rawBody = {
|
|
155
|
+
name: context.propsValue.name,
|
|
156
|
+
legalName: context.propsValue.legalName,
|
|
157
|
+
phone: context.propsValue.phone,
|
|
158
|
+
email: context.propsValue.email,
|
|
159
|
+
website: context.propsValue.website,
|
|
160
|
+
integrationId: context.propsValue.integrationId,
|
|
161
|
+
address: context.propsValue.address,
|
|
162
|
+
contact: context.propsValue.contact,
|
|
163
|
+
notes: context.propsValue.notes,
|
|
164
|
+
customFields: context.propsValue.customFields,
|
|
165
|
+
type: context.propsValue.type,
|
|
166
|
+
socialNetwork: context.propsValue.socialNetwork,
|
|
167
|
+
};
|
|
168
|
+
const body = rawBody;
|
|
169
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
170
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
171
|
+
url: `${baseUrl}/api/v2/public/customers`,
|
|
172
|
+
headers: {
|
|
173
|
+
Authorization: `Bearer ${token}`,
|
|
174
|
+
'Content-Type': 'application/json',
|
|
175
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
176
|
+
},
|
|
177
|
+
body: body,
|
|
178
|
+
});
|
|
179
|
+
return response.body;
|
|
180
|
+
},
|
|
181
|
+
});
|
|
58
182
|
exports.PublicCrmCustomerController_getById = (0, pieces_framework_1.createAction)({
|
|
59
183
|
name: 'PublicCrmCustomerController_getById',
|
|
60
184
|
auth: auth_1.workbuddyAuth,
|
|
@@ -63,7 +187,7 @@ exports.PublicCrmCustomerController_getById = (0, pieces_framework_1.createActio
|
|
|
63
187
|
props: {
|
|
64
188
|
id: pieces_framework_1.Property.ShortText({
|
|
65
189
|
displayName: 'Id',
|
|
66
|
-
description: 'Customer ID',
|
|
190
|
+
description: 'Customer ID or integration ID',
|
|
67
191
|
required: true,
|
|
68
192
|
}),
|
|
69
193
|
},
|
|
@@ -83,10 +207,195 @@ exports.PublicCrmCustomerController_getById = (0, pieces_framework_1.createActio
|
|
|
83
207
|
return response.body;
|
|
84
208
|
},
|
|
85
209
|
});
|
|
210
|
+
exports.PublicCrmCustomerController_update = (0, pieces_framework_1.createAction)({
|
|
211
|
+
name: 'PublicCrmCustomerController_update',
|
|
212
|
+
auth: auth_1.workbuddyAuth,
|
|
213
|
+
displayName: 'Update customer',
|
|
214
|
+
description: '',
|
|
215
|
+
props: {
|
|
216
|
+
id: pieces_framework_1.Property.ShortText({
|
|
217
|
+
displayName: 'Id',
|
|
218
|
+
description: 'Customer ID or integration ID',
|
|
219
|
+
required: true,
|
|
220
|
+
}),
|
|
221
|
+
name: pieces_framework_1.Property.ShortText({
|
|
222
|
+
displayName: 'Name',
|
|
223
|
+
description: 'Display name',
|
|
224
|
+
required: false,
|
|
225
|
+
}),
|
|
226
|
+
legalName: pieces_framework_1.Property.ShortText({
|
|
227
|
+
displayName: 'Legal Name',
|
|
228
|
+
description: '',
|
|
229
|
+
required: false,
|
|
230
|
+
}),
|
|
231
|
+
phone: pieces_framework_1.Property.ShortText({
|
|
232
|
+
displayName: 'Phone',
|
|
233
|
+
description: 'Phone number',
|
|
234
|
+
required: false,
|
|
235
|
+
}),
|
|
236
|
+
email: pieces_framework_1.Property.ShortText({
|
|
237
|
+
displayName: 'Email',
|
|
238
|
+
description: 'Email address',
|
|
239
|
+
required: false,
|
|
240
|
+
}),
|
|
241
|
+
website: pieces_framework_1.Property.ShortText({
|
|
242
|
+
displayName: 'Website',
|
|
243
|
+
description: '',
|
|
244
|
+
required: false,
|
|
245
|
+
}),
|
|
246
|
+
integrationId: pieces_framework_1.Property.ShortText({
|
|
247
|
+
displayName: 'Integration Id',
|
|
248
|
+
description: 'integration ID',
|
|
249
|
+
required: false,
|
|
250
|
+
}),
|
|
251
|
+
address: pieces_framework_1.Property.Json({
|
|
252
|
+
displayName: 'Address',
|
|
253
|
+
description: '',
|
|
254
|
+
required: false,
|
|
255
|
+
}),
|
|
256
|
+
primarySite: pieces_framework_1.Property.Json({
|
|
257
|
+
displayName: 'Primary Site',
|
|
258
|
+
description: '',
|
|
259
|
+
required: false,
|
|
260
|
+
}),
|
|
261
|
+
owner: pieces_framework_1.Property.Json({
|
|
262
|
+
displayName: 'Owner',
|
|
263
|
+
description: '',
|
|
264
|
+
required: false,
|
|
265
|
+
}),
|
|
266
|
+
labels: pieces_framework_1.Property.Json({
|
|
267
|
+
displayName: 'Labels',
|
|
268
|
+
description: '',
|
|
269
|
+
required: false,
|
|
270
|
+
defaultValue: [],
|
|
271
|
+
}),
|
|
272
|
+
notes: pieces_framework_1.Property.LongText({
|
|
273
|
+
displayName: 'Notes',
|
|
274
|
+
description: 'Additional notes or comments',
|
|
275
|
+
required: false,
|
|
276
|
+
}),
|
|
277
|
+
customFields: pieces_framework_1.Property.Json({
|
|
278
|
+
displayName: 'Custom Fields',
|
|
279
|
+
description: 'Custom fields as key-value pairs — validated against tenant field definitions',
|
|
280
|
+
required: false,
|
|
281
|
+
}),
|
|
282
|
+
socialNetwork: pieces_framework_1.Property.Json({
|
|
283
|
+
displayName: 'Social Network',
|
|
284
|
+
description: '',
|
|
285
|
+
required: false,
|
|
286
|
+
}),
|
|
287
|
+
},
|
|
288
|
+
async run(context) {
|
|
289
|
+
const token = await (0, auth_1.getAccessToken)(context.auth);
|
|
290
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
291
|
+
const url = `${baseUrl}/api/v2/public/customers/${context.propsValue.id}`;
|
|
292
|
+
// Build body with only defined values (for partial updates)
|
|
293
|
+
const rawBody = {
|
|
294
|
+
name: context.propsValue.name,
|
|
295
|
+
legalName: context.propsValue.legalName,
|
|
296
|
+
phone: context.propsValue.phone,
|
|
297
|
+
email: context.propsValue.email,
|
|
298
|
+
website: context.propsValue.website,
|
|
299
|
+
integrationId: context.propsValue.integrationId,
|
|
300
|
+
address: context.propsValue.address,
|
|
301
|
+
primarySite: context.propsValue.primarySite,
|
|
302
|
+
owner: context.propsValue.owner,
|
|
303
|
+
labels: context.propsValue.labels,
|
|
304
|
+
notes: context.propsValue.notes,
|
|
305
|
+
customFields: context.propsValue.customFields,
|
|
306
|
+
socialNetwork: context.propsValue.socialNetwork,
|
|
307
|
+
};
|
|
308
|
+
const body = Object.fromEntries(Object.entries(rawBody).filter(([_, v]) => v !== undefined && v !== null && v !== ''));
|
|
309
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
310
|
+
method: pieces_common_1.HttpMethod.PATCH,
|
|
311
|
+
url: `${baseUrl}/api/v2/public/customers/${context.propsValue.id}`,
|
|
312
|
+
headers: {
|
|
313
|
+
Authorization: `Bearer ${token}`,
|
|
314
|
+
'Content-Type': 'application/json',
|
|
315
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
316
|
+
},
|
|
317
|
+
body: body,
|
|
318
|
+
});
|
|
319
|
+
return response.body;
|
|
320
|
+
},
|
|
321
|
+
});
|
|
322
|
+
exports.PublicCrmCustomerController_delete = (0, pieces_framework_1.createAction)({
|
|
323
|
+
name: 'PublicCrmCustomerController_delete',
|
|
324
|
+
auth: auth_1.workbuddyAuth,
|
|
325
|
+
displayName: 'Delete customer',
|
|
326
|
+
description: '',
|
|
327
|
+
props: {
|
|
328
|
+
id: pieces_framework_1.Property.ShortText({
|
|
329
|
+
displayName: 'Id',
|
|
330
|
+
description: 'Customer ID or integration ID',
|
|
331
|
+
required: true,
|
|
332
|
+
}),
|
|
333
|
+
},
|
|
334
|
+
async run(context) {
|
|
335
|
+
const token = await (0, auth_1.getAccessToken)(context.auth);
|
|
336
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
337
|
+
const url = `${baseUrl}/api/v2/public/customers/${context.propsValue.id}`;
|
|
338
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
339
|
+
method: pieces_common_1.HttpMethod.DELETE,
|
|
340
|
+
url: `${baseUrl}/api/v2/public/customers/${context.propsValue.id}`,
|
|
341
|
+
headers: {
|
|
342
|
+
Authorization: `Bearer ${token}`,
|
|
343
|
+
'Content-Type': 'application/json',
|
|
344
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
345
|
+
},
|
|
346
|
+
});
|
|
347
|
+
return response.body;
|
|
348
|
+
},
|
|
349
|
+
});
|
|
350
|
+
exports.PublicCrmCustomerController_updateStatus = (0, pieces_framework_1.createAction)({
|
|
351
|
+
name: 'PublicCrmCustomerController_updateStatus',
|
|
352
|
+
auth: auth_1.workbuddyAuth,
|
|
353
|
+
displayName: 'Update customer status',
|
|
354
|
+
description: '',
|
|
355
|
+
props: {
|
|
356
|
+
id: pieces_framework_1.Property.ShortText({
|
|
357
|
+
displayName: 'Id',
|
|
358
|
+
description: 'Customer ID or integration ID',
|
|
359
|
+
required: true,
|
|
360
|
+
}),
|
|
361
|
+
statusId: pieces_framework_1.Property.ShortText({
|
|
362
|
+
displayName: 'Status Id',
|
|
363
|
+
description: 'status ID',
|
|
364
|
+
required: true,
|
|
365
|
+
}),
|
|
366
|
+
note: pieces_framework_1.Property.ShortText({
|
|
367
|
+
displayName: 'Note',
|
|
368
|
+
description: '',
|
|
369
|
+
required: false,
|
|
370
|
+
}),
|
|
371
|
+
},
|
|
372
|
+
async run(context) {
|
|
373
|
+
const token = await (0, auth_1.getAccessToken)(context.auth);
|
|
374
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
375
|
+
const url = `${baseUrl}/api/v2/public/customers/${context.propsValue.id}/status`;
|
|
376
|
+
// Build body with only defined values (for partial updates)
|
|
377
|
+
const rawBody = {
|
|
378
|
+
statusId: context.propsValue.statusId,
|
|
379
|
+
note: context.propsValue.note,
|
|
380
|
+
};
|
|
381
|
+
const body = Object.fromEntries(Object.entries(rawBody).filter(([_, v]) => v !== undefined && v !== null && v !== ''));
|
|
382
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
383
|
+
method: pieces_common_1.HttpMethod.PATCH,
|
|
384
|
+
url: `${baseUrl}/api/v2/public/customers/${context.propsValue.id}/status`,
|
|
385
|
+
headers: {
|
|
386
|
+
Authorization: `Bearer ${token}`,
|
|
387
|
+
'Content-Type': 'application/json',
|
|
388
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
389
|
+
},
|
|
390
|
+
body: body,
|
|
391
|
+
});
|
|
392
|
+
return response.body;
|
|
393
|
+
},
|
|
394
|
+
});
|
|
86
395
|
exports.PublicCrmCustomerController_listContacts = (0, pieces_framework_1.createAction)({
|
|
87
396
|
name: 'PublicCrmCustomerController_listContacts',
|
|
88
397
|
auth: auth_1.workbuddyAuth,
|
|
89
|
-
displayName: 'List contacts for customer',
|
|
398
|
+
displayName: 'List contacts for customer (contacts + external users)',
|
|
90
399
|
description: '',
|
|
91
400
|
props: {
|
|
92
401
|
customerId: pieces_framework_1.Property.ShortText({
|
|
@@ -130,6 +439,198 @@ exports.PublicCrmCustomerController_listContacts = (0, pieces_framework_1.create
|
|
|
130
439
|
return response.body;
|
|
131
440
|
},
|
|
132
441
|
});
|
|
442
|
+
exports.PublicCrmCustomerController_createContact = (0, pieces_framework_1.createAction)({
|
|
443
|
+
name: 'PublicCrmCustomerController_createContact',
|
|
444
|
+
auth: auth_1.workbuddyAuth,
|
|
445
|
+
displayName: 'Create customer contact',
|
|
446
|
+
description: '',
|
|
447
|
+
props: {
|
|
448
|
+
customerId: pieces_framework_1.Property.ShortText({
|
|
449
|
+
displayName: 'Customer Id',
|
|
450
|
+
description: 'Customer ID',
|
|
451
|
+
required: true,
|
|
452
|
+
}),
|
|
453
|
+
firstName: pieces_framework_1.Property.ShortText({
|
|
454
|
+
displayName: 'First Name',
|
|
455
|
+
description: 'First name',
|
|
456
|
+
required: true,
|
|
457
|
+
}),
|
|
458
|
+
lastName: pieces_framework_1.Property.ShortText({
|
|
459
|
+
displayName: 'Last Name',
|
|
460
|
+
description: 'Last name',
|
|
461
|
+
required: true,
|
|
462
|
+
}),
|
|
463
|
+
login: pieces_framework_1.Property.Checkbox({
|
|
464
|
+
displayName: 'Login',
|
|
465
|
+
description: 'false = basic contact. true = external user with portal login (requires email and roleId).',
|
|
466
|
+
required: true,
|
|
467
|
+
}),
|
|
468
|
+
email: pieces_framework_1.Property.ShortText({
|
|
469
|
+
displayName: 'Email',
|
|
470
|
+
description: 'Email address. Required when login is true.',
|
|
471
|
+
required: false,
|
|
472
|
+
}),
|
|
473
|
+
phone: pieces_framework_1.Property.ShortText({
|
|
474
|
+
displayName: 'Phone',
|
|
475
|
+
description: 'Phone',
|
|
476
|
+
required: false,
|
|
477
|
+
}),
|
|
478
|
+
mobile: pieces_framework_1.Property.ShortText({
|
|
479
|
+
displayName: 'Mobile',
|
|
480
|
+
description: 'Mobile',
|
|
481
|
+
required: false,
|
|
482
|
+
}),
|
|
483
|
+
title: pieces_framework_1.Property.ShortText({
|
|
484
|
+
displayName: 'Title',
|
|
485
|
+
description: 'Job title',
|
|
486
|
+
required: false,
|
|
487
|
+
}),
|
|
488
|
+
note: pieces_framework_1.Property.ShortText({
|
|
489
|
+
displayName: 'Note',
|
|
490
|
+
description: 'Note',
|
|
491
|
+
required: false,
|
|
492
|
+
}),
|
|
493
|
+
integrationId: pieces_framework_1.Property.ShortText({
|
|
494
|
+
displayName: 'Integration Id',
|
|
495
|
+
description: 'External integration identifier',
|
|
496
|
+
required: false,
|
|
497
|
+
}),
|
|
498
|
+
roleId: pieces_framework_1.Property.ShortText({
|
|
499
|
+
displayName: 'Role Id',
|
|
500
|
+
description: 'Portal security role id. Required when login is true. List via GET /settings/roles/client-portal or /settings/roles/contractor-portal.',
|
|
501
|
+
required: false,
|
|
502
|
+
}),
|
|
503
|
+
sendEmail: pieces_framework_1.Property.Checkbox({
|
|
504
|
+
displayName: 'Send Email',
|
|
505
|
+
description: 'Send invite email when login is true. Default true.',
|
|
506
|
+
required: false,
|
|
507
|
+
}),
|
|
508
|
+
autoDispatch: pieces_framework_1.Property.Checkbox({
|
|
509
|
+
displayName: 'Auto Dispatch',
|
|
510
|
+
description: 'Automatically dispatch when contractor is assigned. Only for external users under a contractor.',
|
|
511
|
+
required: false,
|
|
512
|
+
}),
|
|
513
|
+
},
|
|
514
|
+
async run(context) {
|
|
515
|
+
const token = await (0, auth_1.getAccessToken)(context.auth);
|
|
516
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
517
|
+
const url = `${baseUrl}/api/v2/public/customers/${context.propsValue.customerId}/contacts`;
|
|
518
|
+
const rawBody = {
|
|
519
|
+
firstName: context.propsValue.firstName,
|
|
520
|
+
lastName: context.propsValue.lastName,
|
|
521
|
+
email: context.propsValue.email,
|
|
522
|
+
phone: context.propsValue.phone,
|
|
523
|
+
mobile: context.propsValue.mobile,
|
|
524
|
+
title: context.propsValue.title,
|
|
525
|
+
note: context.propsValue.note,
|
|
526
|
+
integrationId: context.propsValue.integrationId,
|
|
527
|
+
login: context.propsValue.login,
|
|
528
|
+
roleId: context.propsValue.roleId,
|
|
529
|
+
sendEmail: context.propsValue.sendEmail,
|
|
530
|
+
autoDispatch: context.propsValue.autoDispatch,
|
|
531
|
+
};
|
|
532
|
+
const body = rawBody;
|
|
533
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
534
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
535
|
+
url: `${baseUrl}/api/v2/public/customers/${context.propsValue.customerId}/contacts`,
|
|
536
|
+
headers: {
|
|
537
|
+
Authorization: `Bearer ${token}`,
|
|
538
|
+
'Content-Type': 'application/json',
|
|
539
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
540
|
+
},
|
|
541
|
+
body: body,
|
|
542
|
+
});
|
|
543
|
+
return response.body;
|
|
544
|
+
},
|
|
545
|
+
});
|
|
546
|
+
exports.PublicCrmCustomerController_deleteContact = (0, pieces_framework_1.createAction)({
|
|
547
|
+
name: 'PublicCrmCustomerController_deleteContact',
|
|
548
|
+
auth: auth_1.workbuddyAuth,
|
|
549
|
+
displayName: 'Delete customer contact',
|
|
550
|
+
description: '',
|
|
551
|
+
props: {
|
|
552
|
+
customerId: pieces_framework_1.Property.ShortText({
|
|
553
|
+
displayName: 'Customer Id',
|
|
554
|
+
description: 'Customer ID',
|
|
555
|
+
required: true,
|
|
556
|
+
}),
|
|
557
|
+
contactId: pieces_framework_1.Property.ShortText({
|
|
558
|
+
displayName: 'Contact Id',
|
|
559
|
+
description: 'Contact ID',
|
|
560
|
+
required: true,
|
|
561
|
+
}),
|
|
562
|
+
},
|
|
563
|
+
async run(context) {
|
|
564
|
+
const token = await (0, auth_1.getAccessToken)(context.auth);
|
|
565
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
566
|
+
const url = `${baseUrl}/api/v2/public/customers/${context.propsValue.customerId}/contacts/${context.propsValue.contactId}`;
|
|
567
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
568
|
+
method: pieces_common_1.HttpMethod.DELETE,
|
|
569
|
+
url: `${baseUrl}/api/v2/public/customers/${context.propsValue.customerId}/contacts/${context.propsValue.contactId}`,
|
|
570
|
+
headers: {
|
|
571
|
+
Authorization: `Bearer ${token}`,
|
|
572
|
+
'Content-Type': 'application/json',
|
|
573
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
574
|
+
},
|
|
575
|
+
});
|
|
576
|
+
return response.body;
|
|
577
|
+
},
|
|
578
|
+
});
|
|
579
|
+
exports.PublicCrmCustomerController_inviteContact = (0, pieces_framework_1.createAction)({
|
|
580
|
+
name: 'PublicCrmCustomerController_inviteContact',
|
|
581
|
+
auth: auth_1.workbuddyAuth,
|
|
582
|
+
displayName: 'Invite contact (CRM)',
|
|
583
|
+
description: '',
|
|
584
|
+
props: {
|
|
585
|
+
customerId: pieces_framework_1.Property.ShortText({
|
|
586
|
+
displayName: 'Customer Id',
|
|
587
|
+
description: 'Customer ID',
|
|
588
|
+
required: true,
|
|
589
|
+
}),
|
|
590
|
+
contactId: pieces_framework_1.Property.ShortText({
|
|
591
|
+
displayName: 'Contact Id',
|
|
592
|
+
description: 'Contact ID',
|
|
593
|
+
required: true,
|
|
594
|
+
}),
|
|
595
|
+
roleId: pieces_framework_1.Property.ShortText({
|
|
596
|
+
displayName: 'Role Id',
|
|
597
|
+
description: 'role ID',
|
|
598
|
+
required: true,
|
|
599
|
+
}),
|
|
600
|
+
email: pieces_framework_1.Property.ShortText({
|
|
601
|
+
displayName: 'Email',
|
|
602
|
+
description: 'Email address',
|
|
603
|
+
required: false,
|
|
604
|
+
}),
|
|
605
|
+
sendEmail: pieces_framework_1.Property.Checkbox({
|
|
606
|
+
displayName: 'Send Email',
|
|
607
|
+
description: '',
|
|
608
|
+
required: false,
|
|
609
|
+
}),
|
|
610
|
+
},
|
|
611
|
+
async run(context) {
|
|
612
|
+
const token = await (0, auth_1.getAccessToken)(context.auth);
|
|
613
|
+
const baseUrl = context.auth.props.baseUrl;
|
|
614
|
+
const url = `${baseUrl}/api/v2/public/customers/${context.propsValue.customerId}/contacts/${context.propsValue.contactId}/invite`;
|
|
615
|
+
const rawBody = {
|
|
616
|
+
email: context.propsValue.email,
|
|
617
|
+
roleId: context.propsValue.roleId,
|
|
618
|
+
sendEmail: context.propsValue.sendEmail,
|
|
619
|
+
};
|
|
620
|
+
const body = rawBody;
|
|
621
|
+
const response = await pieces_common_1.httpClient.sendRequest({
|
|
622
|
+
method: pieces_common_1.HttpMethod.POST,
|
|
623
|
+
url: `${baseUrl}/api/v2/public/customers/${context.propsValue.customerId}/contacts/${context.propsValue.contactId}/invite`,
|
|
624
|
+
headers: {
|
|
625
|
+
Authorization: `Bearer ${token}`,
|
|
626
|
+
'Content-Type': 'application/json',
|
|
627
|
+
'X-WorkBuddy-Version': '2026-01',
|
|
628
|
+
},
|
|
629
|
+
body: body,
|
|
630
|
+
});
|
|
631
|
+
return response.body;
|
|
632
|
+
},
|
|
633
|
+
});
|
|
133
634
|
exports.PublicCrmCustomerController_listSites = (0, pieces_framework_1.createAction)({
|
|
134
635
|
name: 'PublicCrmCustomerController_listSites',
|
|
135
636
|
auth: auth_1.workbuddyAuth,
|