@activepieces/piece-coupa 0.0.3 → 0.0.4

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 (73) hide show
  1. package/package.json +7 -18
  2. package/src/index.js +13 -74
  3. package/src/index.d.ts +0 -7
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/add-file-attachment.d.ts +0 -23
  7. package/src/lib/actions/add-file-attachment.d.ts.map +0 -1
  8. package/src/lib/actions/add-file-attachment.js +0 -127
  9. package/src/lib/actions/add-file-attachment.js.map +0 -1
  10. package/src/lib/actions/cancel-purchase-order.d.ts +0 -14
  11. package/src/lib/actions/cancel-purchase-order.d.ts.map +0 -1
  12. package/src/lib/actions/cancel-purchase-order.js +0 -35
  13. package/src/lib/actions/cancel-purchase-order.js.map +0 -1
  14. package/src/lib/actions/close-purchase-order.d.ts +0 -14
  15. package/src/lib/actions/close-purchase-order.d.ts.map +0 -1
  16. package/src/lib/actions/close-purchase-order.js +0 -35
  17. package/src/lib/actions/close-purchase-order.js.map +0 -1
  18. package/src/lib/actions/create-object.d.ts +0 -12
  19. package/src/lib/actions/create-object.d.ts.map +0 -1
  20. package/src/lib/actions/create-object.js +0 -44
  21. package/src/lib/actions/create-object.js.map +0 -1
  22. package/src/lib/actions/get-object-by-id.d.ts +0 -17
  23. package/src/lib/actions/get-object-by-id.d.ts.map +0 -1
  24. package/src/lib/actions/get-object-by-id.js +0 -44
  25. package/src/lib/actions/get-object-by-id.js.map +0 -1
  26. package/src/lib/actions/get-remit-to-addresses.d.ts +0 -15
  27. package/src/lib/actions/get-remit-to-addresses.d.ts.map +0 -1
  28. package/src/lib/actions/get-remit-to-addresses.js +0 -80
  29. package/src/lib/actions/get-remit-to-addresses.js.map +0 -1
  30. package/src/lib/actions/get-supplier-sites.d.ts +0 -14
  31. package/src/lib/actions/get-supplier-sites.d.ts.map +0 -1
  32. package/src/lib/actions/get-supplier-sites.js +0 -40
  33. package/src/lib/actions/get-supplier-sites.js.map +0 -1
  34. package/src/lib/actions/grant-approval.d.ts +0 -14
  35. package/src/lib/actions/grant-approval.d.ts.map +0 -1
  36. package/src/lib/actions/grant-approval.js +0 -35
  37. package/src/lib/actions/grant-approval.js.map +0 -1
  38. package/src/lib/actions/reject-approval.d.ts +0 -15
  39. package/src/lib/actions/reject-approval.d.ts.map +0 -1
  40. package/src/lib/actions/reject-approval.js +0 -48
  41. package/src/lib/actions/reject-approval.js.map +0 -1
  42. package/src/lib/actions/search-objects.d.ts +0 -11
  43. package/src/lib/actions/search-objects.d.ts.map +0 -1
  44. package/src/lib/actions/search-objects.js +0 -46
  45. package/src/lib/actions/search-objects.js.map +0 -1
  46. package/src/lib/actions/set-integration-run-status.d.ts +0 -10
  47. package/src/lib/actions/set-integration-run-status.d.ts.map +0 -1
  48. package/src/lib/actions/set-integration-run-status.js +0 -49
  49. package/src/lib/actions/set-integration-run-status.js.map +0 -1
  50. package/src/lib/actions/update-object.d.ts +0 -18
  51. package/src/lib/actions/update-object.d.ts.map +0 -1
  52. package/src/lib/actions/update-object.js +0 -46
  53. package/src/lib/actions/update-object.js.map +0 -1
  54. package/src/lib/auth.d.ts +0 -7
  55. package/src/lib/auth.d.ts.map +0 -1
  56. package/src/lib/auth.js +0 -50
  57. package/src/lib/auth.js.map +0 -1
  58. package/src/lib/common/client.d.ts +0 -34
  59. package/src/lib/common/client.d.ts.map +0 -1
  60. package/src/lib/common/client.js +0 -146
  61. package/src/lib/common/client.js.map +0 -1
  62. package/src/lib/common/props.d.ts +0 -47
  63. package/src/lib/common/props.d.ts.map +0 -1
  64. package/src/lib/common/props.js +0 -366
  65. package/src/lib/common/props.js.map +0 -1
  66. package/src/lib/common/utils.d.ts +0 -22
  67. package/src/lib/common/utils.d.ts.map +0 -1
  68. package/src/lib/common/utils.js +0 -182
  69. package/src/lib/common/utils.js.map +0 -1
  70. package/src/lib/triggers/new-or-updated-object.d.ts +0 -39
  71. package/src/lib/triggers/new-or-updated-object.d.ts.map +0 -1
  72. package/src/lib/triggers/new-or-updated-object.js +0 -101
  73. package/src/lib/triggers/new-or-updated-object.js.map +0 -1
