@activepieces/piece-pipedrive 0.8.7 → 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 -14
  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 -88
  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 -48
  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 -111
  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 -67
  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 -61
  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 -74
  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 -80
  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 -75
  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 -66
  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 -91
  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 -112
  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 -101
  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 -111
  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 -64
  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 -73
  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 -76
  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 -111
  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 -109
  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 -65
  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 -86
  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 -59
  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 -45
  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 -52
  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 -65
  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 -73
  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 -77
  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 -63
  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 -84
  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 -119
  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 -182
  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 -247
  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 -134
  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 -141
  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 -129
  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 -81
  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 -116
  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 -126
  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 -154
  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 -161
  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 -226
  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 -325
  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 -113
  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 -123
  197. package/src/lib/trigger/updated-person.js.map +0 -1
@@ -1,109 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findPersonAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../auth");
7
- const common_1 = require("../common");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- const shared_1 = require("@activepieces/shared");
10
- const props_1 = require("../common/props");
11
- const constants_1 = require("../common/constants");
12
- exports.findPersonAction = (0, pieces_framework_1.createAction)({
13
- auth: auth_1.pipedriveAuth,
14
- name: 'find-person',
15
- displayName: 'Find Person',
16
- description: 'Finds a person.',
17
- audience: 'both',
18
- aiMetadata: { description: 'Look up a single person by an exact value in a chosen field (e.g. email, phone, name, or a custom field). Pick this when you need to resolve a person record to its ID or details before acting on it. Effectively read-only (it creates and removes a temporary search filter) and returns the most recently updated match.', idempotent: true },
19
- props: {
20
- searchField: (0, props_1.searchFieldProp)('person'),
21
- searchFieldValue: (0, props_1.searchFieldValueProp)('person'),
22
- },
23
- run(context) {
24
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
- const { searchField } = context.propsValue;
26
- const fieldValue = context.propsValue.searchFieldValue['field_value'];
27
- if ((0, shared_1.isNil)(fieldValue)) {
28
- throw new Error('Please enter a value for the field');
29
- }
30
- // create Filter
31
- const filter = yield (0, common_1.pipedriveApiCall)({
32
- accessToken: context.auth.access_token,
33
- apiDomain: context.auth.data['api_domain'],
34
- method: pieces_common_1.HttpMethod.POST,
35
- resourceUri: '/v1/filters',
36
- body: {
37
- name: 'Activepieces Find Person Filter',
38
- type: 'people',
39
- conditions: {
40
- glue: 'and',
41
- conditions: [
42
- {
43
- glue: 'and',
44
- conditions: [
45
- {
46
- object: 'person',
47
- field_id: searchField,
48
- operator: '=',
49
- value: fieldValue,
50
- },
51
- ],
52
- },
53
- {
54
- glue: 'or',
55
- conditions: [
56
- {
57
- object: 'person',
58
- field_id: searchField,
59
- operator: 'IS NOT NULL',
60
- value: null,
61
- },
62
- ],
63
- },
64
- ],
65
- },
66
- },
67
- });
68
- // search for persons using the filter
69
- const persons = yield (0, common_1.pipedriveApiCall)({
70
- accessToken: context.auth.access_token,
71
- apiDomain: context.auth.data['api_domain'],
72
- method: pieces_common_1.HttpMethod.GET,
73
- resourceUri: '/v2/persons',
74
- query: {
75
- filter_id: filter.data.id,
76
- limit: 1,
77
- sort_by: 'update_time',
78
- sort_direction: 'desc',
79
- include_fields: constants_1.PERSON_OPTIONAL_FIELDS.join(',')
80
- },
81
- });
82
- // delete the filter
83
- yield (0, common_1.pipedriveApiCall)({
84
- accessToken: context.auth.access_token,
85
- apiDomain: context.auth.data['api_domain'],
86
- method: pieces_common_1.HttpMethod.DELETE,
87
- resourceUri: `/v1/filters/${filter.data.id}`,
88
- });
89
- if ((0, shared_1.isNil)(persons.data) || persons.data.length === 0) {
90
- return {
91
- found: false,
92
- data: [],
93
- };
94
- }
95
- const customFieldsResponse = yield (0, common_1.pipedrivePaginatedV1ApiCall)({
96
- accessToken: context.auth.access_token,
97
- apiDomain: context.auth.data['api_domain'],
98
- method: pieces_common_1.HttpMethod.GET,
99
- resourceUri: '/v1/personFields',
100
- });
101
- const updatedPersonProperties = (0, common_1.pipedriveTransformCustomFields)(customFieldsResponse, persons.data[0]);
102
- return {
103
- found: true,
104
- data: [updatedPersonProperties],
105
- };
106
- });
107
- },
108
- });
109
- //# sourceMappingURL=find-person.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-person.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-person.ts"],"names":[],"mappings":"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"}
@@ -1,4 +0,0 @@
1
- export declare const findProductAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
- searchTerm: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- }>;
4
- //# sourceMappingURL=find-product.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-product.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-product.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,iBAAiB;;EAkE5B,CAAC"}
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findProductAction = 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 common_1 = require("../common");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- const shared_1 = require("@activepieces/shared");
10
- exports.findProductAction = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.pipedriveAuth,
12
- name: 'find-product',
13
- displayName: 'Find Product',
14
- description: 'Finds a product by name ',
15
- audience: 'both',
16
- aiMetadata: { description: 'Search the product catalog by name and return the single best-matching product with its full details and custom fields. Pick this when you have a product name or keyword rather than an ID; use Retrieve a Product when you already know the exact product ID. Read-only and returns at most one match (found:false when nothing matches).', idempotent: true },
17
- props: {
18
- searchTerm: pieces_framework_1.Property.ShortText({
19
- displayName: 'Search Term',
20
- required: true,
21
- }),
22
- },
23
- run(context) {
24
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
- const { searchTerm } = context.propsValue;
26
- const searchResponse = yield (0, common_1.pipedriveApiCall)({
27
- accessToken: context.auth.access_token,
28
- apiDomain: context.auth.data['api_domain'],
29
- method: pieces_common_1.HttpMethod.GET,
30
- resourceUri: '/v2/products/search',
31
- query: {
32
- term: searchTerm,
33
- fields: 'name',
34
- limit: 1,
35
- include_fields: 'product.price'
36
- },
37
- });
38
- if ((0, shared_1.isNil)(searchResponse.data) || (0, shared_1.isNil)(searchResponse.data.items) || searchResponse.data.items.length === 0) {
39
- return {
40
- found: false,
41
- data: [],
42
- };
43
- }
44
- const productDetailsResponse = yield (0, common_1.pipedriveApiCall)({
45
- accessToken: context.auth.access_token,
46
- apiDomain: context.auth.data['api_domain'],
47
- method: pieces_common_1.HttpMethod.GET,
48
- resourceUri: `/v2/products/${searchResponse.data.items[0].item.id}`,
49
- });
50
- const customFieldsResponse = yield (0, common_1.pipedrivePaginatedV1ApiCall)({
51
- accessToken: context.auth.access_token,
52
- apiDomain: context.auth.data['api_domain'],
53
- method: pieces_common_1.HttpMethod.GET,
54
- resourceUri: '/v1/productFields',
55
- });
56
- // Transform custom fields in the response data
57
- const updatedProductProperties = (0, common_1.pipedriveTransformCustomFields)(customFieldsResponse, productDetailsResponse.data);
58
- return {
59
- found: true,
60
- data: [updatedProductProperties],
61
- };
62
- });
63
- },
64
- });
65
- //# sourceMappingURL=find-product.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-product.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-product.ts"],"names":[],"mappings":";;;;AAAA,kCAAwC;AACxC,qEAAwE;AACxE,sCAImB;AACnB,+DAAyD;AAEzD,iDAA6C;AAEhC,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,0BAA0B;IACvC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,6UAA6U,EAAE,UAAU,EAAE,IAAI,EAAE;IAC5X,KAAK,EAAE;QACH,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,IAAI;SACjB,CAAC;KAEL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAG1C,MAAM,cAAc,GAAG,MAAM,IAAA,yBAAgB,EAG1C;gBACC,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;gBAClC,KAAK,EAAE;oBACH,IAAI,EAAE,UAAU;oBAChB,MAAM,EAAE,MAAM;oBACd,KAAK,EAAE,CAAC;oBACR,cAAc,EAAC,eAAe;iBACjC;aACJ,CAAC,CAAC;YAEH,IAAI,IAAA,cAAK,EAAC,cAAc,CAAC,IAAI,CAAC,IAAI,IAAA,cAAK,EAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC3G,OAAO;oBACH,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,EAAE;iBACX,CAAC;YACN,CAAC;YAED,MAAM,sBAAsB,GAAG,MAAM,IAAA,yBAAgB,EAAsB;gBACvE,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,gBAAgB,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE;aACtE,CAAC,CAAC;YAEH,MAAM,oBAAoB,GAAG,MAAM,IAAA,oCAA2B,EAAW;gBACrE,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,mBAAmB;aACnC,CAAC,CAAC;YAEH,+CAA+C;YAC/C,MAAM,wBAAwB,GAAG,IAAA,uCAA8B,EAC3D,oBAAoB,EACpB,sBAAsB,CAAC,IAAI,CAC9B,CAAC;YAEF,OAAO;gBACH,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,CAAC,wBAAwB,CAAC;aACnC,CAAC;QACN,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const findProductsAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
- field: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
3
- fieldValue: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- }>;
5
- //# sourceMappingURL=find-products.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-products.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-products.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,kBAAkB;;;EAoF7B,CAAC"}
@@ -1,86 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findProductsAction = 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 common_1 = require("../common");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- const shared_1 = require("@activepieces/shared");
10
- exports.findProductsAction = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.pipedriveAuth,
12
- name: 'find-products',
13
- displayName: 'Find Products',
14
- description: 'Finds a product or products by name or product code.',
15
- audience: 'both',
16
- aiMetadata: {
17
- description: 'Searches products by exact match on either name or product code (selected via the Field dropdown) and returns all matches, paging through every result. Use to locate products before adding them to a deal or updating them. Read-only and idempotent.',
18
- idempotent: true,
19
- },
20
- props: {
21
- field: pieces_framework_1.Property.StaticDropdown({
22
- displayName: 'Field to search by',
23
- required: true,
24
- defaultValue: 'name',
25
- options: {
26
- disabled: false,
27
- options: [
28
- {
29
- label: 'Name',
30
- value: 'name',
31
- },
32
- {
33
- label: 'Product Code',
34
- value: 'code',
35
- },
36
- ],
37
- },
38
- }),
39
- fieldValue: pieces_framework_1.Property.ShortText({
40
- displayName: 'Field Value',
41
- required: true,
42
- }),
43
- },
44
- run(context) {
45
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
46
- var _a, _b;
47
- const qs = {
48
- term: context.propsValue.fieldValue,
49
- fields: context.propsValue.field,
50
- exact_match: 'true',
51
- limit: '100',
52
- };
53
- let cursor = undefined;
54
- let hasMoreItems = true;
55
- const products = [];
56
- do {
57
- if (cursor) {
58
- qs.cursor = cursor;
59
- }
60
- const response = yield (0, common_1.pipedriveApiCall)({
61
- accessToken: context.auth.access_token,
62
- apiDomain: context.auth.data['api_domain'],
63
- method: pieces_common_1.HttpMethod.GET,
64
- resourceUri: '/v2/products/search',
65
- query: {
66
- term: context.propsValue.fieldValue,
67
- fields: context.propsValue.field,
68
- exact_match: 'true',
69
- },
70
- });
71
- if ((0, shared_1.isNil)(response.data.items))
72
- break;
73
- for (const product of response.data.items) {
74
- products.push(product.item);
75
- }
76
- hasMoreItems = ((_a = response.additional_data) === null || _a === void 0 ? void 0 : _a.next_cursor) != null;
77
- cursor = (_b = response.additional_data) === null || _b === void 0 ? void 0 : _b.next_cursor;
78
- } while (hasMoreItems);
79
- return {
80
- found: products.length > 0,
81
- data: products,
82
- };
83
- });
84
- },
85
- });
86
- //# sourceMappingURL=find-products.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-products.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-products.ts"],"names":[],"mappings":";;;;AAAA,kCAAwC;AACxC,qEAAwE;AACxE,sCAKmB;AACnB,+DAAsE;AACtE,iDAA6C;AAGhC,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,sDAAsD;IACnE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACX,WAAW,EACV,yPAAyP;QAC1P,UAAU,EAAE,IAAI;KAChB;IACD,KAAK,EAAE;QACN,KAAK,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC9B,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,MAAM;YACpB,OAAO,EAAE;gBACR,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE;oBACR;wBACC,KAAK,EAAE,MAAM;wBACb,KAAK,EAAE,MAAM;qBACb;oBACD;wBACC,KAAK,EAAE,cAAc;wBACrB,KAAK,EAAE,MAAM;qBACb;iBACD;aACD;SACD,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;;YAChB,MAAM,EAAE,GAAgB;gBACvB,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU;gBACnC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;gBAChC,WAAW,EAAE,MAAM;gBACnB,KAAK,EAAE,KAAK;aACZ,CAAC;YAEF,IAAI,MAAM,GAAuB,SAAS,CAAC;YAE3C,IAAI,YAAY,GAAG,IAAI,CAAC;YACxB,MAAM,QAAQ,GAAG,EAAE,CAAC;YAEpB,GAAG,CAAC;gBACH,IAAI,MAAM,EAAE,CAAC;oBACZ,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC;gBACpB,CAAC;gBACD,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EAMpC;oBACF,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;oBACtC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;oBAC1C,MAAM,EAAE,0BAAU,CAAC,GAAG;oBACtB,WAAW,EAAE,qBAAqB;oBAClC,KAAK,EAAE;wBACN,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU;wBACnC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;wBAChC,WAAW,EAAE,MAAM;qBACnB;iBACD,CAAC,CAAC;gBAEH,IAAI,IAAA,cAAK,EAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;oBAAE,MAAM;gBAEtC,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;oBAC3C,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;gBAC7B,CAAC;gBACD,YAAY,GAAG,CAAA,MAAA,QAAQ,CAAC,eAAe,0CAAE,WAAW,KAAI,IAAI,CAAC;gBAC7D,MAAM,GAAG,MAAA,QAAQ,CAAC,eAAe,0CAAE,WAAW,CAAC;YAChD,CAAC,QAAQ,YAAY,EAAE;YAEvB,OAAO;gBACN,KAAK,EAAE,QAAQ,CAAC,MAAM,GAAG,CAAC;gBAC1B,IAAI,EAAE,QAAQ;aACd,CAAC;QACH,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const findUserAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
- field: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
3
- fieldValue: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- }>;
5
- //# sourceMappingURL=find-user.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-user.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-user.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc;;;EAmDzB,CAAC"}
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findUserAction = 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 common_1 = require("../common");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- exports.findUserAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.pipedriveAuth,
11
- name: 'find-user',
12
- displayName: 'Find User',
13
- description: 'Finds a user by name or email.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Search Pipedrive account users (team members, not CRM persons) by name or by email address. Pick this to resolve an owner or assignee to a user ID; choose the search-by field to match either a name or an email term. Read-only and may return multiple matches.', idempotent: true },
16
- props: {
17
- field: pieces_framework_1.Property.StaticDropdown({
18
- displayName: 'Field to search by',
19
- required: true,
20
- options: {
21
- disabled: false,
22
- options: [
23
- {
24
- label: 'Name',
25
- value: 'name',
26
- },
27
- {
28
- label: 'Email',
29
- value: 'email',
30
- },
31
- ],
32
- },
33
- }),
34
- fieldValue: pieces_framework_1.Property.ShortText({
35
- displayName: 'Field Value',
36
- required: true,
37
- }),
38
- },
39
- run(context) {
40
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
41
- const { field, fieldValue } = context.propsValue;
42
- const response = yield (0, common_1.pipedriveApiCall)({
43
- accessToken: context.auth.access_token,
44
- apiDomain: context.auth.data['api_domain'],
45
- method: pieces_common_1.HttpMethod.GET,
46
- resourceUri: '/v1/users/find',
47
- query: {
48
- term: fieldValue,
49
- search_by_email: field == 'email' ? 1 : 0,
50
- },
51
- });
52
- return {
53
- found: response.data && response.data.length > 0,
54
- data: response.data,
55
- };
56
- });
57
- },
58
- });
59
- //# sourceMappingURL=find-user.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-user.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-user.ts"],"names":[],"mappings":";;;;AAAA,kCAAwC;AACxC,qEAAwE;AACxE,sCAA6C;AAC7C,+DAAyD;AAE5C,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,gCAAgC;IAC7C,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,oQAAoQ,EAAE,UAAU,EAAE,IAAI,EAAE;IACnT,KAAK,EAAE;QACN,KAAK,EAAE,2BAAQ,CAAC,cAAc,CAAC;YAC9B,WAAW,EAAE,oBAAoB;YACjC,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACR,QAAQ,EAAE,KAAK;gBACf,OAAO,EAAE;oBACR;wBACC,KAAK,EAAE,MAAM;wBACb,KAAK,EAAE,MAAM;qBACb;oBACD;wBACC,KAAK,EAAE,OAAO;wBACd,KAAK,EAAE,OAAO;qBACd;iBACD;aACD;SACD,CAAC;QACF,UAAU,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAEjD,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EACtC;gBACC,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,gBAAgB;gBAC7B,KAAK,EAAE;oBACN,IAAI,EAAE,UAAU;oBAChB,eAAe,EAAE,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;iBACzC;aACD,CACD,CAAC;YAEF,OAAO;gBACN,KAAK,EAAE,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC;gBAChD,IAAI,EAAE,QAAQ,CAAC,IAAI;aACnB,CAAC;QACH,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const getNoteAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
- noteId: import("@activepieces/pieces-framework").NumberProperty<true>;
3
- }>;
4
- //# sourceMappingURL=get-note.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-note.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-note.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa;;EAiCxB,CAAC"}
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNoteAction = 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 common_1 = require("../common");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- exports.getNoteAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.pipedriveAuth,
11
- name: 'get-note',
12
- displayName: 'Retrieve a Note',
13
- description: 'Finds a note by ID.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Retrieves a single note by its numeric note ID. Use when you already have the note ID; to list the notes attached to a deal, lead, person, or organization, use Find Notes instead. Read-only and idempotent.',
17
- idempotent: true,
18
- },
19
- props: {
20
- noteId: pieces_framework_1.Property.Number({
21
- displayName: 'Note ID',
22
- required: true,
23
- }),
24
- },
25
- run(context) {
26
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
- try {
28
- const response = yield (0, common_1.pipedriveApiCall)({
29
- accessToken: context.auth.access_token,
30
- apiDomain: context.auth.data['api_domain'],
31
- method: pieces_common_1.HttpMethod.GET,
32
- resourceUri: `/v1/notes/${context.propsValue.noteId}`,
33
- });
34
- return response;
35
- }
36
- catch (error) {
37
- return {
38
- success: false,
39
- data: {}
40
- };
41
- }
42
- });
43
- },
44
- });
45
- //# sourceMappingURL=get-note.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-note.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-note.ts"],"names":[],"mappings":";;;;AAAA,kCAAwC;AACxC,qEAAwE;AACxE,sCAA6C;AAC7C,+DAAyD;AAE5C,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,qBAAqB;IAClC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACX,WAAW,EACV,+MAA+M;QAChN,UAAU,EAAE,IAAI;KAChB;IACD,KAAK,EAAE;QACN,MAAM,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACvB,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,IAAI,CAAC;gBACJ,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EAAC;oBACvC,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;oBACtC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;oBAC1C,MAAM,EAAE,0BAAU,CAAC,GAAG;oBACtB,WAAW,EAAE,aAAa,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE;iBACrD,CAAC,CAAC;gBACH,OAAO,QAAQ,CAAC;YACjB,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO;oBACN,OAAO,EAAE,KAAK;oBACF,IAAI,EAAC,EAAE;iBACnB,CAAC;YACH,CAAC;QACF,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const getProductAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
- productId: import("@activepieces/pieces-framework").NumberProperty<true>;
3
- }>;
4
- //# sourceMappingURL=get-product.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-product.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-product.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,gBAAgB;;EA6C3B,CAAC"}
@@ -1,52 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProductAction = 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 common_1 = require("../common");
8
- const pieces_common_1 = require("@activepieces/pieces-common");
9
- exports.getProductAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.pipedriveAuth,
11
- name: 'get-product',
12
- displayName: 'Retrieve a Product',
13
- description: 'Finds a product by ID.',
14
- audience: 'both',
15
- aiMetadata: { description: 'Retrieve a single product by its exact numeric ID, returning full details and resolved custom fields. Pick this when you already know the product ID; use Find Product to search by name instead. Read-only and returns found:false rather than erroring when the ID does not exist.', idempotent: true },
16
- props: {
17
- productId: pieces_framework_1.Property.Number({
18
- displayName: 'Product ID',
19
- required: true,
20
- }),
21
- },
22
- run(context) {
23
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
- try {
25
- const response = yield (0, common_1.pipedriveApiCall)({
26
- accessToken: context.auth.access_token,
27
- apiDomain: context.auth.data['api_domain'],
28
- method: pieces_common_1.HttpMethod.GET,
29
- resourceUri: `/v2/products/${context.propsValue.productId}`,
30
- });
31
- const customFieldsResponse = yield (0, common_1.pipedrivePaginatedV1ApiCall)({
32
- accessToken: context.auth.access_token,
33
- apiDomain: context.auth.data['api_domain'],
34
- method: pieces_common_1.HttpMethod.GET,
35
- resourceUri: '/v1/productFields',
36
- });
37
- const updatedProductProperties = (0, common_1.pipedriveTransformCustomFields)(customFieldsResponse, response.data);
38
- return {
39
- found: true,
40
- data: [updatedProductProperties],
41
- };
42
- }
43
- catch (error) {
44
- return {
45
- found: false,
46
- data: [],
47
- };
48
- }
49
- });
50
- },
51
- });
52
- //# sourceMappingURL=get-product.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-product.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-product.ts"],"names":[],"mappings":";;;;AAAA,kCAAwC;AACxC,qEAAwE;AACxE,sCAImB;AACnB,+DAAyD;AAG5C,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,wBAAwB;IACrC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,sRAAsR,EAAE,UAAU,EAAE,IAAI,EAAE;IACrU,KAAK,EAAE;QACN,SAAS,EAAE,2BAAQ,CAAC,MAAM,CAAC;YAC1B,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,IAAI,CAAC;gBACJ,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EAAsB;oBAC5D,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;oBACtC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;oBAC1C,MAAM,EAAE,0BAAU,CAAC,GAAG;oBACtB,WAAW,EAAE,gBAAgB,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE;iBAC3D,CAAC,CAAC;gBAEH,MAAM,oBAAoB,GAAG,MAAM,IAAA,oCAA2B,EAAW;oBACxE,WAAW,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY;oBACtC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC;oBAC1C,MAAM,EAAE,0BAAU,CAAC,GAAG;oBACtB,WAAW,EAAE,mBAAmB;iBAChC,CAAC,CAAC;gBAEH,MAAM,wBAAwB,GAAG,IAAA,uCAA8B,EAC9D,oBAAoB,EACpB,QAAQ,CAAC,IAAI,CACb,CAAC;gBAEF,OAAO;oBACN,KAAK,EAAE,IAAI;oBACX,IAAI,EAAE,CAAC,wBAAwB,CAAC;iBAChC,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,OAAO;oBACN,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,EAAE;iBACR,CAAC;YACH,CAAC;QACF,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -1,18 +0,0 @@
1
- export declare const updateActivityAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
- organizationId: import("@activepieces/pieces-framework").NumberProperty<false> | import("@activepieces/pieces-framework").NumberProperty<true>;
3
- personId: import("@activepieces/pieces-framework").NumberProperty<false> | import("@activepieces/pieces-framework").NumberProperty<true>;
4
- dealId: import("@activepieces/pieces-framework").NumberProperty<false> | import("@activepieces/pieces-framework").NumberProperty<true>;
5
- leadId: import("@activepieces/pieces-framework").ShortTextProperty<false> | import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
- assignTo: 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>>;
7
- type: import("@activepieces/pieces-framework").DropdownProperty<string, false, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>> | import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>>;
8
- dueDate: import("@activepieces/pieces-framework").DateTimeProperty<false>;
9
- dueTime: import("@activepieces/pieces-framework").ShortTextProperty<false>;
10
- duration: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
- isDone: import("@activepieces/pieces-framework").CheckboxProperty<false>;
12
- busy: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
13
- note: import("@activepieces/pieces-framework").LongTextProperty<false>;
14
- publicDescription: import("@activepieces/pieces-framework").LongTextProperty<false>;
15
- activityId: import("@activepieces/pieces-framework").NumberProperty<true>;
16
- subject: import("@activepieces/pieces-framework").ShortTextProperty<false>;
17
- }>;
18
- //# sourceMappingURL=update-activity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-activity.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-activity.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;EAgF/B,CAAC"}
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateActivityAction = 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.updateActivityAction = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.pipedriveAuth,
13
- name: 'update-activity',
14
- displayName: 'Update Activity',
15
- description: 'Updates an existing activity.',
16
- audience: 'both',
17
- aiMetadata: {
18
- description: 'Updates fields on an existing activity identified by its activity ID, such as subject, type, due date/time, owner, done state, and linked records; only supplied fields change. Use to reschedule or mark an activity done (use Create Activity to add a new one). Idempotent: repeating the same update converges to the same activity state.',
19
- idempotent: true,
20
- },
21
- props: Object.assign({ activityId: pieces_framework_1.Property.Number({
22
- displayName: 'Activity ID',
23
- required: true,
24
- }), subject: pieces_framework_1.Property.ShortText({
25
- displayName: 'Subject',
26
- required: false,
27
- }) }, props_1.activityCommonProps),
28
- run(context) {
29
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
30
- const { activityId, subject, organizationId, personId, dealId, leadId, assignTo, // This is the user ID for the assignee
31
- type, dueDate, dueTime, duration, isDone, busy, note, publicDescription, } = context.propsValue;
32
- const activityPayload = {
33
- subject,
34
- org_id: organizationId,
35
- deal_id: dealId,
36
- lead_id: leadId,
37
- note,
38
- public_description: publicDescription,
39
- type,
40
- owner_id: assignTo,
41
- due_time: dueTime,
42
- duration,
43
- done: isDone,
44
- };
45
- if (personId) {
46
- activityPayload.participants = [{ person_id: personId, primary: true }];
47
- }
48
- if (busy) {
49
- activityPayload.busy = busy === 'busy' ? true : false;
50
- }
51
- if (dueDate) {
52
- activityPayload.due_date = (0, dayjs_1.default)(dueDate).format('YYYY-MM-DD');
53
- }
54
- const response = 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: `/v2/activities/${activityId}`,
59
- body: activityPayload,
60
- });
61
- return response;
62
- });
63
- },
64
- });
65
- //# sourceMappingURL=update-activity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-activity.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-activity.ts"],"names":[],"mappings":";;;;AAAA,kCAAwC;AACxC,qEAAwE;AACxE,2CAAsD;AACtD,sCAA6C;AAC7C,+DAAyD;AACzD,0DAA0B;AAEb,QAAA,oBAAoB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,+BAA+B;IAC5C,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACR,WAAW,EACP,gVAAgV;QACpV,UAAU,EAAE,IAAI;KACnB;IACD,KAAK,kBACD,UAAU,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACxB,WAAW,EAAE,aAAa;YAC1B,QAAQ,EAAE,IAAI;SACjB,CAAC,EACF,OAAO,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,SAAS;YACtB,QAAQ,EAAE,KAAK;SAClB,CAAC,IACC,2BAAmB,CACzB;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,EACF,UAAU,EACV,OAAO,EACP,cAAc,EACd,QAAQ,EACR,MAAM,EACN,MAAM,EACN,QAAQ,EAAE,uCAAuC;YACjD,IAAI,EACJ,OAAO,EACP,OAAO,EACP,QAAQ,EACR,MAAM,EACN,IAAI,EACJ,IAAI,EACJ,iBAAiB,GACpB,GAAG,OAAO,CAAC,UAAU,CAAC;YAEvB,MAAM,eAAe,GAAwB;gBACzC,OAAO;gBACP,MAAM,EAAE,cAAc;gBACtB,OAAO,EAAE,MAAM;gBACf,OAAO,EAAE,MAAM;gBACf,IAAI;gBACJ,kBAAkB,EAAE,iBAAiB;gBACrC,IAAI;gBACJ,QAAQ,EAAE,QAAQ;gBAClB,QAAQ,EAAE,OAAO;gBACjB,QAAQ;gBACR,IAAI,EAAE,MAAM;aACf,CAAC;YAGF,IAAI,QAAQ,EAAE,CAAC;gBACX,eAAe,CAAC,YAAY,GAAG,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;YAC5E,CAAC;YAEA,IAAI,IAAI,EAAE,CAAC;gBACjB,eAAe,CAAC,IAAI,GAAG,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;YACvD,CAAC;YAEK,IAAI,OAAO,EAAE,CAAC;gBAEV,eAAe,CAAC,QAAQ,GAAG,IAAA,eAAK,EAAC,OAAO,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;YACnE,CAAC;YAGD,MAAM,QAAQ,GAAG,MAAM,IAAA,yBAAgB,EAAC;gBACpC,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,kBAAkB,UAAU,EAAE;gBAC3C,IAAI,EAAE,eAAe;aACxB,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC;QACpB,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -1,19 +0,0 @@
1
- export declare const updateDealAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>, {
2
- creationTime: import("@activepieces/pieces-framework").DateTimeProperty<false>;
3
- status: import("@activepieces/pieces-framework").StaticDropdownProperty<string, false>;
4
- stageId: 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>>;
5
- pipelineId: 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>>;
6
- 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>>;
7
- organizationId: import("@activepieces/pieces-framework").NumberProperty<false> | import("@activepieces/pieces-framework").NumberProperty<true>;
8
- personId: import("@activepieces/pieces-framework").NumberProperty<false> | import("@activepieces/pieces-framework").NumberProperty<true>;
9
- 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>>;
10
- probability: import("@activepieces/pieces-framework").NumberProperty<false>;
11
- expectedCloseDate: import("@activepieces/pieces-framework").DateTimeProperty<false>;
12
- dealValue: import("@activepieces/pieces-framework").NumberProperty<false>;
13
- dealValueCurrency: import("@activepieces/pieces-framework").ShortTextProperty<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
- dealId: import("@activepieces/pieces-framework").NumberProperty<false> | import("@activepieces/pieces-framework").NumberProperty<true>;
17
- title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
18
- }>;
19
- //# sourceMappingURL=update-deal.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-deal.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-deal.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;EA4F3B,CAAC"}