@activepieces/piece-pipedrive 0.8.6 → 0.8.8

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.
Files changed (197) hide show
  1. package/package.json +8 -33
  2. package/src/index.js +13 -117
  3. package/src/index.d.ts +0 -2
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/add-follower.d.ts +0 -6
  7. package/src/lib/actions/add-follower.d.ts.map +0 -1
  8. package/src/lib/actions/add-follower.js +0 -83
  9. package/src/lib/actions/add-follower.js.map +0 -1
  10. package/src/lib/actions/add-label-to-person.d.ts +0 -5
  11. package/src/lib/actions/add-label-to-person.d.ts.map +0 -1
  12. package/src/lib/actions/add-label-to-person.js +0 -46
  13. package/src/lib/actions/add-label-to-person.js.map +0 -1
  14. package/src/lib/actions/add-product-to-deal.d.ts +0 -13
  15. package/src/lib/actions/add-product-to-deal.d.ts.map +0 -1
  16. package/src/lib/actions/add-product-to-deal.js +0 -106
  17. package/src/lib/actions/add-product-to-deal.js.map +0 -1
  18. package/src/lib/actions/attach-file.d.ts +0 -10
  19. package/src/lib/actions/attach-file.d.ts.map +0 -1
  20. package/src/lib/actions/attach-file.js +0 -62
  21. package/src/lib/actions/attach-file.js.map +0 -1
  22. package/src/lib/actions/create-activity.d.ts +0 -17
  23. package/src/lib/actions/create-activity.d.ts.map +0 -1
  24. package/src/lib/actions/create-activity.js +0 -56
  25. package/src/lib/actions/create-activity.js.map +0 -1
  26. package/src/lib/actions/create-deal.d.ts +0 -18
  27. package/src/lib/actions/create-deal.d.ts.map +0 -1
  28. package/src/lib/actions/create-deal.js +0 -69
  29. package/src/lib/actions/create-deal.js.map +0 -1
  30. package/src/lib/actions/create-lead.d.ts +0 -14
  31. package/src/lib/actions/create-lead.d.ts.map +0 -1
  32. package/src/lib/actions/create-lead.js +0 -75
  33. package/src/lib/actions/create-lead.js.map +0 -1
  34. package/src/lib/actions/create-note.d.ts +0 -12
  35. package/src/lib/actions/create-note.d.ts.map +0 -1
  36. package/src/lib/actions/create-note.js +0 -73
  37. package/src/lib/actions/create-note.js.map +0 -1
  38. package/src/lib/actions/create-organization.d.ts +0 -9
  39. package/src/lib/actions/create-organization.d.ts.map +0 -1
  40. package/src/lib/actions/create-organization.js +0 -61
  41. package/src/lib/actions/create-organization.js.map +0 -1
  42. package/src/lib/actions/create-person.d.ts +0 -14
  43. package/src/lib/actions/create-person.d.ts.map +0 -1
  44. package/src/lib/actions/create-person.js +0 -86
  45. package/src/lib/actions/create-person.js.map +0 -1
  46. package/src/lib/actions/create-product.d.ts +0 -16
  47. package/src/lib/actions/create-product.d.ts.map +0 -1
  48. package/src/lib/actions/create-product.js +0 -110
  49. package/src/lib/actions/create-product.js.map +0 -1
  50. package/src/lib/actions/find-activity.d.ts +0 -9
  51. package/src/lib/actions/find-activity.d.ts.map +0 -1
  52. package/src/lib/actions/find-activity.js +0 -99
  53. package/src/lib/actions/find-activity.js.map +0 -1
  54. package/src/lib/actions/find-deal.d.ts +0 -5
  55. package/src/lib/actions/find-deal.d.ts.map +0 -1
  56. package/src/lib/actions/find-deal.js +0 -106
  57. package/src/lib/actions/find-deal.js.map +0 -1
  58. package/src/lib/actions/find-deals-associated-with-person.d.ts +0 -4
  59. package/src/lib/actions/find-deals-associated-with-person.d.ts.map +0 -1
  60. package/src/lib/actions/find-deals-associated-with-person.js +0 -59
  61. package/src/lib/actions/find-deals-associated-with-person.js.map +0 -1
  62. package/src/lib/actions/find-leads.d.ts +0 -5
  63. package/src/lib/actions/find-leads.d.ts.map +0 -1
  64. package/src/lib/actions/find-leads.js +0 -68
  65. package/src/lib/actions/find-leads.js.map +0 -1
  66. package/src/lib/actions/find-notes.d.ts +0 -5
  67. package/src/lib/actions/find-notes.d.ts.map +0 -1
  68. package/src/lib/actions/find-notes.js +0 -71
  69. package/src/lib/actions/find-notes.js.map +0 -1
  70. package/src/lib/actions/find-organization.d.ts +0 -5
  71. package/src/lib/actions/find-organization.d.ts.map +0 -1
  72. package/src/lib/actions/find-organization.js +0 -106
  73. package/src/lib/actions/find-organization.js.map +0 -1
  74. package/src/lib/actions/find-person.d.ts +0 -5
  75. package/src/lib/actions/find-person.d.ts.map +0 -1
  76. package/src/lib/actions/find-person.js +0 -107
  77. package/src/lib/actions/find-person.js.map +0 -1
  78. package/src/lib/actions/find-product.d.ts +0 -4
  79. package/src/lib/actions/find-product.d.ts.map +0 -1
  80. package/src/lib/actions/find-product.js +0 -63
  81. package/src/lib/actions/find-product.js.map +0 -1
  82. package/src/lib/actions/find-products.d.ts +0 -5
  83. package/src/lib/actions/find-products.d.ts.map +0 -1
  84. package/src/lib/actions/find-products.js +0 -81
  85. package/src/lib/actions/find-products.js.map +0 -1
  86. package/src/lib/actions/find-user.d.ts +0 -5
  87. package/src/lib/actions/find-user.d.ts.map +0 -1
  88. package/src/lib/actions/find-user.js +0 -57
  89. package/src/lib/actions/find-user.js.map +0 -1
  90. package/src/lib/actions/get-note.d.ts +0 -4
  91. package/src/lib/actions/get-note.d.ts.map +0 -1
  92. package/src/lib/actions/get-note.js +0 -40
  93. package/src/lib/actions/get-note.js.map +0 -1
  94. package/src/lib/actions/get-product.d.ts +0 -4
  95. package/src/lib/actions/get-product.d.ts.map +0 -1
  96. package/src/lib/actions/get-product.js +0 -50
  97. package/src/lib/actions/get-product.js.map +0 -1
  98. package/src/lib/actions/update-activity.d.ts +0 -18
  99. package/src/lib/actions/update-activity.d.ts.map +0 -1
  100. package/src/lib/actions/update-activity.js +0 -60
  101. package/src/lib/actions/update-activity.js.map +0 -1
  102. package/src/lib/actions/update-deal.d.ts +0 -19
  103. package/src/lib/actions/update-deal.d.ts.map +0 -1
  104. package/src/lib/actions/update-deal.js +0 -68
  105. package/src/lib/actions/update-deal.js.map +0 -1
  106. package/src/lib/actions/update-lead.d.ts +0 -15
  107. package/src/lib/actions/update-lead.d.ts.map +0 -1
  108. package/src/lib/actions/update-lead.js +0 -72
  109. package/src/lib/actions/update-lead.js.map +0 -1
  110. package/src/lib/actions/update-organization.d.ts +0 -10
  111. package/src/lib/actions/update-organization.d.ts.map +0 -1
  112. package/src/lib/actions/update-organization.js +0 -61
  113. package/src/lib/actions/update-organization.js.map +0 -1
  114. package/src/lib/actions/update-person.d.ts +0 -15
  115. package/src/lib/actions/update-person.d.ts.map +0 -1
  116. package/src/lib/actions/update-person.js +0 -79
  117. package/src/lib/actions/update-person.js.map +0 -1
  118. package/src/lib/actions/update-product.d.ts +0 -17
  119. package/src/lib/actions/update-product.d.ts.map +0 -1
  120. package/src/lib/actions/update-product.js +0 -114
  121. package/src/lib/actions/update-product.js.map +0 -1
  122. package/src/lib/auth.d.ts +0 -2
  123. package/src/lib/auth.d.ts.map +0 -1
  124. package/src/lib/auth.js +0 -22
  125. package/src/lib/auth.js.map +0 -1
  126. package/src/lib/common/constants.d.ts +0 -4
  127. package/src/lib/common/constants.d.ts.map +0 -1
  128. package/src/lib/common/constants.js +0 -64
  129. package/src/lib/common/constants.js.map +0 -1
  130. package/src/lib/common/index.d.ts +0 -25
  131. package/src/lib/common/index.d.ts.map +0 -1
  132. package/src/lib/common/index.js +0 -260
  133. package/src/lib/common/index.js.map +0 -1
  134. package/src/lib/common/props.d.ts +0 -144
  135. package/src/lib/common/props.d.ts.map +0 -1
  136. package/src/lib/common/props.js +0 -893
  137. package/src/lib/common/props.js.map +0 -1
  138. package/src/lib/common/types.d.ts +0 -370
  139. package/src/lib/common/types.d.ts.map +0 -1
  140. package/src/lib/common/types.js +0 -3
  141. package/src/lib/common/types.js.map +0 -1
  142. package/src/lib/trigger/activity-matching-filter.d.ts +0 -11
  143. package/src/lib/trigger/activity-matching-filter.d.ts.map +0 -1
  144. package/src/lib/trigger/activity-matching-filter.js +0 -179
  145. package/src/lib/trigger/activity-matching-filter.js.map +0 -1
  146. package/src/lib/trigger/deal-matching-filter.d.ts +0 -15
  147. package/src/lib/trigger/deal-matching-filter.d.ts.map +0 -1
  148. package/src/lib/trigger/deal-matching-filter.js +0 -244
  149. package/src/lib/trigger/deal-matching-filter.js.map +0 -1
  150. package/src/lib/trigger/new-activity.d.ts +0 -3
  151. package/src/lib/trigger/new-activity.d.ts.map +0 -1
  152. package/src/lib/trigger/new-activity.js +0 -131
  153. package/src/lib/trigger/new-activity.js.map +0 -1
  154. package/src/lib/trigger/new-deal.d.ts +0 -3
  155. package/src/lib/trigger/new-deal.d.ts.map +0 -1
  156. package/src/lib/trigger/new-deal.js +0 -138
  157. package/src/lib/trigger/new-deal.js.map +0 -1
  158. package/src/lib/trigger/new-lead.d.ts +0 -3
  159. package/src/lib/trigger/new-lead.d.ts.map +0 -1
  160. package/src/lib/trigger/new-lead.js +0 -126
  161. package/src/lib/trigger/new-lead.js.map +0 -1
  162. package/src/lib/trigger/new-note.d.ts +0 -3
  163. package/src/lib/trigger/new-note.d.ts.map +0 -1
  164. package/src/lib/trigger/new-note.js +0 -78
  165. package/src/lib/trigger/new-note.js.map +0 -1
  166. package/src/lib/trigger/new-organization.d.ts +0 -3
  167. package/src/lib/trigger/new-organization.d.ts.map +0 -1
  168. package/src/lib/trigger/new-organization.js +0 -113
  169. package/src/lib/trigger/new-organization.js.map +0 -1
  170. package/src/lib/trigger/new-person.d.ts +0 -3
  171. package/src/lib/trigger/new-person.d.ts.map +0 -1
  172. package/src/lib/trigger/new-person.js +0 -123
  173. package/src/lib/trigger/new-person.js.map +0 -1
  174. package/src/lib/trigger/organization-matching-filter.d.ts +0 -11
  175. package/src/lib/trigger/organization-matching-filter.d.ts.map +0 -1
  176. package/src/lib/trigger/organization-matching-filter.js +0 -151
  177. package/src/lib/trigger/organization-matching-filter.js.map +0 -1
  178. package/src/lib/trigger/person-matching-filter.d.ts +0 -11
  179. package/src/lib/trigger/person-matching-filter.d.ts.map +0 -1
  180. package/src/lib/trigger/person-matching-filter.js +0 -158
  181. package/src/lib/trigger/person-matching-filter.js.map +0 -1
  182. package/src/lib/trigger/updated-deal-stage.d.ts +0 -11
  183. package/src/lib/trigger/updated-deal-stage.d.ts.map +0 -1
  184. package/src/lib/trigger/updated-deal-stage.js +0 -223
  185. package/src/lib/trigger/updated-deal-stage.js.map +0 -1
  186. package/src/lib/trigger/updated-deal.d.ts +0 -19
  187. package/src/lib/trigger/updated-deal.d.ts.map +0 -1
  188. package/src/lib/trigger/updated-deal.js +0 -322
  189. package/src/lib/trigger/updated-deal.js.map +0 -1
  190. package/src/lib/trigger/updated-organization.d.ts +0 -3
  191. package/src/lib/trigger/updated-organization.d.ts.map +0 -1
  192. package/src/lib/trigger/updated-organization.js +0 -110
  193. package/src/lib/trigger/updated-organization.js.map +0 -1
  194. package/src/lib/trigger/updated-person.d.ts +0 -3
  195. package/src/lib/trigger/updated-person.d.ts.map +0 -1
  196. package/src/lib/trigger/updated-person.js +0 -120
  197. package/src/lib/trigger/updated-person.js.map +0 -1
