@activepieces/piece-pipedrive 0.4.0 → 0.4.2
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 +6 -5
- package/src/index.js +51 -1
- package/src/index.js.map +1 -1
- package/src/lib/actions/add-follower.d.ts +5 -0
- package/src/lib/actions/add-follower.js +119 -0
- package/src/lib/actions/add-follower.js.map +1 -0
- package/src/lib/actions/attach-file.d.ts +9 -0
- package/src/lib/actions/attach-file.js +62 -0
- package/src/lib/actions/attach-file.js.map +1 -0
- package/src/lib/actions/create-activity.d.ts +16 -0
- package/src/lib/actions/create-activity.js +54 -0
- package/src/lib/actions/create-activity.js.map +1 -0
- package/src/lib/actions/create-deal.d.ts +1 -1
- package/src/lib/actions/create-deal.js +4 -1
- package/src/lib/actions/create-deal.js.map +1 -1
- package/src/lib/actions/create-lead.d.ts +1 -1
- package/src/lib/actions/create-lead.js +4 -1
- package/src/lib/actions/create-lead.js.map +1 -1
- package/src/lib/actions/create-note.d.ts +11 -0
- package/src/lib/actions/create-note.js +73 -0
- package/src/lib/actions/create-note.js.map +1 -0
- package/src/lib/actions/create-organization.js +3 -3
- package/src/lib/actions/create-organization.js.map +1 -1
- package/src/lib/actions/create-person.js +3 -3
- package/src/lib/actions/create-person.js.map +1 -1
- package/src/lib/actions/create-product.js +1 -1
- package/src/lib/actions/create-product.js.map +1 -1
- package/src/lib/actions/find-activity.d.ts +8 -0
- package/src/lib/actions/find-activity.js +85 -0
- package/src/lib/actions/find-activity.js.map +1 -0
- package/src/lib/actions/find-deal.d.ts +4 -0
- package/src/lib/actions/find-deal.js +104 -0
- package/src/lib/actions/find-deal.js.map +1 -0
- package/src/lib/actions/find-deals-associated-with-person.d.ts +3 -0
- package/src/lib/actions/find-deals-associated-with-person.js +53 -0
- package/src/lib/actions/find-deals-associated-with-person.js.map +1 -0
- package/src/lib/actions/find-notes.d.ts +4 -0
- package/src/lib/actions/find-notes.js +70 -0
- package/src/lib/actions/find-notes.js.map +1 -0
- package/src/lib/actions/find-organization.d.ts +4 -0
- package/src/lib/actions/find-organization.js +104 -0
- package/src/lib/actions/find-organization.js.map +1 -0
- package/src/lib/actions/find-person.d.ts +4 -0
- package/src/lib/actions/find-person.js +104 -0
- package/src/lib/actions/find-person.js.map +1 -0
- package/src/lib/actions/find-product.d.ts +3 -0
- package/src/lib/actions/find-product.js +59 -0
- package/src/lib/actions/find-product.js.map +1 -0
- package/src/lib/actions/find-products.d.ts +4 -0
- package/src/lib/actions/find-products.js +73 -0
- package/src/lib/actions/find-products.js.map +1 -0
- package/src/lib/actions/find-user.d.ts +4 -0
- package/src/lib/actions/find-user.js +57 -0
- package/src/lib/actions/find-user.js.map +1 -0
- package/src/lib/actions/get-note.d.ts +3 -0
- package/src/lib/actions/get-note.js +39 -0
- package/src/lib/actions/get-note.js.map +1 -0
- package/src/lib/actions/get-product.d.ts +3 -0
- package/src/lib/actions/get-product.js +50 -0
- package/src/lib/actions/get-product.js.map +1 -0
- package/src/lib/actions/update-activity.d.ts +17 -0
- package/src/lib/actions/update-activity.js +57 -0
- package/src/lib/actions/update-activity.js.map +1 -0
- package/src/lib/actions/update-deal.d.ts +1 -1
- package/src/lib/actions/update-deal.js +4 -1
- package/src/lib/actions/update-deal.js.map +1 -1
- package/src/lib/actions/update-lead.d.ts +1 -1
- package/src/lib/actions/update-lead.js +4 -1
- package/src/lib/actions/update-lead.js.map +1 -1
- package/src/lib/actions/update-organization.js +3 -3
- package/src/lib/actions/update-organization.js.map +1 -1
- package/src/lib/actions/update-person.js +3 -3
- package/src/lib/actions/update-person.js.map +1 -1
- package/src/lib/common/index.js +16 -2
- package/src/lib/common/index.js.map +1 -1
- package/src/lib/common/props.d.ts +28 -5
- package/src/lib/common/props.js +266 -16
- package/src/lib/common/props.js.map +1 -1
- package/src/lib/common/types.d.ts +1 -1
- package/src/lib/trigger/activity-matching-filter.d.ts +8 -0
- package/src/lib/trigger/activity-matching-filter.js +178 -0
- package/src/lib/trigger/activity-matching-filter.js.map +1 -0
- package/src/lib/trigger/deal-matching-filter.d.ts +11 -0
- package/src/lib/trigger/deal-matching-filter.js +287 -0
- package/src/lib/trigger/deal-matching-filter.js.map +1 -0
- package/src/lib/trigger/new-note.d.ts +2 -0
- package/src/lib/trigger/new-note.js +113 -0
- package/src/lib/trigger/new-note.js.map +1 -0
- package/src/lib/trigger/organization-matching-filter.d.ts +8 -0
- package/src/lib/trigger/organization-matching-filter.js +174 -0
- package/src/lib/trigger/organization-matching-filter.js.map +1 -0
- package/src/lib/trigger/person-matching-filter.d.ts +8 -0
- package/src/lib/trigger/person-matching-filter.js +203 -0
- package/src/lib/trigger/person-matching-filter.js.map +1 -0
- package/src/lib/trigger/updated-deal-stage.js +1 -0
- package/src/lib/trigger/updated-deal-stage.js.map +1 -1
|
@@ -31,10 +31,10 @@ exports.updateOrganizationAction = (0, pieces_framework_1.createAction)({
|
|
|
31
31
|
if (labelIds.length > 0) {
|
|
32
32
|
organizationDefaultFields.label_ids = labelIds;
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const organizationCustomFields = {};
|
|
35
35
|
Object.entries(customFields).forEach(([key, value]) => {
|
|
36
36
|
// Format values if they are arrays
|
|
37
|
-
|
|
37
|
+
organizationCustomFields[key] =
|
|
38
38
|
Array.isArray(value) && value.length > 0 ? value.join(',') : value;
|
|
39
39
|
});
|
|
40
40
|
const updatedOrganizationResponse = yield (0, common_1.pipedriveApiCall)({
|
|
@@ -42,7 +42,7 @@ exports.updateOrganizationAction = (0, pieces_framework_1.createAction)({
|
|
|
42
42
|
apiDomain: context.auth.data['api_domain'],
|
|
43
43
|
method: pieces_common_1.HttpMethod.PUT,
|
|
44
44
|
resourceUri: `/organizations/${organizationId}`,
|
|
45
|
-
body: Object.assign(Object.assign({}, organizationDefaultFields),
|
|
45
|
+
body: Object.assign(Object.assign({}, organizationDefaultFields), organizationCustomFields),
|
|
46
46
|
});
|
|
47
47
|
const customFieldsResponse = yield (0, common_1.pipedrivePaginatedApiCall)({
|
|
48
48
|
accessToken: context.auth.access_token,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-organization.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/pipedrive/src/lib/actions/update-organization.ts"],"names":[],"mappings":";;;;AAAA,uCAA4C;AAC5C,qEAAwE;AACxE,2CAA8E;AAC9E,sCAImB;AAEnB,+DAAyD;AAE5C,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,qBAAa;IACnB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,mCAAmC;IAChD,KAAK,kBACJ,cAAc,EAAE,IAAA,0BAAkB,EAAC,IAAI,CAAC,EACxC,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,KAAK;SACf,CAAC,IACC,+BAAuB,CAC1B;IACK,GAAG,CAAC,OAAO;;;YAChB,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEjF,MAAM,QAAQ,GAAG,MAAC,OAAO,CAAC,UAAU,CAAC,QAAqB,mCAAI,EAAE,CAAC;YACjE,MAAM,YAAY,GAAG,MAAA,OAAO,CAAC,UAAU,CAAC,YAAY,mCAAI,EAAE,CAAC;YAE3D,MAAM,yBAAyB,GAAwB;gBACtD,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,OAAO;gBACjB,UAAU,EAAE,SAAS;gBACrB,OAAO,EAAE,OAAO;aAChB,CAAC;YAEF,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACzB,yBAAyB,CAAC,SAAS,GAAG,QAAQ,CAAC;YAChD,CAAC;YAED,MAAM,
|
|
1
|
+
{"version":3,"file":"update-organization.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/pip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O,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YACrE,CAAC,CAAC,CAAC;YAEH,MAAM,2BAA2B,GAAG,MAAM,IAAA,yBAAgB,EAA6B;gBACtF,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;gBACtC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;gBAC1C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,WAAW,EAAE,kBAAkB,cAAc,EAAE;gBAC/C,IAAI,kCACA,yBAAyB,GACzB,wBAAwB,CAC3B;aACD,CAAC,CAAC;YAEH,MAAM,oBAAoB,GAAG,MAAM,IAAA,kCAAyB,EAAW;gBACtE,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;gBACtC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;gBAC1C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,WAAW,EAAE,qBAAqB;aAClC,CAAC,CAAC;YAEH,MAAM,6BAA6B,GAAG,IAAA,uCAA8B,EACnE,oBAAoB,EACpB,2BAA2B,CAAC,IAAI,CAChC,CAAC;YAEF,uCACI,2BAA2B,KAC9B,IAAI,EAAE,6BAA6B,IAClC;QACH,CAAC;KAAA;CACD,CAAC,CAAC"}
|
|
@@ -42,17 +42,17 @@ exports.updatePersonAction = (0, pieces_framework_1.createAction)({
|
|
|
42
42
|
if (labelIds.length > 0) {
|
|
43
43
|
personDefaultFields.label_ids = labelIds;
|
|
44
44
|
}
|
|
45
|
-
const
|
|
45
|
+
const personCustomFields = {};
|
|
46
46
|
Object.entries(customFields).forEach(([key, value]) => {
|
|
47
47
|
// Format values if they are arrays
|
|
48
|
-
|
|
48
|
+
personCustomFields[key] = Array.isArray(value) && value.length > 0 ? value.join(',') : value;
|
|
49
49
|
});
|
|
50
50
|
const updatedPersonResponse = yield (0, common_1.pipedriveApiCall)({
|
|
51
51
|
accessToken: context.auth.access_token,
|
|
52
52
|
apiDomain: context.auth.data['api_domain'],
|
|
53
53
|
method: pieces_common_1.HttpMethod.PUT,
|
|
54
54
|
resourceUri: `/persons/${personId}`,
|
|
55
|
-
body: Object.assign(Object.assign({}, personDefaultFields),
|
|
55
|
+
body: Object.assign(Object.assign({}, personDefaultFields), personCustomFields),
|
|
56
56
|
});
|
|
57
57
|
const customFieldsResponse = yield (0, common_1.pipedrivePaginatedApiCall)({
|
|
58
58
|
accessToken: context.auth.access_token,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-person.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/pipedrive/src/lib/actions/update-person.ts"],"names":[],"mappings":";;;;AAAA,uCAA4C;AAC5C,qEAAwE;AACxE,2CAAkE;AAClE,sCAImB;AAEnB,+DAAyD;AAE5C,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,qBAAa;IACnB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,6BAA6B;IAC1C,KAAK,kBACJ,QAAQ,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC,EAC5B,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,MAAM;YACnB,QAAQ,EAAE,KAAK;SACf,CAAC,IACC,yBAAiB,CACpB;IACK,GAAG,CAAC,OAAO;;;YAChB,MAAM,EACL,IAAI,EACJ,OAAO,EACP,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,SAAS,EACT,QAAQ,GACR,GAAG,OAAO,CAAC,UAAU,CAAC;YACvB,MAAM,KAAK,GAAG,MAAC,OAAO,CAAC,UAAU,CAAC,KAAkB,mCAAI,EAAE,CAAC;YAC3D,MAAM,KAAK,GAAG,MAAC,OAAO,CAAC,UAAU,CAAC,KAAkB,mCAAI,EAAE,CAAC;YAC3D,MAAM,QAAQ,GAAG,MAAC,OAAO,CAAC,UAAU,CAAC,QAAqB,mCAAI,EAAE,CAAC;YACjE,MAAM,YAAY,GAAG,MAAA,OAAO,CAAC,UAAU,CAAC,YAAY,mCAAI,EAAE,CAAC;YAE3D,MAAM,mBAAmB,GAAwB;gBAChD,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,OAAO;gBACjB,MAAM,EAAE,cAAc;gBACtB,gBAAgB,EAAE,gBAAgB;gBAClC,UAAU,EAAE,SAAS;gBACrB,UAAU,EAAE,SAAS;gBACrB,SAAS,EAAE,QAAQ;aACnB,CAAC;YAEF,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACtB,mBAAmB,CAAC,KAAK,GAAG,KAAK,CAAC;YACnC,CAAC;YAED,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACtB,mBAAmB,CAAC,KAAK,GAAG,KAAK,CAAC;YACnC,CAAC;YAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACzB,mBAAmB,CAAC,SAAS,GAAG,QAAQ,CAAC;YAC1C,CAAC;YAED,MAAM,
|
|
1
|
+
{"version":3,"file":"update-person.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/pipedrive/src/lib/actions/update-person.ts"],"names":[],"mappings":";;;;AAAA,uCAA4C;AAC5C,qEAAwE;AACxE,2CAAkE;AAClE,sCAImB;AAEnB,+DAAyD;AAE5C,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,qBAAa;IACnB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,6BAA6B;IAC1C,KAAK,kBACJ,QAAQ,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC,EAC5B,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW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GAAG,EAAE,KAAK,CAAC,EAAE,EAAE;gBACrD,mCAAmC;gBACnC,kBAAkB,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;YAC9F,CAAC,CAAC,CAAC;YAEH,MAAM,qBAAqB,GAAG,MAAM,IAAA,yBAAgB,EAAuB;gBAC1E,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;gBACtC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;gBAC1C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,WAAW,EAAE,YAAY,QAAQ,EAAE;gBACnC,IAAI,kCACA,mBAAmB,GACnB,kBAAkB,CACrB;aACD,CAAC,CAAC;YAEH,MAAM,oBAAoB,GAAG,MAAM,IAAA,kCAAyB,EAAW;gBACtE,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;gBACtC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;gBAC1C,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,WAAW,EAAE,eAAe;aAC5B,CAAC,CAAC;YAEH,MAAM,uBAAuB,GAAG,IAAA,uCAA8B,EAC7D,oBAAoB,EACpB,qBAAqB,CAAC,IAAI,CAC1B,CAAC;YAEF,uCACI,qBAAqB,KACxB,IAAI,EAAE,uBAAuB,IAC5B;QACH,CAAC;KAAA;CACD,CAAC,CAAC"}
|
package/src/lib/common/index.js
CHANGED
|
@@ -6,6 +6,7 @@ exports.pipedrivePaginatedApiCall = pipedrivePaginatedApiCall;
|
|
|
6
6
|
exports.pipedriveTransformCustomFields = pipedriveTransformCustomFields;
|
|
7
7
|
const tslib_1 = require("tslib");
|
|
8
8
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
9
|
+
const shared_1 = require("@activepieces/shared");
|
|
9
10
|
exports.pipedriveCommon = {
|
|
10
11
|
subscribeWebhook: (object, action, webhookUrl, apiDomain, accessToken) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
11
12
|
const request = {
|
|
@@ -15,6 +16,7 @@ exports.pipedriveCommon = {
|
|
|
15
16
|
event_object: object,
|
|
16
17
|
event_action: action,
|
|
17
18
|
subscription_url: webhookUrl,
|
|
19
|
+
version: '1.0'
|
|
18
20
|
},
|
|
19
21
|
authentication: {
|
|
20
22
|
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
@@ -41,6 +43,7 @@ function pipedriveApiCall(_a) {
|
|
|
41
43
|
return tslib_1.__awaiter(this, arguments, void 0, function* ({ accessToken, apiDomain, method, resourceUri, query, body, }) {
|
|
42
44
|
const baseUrl = `${apiDomain}/api/v1`;
|
|
43
45
|
const qs = {};
|
|
46
|
+
let data;
|
|
44
47
|
if (query) {
|
|
45
48
|
for (const [key, value] of Object.entries(query)) {
|
|
46
49
|
if (value !== null && value !== undefined) {
|
|
@@ -48,6 +51,14 @@ function pipedriveApiCall(_a) {
|
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
}
|
|
54
|
+
if (body) {
|
|
55
|
+
data = Object.entries(body).reduce((acc, [key, value]) => {
|
|
56
|
+
if (!(0, shared_1.isNil)(value)) {
|
|
57
|
+
acc[key] = value;
|
|
58
|
+
}
|
|
59
|
+
return acc;
|
|
60
|
+
}, {});
|
|
61
|
+
}
|
|
51
62
|
const request = {
|
|
52
63
|
method,
|
|
53
64
|
url: baseUrl + resourceUri,
|
|
@@ -56,7 +67,7 @@ function pipedriveApiCall(_a) {
|
|
|
56
67
|
token: accessToken,
|
|
57
68
|
},
|
|
58
69
|
queryParams: qs,
|
|
59
|
-
body,
|
|
70
|
+
body: data,
|
|
60
71
|
};
|
|
61
72
|
try {
|
|
62
73
|
const response = yield pieces_common_1.httpClient.sendRequest(request);
|
|
@@ -65,7 +76,7 @@ function pipedriveApiCall(_a) {
|
|
|
65
76
|
catch (error) {
|
|
66
77
|
if (error instanceof pieces_common_1.HttpError) {
|
|
67
78
|
if (error.response.status === 403) {
|
|
68
|
-
throw new Error(
|
|
79
|
+
throw new Error('Please reconnect your Pipedrive account.');
|
|
69
80
|
}
|
|
70
81
|
}
|
|
71
82
|
throw error;
|
|
@@ -88,6 +99,9 @@ function pipedrivePaginatedApiCall(_a) {
|
|
|
88
99
|
query: qs,
|
|
89
100
|
body,
|
|
90
101
|
});
|
|
102
|
+
if ((0, shared_1.isNil)(response.data)) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
91
105
|
resultData.push(...response.data);
|
|
92
106
|
qs.start = response.additional_data.pagination.next_start;
|
|
93
107
|
hasMoreItems = response.additional_data.pagination.more_items_in_collection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/pipedrive/src/lib/common/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/pipedrive/src/lib/common/index.ts"],"names":[],"mappings":";;;AA+DA,4CAiDC;AAED,8DAkCC;AAED,wEAiCC;;AAvLD,+DAQqC;AAErC,iDAAqD;AAExC,QAAA,eAAe,GAAG;IAC9B,gBAAgB,EAAE,CACjB,MAAc,EACd,MAAc,EACd,UAAkB,EAClB,SAAiB,EACjB,WAAmB,EAClB,EAAE;QACH,MAAM,OAAO,GAAgB;YAC5B,MAAM,EAAE,0BAAU,CAAC,IAAI;YACvB,GAAG,EAAE,GAAG,SAAS,kBAAkB;YACnC,IAAI,EAAE;gBACL,YAAY,EAAE,MAAM;gBACpB,YAAY,EAAE,MAAM;gBACpB,gBAAgB,EAAE,UAAU;gBAC5B,OAAO,EAAC,KAAK;aACb;YACD,cAAc,EAAE;gBACf,IAAI,EAAE,kCAAkB,CAAC,YAAY;gBAC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,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,YAAY,CAAC,MAAM,CAAC,CAAC,0CAAE,KAAK;wBACrF,IAAI,CAAC;YACP,CAAC;iBAAM,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;gBAChC,MAAM,MAAM,GAAa,YAAY,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACzD,mBAAmB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CACvC,CAAC,IAAI,EAAE,EAAE,eAAC,OAAA,CAAA,MAAA,MAAA,KAAK,CAAC,OAAO,0CAAE,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,CAAC,0CAAE,KAAK,KAAI,IAAI,CAAA,EAAA,CACvF,CAAC;YACH,CAAC;iBAAM,CAAC;gBACP,mBAAmB,CAAC,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;YACpD,CAAC;YACD,OAAO,mBAAmB,CAAC,MAAM,CAAC,CAAC;QACpC,CAAC;IACF,CAAC;IACD,OAAO,mBAAmB,CAAC;AAC5B,CAAC"}
|
|
@@ -1,25 +1,33 @@
|
|
|
1
1
|
import { pipedriveAuth } from '../../index';
|
|
2
2
|
import { DropdownOption, DynamicPropsValue, PiecePropValueSchema } from '@activepieces/pieces-framework';
|
|
3
|
+
import { GetField } from './types';
|
|
4
|
+
export declare function fetchFiltersOptions(auth: PiecePropValueSchema<typeof pipedriveAuth>, type: string): Promise<DropdownOption<number>[]>;
|
|
3
5
|
export declare function fetchProductsOptions(auth: PiecePropValueSchema<typeof pipedriveAuth>): Promise<DropdownOption<number>[]>;
|
|
4
6
|
export declare function fetchDealsOptions(auth: PiecePropValueSchema<typeof pipedriveAuth>): Promise<DropdownOption<number>[]>;
|
|
5
7
|
export declare function fetchLeadsOptions(auth: PiecePropValueSchema<typeof pipedriveAuth>): Promise<DropdownOption<number>[]>;
|
|
8
|
+
export declare function fetchActivityTypesOptions(auth: PiecePropValueSchema<typeof pipedriveAuth>): Promise<DropdownOption<string>[]>;
|
|
6
9
|
export declare function fetchPipelinesOptions(auth: PiecePropValueSchema<typeof pipedriveAuth>): Promise<DropdownOption<number>[]>;
|
|
7
10
|
export declare function fetchPersonsOptions(auth: PiecePropValueSchema<typeof pipedriveAuth>): Promise<DropdownOption<number>[]>;
|
|
8
11
|
export declare function fetchOwnersOptions(auth: PiecePropValueSchema<typeof pipedriveAuth>): Promise<DropdownOption<number>[]>;
|
|
9
12
|
export declare function fetchOrganizationsOptions(auth: PiecePropValueSchema<typeof pipedriveAuth>): Promise<DropdownOption<number>[]>;
|
|
10
|
-
export declare function
|
|
13
|
+
export declare function createPropertyDefinition(property: GetField): import("@activepieces/pieces-framework").StaticDropdownProperty<string, false> | import("@activepieces/pieces-framework").ShortTextProperty<false> | import("@activepieces/pieces-framework").LongTextProperty<false> | import("@activepieces/pieces-framework").StaticMultiSelectDropdownProperty<string, false> | import("@activepieces/pieces-framework").NumberProperty<false> | import("@activepieces/pieces-framework").DateTimeProperty<false> | null;
|
|
14
|
+
export declare function retrieveObjectCustomProperties(auth: PiecePropValueSchema<typeof pipedriveAuth>, objectType: string): Promise<DynamicPropsValue>;
|
|
15
|
+
export declare const searchFieldProp: (objectType: string) => import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
16
|
+
export declare const searchFieldValueProp: (objectType: string) => import("@activepieces/pieces-framework").DynamicProperties<true>;
|
|
11
17
|
export declare const customFieldsProp: (objectType: string) => import("@activepieces/pieces-framework").DynamicProperties<false>;
|
|
12
|
-
export declare const ownerIdProp: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
18
|
+
export declare const ownerIdProp: (displayName: string, required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
19
|
+
export declare const filterIdProp: (type: string, required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
13
20
|
export declare const organizationIdProp: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
14
21
|
export declare const dealPipelineIdProp: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
15
22
|
export declare const dealStageIdProp: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
16
23
|
export declare const personIdProp: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
17
24
|
export declare const labelIdsProp: (objectType: string, labelFieldName: string, required?: boolean) => import("@activepieces/pieces-framework").MultiSelectDropdownProperty<number, false> | import("@activepieces/pieces-framework").MultiSelectDropdownProperty<number, true>;
|
|
18
|
-
export declare const
|
|
25
|
+
export declare const leadlabeIdsProp: (required?: boolean) => import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false> | import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, true>;
|
|
19
26
|
export declare const dealIdProp: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
20
27
|
export declare const productIdProp: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
21
28
|
export declare const visibleToProp: import("@activepieces/pieces-framework").StaticDropdownProperty<number, false>;
|
|
22
29
|
export declare const leadIdProp: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
30
|
+
export declare const activityTypeIdProp: (required?: boolean) => import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
23
31
|
export declare const dealCommonProps: {
|
|
24
32
|
creationTime: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
25
33
|
status: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
@@ -30,7 +38,7 @@ export declare const dealCommonProps: {
|
|
|
30
38
|
personId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
31
39
|
labelIds: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<number, false> | import("@activepieces/pieces-framework").MultiSelectDropdownProperty<number, true>;
|
|
32
40
|
probability: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
33
|
-
expectedCloseDate: import("@activepieces/pieces-framework").
|
|
41
|
+
expectedCloseDate: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
34
42
|
dealValue: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
35
43
|
dealValueCurrency: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
36
44
|
visibleTo: import("@activepieces/pieces-framework").StaticDropdownProperty<number, false>;
|
|
@@ -41,7 +49,7 @@ export declare const leadCommonProps: {
|
|
|
41
49
|
organizationId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
42
50
|
personId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
43
51
|
labelIds: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false> | import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, true>;
|
|
44
|
-
expectedCloseDate: import("@activepieces/pieces-framework").
|
|
52
|
+
expectedCloseDate: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
45
53
|
visibleTo: import("@activepieces/pieces-framework").StaticDropdownProperty<number, false>;
|
|
46
54
|
channel: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<number, false>;
|
|
47
55
|
leadValue: import("@activepieces/pieces-framework").NumberProperty<false>;
|
|
@@ -67,3 +75,18 @@ export declare const personCommonProps: {
|
|
|
67
75
|
marketing_status: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false> | import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
|
|
68
76
|
customfields: import("@activepieces/pieces-framework").DynamicProperties<false>;
|
|
69
77
|
};
|
|
78
|
+
export declare const activityCommonProps: {
|
|
79
|
+
organizationId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
80
|
+
personId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
81
|
+
dealId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
82
|
+
leadId: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
83
|
+
assignTo: import("@activepieces/pieces-framework").DropdownProperty<number, false> | import("@activepieces/pieces-framework").DropdownProperty<number, true>;
|
|
84
|
+
type: import("@activepieces/pieces-framework").DropdownProperty<string, false> | import("@activepieces/pieces-framework").DropdownProperty<string, true>;
|
|
85
|
+
dueDate: import("@activepieces/pieces-framework").DateTimeProperty<false>;
|
|
86
|
+
dueTime: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
87
|
+
duration: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
88
|
+
idDone: import("@activepieces/pieces-framework").CheckboxProperty<false>;
|
|
89
|
+
isBusy: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
|
|
90
|
+
note: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
91
|
+
publicDescription: import("@activepieces/pieces-framework").LongTextProperty<false>;
|
|
92
|
+
};
|
package/src/lib/common/props.js
CHANGED
|
@@ -1,18 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.personCommonProps = exports.organizationCommonProps = exports.leadCommonProps = exports.dealCommonProps = exports.leadIdProp = exports.visibleToProp = exports.productIdProp = exports.dealIdProp = exports.
|
|
3
|
+
exports.activityCommonProps = exports.personCommonProps = exports.organizationCommonProps = exports.leadCommonProps = exports.dealCommonProps = exports.activityTypeIdProp = exports.leadIdProp = exports.visibleToProp = exports.productIdProp = exports.dealIdProp = exports.leadlabeIdsProp = exports.labelIdsProp = exports.personIdProp = exports.dealStageIdProp = exports.dealPipelineIdProp = exports.organizationIdProp = exports.filterIdProp = exports.ownerIdProp = exports.customFieldsProp = exports.searchFieldValueProp = exports.searchFieldProp = void 0;
|
|
4
|
+
exports.fetchFiltersOptions = fetchFiltersOptions;
|
|
4
5
|
exports.fetchProductsOptions = fetchProductsOptions;
|
|
5
6
|
exports.fetchDealsOptions = fetchDealsOptions;
|
|
6
7
|
exports.fetchLeadsOptions = fetchLeadsOptions;
|
|
8
|
+
exports.fetchActivityTypesOptions = fetchActivityTypesOptions;
|
|
7
9
|
exports.fetchPipelinesOptions = fetchPipelinesOptions;
|
|
8
10
|
exports.fetchPersonsOptions = fetchPersonsOptions;
|
|
9
11
|
exports.fetchOwnersOptions = fetchOwnersOptions;
|
|
10
12
|
exports.fetchOrganizationsOptions = fetchOrganizationsOptions;
|
|
11
|
-
exports.
|
|
13
|
+
exports.createPropertyDefinition = createPropertyDefinition;
|
|
14
|
+
exports.retrieveObjectCustomProperties = retrieveObjectCustomProperties;
|
|
12
15
|
const tslib_1 = require("tslib");
|
|
13
16
|
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
14
17
|
const _1 = require(".");
|
|
15
18
|
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
19
|
+
const shared_1 = require("@activepieces/shared");
|
|
20
|
+
function fetchFiltersOptions(auth, type) {
|
|
21
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
const filters = yield (0, _1.pipedriveApiCall)({
|
|
23
|
+
accessToken: auth.access_token,
|
|
24
|
+
apiDomain: auth.data['api_domain'],
|
|
25
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
26
|
+
resourceUri: '/filters',
|
|
27
|
+
query: {
|
|
28
|
+
type: type,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
const options = [];
|
|
32
|
+
for (const filter of filters.data) {
|
|
33
|
+
options.push({
|
|
34
|
+
label: filter.name,
|
|
35
|
+
value: filter.id,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
return options;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
16
41
|
function fetchProductsOptions(auth) {
|
|
17
42
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
18
43
|
const products = yield (0, _1.pipedrivePaginatedApiCall)({
|
|
@@ -76,6 +101,24 @@ function fetchLeadsOptions(auth) {
|
|
|
76
101
|
return options;
|
|
77
102
|
});
|
|
78
103
|
}
|
|
104
|
+
function fetchActivityTypesOptions(auth) {
|
|
105
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
const activityTypes = yield (0, _1.pipedriveApiCall)({
|
|
107
|
+
accessToken: auth.access_token,
|
|
108
|
+
apiDomain: auth.data['api_domain'],
|
|
109
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
110
|
+
resourceUri: '/activityTypes:(key_string,name)',
|
|
111
|
+
});
|
|
112
|
+
const options = [];
|
|
113
|
+
for (const type of activityTypes.data) {
|
|
114
|
+
options.push({
|
|
115
|
+
label: type.name,
|
|
116
|
+
value: type.key_string,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return options;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
79
122
|
function fetchPipelinesOptions(auth) {
|
|
80
123
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
81
124
|
const pipelines = yield (0, _1.pipedriveApiCall)({
|
|
@@ -232,7 +275,7 @@ function createPropertyDefinition(property) {
|
|
|
232
275
|
return null;
|
|
233
276
|
}
|
|
234
277
|
}
|
|
235
|
-
function
|
|
278
|
+
function retrieveObjectCustomProperties(auth, objectType) {
|
|
236
279
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
237
280
|
let endpoint = '';
|
|
238
281
|
switch (objectType) {
|
|
@@ -269,6 +312,118 @@ function retriveObjectCustomProperties(auth, objectType) {
|
|
|
269
312
|
return props;
|
|
270
313
|
});
|
|
271
314
|
}
|
|
315
|
+
const searchFieldProp = (objectType) => pieces_framework_1.Property.Dropdown({
|
|
316
|
+
displayName: 'Field to search by',
|
|
317
|
+
required: true,
|
|
318
|
+
refreshers: [],
|
|
319
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
320
|
+
if (!auth) {
|
|
321
|
+
return {
|
|
322
|
+
disabled: true,
|
|
323
|
+
options: [],
|
|
324
|
+
placeholder: 'Please connect your account.',
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
const authValue = auth;
|
|
328
|
+
let endpoint = '';
|
|
329
|
+
switch (objectType) {
|
|
330
|
+
case 'person':
|
|
331
|
+
endpoint = '/personFields';
|
|
332
|
+
break;
|
|
333
|
+
case 'deal':
|
|
334
|
+
case 'lead':
|
|
335
|
+
endpoint = '/dealFields';
|
|
336
|
+
break;
|
|
337
|
+
case 'organization':
|
|
338
|
+
endpoint = '/organizationFields';
|
|
339
|
+
break;
|
|
340
|
+
case 'product':
|
|
341
|
+
endpoint = '/productFields';
|
|
342
|
+
break;
|
|
343
|
+
}
|
|
344
|
+
const response = yield (0, _1.pipedrivePaginatedApiCall)({
|
|
345
|
+
accessToken: authValue.access_token,
|
|
346
|
+
apiDomain: authValue.data['api_domain'],
|
|
347
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
348
|
+
resourceUri: endpoint,
|
|
349
|
+
});
|
|
350
|
+
const options = [];
|
|
351
|
+
for (const field of response) {
|
|
352
|
+
if (!(0, shared_1.isNil)(field.id)) {
|
|
353
|
+
options.push({
|
|
354
|
+
label: field.name,
|
|
355
|
+
value: field.id,
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
return {
|
|
360
|
+
disabled: false,
|
|
361
|
+
options,
|
|
362
|
+
};
|
|
363
|
+
}),
|
|
364
|
+
});
|
|
365
|
+
exports.searchFieldProp = searchFieldProp;
|
|
366
|
+
const searchFieldValueProp = (objectType) => pieces_framework_1.Property.DynamicProperties({
|
|
367
|
+
displayName: 'Field Value',
|
|
368
|
+
required: true,
|
|
369
|
+
refreshers: ['searchField'],
|
|
370
|
+
props: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth, searchField }) {
|
|
371
|
+
if (!auth || !searchField)
|
|
372
|
+
return {};
|
|
373
|
+
const authValue = auth;
|
|
374
|
+
const props = {};
|
|
375
|
+
let endpoint = '';
|
|
376
|
+
switch (objectType) {
|
|
377
|
+
case 'person':
|
|
378
|
+
endpoint = '/personFields';
|
|
379
|
+
break;
|
|
380
|
+
case 'deal':
|
|
381
|
+
case 'lead':
|
|
382
|
+
endpoint = '/dealFields';
|
|
383
|
+
break;
|
|
384
|
+
case 'organization':
|
|
385
|
+
endpoint = '/organizationFields';
|
|
386
|
+
break;
|
|
387
|
+
case 'product':
|
|
388
|
+
endpoint = '/productFields';
|
|
389
|
+
break;
|
|
390
|
+
}
|
|
391
|
+
const response = yield (0, _1.pipedriveApiCall)({
|
|
392
|
+
accessToken: authValue.access_token,
|
|
393
|
+
apiDomain: authValue.data['api_domain'],
|
|
394
|
+
method: pieces_common_1.HttpMethod.GET,
|
|
395
|
+
resourceUri: `${endpoint}/${searchField}`,
|
|
396
|
+
});
|
|
397
|
+
const propertyDefinition = response.data.field_type === 'set'
|
|
398
|
+
? pieces_framework_1.Property.StaticDropdown({
|
|
399
|
+
displayName: response.data.name,
|
|
400
|
+
required: false,
|
|
401
|
+
options: {
|
|
402
|
+
disabled: false,
|
|
403
|
+
options: response.data.options
|
|
404
|
+
? response.data.options.map((option) => {
|
|
405
|
+
return {
|
|
406
|
+
label: option.label,
|
|
407
|
+
value: option.id.toString(),
|
|
408
|
+
};
|
|
409
|
+
})
|
|
410
|
+
: [],
|
|
411
|
+
},
|
|
412
|
+
})
|
|
413
|
+
: createPropertyDefinition(response.data);
|
|
414
|
+
if (propertyDefinition) {
|
|
415
|
+
props['field_value'] = propertyDefinition;
|
|
416
|
+
}
|
|
417
|
+
else {
|
|
418
|
+
props['field_value'] = pieces_framework_1.Property.ShortText({
|
|
419
|
+
displayName: response.data.name,
|
|
420
|
+
required: false,
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
return props;
|
|
424
|
+
}),
|
|
425
|
+
});
|
|
426
|
+
exports.searchFieldValueProp = searchFieldValueProp;
|
|
272
427
|
const customFieldsProp = (objectType) => pieces_framework_1.Property.DynamicProperties({
|
|
273
428
|
displayName: 'Custom Fields',
|
|
274
429
|
refreshers: [],
|
|
@@ -277,12 +432,12 @@ const customFieldsProp = (objectType) => pieces_framework_1.Property.DynamicProp
|
|
|
277
432
|
if (!auth)
|
|
278
433
|
return {};
|
|
279
434
|
const authValue = auth;
|
|
280
|
-
return yield
|
|
435
|
+
return yield retrieveObjectCustomProperties(authValue, objectType);
|
|
281
436
|
}),
|
|
282
437
|
});
|
|
283
438
|
exports.customFieldsProp = customFieldsProp;
|
|
284
|
-
const ownerIdProp = (required = false) => pieces_framework_1.Property.Dropdown({
|
|
285
|
-
displayName
|
|
439
|
+
const ownerIdProp = (displayName, required = false) => pieces_framework_1.Property.Dropdown({
|
|
440
|
+
displayName,
|
|
286
441
|
refreshers: [],
|
|
287
442
|
required,
|
|
288
443
|
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
@@ -302,6 +457,27 @@ const ownerIdProp = (required = false) => pieces_framework_1.Property.Dropdown({
|
|
|
302
457
|
}),
|
|
303
458
|
});
|
|
304
459
|
exports.ownerIdProp = ownerIdProp;
|
|
460
|
+
const filterIdProp = (type, required = false) => pieces_framework_1.Property.Dropdown({
|
|
461
|
+
displayName: 'Filter',
|
|
462
|
+
refreshers: [],
|
|
463
|
+
required,
|
|
464
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
465
|
+
if (!auth) {
|
|
466
|
+
return {
|
|
467
|
+
disabled: true,
|
|
468
|
+
options: [],
|
|
469
|
+
placeholder: 'Please connect your account.',
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
const authValue = auth;
|
|
473
|
+
const options = yield fetchFiltersOptions(authValue, type);
|
|
474
|
+
return {
|
|
475
|
+
disabled: false,
|
|
476
|
+
options,
|
|
477
|
+
};
|
|
478
|
+
}),
|
|
479
|
+
});
|
|
480
|
+
exports.filterIdProp = filterIdProp;
|
|
305
481
|
const organizationIdProp = (required = false) => pieces_framework_1.Property.Dropdown({
|
|
306
482
|
displayName: 'Organization',
|
|
307
483
|
refreshers: [],
|
|
@@ -448,7 +624,7 @@ const labelIdsProp = (objectType, labelFieldName, required = false) => pieces_fr
|
|
|
448
624
|
}),
|
|
449
625
|
});
|
|
450
626
|
exports.labelIdsProp = labelIdsProp;
|
|
451
|
-
const
|
|
627
|
+
const leadlabeIdsProp = (required = false) => pieces_framework_1.Property.MultiSelectDropdown({
|
|
452
628
|
displayName: 'Label',
|
|
453
629
|
required,
|
|
454
630
|
refreshers: [],
|
|
@@ -480,7 +656,7 @@ const leadLableIdsProp = (required = false) => pieces_framework_1.Property.Multi
|
|
|
480
656
|
};
|
|
481
657
|
}),
|
|
482
658
|
});
|
|
483
|
-
exports.
|
|
659
|
+
exports.leadlabeIdsProp = leadlabeIdsProp;
|
|
484
660
|
const dealIdProp = (required = false) => pieces_framework_1.Property.Dropdown({
|
|
485
661
|
displayName: 'Deal',
|
|
486
662
|
refreshers: [],
|
|
@@ -561,6 +737,27 @@ const leadIdProp = (required = false) => pieces_framework_1.Property.Dropdown({
|
|
|
561
737
|
}),
|
|
562
738
|
});
|
|
563
739
|
exports.leadIdProp = leadIdProp;
|
|
740
|
+
const activityTypeIdProp = (required = false) => pieces_framework_1.Property.Dropdown({
|
|
741
|
+
displayName: 'Activity Type',
|
|
742
|
+
refreshers: [],
|
|
743
|
+
required,
|
|
744
|
+
options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
|
|
745
|
+
if (!auth) {
|
|
746
|
+
return {
|
|
747
|
+
disabled: true,
|
|
748
|
+
options: [],
|
|
749
|
+
placeholder: 'Please connect your account.',
|
|
750
|
+
};
|
|
751
|
+
}
|
|
752
|
+
const authValue = auth;
|
|
753
|
+
const options = yield fetchActivityTypesOptions(authValue);
|
|
754
|
+
return {
|
|
755
|
+
disabled: false,
|
|
756
|
+
options,
|
|
757
|
+
};
|
|
758
|
+
}),
|
|
759
|
+
});
|
|
760
|
+
exports.activityTypeIdProp = activityTypeIdProp;
|
|
564
761
|
exports.dealCommonProps = {
|
|
565
762
|
creationTime: pieces_framework_1.Property.DateTime({
|
|
566
763
|
displayName: 'Creation Time',
|
|
@@ -593,7 +790,7 @@ exports.dealCommonProps = {
|
|
|
593
790
|
}),
|
|
594
791
|
stageId: (0, exports.dealStageIdProp)(false),
|
|
595
792
|
pipelineId: (0, exports.dealPipelineIdProp)(false),
|
|
596
|
-
ownerId: (0, exports.ownerIdProp)(false),
|
|
793
|
+
ownerId: (0, exports.ownerIdProp)('Owner', false),
|
|
597
794
|
organizationId: (0, exports.organizationIdProp)(false),
|
|
598
795
|
personId: (0, exports.personIdProp)(false),
|
|
599
796
|
labelIds: (0, exports.labelIdsProp)('deal', 'label', false),
|
|
@@ -601,7 +798,7 @@ exports.dealCommonProps = {
|
|
|
601
798
|
displayName: 'Probability',
|
|
602
799
|
required: false,
|
|
603
800
|
}),
|
|
604
|
-
expectedCloseDate: pieces_framework_1.Property.
|
|
801
|
+
expectedCloseDate: pieces_framework_1.Property.DateTime({
|
|
605
802
|
displayName: 'Expected Close Date',
|
|
606
803
|
required: false,
|
|
607
804
|
description: 'Please enter date in YYYY-MM-DD format.',
|
|
@@ -619,11 +816,11 @@ exports.dealCommonProps = {
|
|
|
619
816
|
customfields: (0, exports.customFieldsProp)('deal'),
|
|
620
817
|
};
|
|
621
818
|
exports.leadCommonProps = {
|
|
622
|
-
ownerId: (0, exports.ownerIdProp)(false),
|
|
819
|
+
ownerId: (0, exports.ownerIdProp)('Owner', false),
|
|
623
820
|
organizationId: (0, exports.organizationIdProp)(false),
|
|
624
821
|
personId: (0, exports.personIdProp)(false),
|
|
625
|
-
labelIds: (0, exports.
|
|
626
|
-
expectedCloseDate: pieces_framework_1.Property.
|
|
822
|
+
labelIds: (0, exports.leadlabeIdsProp)(false),
|
|
823
|
+
expectedCloseDate: pieces_framework_1.Property.DateTime({
|
|
627
824
|
displayName: 'Expected Close Date',
|
|
628
825
|
required: false,
|
|
629
826
|
description: 'Please enter date in YYYY-MM-DD format.',
|
|
@@ -677,7 +874,7 @@ exports.leadCommonProps = {
|
|
|
677
874
|
customfields: (0, exports.customFieldsProp)('lead'),
|
|
678
875
|
};
|
|
679
876
|
exports.organizationCommonProps = {
|
|
680
|
-
ownerId: (0, exports.ownerIdProp)(false),
|
|
877
|
+
ownerId: (0, exports.ownerIdProp)('Owner', false),
|
|
681
878
|
visibleTo: exports.visibleToProp,
|
|
682
879
|
labelIds: (0, exports.labelIdsProp)('organization', 'label_ids', false),
|
|
683
880
|
address: pieces_framework_1.Property.LongText({
|
|
@@ -687,7 +884,7 @@ exports.organizationCommonProps = {
|
|
|
687
884
|
customfields: (0, exports.customFieldsProp)('organization'),
|
|
688
885
|
};
|
|
689
886
|
exports.personCommonProps = {
|
|
690
|
-
ownerId: (0, exports.ownerIdProp)(false),
|
|
887
|
+
ownerId: (0, exports.ownerIdProp)('Owner', false),
|
|
691
888
|
organizationId: (0, exports.organizationIdProp)(false),
|
|
692
889
|
email: pieces_framework_1.Property.Array({
|
|
693
890
|
displayName: 'Email',
|
|
@@ -733,6 +930,59 @@ exports.personCommonProps = {
|
|
|
733
930
|
],
|
|
734
931
|
},
|
|
735
932
|
}),
|
|
736
|
-
customfields: (0, exports.customFieldsProp)('person')
|
|
933
|
+
customfields: (0, exports.customFieldsProp)('person'),
|
|
934
|
+
};
|
|
935
|
+
exports.activityCommonProps = {
|
|
936
|
+
organizationId: (0, exports.organizationIdProp)(false),
|
|
937
|
+
personId: (0, exports.personIdProp)(false),
|
|
938
|
+
dealId: (0, exports.dealIdProp)(false),
|
|
939
|
+
leadId: (0, exports.leadIdProp)(false),
|
|
940
|
+
assignTo: (0, exports.ownerIdProp)('Assign To', false),
|
|
941
|
+
type: (0, exports.activityTypeIdProp)(false),
|
|
942
|
+
dueDate: pieces_framework_1.Property.DateTime({
|
|
943
|
+
displayName: 'Due Date',
|
|
944
|
+
required: false,
|
|
945
|
+
description: 'Please enter date in YYYY-MM-DD format.',
|
|
946
|
+
}),
|
|
947
|
+
dueTime: pieces_framework_1.Property.ShortText({
|
|
948
|
+
displayName: 'Due Time',
|
|
949
|
+
required: false,
|
|
950
|
+
description: 'Please enter time in HH:MM format.',
|
|
951
|
+
}),
|
|
952
|
+
duration: pieces_framework_1.Property.ShortText({
|
|
953
|
+
displayName: 'Duration',
|
|
954
|
+
required: false,
|
|
955
|
+
description: 'Please enter time in HH:MM format.',
|
|
956
|
+
}),
|
|
957
|
+
idDone: pieces_framework_1.Property.Checkbox({
|
|
958
|
+
displayName: 'Mark as Done?',
|
|
959
|
+
required: false,
|
|
960
|
+
defaultValue: false,
|
|
961
|
+
}),
|
|
962
|
+
isBusy: pieces_framework_1.Property.StaticDropdown({
|
|
963
|
+
displayName: 'Free or Busy',
|
|
964
|
+
required: false,
|
|
965
|
+
options: {
|
|
966
|
+
disabled: false,
|
|
967
|
+
options: [
|
|
968
|
+
{
|
|
969
|
+
label: 'Free',
|
|
970
|
+
value: 'free',
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
label: 'Busy',
|
|
974
|
+
value: 'busy',
|
|
975
|
+
},
|
|
976
|
+
],
|
|
977
|
+
},
|
|
978
|
+
}),
|
|
979
|
+
note: pieces_framework_1.Property.LongText({
|
|
980
|
+
displayName: 'Note',
|
|
981
|
+
required: false,
|
|
982
|
+
}),
|
|
983
|
+
publicDescription: pieces_framework_1.Property.LongText({
|
|
984
|
+
displayName: 'Public Description',
|
|
985
|
+
required: false,
|
|
986
|
+
}),
|
|
737
987
|
};
|
|
738
988
|
//# sourceMappingURL=props.js.map
|