@@ -1,127 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addFileAttachment = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const form_data_1 = tslib_1.__importDefault(require("form-data"));
7
- const auth_1 = require("../auth");
8
- const client_1 = require("../common/client");
9
- const props_1 = require("../common/props");
10
- const utils_1 = require("../common/utils");
11
- exports.addFileAttachment = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.coupaAuth,
13
- name: 'add_file_attachment_to_object',
14
- displayName: 'Add File Attachment to Object',
15
- description: 'Adds an attachment (an uploaded file or a link) to a Purchase Order, Supplier, or Contract in Coupa.',
16
- audience: 'both',
17
- aiMetadata: {
18
- description: 'Attach a file or a URL link to an existing Coupa purchase order, supplier, or contract record. Pick the mode via attachmentSource: upload a file directly, or link a URL instead. Not idempotent — each run appends a new attachment to the record, so retries create duplicates.',
19
- idempotent: false,
20
- },
21
- props: {
22
- module: props_1.attachmentModuleProperty,
23
- parentRecord: pieces_framework_1.Property.DynamicProperties({
24
- displayName: 'Record',
25
- description: 'The record to attach to. Pick it by name after choosing a module.',
26
- required: true,
27
- refreshers: ['module'],
28
- auth: auth_1.coupaAuth,
29
- props: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ module }) {
30
- if (module === 'purchase_orders') {
31
- return { recordId: props_1.purchaseOrderDropdown };
32
- }
33
- if (module === 'suppliers') {
34
- return { recordId: props_1.supplierDropdown };
35
- }
36
- if (module === 'contracts') {
37
- return { recordId: props_1.contractDropdown };
38
- }
39
- return {
40
- recordId: pieces_framework_1.Property.ShortText({
41
- displayName: 'Record ID',
42
- description: 'Select a module first.',
43
- required: true,
44
- }),
45
- };
46
- }),
47
- }),
48
- attachmentSource: pieces_framework_1.Property.StaticDropdown({
49
- displayName: 'Attachment Type',
50
- description: 'Choose whether to upload a file directly or attach a link (URL).',
51
- required: true,
52
- defaultValue: 'file',
53
- options: {
54
- disabled: false,
55
- options: [
56
- { label: 'Upload a file', value: 'file' },
57
- { label: 'Link a URL', value: 'url' },
58
- ],
59
- },
60
- }),
61
- attachment: pieces_framework_1.Property.DynamicProperties({
62
- displayName: 'Attachment',
63
- description: 'The file to upload or the URL to link.',
64
- required: true,
65
- refreshers: ['attachmentSource'],
66
- auth: auth_1.coupaAuth,
67
- props: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ attachmentSource }) {
68
- if (attachmentSource === 'url') {
69
- return {
70
- url: pieces_framework_1.Property.ShortText({
71
- displayName: 'URL',
72
- description: 'The full link to attach (e.g. https://example.com/spec.pdf).',
73
- required: true,
74
- }),
75
- };
76
- }
77
- return {
78
- file: pieces_framework_1.Property.File({
79
- displayName: 'File',
80
- description: 'The file to upload to the record.',
81
- required: true,
82
- }),
83
- };
84
- }),
85
- }),
86
- intent: pieces_framework_1.Property.ShortText({
87
- displayName: 'Intent',
88
- description: 'Optional Coupa attachment intent that controls who can see the attachment (e.g. `Supplier`). Leave empty to use the Coupa default.',
89
- required: false,
90
- }),
91
- },
92
- run(_a) {
93
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
94
- var _b;
95
- const client = new client_1.CoupaClient(auth.props);
96
- const module = (0, props_1.toCoupaModule)(propsValue.module);
97
- const parentId = propsValue.parentRecord['recordId'];
98
- const source = propsValue.attachmentSource;
99
- const attachment = propsValue.attachment;
100
- const formData = new form_data_1.default();
101
- if (source === 'url') {
102
- formData.append('attachment[url]', (_b = (0, utils_1.getString)(attachment['url'])) !== null && _b !== void 0 ? _b : '');
103
- formData.append('attachment[type]', 'url');
104
- }
105
- else {
106
- const file = attachment['file'];
107
- if (!file) {
108
- throw new Error('A file is required when the attachment type is "Upload a file".');
109
- }
110
- formData.append('attachment[file]', file.data, {
111
- filename: file.filename,
112
- contentType: (0, utils_1.getMimeType)(file.filename, file.extension),
113
- });
114
- formData.append('attachment[type]', 'file');
115
- }
116
- if (propsValue.intent) {
117
- formData.append('attachment[intent]', propsValue.intent);
118
- }
119
- const result = yield client.requestMultipart({
120
- resourceUri: `/${module}/${parentId}/attachments`,
121
- formData,
122
- });
123
- return (0, utils_1.formatCoupaOutput)(result, module);
124
- });
125
- },
126
- });
127
- //# sourceMappingURL=add-file-attachment.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"add-file-attachment.js","sourceRoot":"","sources":["../../../../src/lib/actions/add-file-attachment.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,kEAAiC;AACjC,kCAAoC;AACpC,6CAA+C;AAC/C,2CAMyB;AACzB,2CAA4E;AAE/D,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,+BAA+B;IAC5C,WAAW,EACT,sGAAsG;IACxG,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,mRAAmR;QACrR,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,gCAAwB;QAChC,YAAY,EAAE,2BAAQ,CAAC,iBAAiB,CAAC;YACvC,WAAW,EAAE,QAAQ;YACrB,WAAW,EAAE,mEAAmE;YAChF,QAAQ,EAAE,IAAI;YACd,UAAU,EAAE,CAAC,QAAQ,CAAC;YACtB,IAAI,EAAE,gBAAS;YACf,KAAK,EAAE,KAA+C,EAAE,oDAA1C,EAAE,MAAM,EAAE;gBACtB,IAAI,MAAM,KAAK,iBAAiB,EAAE,CAAC;oBACjC,OAAO,EAAE,QAAQ,EAAE,6BAAqB,EAAE,CAAC;gBAC7C,CAAC;gBACD,IAAI,MAAM,KAAK,WAAW,EAAE,CAAC;oBAC3B,OAAO,EAAE,QAAQ,EAAE,wBAAgB,EAAE,CAAC;gBACxC,CAAC;gBACD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,CAAC;iBACxD,CAAC,CAAC;gBACH,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;YAC9C,CAAC;YACD,IAAI,UAAU,CAAC,MAAM,EAAE,CAAC;gBACtB,QAAQ,CAAC,MAAM,CAAC,oBAAoB,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;YAC3D,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAA0B;gBACpE,WAAW,EAAE,IAAI,MAAM,IAAI,QAAQ,cAAc;gBACjD,QAAQ;aACT,CAAC,CAAC;YACH,OAAO,IAAA,yBAAiB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3C,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- export declare const cancelPurchaseOrder: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- clientId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- scope: import("@activepieces/pieces-framework").LongTextProperty<true>;
6
- }>, {
7
- purchaseOrderId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
- instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- clientId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
10
- clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
- scope: import("@activepieces/pieces-framework").LongTextProperty<true>;
12
- }>>;
13
- }>;
14
- //# sourceMappingURL=cancel-purchase-order.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel-purchase-order.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/cancel-purchase-order.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAuB9B,CAAC"}
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cancelPurchaseOrder = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_common_1 = require("@activepieces/pieces-common");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const auth_1 = require("../auth");
8
- const client_1 = require("../common/client");
9
- const props_1 = require("../common/props");
10
- const utils_1 = require("../common/utils");
11
- exports.cancelPurchaseOrder = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.coupaAuth,
13
- name: 'cancel_purchase_order',
14
- displayName: 'Cancel Purchase Order',
15
- description: 'Cancels a purchase order using `PUT /api/purchase_orders/:id/cancel`.',
16
- audience: 'both',
17
- aiMetadata: {
18
- description: 'Cancel an existing Coupa purchase order by ID, voiding it rather than completing it — use Close Purchase Order to finalize a fulfilled order instead. This is an irreversible workflow transition and not idempotent: re-running against an already-cancelled order may fail.',
19
- idempotent: false,
20
- },
21
- props: {
22
- purchaseOrderId: props_1.purchaseOrderDropdown,
23
- },
24
- run(_a) {
25
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
26
- const client = new client_1.CoupaClient(auth.props);
27
- const result = yield client.request({
28
- method: pieces_common_1.HttpMethod.PUT,
29
- resourceUri: `/purchase_orders/${propsValue.purchaseOrderId}/cancel`,
30
- });
31
- return (0, utils_1.formatCoupaOutput)(result, 'purchase_orders');
32
- });
33
- },
34
- });
35
- //# sourceMappingURL=cancel-purchase-order.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancel-purchase-order.js","sourceRoot":"","sources":["../../../../src/lib/actions/cancel-purchase-order.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAA8D;AAC9D,kCAAoC;AACpC,6CAA+C;AAC/C,2CAAwD;AACxD,2CAAoD;AAEvC,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EACT,uEAAuE;IACzE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,+QAA+Q;QACjR,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,eAAe,EAAE,6BAAqB;KACvC;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAI,oBAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAA0B;gBAC3D,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,WAAW,EAAE,oBAAoB,UAAU,CAAC,eAAe,SAAS;aACrE,CAAC,CAAC;YACH,OAAO,IAAA,yBAAiB,EAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;QACtD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- export declare const closePurchaseOrder: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- clientId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- scope: import("@activepieces/pieces-framework").LongTextProperty<true>;
6
- }>, {
7
- purchaseOrderId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
- instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- clientId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
10
- clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
- scope: import("@activepieces/pieces-framework").LongTextProperty<true>;
12
- }>>;
13
- }>;
14
- //# sourceMappingURL=close-purchase-order.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"close-purchase-order.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/close-purchase-order.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAuB7B,CAAC"}
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.closePurchaseOrder = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_common_1 = require("@activepieces/pieces-common");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const auth_1 = require("../auth");
8
- const client_1 = require("../common/client");
9
- const props_1 = require("../common/props");
10
- const utils_1 = require("../common/utils");
11
- exports.closePurchaseOrder = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.coupaAuth,
13
- name: 'close_purchase_order',
14
- displayName: 'Close Purchase Order',
15
- description: 'Closes a purchase order using `PUT /api/purchase_orders/:id/close`.',
16
- audience: 'both',
17
- aiMetadata: {
18
- description: 'Close an existing Coupa purchase order by ID, marking it complete so no further receiving or invoicing occurs — use Cancel Purchase Order to void an order instead. Not idempotent: closing is a one-way workflow transition and re-running on an already-closed order may fail.',
19
- idempotent: false,
20
- },
21
- props: {
22
- purchaseOrderId: props_1.purchaseOrderDropdown,
23
- },
24
- run(_a) {
25
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
26
- const client = new client_1.CoupaClient(auth.props);
27
- const result = yield client.request({
28
- method: pieces_common_1.HttpMethod.PUT,
29
- resourceUri: `/purchase_orders/${propsValue.purchaseOrderId}/close`,
30
- });
31
- return (0, utils_1.formatCoupaOutput)(result, 'purchase_orders');
32
- });
33
- },
34
- });
35
- //# sourceMappingURL=close-purchase-order.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"close-purchase-order.js","sourceRoot":"","sources":["../../../../src/lib/actions/close-purchase-order.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAA8D;AAC9D,kCAAoC;AACpC,6CAA+C;AAC/C,2CAAwD;AACxD,2CAAoD;AAEvC,QAAA,kBAAkB,GAAG,IAAA,+BAAY,EAAC;IAC7C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EACT,qEAAqE;IACvE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,kRAAkR;QACpR,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,eAAe,EAAE,6BAAqB;KACvC;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAI,oBAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAA0B;gBAC3D,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,WAAW,EAAE,oBAAoB,UAAU,CAAC,eAAe,QAAQ;aACpE,CAAC,CAAC;YACH,OAAO,IAAA,yBAAiB,EAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC;QACtD,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- export declare const createObject: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- clientId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- scope: import("@activepieces/pieces-framework").LongTextProperty<true>;
6
- }>, {
7
- module: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
8
- customResource: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
- bodyHelp: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
10
- body: import("@activepieces/pieces-framework").JsonProperty<true>;
11
- }>;
12
- //# sourceMappingURL=create-object.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-object.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/create-object.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,YAAY;;;;;;;;;;EAmCvB,CAAC"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createObject = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_common_1 = require("@activepieces/pieces-common");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const auth_1 = require("../auth");
8
- const client_1 = require("../common/client");
9
- const props_1 = require("../common/props");
10
- const utils_1 = require("../common/utils");
11
- exports.createObject = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.coupaAuth,
13
- name: 'create_object',
14
- displayName: 'Create Object',
15
- description: 'Creates a record in the selected Coupa module (Purchase Orders, Suppliers, or Contracts).',
16
- audience: 'both',
17
- aiMetadata: {
18
- description: 'Create a new record in a Coupa module — purchase orders, suppliers, contracts, or any other resource via the custom-module option — from a raw JSON body matching the Coupa API schema. Not idempotent: each run POSTs a new record, so retries create duplicates. Use Update Object to modify an existing record instead.',
19
- idempotent: false,
20
- },
21
- props: {
22
- module: props_1.moduleProperty,
23
- customResource: props_1.customModuleResourceProperty,
24
- bodyHelp: props_1.requestBodyHelp,
25
- body: props_1.requestBodyProperty,
26
- },
27
- run(_a) {
28
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
29
- const client = new client_1.CoupaClient(auth.props);
30
- const resource = (0, props_1.resolveModuleResource)(propsValue.module, propsValue.customResource);
31
- const body = (0, utils_1.parseJsonBody)(propsValue.body);
32
- const result = yield client.request({
33
- method: pieces_common_1.HttpMethod.POST,
34
- resourceUri: `/${resource}`,
35
- body,
36
- });
37
- if (propsValue.module !== '__custom__') {
38
- return (0, utils_1.formatCoupaOutput)(result, (0, props_1.toCoupaModule)(propsValue.module));
39
- }
40
- return result;
41
- });
42
- },
43
- });
44
- //# sourceMappingURL=create-object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-object.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-object.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAA8D;AAC9D,kCAAoC;AACpC,6CAA+C;AAC/C,2CAOyB;AACzB,2CAAmE;AAEtD,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EACT,2FAA2F;IAC7F,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,4TAA4T;QAC9T,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,sBAAc;QACtB,cAAc,EAAE,oCAA4B;QAC5C,QAAQ,EAAE,uBAAe;QACzB,IAAI,EAAE,2BAAmB;KAC1B;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAI,oBAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3C,MAAM,QAAQ,GAAG,IAAA,6BAAqB,EACpC,UAAU,CAAC,MAAM,EACjB,UAAU,CAAC,cAAc,CAC1B,CAAC;YACF,MAAM,IAAI,GAAG,IAAA,qBAAa,EAAC,UAAU,CAAC,IAAI,CAAC,CAAC;YAC5C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAA0B;gBAC3D,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,WAAW,EAAE,IAAI,QAAQ,EAAE;gBAC3B,IAAI;aACL,CAAC,CAAC;YACH,IAAI,UAAU,CAAC,MAAM,KAAK,YAAY,EAAE,CAAC;gBACvC,OAAO,IAAA,yBAAiB,EAAC,MAAM,EAAE,IAAA,qBAAa,EAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;YACrE,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,17 +0,0 @@
1
- export declare const getObjectById: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- clientId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- scope: import("@activepieces/pieces-framework").LongTextProperty<true>;
6
- }>, {
7
- module: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
8
- customResource: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
- record: import("@activepieces/pieces-framework").DynamicProperties<true, import("@activepieces/pieces-framework").CustomAuthProperty<{
10
- instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
11
- clientId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
12
- clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
13
- scope: import("@activepieces/pieces-framework").LongTextProperty<true>;
14
- }>>;
15
- queryParams: import("@activepieces/pieces-framework").JsonProperty<false>;
16
- }>;
17
- //# sourceMappingURL=get-object-by-id.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-object-by-id.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-object-by-id.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;EAmCxB,CAAC"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getObjectById = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_common_1 = require("@activepieces/pieces-common");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const auth_1 = require("../auth");
8
- const client_1 = require("../common/client");
9
- const props_1 = require("../common/props");
10
- const utils_1 = require("../common/utils");
11
- exports.getObjectById = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.coupaAuth,
13
- name: 'get_object_by_id',
14
- displayName: 'Get Object by ID',
15
- description: 'Retrieves a single record by ID from Purchase Orders, Suppliers, or Contracts.',
16
- audience: 'both',
17
- aiMetadata: {
18
- description: 'Fetch one Coupa record by its ID from purchase orders, suppliers, contracts, or any other resource via the custom-module option, with optional query parameters such as a fields filter. Use this when you already know the record ID; use Search Objects to find records by criteria. Read-only and idempotent.',
19
- idempotent: true,
20
- },
21
- props: {
22
- module: props_1.moduleProperty,
23
- customResource: props_1.customModuleResourceProperty,
24
- record: props_1.objectSelector,
25
- queryParams: props_1.optionalQueryParamsProperty,
26
- },
27
- run(_a) {
28
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
29
- const client = new client_1.CoupaClient(auth.props);
30
- const resource = (0, props_1.resolveModuleResource)(propsValue.module, propsValue.customResource);
31
- const objectId = propsValue.record['objectId'];
32
- const result = yield client.request({
33
- method: pieces_common_1.HttpMethod.GET,
34
- resourceUri: `/${resource}/${objectId}`,
35
- query: (0, props_1.parseOptionalQuery)(propsValue.queryParams),
36
- });
37
- if (propsValue.module !== '__custom__') {
38
- return (0, utils_1.formatCoupaOutput)(result, (0, props_1.toCoupaModule)(propsValue.module));
39
- }
40
- return result;
41
- });
42
- },
43
- });
44
- //# sourceMappingURL=get-object-by-id.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-object-by-id.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-object-by-id.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAA8D;AAC9D,kCAAoC;AACpC,6CAA+C;AAC/C,2CAQyB;AACzB,2CAAoD;AAEvC,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EACT,gFAAgF;IAClF,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,kTAAkT;QACpT,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,sBAAc;QACtB,cAAc,EAAE,oCAA4B;QAC5C,MAAM,EAAE,sBAAc;QACtB,WAAW,EAAE,mCAA2B;KACzC;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAI,oBAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3C,MAAM,QAAQ,GAAG,IAAA,6BAAqB,EACpC,UAAU,CAAC,MAAM,EACjB,UAAU,CAAC,cAAc,CAC1B,CAAC;YACF,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YAC/C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAA0B;gBAC3D,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,WAAW,EAAE,IAAI,QAAQ,IAAI,QAAQ,EAAE;gBACvC,KAAK,EAAE,IAAA,0BAAkB,EAAC,UAAU,CAAC,WAAW,CAAC;aAClD,CAAC,CAAC;YACH,IAAI,UAAU,CAAC,MAAM,KAAK,YAAY,EAAE,CAAC;gBACvC,OAAO,IAAA,yBAAiB,EAAC,MAAM,EAAE,IAAA,qBAAa,EAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;YACrE,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- export declare const getRemitToAddresses: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- clientId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- scope: import("@activepieces/pieces-framework").LongTextProperty<true>;
6
- }>, {
7
- parentModule: import("@activepieces/pieces-framework").StaticDropdownProperty<string, true>;
8
- parentRecord: import("@activepieces/pieces-framework").DynamicProperties<true, import("@activepieces/pieces-framework").CustomAuthProperty<{
9
- instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
- clientId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
- clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
12
- scope: import("@activepieces/pieces-framework").LongTextProperty<true>;
13
- }>>;
14
- }>;
15
- //# sourceMappingURL=get-remit-to-addresses.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-remit-to-addresses.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-remit-to-addresses.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;EAqE9B,CAAC"}
@@ -1,80 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRemitToAddresses = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_common_1 = require("@activepieces/pieces-common");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const auth_1 = require("../auth");
8
- const client_1 = require("../common/client");
9
- const props_1 = require("../common/props");
10
- const utils_1 = require("../common/utils");
11
- exports.getRemitToAddresses = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.coupaAuth,
13
- name: 'get_remit_to_addresses_by_object_id',
14
- displayName: 'Get Remit-To Addresses by Object ID',
15
- description: 'Lists remit-to addresses for a Supplier or resolves the supplier from a Purchase Order.',
16
- audience: 'both',
17
- aiMetadata: {
18
- description: 'List the remit-to (payment) addresses on file for a Coupa supplier. Works in two modes: pass a supplier ID directly, or pass a purchase order ID and it resolves the linked supplier first (failing if the order has no supplier). Read-only and idempotent.',
19
- idempotent: true,
20
- },
21
- props: {
22
- parentModule: props_1.remitToParentTypeProperty,
23
- parentRecord: pieces_framework_1.Property.DynamicProperties({
24
- displayName: 'Record',
25
- required: true,
26
- refreshers: ['parentModule'],
27
- auth: auth_1.coupaAuth,
28
- props: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ parentModule }) {
29
- if (parentModule === 'suppliers') {
30
- return { recordId: props_1.supplierDropdown };
31
- }
32
- if (parentModule === 'purchase_orders') {
33
- return { recordId: props_1.purchaseOrderDropdown };
34
- }
35
- return {
36
- recordId: pieces_framework_1.Property.ShortText({
37
- displayName: 'Record ID',
38
- description: 'Select a parent module first.',
39
- required: true,
40
- }),
41
- };
42
- }),
43
- }),
44
- },
45
- run(_a) {
46
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
47
- var _b;
48
- const client = new client_1.CoupaClient(auth.props);
49
- const recordId = propsValue.parentRecord['recordId'];
50
- let path;
51
- if (propsValue.parentModule === 'suppliers') {
52
- path = `/suppliers/${recordId}/addresses`;
53
- }
54
- else {
55
- const po = yield client.request({
56
- method: pieces_common_1.HttpMethod.GET,
57
- resourceUri: `/purchase_orders/${recordId}`,
58
- query: { fields: '["id","supplier"]' },
59
- });
60
- const supplier = po['supplier'];
61
- const supplierId = (_b = ((0, utils_1.isRecord)(supplier) ? supplier['id'] : undefined)) !== null && _b !== void 0 ? _b : po['supplier-id'];
62
- if (!supplierId) {
63
- throw new Error('Purchase order has no linked supplier.');
64
- }
65
- path = `/suppliers/${supplierId}/addresses`;
66
- }
67
- const result = yield client.request({
68
- method: pieces_common_1.HttpMethod.GET,
69
- resourceUri: path,
70
- });
71
- const list = Array.isArray(result) ? result : [result];
72
- const formatted = (0, utils_1.flattenRecords)(list);
73
- return {
74
- total_count: formatted.length,
75
- addresses: formatted,
76
- };
77
- });
78
- },
79
- });
80
- //# sourceMappingURL=get-remit-to-addresses.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-remit-to-addresses.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-remit-to-addresses.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AACxE,kCAAoC;AACpC,6CAA+C;AAC/C,2CAIyB;AACzB,2CAA2D;AAE9C,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,qCAAqC;IAC3C,WAAW,EAAE,qCAAqC;IAClD,WAAW,EACT,yFAAyF;IA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BAAoB,QAAQ,EAAE;oBAC3C,KAAK,EAAE,EAAE,MAAM,EAAE,mBAAmB,EAAE;iBACvC,CAAC,CAAC;gBACH,MAAM,QAAQ,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC;gBAChC,MAAM,UAAU,GACd,MAAA,CAAC,IAAA,gBAAQ,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,mCAAI,EAAE,CAAC,aAAa,CAAC,CAAC;gBACzE,IAAI,CAAC,UAAU,EAAE,CAAC;oBAChB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;gBAC5D,CAAC;gBACD,IAAI,GAAG,cAAc,UAAU,YAAY,CAAC;YAC9C,CAAC;YAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAA4B;gBAC7D,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,WAAW,EAAE,IAAI;aAClB,CAAC,CAAC;YACH,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YACvD,MAAM,SAAS,GAAG,IAAA,sBAAc,EAAC,IAAI,CAAC,CAAC;YACvC,OAAO;gBACL,WAAW,EAAE,SAAS,CAAC,MAAM;gBAC7B,SAAS,EAAE,SAAS;aACrB,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- export declare const getSupplierSites: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- clientId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- scope: import("@activepieces/pieces-framework").LongTextProperty<true>;
6
- }>, {
7
- supplierId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
- instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- clientId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
10
- clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
- scope: import("@activepieces/pieces-framework").LongTextProperty<true>;
12
- }>>;
13
- }>;
14
- //# sourceMappingURL=get-supplier-sites.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-supplier-sites.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-supplier-sites.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EA4B3B,CAAC"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSupplierSites = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_common_1 = require("@activepieces/pieces-common");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const auth_1 = require("../auth");
8
- const client_1 = require("../common/client");
9
- const props_1 = require("../common/props");
10
- const utils_1 = require("../common/utils");
11
- exports.getSupplierSites = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.coupaAuth,
13
- name: 'get_supplier_sites_by_supplier',
14
- displayName: 'Get Supplier Sites by Supplier',
15
- description: 'Lists supplier sites for a supplier (`GET /api/suppliers/:id/supplier_sites`).',
16
- audience: 'both',
17
- aiMetadata: {
18
- description: 'List all supplier sites (locations/storefronts) configured under a given Coupa supplier ID. Use this to enumerate a supplier\'s sites; use Get Remit-To Addresses for payment addresses instead. Read-only and idempotent.',
19
- idempotent: true,
20
- },
21
- props: {
22
- supplierId: props_1.supplierDropdown,
23
- },
24
- run(_a) {
25
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
26
- const client = new client_1.CoupaClient(auth.props);
27
- const result = yield client.request({
28
- method: pieces_common_1.HttpMethod.GET,
29
- resourceUri: `/suppliers/${propsValue.supplierId}/supplier_sites`,
30
- });
31
- const list = Array.isArray(result) ? result : [result];
32
- const formatted = (0, utils_1.formatCoupaOutputs)(list, 'suppliers');
33
- return {
34
- total_count: formatted.length,
35
- supplier_sites: formatted,
36
- };
37
- });
38
- },
39
- });
40
- //# sourceMappingURL=get-supplier-sites.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-supplier-sites.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-supplier-sites.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAA8D;AAC9D,kCAAoC;AACpC,6CAA+C;AAC/C,2CAAmD;AACnD,2CAAqD;AAExC,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,gCAAgC;IACtC,WAAW,EAAE,gCAAgC;IAC7C,WAAW,EACT,gFAAgF;IAClF,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,4NAA4N;QAC9N,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,UAAU,EAAE,wBAAgB;KAC7B;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAI,oBAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC3C,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,CAA4B;gBAC7D,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,WAAW,EAAE,cAAc,UAAU,CAAC,UAAU,iBAAiB;aAClE,CAAC,CAAC;YACH,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;YACvD,MAAM,SAAS,GAAG,IAAA,0BAAkB,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;YACxD,OAAO;gBACL,WAAW,EAAE,SAAS,CAAC,MAAM;gBAC7B,cAAc,EAAE,SAAS;aAC1B,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- export declare const grantApproval: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- clientId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- scope: import("@activepieces/pieces-framework").LongTextProperty<true>;
6
- }>, {
7
- approvalId: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
8
- instanceUrl: import("@activepieces/pieces-framework").ShortTextProperty<true>;
9
- clientId: import("@activepieces/pieces-framework").SecretTextProperty<true>;
10
- clientSecret: import("@activepieces/pieces-framework").SecretTextProperty<true>;
11
- scope: import("@activepieces/pieces-framework").LongTextProperty<true>;
12
- }>>;
13
- }>;
14
- //# sourceMappingURL=grant-approval.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"grant-approval.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/grant-approval.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa;;;;;;;;;;;;EAuBxB,CAAC"}
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.grantApproval = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_common_1 = require("@activepieces/pieces-common");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const auth_1 = require("../auth");
8
- const client_1 = require("../common/client");
9
- const props_1 = require("../common/props");
10
- const utils_1 = require("../common/utils");
11
- exports.grantApproval = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.coupaAuth,
13
- name: 'grant_approval',
14
- displayName: 'Grant Approval',
15
- description: 'Approves a pending approval in Coupa (e.g. a requisition or purchase order awaiting your decision). Pick the approval from the dropdown.',
16
- audience: 'both',
17
- aiMetadata: {
18
- description: 'Approve a pending Coupa approval (e.g. a requisition or purchase order awaiting decision) by its approval ID, advancing the document through its approval chain. Use Reject Approval to decline instead. Not idempotent: the approval must be in a pending state, and re-running after it is decided may fail.',
19
- idempotent: false,
20
- },
21
- props: {
22
- approvalId: props_1.pendingApprovalDropdown,
23
- },
24
- run(_a) {
25
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
26
- const client = new client_1.CoupaClient(auth.props);
27
- const result = yield client.request({
28
- method: pieces_common_1.HttpMethod.PUT,
29
- resourceUri: `/approvals/${propsValue.approvalId}/approve`,
30
- });
31
- return (0, utils_1.flattenRecord)(result);
32
- });
33
- },
34
- });
35
- //# sourceMappingURL=grant-approval.js.map