@@ -1,72 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateLeadAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const auth_1 = require("../auth");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const props_1 = require("../common/props");
8
- const common_1 = require("../common");
9
- const pieces_common_1 = require("@activepieces/pieces-common");
10
- const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
11
- exports.updateLeadAction = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.pipedriveAuth,
13
- name: 'update-lead',
14
- displayName: 'Update Lead',
15
- description: 'Updates an existing lead.',
16
- props: Object.assign({ leadId: (0, props_1.leadIdProp)(true), title: pieces_framework_1.Property.ShortText({
17
- displayName: 'Title',
18
- required: false,
19
- }) }, props_1.leadCommonProps),
20
- run(context) {
21
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
- var _a, _b;
23
- const { title, ownerId, leadId, channel, organizationId, personId, expectedCloseDate, visibleTo, leadValue, leadValueCurrency, } = context.propsValue;
24
- const labelIds = (_a = context.propsValue.labelIds) !== null && _a !== void 0 ? _a : [];
25
- const customFields = (_b = context.propsValue.customfields) !== null && _b !== void 0 ? _b : {};
26
- const leadDefaultFields = {
27
- title,
28
- owner_id: ownerId,
29
- organization_id: organizationId,
30
- person_id: personId,
31
- channel: channel,
32
- visible_to: visibleTo,
33
- };
34
- if (labelIds.length > 0) {
35
- leadDefaultFields.label_ids = labelIds;
36
- }
37
- if (expectedCloseDate) {
38
- leadDefaultFields.expected_close_date = (0, dayjs_1.default)(expectedCloseDate).format('YYYY-MM-DD');
39
- }
40
- if (leadValue) {
41
- if (!leadValueCurrency) {
42
- throw new Error('lead Value Currency is required when lead Value is provided');
43
- }
44
- leadDefaultFields.value = {
45
- amount: leadValue,
46
- currency: leadValueCurrency,
47
- };
48
- }
49
- const leadCustomFields = {};
50
- Object.entries(customFields).forEach(([key, value]) => {
51
- // Format values if they are arrays
52
- leadCustomFields[key] = Array.isArray(value) && value.length > 0 ? value.join(',') : value;
53
- });
54
- const updatedLeadResponse = yield (0, common_1.pipedriveApiCall)({
55
- accessToken: context.auth.access_token,
56
- apiDomain: context.auth.data['api_domain'],
57
- method: pieces_common_1.HttpMethod.PATCH,
58
- resourceUri: `/v1/leads/${leadId}`,
59
- body: Object.assign(Object.assign({}, leadDefaultFields), leadCustomFields),
60
- });
61
- const customFieldsResponse = yield (0, common_1.pipedrivePaginatedV1ApiCall)({
62
- accessToken: context.auth.access_token,
63
- apiDomain: context.auth.data['api_domain'],
64
- method: pieces_common_1.HttpMethod.GET,
65
- resourceUri: '/v1/dealFields',
66
- });
67
- const transformedLeadProperties = (0, common_1.pipedriveTransformV1CustomFields)(customFieldsResponse, updatedLeadResponse.data);
68
- return Object.assign(Object.assign({}, updatedLeadResponse), { data: transformedLeadProperties });
69
- });
70
- },
71
- });
72
- //# sourceMappingURL=update-lead.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-lead.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-lead.ts"],"names":[],"mappings":";;;;AAAA,kCAAwC;AACxC,qEAAwE;AACxE,2CAA8D;AAC9D,sCAIm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ACI,mBAAmB,KACtB,IAAI,EAAE,yBAAyB,IAC9B;QACH,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- export declare const updateOrganizationAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
- ownerId: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
3
- visibleTo: import("@activepieces/pieces-framework").StaticDropdownProperty<number, false>;
4
- labelIds: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<number, false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>> | import("@activepieces/pieces-framework").MultiSelectDropdownProperty<number, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
5
- address: import("@activepieces/pieces-framework").LongTextProperty<false>;
6
- customfields: import("@activepieces/pieces-framework").DynamicProperties<false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
7
- organizationId: import("@activepieces/pieces-framework").NumberProperty<false> | import("@activepieces/pieces-framework").NumberProperty<true>;
8
- name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
- }>;
10
- //# sourceMappingURL=update-organization.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-organization.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-organization.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,wBAAwB;;;;;;;;EAkEnC,CAAC"}
@@ -1,61 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateOrganizationAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const auth_1 = require("../auth");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const props_1 = require("../common/props");
8
- const common_1 = require("../common");
9
- const pieces_common_1 = require("@activepieces/pieces-common");
10
- const shared_1 = require("@activepieces/shared");
11
- exports.updateOrganizationAction = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.pipedriveAuth,
13
- name: 'update-organization',
14
- displayName: 'Update Organization',
15
- description: 'Updates an existing organization.',
16
- props: Object.assign({ organizationId: (0, props_1.organizationIdProp)(true), name: pieces_framework_1.Property.ShortText({
17
- displayName: 'Name',
18
- required: false,
19
- }) }, props_1.organizationCommonProps),
20
- run(context) {
21
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
- var _a, _b;
23
- const { name, ownerId, address, visibleTo, organizationId } = context.propsValue;
24
- const labelIds = (_a = context.propsValue.labelIds) !== null && _a !== void 0 ? _a : [];
25
- const customFields = (_b = context.propsValue.customfields) !== null && _b !== void 0 ? _b : {};
26
- const organizationPayload = {
27
- name: name,
28
- owner_id: ownerId,
29
- visible_to: visibleTo,
30
- };
31
- if (address) {
32
- if (typeof address === 'string') {
33
- organizationPayload.address = { value: address };
34
- }
35
- }
36
- if (labelIds.length > 0) {
37
- organizationPayload.label_ids = labelIds;
38
- }
39
- const customFieldsResponse = yield (0, common_1.pipedrivePaginatedV1ApiCall)({
40
- accessToken: context.auth.access_token,
41
- apiDomain: context.auth.data['api_domain'],
42
- method: pieces_common_1.HttpMethod.GET,
43
- resourceUri: '/v1/organizationFields',
44
- });
45
- const orgCustomFields = (0, common_1.pipedriveParseCustomFields)(customFieldsResponse, customFields);
46
- if (!(0, shared_1.isEmpty)(orgCustomFields)) {
47
- organizationPayload.custom_fields = orgCustomFields;
48
- }
49
- const updatedOrganizationResponse = yield (0, common_1.pipedriveApiCall)({
50
- accessToken: context.auth.access_token,
51
- apiDomain: context.auth.data['api_domain'],
52
- method: pieces_common_1.HttpMethod.PATCH,
53
- resourceUri: `/v2/organizations/${organizationId}`,
54
- body: organizationPayload,
55
- });
56
- const transformedOrganizationProperties = (0, common_1.pipedriveTransformCustomFields)(customFieldsResponse, updatedOrganizationResponse.data);
57
- return Object.assign(Object.assign({}, updatedOrganizationResponse), { data: transformedOrganizationProperties });
58
- });
59
- },
60
- });
61
- //# sourceMappingURL=update-organization.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-organization.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-organization.ts"],"names":[],"mappings":";;;;AAAA,kCAAwC;AACxC,qEAAwE;AACxE,2CAA8E;AAC9E,sCAKmB;AAEnB,+DAAyD;AACzD,iDAA+C;AAElC,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACpD,IAAI,EAAE,oBAAa;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,mBAAmB,GAAwB;gBAChD,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,OAAO;gBACjB,UAAU,EAAE,SAAS;aACrB,CAAC;YAEF,IAAI,OAAO,EAAE,CAAC;gBACb,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;oBACjC,mBAAmB,CAAC,OAAO,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;gBAClD,CAAC;YACF,CAAC;YAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACzB,mBAAmB,CAAC,SAAS,GAAG,QAAQ,CAAC;YAC1C,CAAC;YAED,MAAM,oBAAoB,GAAG,MAAM,IAAA,oCAA2B,EAAW;gBACxE,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,wBAAwB;aACrC,CAAC,CAAC;YAEH,MAAM,eAAe,GAAG,IAAA,mCAA0B,EAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC;YAEvF,IAAI,CAAC,IAAA,gBAAO,EAAC,eAAe,CAAC,EAAE,CAAC;gBAC/B,mBAAmB,CAAC,aAAa,GAAG,eAAe,CAAC;YACrD,CAAC;YAED,MAAM,2BAA2B,GAAG,MAAM,IAAA,yBAAgB,EAA0B;gBACnF,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;gBACtC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;gBAC1C,MAAM,EAAE,0BAAU,CAAC,KAAK;gBACxB,WAAW,EAAE,qBAAqB,cAAc,EAAE;gBAClD,IAAI,EAAE,mBAAmB;aACzB,CAAC,CAAC;YAEH,MAAM,iCAAiC,GAAG,IAAA,uCAA8B,EACvE,oBAAoB,EACpB,2BAA2B,CAAC,IAAI,CAChC,CAAC;YAEF,uCACI,2BAA2B,KAC9B,IAAI,EAAE,iCAAiC,IACtC;QACH,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- export declare const updatePersonAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
- ownerId: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
3
- organizationId: import("@activepieces/pieces-framework").NumberProperty<false> | import("@activepieces/pieces-framework").NumberProperty<true>;
4
- email: import("@activepieces/pieces-framework").ArrayProperty<false>;
5
- phone: import("@activepieces/pieces-framework").ArrayProperty<false>;
6
- labelIds: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<number, false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>> | import("@activepieces/pieces-framework").MultiSelectDropdownProperty<number, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
7
- firstName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
- lastName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
- visibleTo: import("@activepieces/pieces-framework").StaticDropdownProperty<number, false>;
10
- marketing_status: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false> | import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
11
- customfields: import("@activepieces/pieces-framework").DynamicProperties<false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
12
- personId: import("@activepieces/pieces-framework").NumberProperty<false> | import("@activepieces/pieces-framework").NumberProperty<true>;
13
- name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
- }>;
15
- //# sourceMappingURL=update-person.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-person.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-person.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;EA8F7B,CAAC"}
@@ -1,79 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updatePersonAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const auth_1 = require("../auth");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const props_1 = require("../common/props");
8
- const common_1 = require("../common");
9
- const pieces_common_1 = require("@activepieces/pieces-common");
10
- const shared_1 = require("@activepieces/shared");
11
- exports.updatePersonAction = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.pipedriveAuth,
13
- name: 'update-person',
14
- displayName: 'Update Person',
15
- description: 'Updates an existing person.',
16
- props: Object.assign({ personId: (0, props_1.personIdProp)(true), name: pieces_framework_1.Property.ShortText({
17
- displayName: 'Name',
18
- required: false,
19
- }) }, props_1.personCommonProps),
20
- run(context) {
21
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
- var _a, _b, _c, _d;
23
- const { name, ownerId, personId, organizationId, marketing_status, visibleTo, firstName, lastName, } = context.propsValue;
24
- const rawPhones = (_a = context.propsValue.phone) !== null && _a !== void 0 ? _a : [];
25
- const rawEmails = (_b = context.propsValue.email) !== null && _b !== void 0 ? _b : [];
26
- const labelIds = (_c = context.propsValue.labelIds) !== null && _c !== void 0 ? _c : [];
27
- const customFields = (_d = context.propsValue.customfields) !== null && _d !== void 0 ? _d : {};
28
- if ((firstName && !lastName) || (!firstName && lastName)) {
29
- throw new Error('If First Name is provided, Last Name must be provided as well.');
30
- }
31
- const phones = rawPhones.map((value, index) => ({
32
- value,
33
- label: 'work',
34
- primary: index === 0,
35
- }));
36
- const emails = rawEmails.map((value, index) => ({
37
- value,
38
- label: 'work',
39
- primary: index === 0,
40
- }));
41
- const personPayload = {
42
- name: name,
43
- owner_id: ownerId,
44
- org_id: organizationId,
45
- marketing_status: marketing_status,
46
- visible_to: visibleTo,
47
- first_name: firstName,
48
- last_name: lastName,
49
- };
50
- // Phones and emails
51
- if (phones.length)
52
- personPayload.phones = phones;
53
- if (emails.length)
54
- personPayload.emails = emails;
55
- if (labelIds.length)
56
- personPayload.label_ids = labelIds;
57
- const customFieldsResponse = yield (0, common_1.pipedrivePaginatedV1ApiCall)({
58
- accessToken: context.auth.access_token,
59
- apiDomain: context.auth.data['api_domain'],
60
- method: pieces_common_1.HttpMethod.GET,
61
- resourceUri: '/v1/personFields',
62
- });
63
- const personCustomFields = (0, common_1.pipedriveParseCustomFields)(customFieldsResponse, customFields);
64
- if (!(0, shared_1.isEmpty)(personCustomFields)) {
65
- personPayload.custom_fields = personCustomFields;
66
- }
67
- const updatedPersonResponse = yield (0, common_1.pipedriveApiCall)({
68
- accessToken: context.auth.access_token,
69
- apiDomain: context.auth.data['api_domain'],
70
- method: pieces_common_1.HttpMethod.PATCH,
71
- resourceUri: `/v2/persons/${personId}`,
72
- body: personPayload,
73
- });
74
- const transformedPersonProperties = (0, common_1.pipedriveTransformCustomFields)(customFieldsResponse, updatedPersonResponse.data);
75
- return Object.assign(Object.assign({}, updatedPersonResponse), { data: transformedPersonProperties });
76
- });
77
- },
78
- });
79
- //# sourceMappingURL=update-person.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-person.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-person.ts"],"names":[],"mappings":";;;;AAAA,kCAAwC;AACxC,qEAAwE;AACxE,2CAAoF;AACpF,sCAKmB;AAEnB,+DAAyD;AACzD,iDAA+C;AAElC,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,oBAAa;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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;YACjD,IAAI,MAAM,CAAC,MAAM;gBAAE,aAAa,CAAC,MAAM,GAAG,MAAM,CAAC;YACjD,IAAI,QAAQ,CAAC,MAAM;gBAAE,aAAa,CAAC,SAAS,GAAG,QAAQ,CAAC;YAExD,MAAM,oBAAoB,GAAG,MAAM,IAAA,oCAA2B,EAAW;gBACxE,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;aAC/B,CAAC,CAAC;YAEH,MAAM,kBAAkB,GAAG,IAAA,mCAA0B,EAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC;YAE1F,IAAI,CAAC,IAAA,gBAAO,EAAC,kBAAkB,CAAC,EAAE,CAAC;gBAClC,aAAa,CAAC,aAAa,GAAG,kBAAkB,CAAC;YAClD,CAAC;YAED,MAAM,qBAAqB,GAAG,MAAM,IAAA,yBAAgB,EAAoB;gBACvE,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;gBACtC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;gBAC1C,MAAM,EAAE,0BAAU,CAAC,KAAK;gBACxB,WAAW,EAAE,eAAe,QAAQ,EAAE;gBACtC,IAAI,EAAE,aAAa;aACnB,CAAC,CAAC;YAEH,MAAM,2BAA2B,GAAG,IAAA,uCAA8B,EACjE,oBAAoB,EACpB,qBAAqB,CAAC,IAAI,CAC1B,CAAC;YAEF,uCACI,qBAAqB,KACxB,IAAI,EAAE,2BAA2B,IAChC;QACH,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -1,17 +0,0 @@
1
- export declare const updateProductAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
- id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
4
- code: import("@activepieces/pieces-framework").ShortTextProperty<false>;
5
- description: import("@activepieces/pieces-framework").LongTextProperty<false>;
6
- unit: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
- tax: import("@activepieces/pieces-framework").NumberProperty<false>;
8
- isActive: import("@activepieces/pieces-framework").CheckboxProperty<false>;
9
- ownerId: import("@activepieces/pieces-framework").DropdownProperty<number, false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>> | import("@activepieces/pieces-framework").DropdownProperty<number, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
10
- currency: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
- price: import("@activepieces/pieces-framework").NumberProperty<false>;
12
- cost: import("@activepieces/pieces-framework").NumberProperty<false>;
13
- overheadCost: import("@activepieces/pieces-framework").NumberProperty<false>;
14
- visibleTo: import("@activepieces/pieces-framework").StaticDropdownProperty<number, false>;
15
- customfields: import("@activepieces/pieces-framework").DynamicProperties<false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
16
- }>;
17
- //# sourceMappingURL=update-product.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-product.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-product.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;EAgI9B,CAAC"}
@@ -1,114 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateProductAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const auth_1 = require("../auth");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const props_1 = require("../common/props");
8
- const common_1 = require("../common");
9
- const pieces_common_1 = require("@activepieces/pieces-common");
10
- const shared_1 = require("@activepieces/shared");
11
- exports.updateProductAction = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.pipedriveAuth,
13
- name: 'update-product',
14
- displayName: 'Update Product',
15
- description: 'Updates an existing product.',
16
- props: {
17
- id: pieces_framework_1.Property.ShortText({
18
- displayName: 'Product ID',
19
- required: true,
20
- }),
21
- name: pieces_framework_1.Property.ShortText({
22
- displayName: 'Name',
23
- required: false,
24
- }),
25
- code: pieces_framework_1.Property.ShortText({
26
- displayName: 'Code',
27
- required: false,
28
- }),
29
- description: pieces_framework_1.Property.LongText({
30
- displayName: 'Description',
31
- required: false,
32
- }),
33
- unit: pieces_framework_1.Property.ShortText({
34
- displayName: 'Unit',
35
- required: false,
36
- }),
37
- tax: pieces_framework_1.Property.Number({
38
- displayName: 'Tax percentage',
39
- required: false,
40
- }),
41
- isActive: pieces_framework_1.Property.Checkbox({
42
- displayName: 'Is Active ?',
43
- required: false,
44
- defaultValue: true,
45
- }),
46
- ownerId: (0, props_1.ownerIdProp)('Owner', false),
47
- currency: pieces_framework_1.Property.ShortText({
48
- displayName: 'Currency',
49
- required: false,
50
- description: 'Please enter currency code (e.g., "USD", "EUR").',
51
- }),
52
- price: pieces_framework_1.Property.Number({
53
- displayName: 'Price',
54
- required: false,
55
- }),
56
- cost: pieces_framework_1.Property.Number({
57
- displayName: 'Cost',
58
- required: false,
59
- }),
60
- overheadCost: pieces_framework_1.Property.Number({
61
- displayName: 'Overhead Cost',
62
- required: false,
63
- }),
64
- visibleTo: props_1.visibleToProp,
65
- customfields: (0, props_1.customFieldsProp)('product'),
66
- },
67
- run(context) {
68
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
69
- var _a;
70
- const { id, name, code, description, unit, tax, isActive, ownerId, currency, price, cost, overheadCost, visibleTo, } = context.propsValue;
71
- const customFields = (_a = context.propsValue.customfields) !== null && _a !== void 0 ? _a : {};
72
- const productPayload = {
73
- name,
74
- code,
75
- description,
76
- unit,
77
- tax,
78
- is_deleted: !isActive,
79
- prices: [
80
- {
81
- price: price !== null && price !== void 0 ? price : 0,
82
- currency: currency !== null && currency !== void 0 ? currency : 'USD',
83
- cost: cost !== null && cost !== void 0 ? cost : 0,
84
- direct_cost: overheadCost !== null && overheadCost !== void 0 ? overheadCost : 0,
85
- },
86
- ],
87
- visible_to: visibleTo,
88
- };
89
- if (ownerId) {
90
- productPayload.owner_id = ownerId;
91
- }
92
- const customFieldsResponse = yield (0, common_1.pipedrivePaginatedV1ApiCall)({
93
- accessToken: context.auth.access_token,
94
- apiDomain: context.auth.data['api_domain'],
95
- method: pieces_common_1.HttpMethod.GET,
96
- resourceUri: '/v1/productFields',
97
- });
98
- const productCustomFields = (0, common_1.pipedriveParseCustomFields)(customFieldsResponse, customFields);
99
- if (!(0, shared_1.isEmpty)(productCustomFields)) {
100
- productPayload.custom_fields = productCustomFields;
101
- }
102
- const updatedProductResponse = yield (0, common_1.pipedriveApiCall)({
103
- accessToken: context.auth.access_token,
104
- apiDomain: context.auth.data['api_domain'],
105
- method: pieces_common_1.HttpMethod.PATCH,
106
- resourceUri: '/v2/products/' + id,
107
- body: productPayload,
108
- });
109
- const updatedProductProperties = (0, common_1.pipedriveTransformCustomFields)(customFieldsResponse, updatedProductResponse.data);
110
- return Object.assign(Object.assign({}, updatedProductResponse), { data: updatedProductProperties });
111
- });
112
- },
113
- });
114
- //# sourceMappingURL=update-product.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-product.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-product.ts"],"names":[],"mappings":";;;;AAAA,kCAAwC;AACxC,qEAAwE;AACxE,2CAA+E;AAC/E,sCAKmB;AAEnB,+DAAyD;AACzD,iDAA+C;AAElC,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,8BAA8B;IAC3C,KAAK,EAAE;QACH,EAAE,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACnB,WAAW,EAAE,YAAY;YAC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E3F,IAAI,CAAC,IAAA,gBAAO,EAAC,mBAAmB,CAAC,EAAE,CAAC;gBAChC,cAAc,CAAC,aAAa,GAAG,mBAAmB,CAAC;YACvD,CAAC;YAED,MAAM,sBAAsB,GAAG,MAAM,IAAA,yBAAgB,EAAqB;gBACtE,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;gBACtC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;gBAC1C,MAAM,EAAE,0BAAU,CAAC,KAAK;gBACxB,WAAW,EAAE,eAAe,GAAG,EAAE;gBACjC,IAAI,EAAE,cAAc;aACvB,CAAC,CAAC;YAEH,MAAM,wBAAwB,GAAG,IAAA,uCAA8B,EAC3D,oBAAoB,EACpB,sBAAsB,CAAC,IAAI,CAC9B,CAAC;YAEF,uCACO,sBAAsB,KACzB,IAAI,EAAE,wBAAwB,IAChC;QACN,CAAC;KAAA;CACJ,CAAC,CAAC"}
package/src/lib/auth.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const pipedriveAuth: import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>;
2
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,+GAgBxB,CAAC"}
package/src/lib/auth.js DELETED
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pipedriveAuth = void 0;
4
- const pieces_framework_1 = require("@activepieces/pieces-framework");
5
- exports.pipedriveAuth = pieces_framework_1.PieceAuth.OAuth2({
6
- description: '',
7
- authUrl: 'https://oauth.pipedrive.com/oauth/authorize',
8
- tokenUrl: 'https://oauth.pipedrive.com/oauth/token',
9
- required: true,
10
- scope: [
11
- 'base',
12
- 'admin',
13
- 'contacts:full',
14
- 'users:read',
15
- 'deals:full',
16
- 'activities:full',
17
- 'leads:full',
18
- 'products:full',
19
- 'webhooks:full'
20
- ],
21
- });
22
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;AAAA,qEAA2D;AAE9C,QAAA,aAAa,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC7C,WAAW,EAAE,EAAE;IACf,OAAO,EAAE,6CAA6C;IACtD,QAAQ,EAAE,yCAAyC;IACnD,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE;QACN,MAAM;QACN,OAAO;QACP,eAAe;QACf,YAAY;QACZ,YAAY;QACZ,iBAAiB;QACjB,YAAY;QACZ,eAAe;QACf,eAAe;KACf;CACD,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const PERSON_OPTIONAL_FIELDS: string[];
2
- export declare const DEAL_OPTIONAL_FIELDS: string[];
3
- export declare const ORGANIZATION_OPTIONAL_FIELDS: string[];
4
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,UAsBlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,UAgBhC,CAAC;AAEF,eAAO,MAAM,4BAA4B,UAmBxC,CAAC"}
@@ -1,64 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ORGANIZATION_OPTIONAL_FIELDS = exports.DEAL_OPTIONAL_FIELDS = exports.PERSON_OPTIONAL_FIELDS = void 0;
4
- exports.PERSON_OPTIONAL_FIELDS = [
5
- 'next_activity_id',
6
- 'last_activity_id',
7
- 'open_deals_count',
8
- 'related_open_deals_count',
9
- 'closed_deals_count',
10
- 'related_closed_deals_count',
11
- 'participant_open_deals_count',
12
- 'participant_closed_deals_count',
13
- 'email_messages_count',
14
- 'activities_count',
15
- 'done_activities_count',
16
- 'undone_activities_count',
17
- 'files_count',
18
- 'notes_count',
19
- 'followers_count',
20
- 'related_won_deals_count',
21
- 'lost_deals_count',
22
- 'related_lost_deals_count',
23
- 'last_incoming_mail_time',
24
- 'last_outgoing_mail_time',
25
- 'won_deals_count',
26
- ];
27
- exports.DEAL_OPTIONAL_FIELDS = [
28
- 'next_activity_id',
29
- 'last_activity_id',
30
- 'first_won_time',
31
- 'products_count',
32
- 'files_count',
33
- 'notes_count',
34
- 'followers_count',
35
- 'email_messages_count',
36
- 'activities_count',
37
- 'done_activities_count',
38
- 'undone_activities_count',
39
- 'participants_count',
40
- 'last_incoming_mail_time',
41
- 'last_outgoing_mail_time',
42
- 'smart_bcc_email',
43
- ];
44
- exports.ORGANIZATION_OPTIONAL_FIELDS = [
45
- 'next_activity_id',
46
- 'last_activity_id',
47
- 'open_deals_count',
48
- 'related_open_deals_count',
49
- 'closed_deals_count',
50
- 'related_closed_deals_count',
51
- 'email_messages_count',
52
- 'people_count',
53
- 'activities_count',
54
- 'done_activities_count',
55
- 'undone_activities_count',
56
- 'files_count',
57
- 'notes_count',
58
- 'followers_count',
59
- 'won_deals_count',
60
- 'related_won_deals_count',
61
- 'lost_deals_count',
62
- 'related_lost_deals_count',
63
- ];
64
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/lib/common/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,sBAAsB,GAAG;IACrC,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,0BAA0B;IAC1B,oBAAoB;IACpB,4BAA4B;IAC5B,8BAA8B;IAC9B,gCAAgC;IAChC,sBAAsB;IACtB,kBAAkB;IAClB,uBAAuB;IACvB,yBAAyB;IACzB,aAAa;IACb,aAAa;IACb,iBAAiB;IACjB,yBAAyB;IACzB,kBAAkB;IAClB,0BAA0B;IAC1B,yBAAyB;IACzB,yBAAyB;IACzB,iBAAiB;CACjB,CAAC;AAEW,QAAA,oBAAoB,GAAG;IACnC,kBAAkB;IAClB,kBAAkB;IAClB,gBAAgB;IAChB,gBAAgB;IAChB,aAAa;IACb,aAAa;IACb,iBAAiB;IACjB,sBAAsB;IACtB,kBAAkB;IAClB,uBAAuB;IACvB,yBAAyB;IACzB,oBAAoB;IACpB,yBAAyB;IACzB,yBAAyB;IACzB,iBAAiB;CACjB,CAAC;AAEW,QAAA,4BAA4B,GAAG;IAC3C,kBAAkB;IAClB,kBAAkB;IAClB,kBAAkB;IAClB,0BAA0B;IAC1B,oBAAoB;IACpB,4BAA4B;IAC5B,sBAAsB;IACtB,cAAc;IACd,kBAAkB;IAClB,uBAAuB;IACvB,yBAAyB;IACzB,aAAa;IACb,aAAa;IACb,iBAAiB;IACjB,iBAAiB;IACjB,yBAAyB;IACzB,kBAAkB;IAClB,0BAA0B;CAC1B,CAAC"}
@@ -1,25 +0,0 @@
1
- import { HttpMessageBody, HttpMethod } from '@activepieces/pieces-common';
2
- import { GetField, RequestParams } from './types';
3
- export declare const pipedriveCommon: {
4
- subscribeWebhook: (object: string, action: string, webhookUrl: string, apiDomain: string, accessToken: string) => Promise<{
5
- data: {
6
- id: string;
7
- };
8
- }>;
9
- unsubscribeWebhook: (webhookId: string, apiDomain: string, accessToken: string) => Promise<import("@activepieces/pieces-common").HttpResponse<any>>;
10
- };
11
- export type PipedriveApiCallParams = {
12
- accessToken: string;
13
- apiDomain: string;
14
- method: HttpMethod;
15
- resourceUri: string;
16
- query?: RequestParams;
17
- body?: any;
18
- };
19
- export declare function pipedriveApiCall<T extends HttpMessageBody>({ accessToken, apiDomain, method, resourceUri, query, body, }: PipedriveApiCallParams): Promise<T>;
20
- export declare function pipedrivePaginatedV1ApiCall<T extends HttpMessageBody>({ accessToken, apiDomain, method, resourceUri, query, body, }: PipedriveApiCallParams): Promise<T[]>;
21
- export declare function pipedrivePaginatedV2ApiCall<T extends HttpMessageBody>({ accessToken, apiDomain, method, resourceUri, query, body, }: PipedriveApiCallParams): Promise<T[]>;
22
- export declare function pipedriveParseCustomFields(customFieldsDefinitions: GetField[], inputData: Record<string, any>): Record<string, any>;
23
- export declare function pipedriveTransformCustomFields(customFieldsDefinitions: GetField[], responseData: Record<string, any>): Record<string, any>;
24
- export declare function pipedriveTransformV1CustomFields(CustomFields: GetField[], responseData: Record<string, any>): Record<string, any>;
25
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIN,eAAe,EACf,UAAU,EAEV,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,QAAQ,EAA4C,aAAa,EAAE,MAAM,SAAS,CAAC;AAS5F,eAAO,MAAM,eAAe;+BAElB,MAAM,UACN,MAAM,cACF,MAAM,aACP,MAAM,eACJ,MAAM;cAmBZ;YAAE,EAAE,EAAE,MAAM,CAAA;SAAE;;oCAKgB,MAAM,aAAa,MAAM,eAAe,MAAM;CAWpF,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,IAAI,CAAC,EAAE,GAAG,CAAC;CACX,CAAC;AAEF,wBAAsB,gBAAgB,CAAC,CAAC,SAAS,eAAe,EAAE,EACjE,WAAW,EACX,SAAS,EACT,MAAM,EACN,WAAW,EACX,KAAK,EACL,IAAI,GACJ,EAAE,sBAAsB,GAAG,OAAO,CAAC,CAAC,CAAC,CA4CrC;AAED,wBAAsB,2BAA2B,CAAC,CAAC,SAAS,eAAe,EAAE,EAC5E,WAAW,EACX,SAAS,EACT,MAAM,EACN,WAAW,EACX,KAAK,EACL,IAAI,GACJ,EAAE,sBAAsB,GAAG,OAAO,CAAC,CAAC,EA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