@activepieces/piece-promotekit 0.3.2 → 0.3.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 -12
  2. package/src/index.js +48 -78
  3. package/src/index.d.ts +0 -3
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/create-affiliate.d.ts +0 -7
  7. package/src/lib/actions/create-affiliate.d.ts.map +0 -1
  8. package/src/lib/actions/create-affiliate.js +0 -56
  9. package/src/lib/actions/create-affiliate.js.map +0 -1
  10. package/src/lib/actions/create-referral.d.ts +0 -5
  11. package/src/lib/actions/create-referral.d.ts.map +0 -1
  12. package/src/lib/actions/create-referral.js +0 -42
  13. package/src/lib/actions/create-referral.js.map +0 -1
  14. package/src/lib/actions/find-affiliate.d.ts +0 -4
  15. package/src/lib/actions/find-affiliate.d.ts.map +0 -1
  16. package/src/lib/actions/find-affiliate.js +0 -37
  17. package/src/lib/actions/find-affiliate.js.map +0 -1
  18. package/src/lib/actions/find-campaign.d.ts +0 -4
  19. package/src/lib/actions/find-campaign.d.ts.map +0 -1
  20. package/src/lib/actions/find-campaign.js +0 -44
  21. package/src/lib/actions/find-campaign.js.map +0 -1
  22. package/src/lib/actions/find-commission.d.ts +0 -4
  23. package/src/lib/actions/find-commission.d.ts.map +0 -1
  24. package/src/lib/actions/find-commission.js +0 -37
  25. package/src/lib/actions/find-commission.js.map +0 -1
  26. package/src/lib/actions/find-payout.d.ts +0 -4
  27. package/src/lib/actions/find-payout.d.ts.map +0 -1
  28. package/src/lib/actions/find-payout.js +0 -37
  29. package/src/lib/actions/find-payout.js.map +0 -1
  30. package/src/lib/actions/find-referral.d.ts +0 -4
  31. package/src/lib/actions/find-referral.d.ts.map +0 -1
  32. package/src/lib/actions/find-referral.js +0 -37
  33. package/src/lib/actions/find-referral.js.map +0 -1
  34. package/src/lib/actions/list-affiliates.d.ts +0 -5
  35. package/src/lib/actions/list-affiliates.d.ts.map +0 -1
  36. package/src/lib/actions/list-affiliates.js +0 -49
  37. package/src/lib/actions/list-affiliates.js.map +0 -1
  38. package/src/lib/actions/list-campaigns.d.ts +0 -2
  39. package/src/lib/actions/list-campaigns.d.ts.map +0 -1
  40. package/src/lib/actions/list-campaigns.js +0 -40
  41. package/src/lib/actions/list-campaigns.js.map +0 -1
  42. package/src/lib/actions/list-commissions.d.ts +0 -5
  43. package/src/lib/actions/list-commissions.d.ts.map +0 -1
  44. package/src/lib/actions/list-commissions.js +0 -49
  45. package/src/lib/actions/list-commissions.js.map +0 -1
  46. package/src/lib/actions/list-payouts.d.ts +0 -5
  47. package/src/lib/actions/list-payouts.d.ts.map +0 -1
  48. package/src/lib/actions/list-payouts.js +0 -49
  49. package/src/lib/actions/list-payouts.js.map +0 -1
  50. package/src/lib/actions/list-referrals.d.ts +0 -5
  51. package/src/lib/actions/list-referrals.d.ts.map +0 -1
  52. package/src/lib/actions/list-referrals.js +0 -49
  53. package/src/lib/actions/list-referrals.js.map +0 -1
  54. package/src/lib/actions/update-affiliate.d.ts +0 -9
  55. package/src/lib/actions/update-affiliate.d.ts.map +0 -1
  56. package/src/lib/actions/update-affiliate.js +0 -72
  57. package/src/lib/actions/update-affiliate.js.map +0 -1
  58. package/src/lib/common/index.d.ts +0 -27
  59. package/src/lib/common/index.d.ts.map +0 -1
  60. package/src/lib/common/index.js +0 -190
  61. package/src/lib/common/index.js.map +0 -1
  62. package/src/lib/triggers/new-affiliate-event.d.ts +0 -15
  63. package/src/lib/triggers/new-affiliate-event.d.ts.map +0 -1
  64. package/src/lib/triggers/new-affiliate-event.js +0 -94
  65. package/src/lib/triggers/new-affiliate-event.js.map +0 -1
  66. package/src/lib/triggers/new-commission-event.d.ts +0 -11
  67. package/src/lib/triggers/new-commission-event.d.ts.map +0 -1
  68. package/src/lib/triggers/new-commission-event.js +0 -74
  69. package/src/lib/triggers/new-commission-event.js.map +0 -1
  70. package/src/lib/triggers/new-referral-event.d.ts +0 -15
  71. package/src/lib/triggers/new-referral-event.d.ts.map +0 -1
  72. package/src/lib/triggers/new-referral-event.js +0 -93
  73. package/src/lib/triggers/new-referral-event.js.map +0 -1
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createReferral = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- const common_1 = require("../common");
9
- exports.createReferral = (0, pieces_framework_1.createAction)({
10
- auth: __1.promotekitAuth,
11
- name: 'create_referral',
12
- displayName: 'Create Referral',
13
- description: 'Create a new referral in PromoteKit.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Create a new referral attributing a referred person (by email) to an affiliate. Both the email and the affiliate ID are required. Not idempotent: each call records another referral, so check for an existing one before repeating.',
17
- idempotent: false,
18
- },
19
- props: {
20
- email: pieces_framework_1.Property.ShortText({
21
- displayName: 'Email',
22
- description: 'The email address of the referred person.',
23
- required: true,
24
- }),
25
- affiliate_id: common_1.promotekitCommon.affiliateDropdown,
26
- },
27
- run(context) {
28
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
- const response = yield (0, common_1.promotekitApiCall)({
30
- token: context.auth.secret_text,
31
- method: pieces_common_1.HttpMethod.POST,
32
- path: '/referrals',
33
- body: {
34
- email: context.propsValue.email,
35
- affiliate_id: context.propsValue.affiliate_id,
36
- },
37
- });
38
- return common_1.promotekitCommon.flattenReferral(response.body.data);
39
- });
40
- },
41
- });
42
- //# sourceMappingURL=create-referral.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-referral.js","sourceRoot":"","sources":["../../../../src/lib/actions/create-referral.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,6BAAuC;AACvC,sCAAgE;AAEnD,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,kBAAc;IACpB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,sCAAsC;IACnD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,sOAAsO;QACnP,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,2CAA2C;YACxD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,YAAY,EAAE,yBAAgB,CAAC,iBAAiB;KACjD;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAErC;gBACD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,IAAI,EAAE,YAAY;gBAClB,IAAI,EAAE;oBACJ,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK;oBAC/B,YAAY,EAAE,OAAO,CAAC,UAAU,CAAC,YAAY;iBAC9C;aACF,CAAC,CAAC;YACH,OAAO,yBAAgB,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9D,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const findAffiliate: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- affiliate_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- }>;
4
- //# sourceMappingURL=find-affiliate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-affiliate.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-affiliate.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa;;EA2BxB,CAAC"}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findAffiliate = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- const common_1 = require("../common");
9
- exports.findAffiliate = (0, pieces_framework_1.createAction)({
10
- auth: __1.promotekitAuth,
11
- name: 'find_affiliate',
12
- displayName: 'Find Affiliate',
13
- description: 'Get details of a specific affiliate by ID.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Fetch a single affiliate by its PromoteKit affiliate ID. Use when you already have the exact ID and need that affiliate\'s details; to discover IDs, list affiliates first. Read-only and safe to repeat.',
17
- idempotent: true,
18
- },
19
- props: {
20
- affiliate_id: pieces_framework_1.Property.ShortText({
21
- displayName: 'Affiliate ID',
22
- description: 'The ID of the affiliate to retrieve.',
23
- required: true,
24
- }),
25
- },
26
- run(context) {
27
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
28
- const response = yield (0, common_1.promotekitApiCall)({
29
- token: context.auth.secret_text,
30
- method: pieces_common_1.HttpMethod.GET,
31
- path: `/affiliates/${context.propsValue.affiliate_id}`,
32
- });
33
- return common_1.promotekitCommon.flattenAffiliate(response.body.data);
34
- });
35
- },
36
- });
37
- //# sourceMappingURL=find-affiliate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-affiliate.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-affiliate.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,6BAAuC;AACvC,sCAAgE;AAEnD,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,kBAAc;IACpB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,4CAA4C;IACzD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,2MAA2M;QACxN,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,YAAY,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC/B,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,sCAAsC;YACnD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAErC;gBACD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,eAAe,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE;aACvD,CAAC,CAAC;YACH,OAAO,yBAAgB,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/D,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const findCampaign: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- campaign_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- }>;
4
- //# sourceMappingURL=find-campaign.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-campaign.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-campaign.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;EAiCvB,CAAC"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findCampaign = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- const common_1 = require("../common");
9
- exports.findCampaign = (0, pieces_framework_1.createAction)({
10
- auth: __1.promotekitAuth,
11
- name: 'find_campaign',
12
- displayName: 'Find Campaign',
13
- description: 'Get details of a specific campaign by ID.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Fetch a single campaign by its PromoteKit campaign ID, returning its name and commission terms. Use when you already have the exact ID; to discover IDs, list campaigns first. Read-only and safe to repeat.',
17
- idempotent: true,
18
- },
19
- props: {
20
- campaign_id: pieces_framework_1.Property.ShortText({
21
- displayName: 'Campaign ID',
22
- description: 'The ID of the campaign to retrieve.',
23
- required: true,
24
- }),
25
- },
26
- run(context) {
27
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
28
- var _a, _b;
29
- const response = yield (0, common_1.promotekitApiCall)({
30
- token: context.auth.secret_text,
31
- method: pieces_common_1.HttpMethod.GET,
32
- path: `/campaigns/${context.propsValue.campaign_id}`,
33
- });
34
- const campaign = response.body.data;
35
- return {
36
- id: campaign['id'],
37
- name: campaign['name'],
38
- commission_type: (_a = campaign['commission_type']) !== null && _a !== void 0 ? _a : null,
39
- commission_amount: (_b = campaign['commission_amount']) !== null && _b !== void 0 ? _b : null,
40
- };
41
- });
42
- },
43
- });
44
- //# sourceMappingURL=find-campaign.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-campaign.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-campaign.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,6BAAuC;AACvC,sCAA8C;AAEjC,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,kBAAc;IACpB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,2CAA2C;IACxD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,8MAA8M;QAC3N,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,qCAAqC;YAClD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAErC;gBACD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,cAAc,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE;aACrD,CAAC,CAAC;YACH,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;YACpC,OAAO;gBACL,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC;gBAClB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;gBACtB,eAAe,EAAE,MAAA,QAAQ,CAAC,iBAAiB,CAAC,mCAAI,IAAI;gBACpD,iBAAiB,EAAE,MAAA,QAAQ,CAAC,mBAAmB,CAAC,mCAAI,IAAI;aACzD,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const findCommission: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- commission_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- }>;
4
- //# sourceMappingURL=find-commission.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-commission.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-commission.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc;;EA2BzB,CAAC"}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findCommission = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- const common_1 = require("../common");
9
- exports.findCommission = (0, pieces_framework_1.createAction)({
10
- auth: __1.promotekitAuth,
11
- name: 'find_commission',
12
- displayName: 'Find Commission',
13
- description: 'Get details of a specific commission by ID.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Fetch a single commission by its PromoteKit commission ID. Use when you already have the exact ID and need that commission\'s details; to discover IDs, list commissions first. Read-only and safe to repeat.',
17
- idempotent: true,
18
- },
19
- props: {
20
- commission_id: pieces_framework_1.Property.ShortText({
21
- displayName: 'Commission ID',
22
- description: 'The ID of the commission to retrieve.',
23
- required: true,
24
- }),
25
- },
26
- run(context) {
27
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
28
- const response = yield (0, common_1.promotekitApiCall)({
29
- token: context.auth.secret_text,
30
- method: pieces_common_1.HttpMethod.GET,
31
- path: `/commissions/${context.propsValue.commission_id}`,
32
- });
33
- return common_1.promotekitCommon.flattenCommission(response.body.data);
34
- });
35
- },
36
- });
37
- //# sourceMappingURL=find-commission.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-commission.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-commission.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,6BAAuC;AACvC,sCAAgE;AAEnD,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,kBAAc;IACpB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,6CAA6C;IAC1D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,+MAA+M;QAC5N,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,aAAa,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAChC,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,uCAAuC;YACpD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAErC;gBACD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,gBAAgB,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE;aACzD,CAAC,CAAC;YACH,OAAO,yBAAgB,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChE,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const findPayout: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- payout_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- }>;
4
- //# sourceMappingURL=find-payout.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-payout.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-payout.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,UAAU;;EA2BrB,CAAC"}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findPayout = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- const common_1 = require("../common");
9
- exports.findPayout = (0, pieces_framework_1.createAction)({
10
- auth: __1.promotekitAuth,
11
- name: 'find_payout',
12
- displayName: 'Find Payout',
13
- description: 'Get details of a specific payout by ID.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Fetch a single payout by its PromoteKit payout ID. Use when you already have the exact ID and need that payout\'s details; to discover IDs, list payouts first. Read-only and safe to repeat.',
17
- idempotent: true,
18
- },
19
- props: {
20
- payout_id: pieces_framework_1.Property.ShortText({
21
- displayName: 'Payout ID',
22
- description: 'The ID of the payout to retrieve.',
23
- required: true,
24
- }),
25
- },
26
- run(context) {
27
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
28
- const response = yield (0, common_1.promotekitApiCall)({
29
- token: context.auth.secret_text,
30
- method: pieces_common_1.HttpMethod.GET,
31
- path: `/payouts/${context.propsValue.payout_id}`,
32
- });
33
- return common_1.promotekitCommon.flattenPayout(response.body.data);
34
- });
35
- },
36
- });
37
- //# sourceMappingURL=find-payout.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-payout.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-payout.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,6BAAuC;AACvC,sCAAgE;AAEnD,QAAA,UAAU,GAAG,IAAA,+BAAY,EAAC;IACrC,IAAI,EAAE,kBAAc;IACpB,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,yCAAyC;IACtD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,+LAA+L;QAC5M,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,mCAAmC;YAChD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAErC;gBACD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,YAAY,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE;aACjD,CAAC,CAAC;YACH,OAAO,yBAAgB,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5D,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const findReferral: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- referral_id: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- }>;
4
- //# sourceMappingURL=find-referral.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-referral.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/find-referral.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;EA2BvB,CAAC"}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findReferral = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- const common_1 = require("../common");
9
- exports.findReferral = (0, pieces_framework_1.createAction)({
10
- auth: __1.promotekitAuth,
11
- name: 'find_referral',
12
- displayName: 'Find Referral',
13
- description: 'Get details of a specific referral by ID.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Fetch a single referral by its PromoteKit referral ID. Use when you already have the exact ID and need that referral\'s details; to discover IDs, list referrals first. Read-only and safe to repeat.',
17
- idempotent: true,
18
- },
19
- props: {
20
- referral_id: pieces_framework_1.Property.ShortText({
21
- displayName: 'Referral ID',
22
- description: 'The ID of the referral to retrieve.',
23
- required: true,
24
- }),
25
- },
26
- run(context) {
27
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
28
- const response = yield (0, common_1.promotekitApiCall)({
29
- token: context.auth.secret_text,
30
- method: pieces_common_1.HttpMethod.GET,
31
- path: `/referrals/${context.propsValue.referral_id}`,
32
- });
33
- return common_1.promotekitCommon.flattenReferral(response.body.data);
34
- });
35
- },
36
- });
37
- //# sourceMappingURL=find-referral.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-referral.js","sourceRoot":"","sources":["../../../../src/lib/actions/find-referral.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,6BAAuC;AACvC,sCAAgE;AAEnD,QAAA,YAAY,GAAG,IAAA,+BAAY,EAAC;IACvC,IAAI,EAAE,kBAAc;IACpB,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EAAE,2CAA2C;IACxD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,uMAAuM;QACpN,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,WAAW,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC9B,WAAW,EAAE,aAAa;YAC1B,WAAW,EAAE,qCAAqC;YAClD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAErC;gBACD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,cAAc,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE;aACrD,CAAC,CAAC;YACH,OAAO,yBAAgB,CAAC,eAAe,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9D,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const listAffiliates: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- page: import("@activepieces/pieces-framework").NumberProperty<false>;
3
- limit: import("@activepieces/pieces-framework").NumberProperty<false>;
4
- }>;
5
- //# sourceMappingURL=list-affiliates.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-affiliates.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-affiliates.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc;;;EAsCzB,CAAC"}
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listAffiliates = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- const common_1 = require("../common");
9
- exports.listAffiliates = (0, pieces_framework_1.createAction)({
10
- auth: __1.promotekitAuth,
11
- name: 'list_affiliates',
12
- displayName: 'List Affiliates',
13
- description: 'List all affiliates in your PromoteKit account.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Retrieve a paginated list of affiliates in the PromoteKit account. Use to enumerate or browse affiliates rather than look one up by a known ID. Supports page and per-page limit (max 100); read-only and safe to repeat.',
17
- idempotent: true,
18
- },
19
- props: {
20
- page: pieces_framework_1.Property.Number({
21
- displayName: 'Page',
22
- description: 'Page number to retrieve. Defaults to 1.',
23
- required: false,
24
- defaultValue: 1,
25
- }),
26
- limit: pieces_framework_1.Property.Number({
27
- displayName: 'Limit',
28
- description: 'Number of affiliates per page (max 100). Defaults to 10.',
29
- required: false,
30
- defaultValue: 10,
31
- }),
32
- },
33
- run(context) {
34
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
- var _a, _b;
36
- const response = yield (0, common_1.promotekitApiCall)({
37
- token: context.auth.secret_text,
38
- method: pieces_common_1.HttpMethod.GET,
39
- path: '/affiliates',
40
- queryParams: {
41
- page: String((_a = context.propsValue.page) !== null && _a !== void 0 ? _a : 1),
42
- limit: String((_b = context.propsValue.limit) !== null && _b !== void 0 ? _b : 10),
43
- },
44
- });
45
- return response.body.data.map(common_1.promotekitCommon.flattenAffiliate);
46
- });
47
- },
48
- });
49
- //# sourceMappingURL=list-affiliates.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-affiliates.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-affiliates.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,6BAAuC;AACvC,sCAAgE;AAEnD,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,kBAAc;IACpB,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,iDAAiD;IAC9D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,2NAA2N;QACxO,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,CAAC;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,0DAA0D;YACvE,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,EAAE;SACjB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAErC;gBACD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE;oBACX,IAAI,EAAE,MAAM,CAAC,MAAA,OAAO,CAAC,UAAU,CAAC,IAAI,mCAAI,CAAC,CAAC;oBAC1C,KAAK,EAAE,MAAM,CAAC,MAAA,OAAO,CAAC,UAAU,CAAC,KAAK,mCAAI,EAAE,CAAC;iBAC9C;aACF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,yBAAgB,CAAC,gBAAgB,CAAC,CAAC;QACnE,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,2 +0,0 @@
1
- export declare const listCampaigns: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {}>;
2
- //# sourceMappingURL=list-campaigns.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-campaigns.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-campaigns.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa,yHA2BxB,CAAC"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listCampaigns = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- const common_1 = require("../common");
9
- exports.listCampaigns = (0, pieces_framework_1.createAction)({
10
- auth: __1.promotekitAuth,
11
- name: 'list_campaigns',
12
- displayName: 'List Campaigns',
13
- description: 'List all campaigns in your PromoteKit account.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Retrieve all campaigns (up to 100) in the PromoteKit account, each with its commission type and amount. Use to discover campaign IDs and commission terms, e.g. before assigning an affiliate to a campaign. Read-only and safe to repeat.',
17
- idempotent: true,
18
- },
19
- props: {},
20
- run(context) {
21
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
- const response = yield (0, common_1.promotekitApiCall)({
23
- token: context.auth.secret_text,
24
- method: pieces_common_1.HttpMethod.GET,
25
- path: '/campaigns',
26
- queryParams: { limit: '100' },
27
- });
28
- return response.body.data.map((campaign) => {
29
- var _a, _b;
30
- return ({
31
- id: campaign['id'],
32
- name: campaign['name'],
33
- commission_type: (_a = campaign['commission_type']) !== null && _a !== void 0 ? _a : null,
34
- commission_amount: (_b = campaign['commission_amount']) !== null && _b !== void 0 ? _b : null,
35
- });
36
- });
37
- });
38
- },
39
- });
40
- //# sourceMappingURL=list-campaigns.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-campaigns.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-campaigns.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,+DAAyD;AACzD,6BAAuC;AACvC,sCAA8C;AAEjC,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,kBAAc;IACpB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,gDAAgD;IAC7D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,4OAA4O;QACzP,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE,EAAE;IACH,GAAG,CAAC,OAAO;;YACf,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAErC;gBACD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,YAAY;gBAClB,WAAW,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE;aAC9B,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;;gBAAC,OAAA,CAAC;oBAC3C,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC;oBAClB,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC;oBACtB,eAAe,EAAE,MAAA,QAAQ,CAAC,iBAAiB,CAAC,mCAAI,IAAI;oBACpD,iBAAiB,EAAE,MAAA,QAAQ,CAAC,mBAAmB,CAAC,mCAAI,IAAI;iBACzD,CAAC,CAAA;aAAA,CAAC,CAAC;QACN,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const listCommissions: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- page: import("@activepieces/pieces-framework").NumberProperty<false>;
3
- limit: import("@activepieces/pieces-framework").NumberProperty<false>;
4
- }>;
5
- //# sourceMappingURL=list-commissions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-commissions.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-commissions.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe;;;EAsC1B,CAAC"}
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listCommissions = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- const common_1 = require("../common");
9
- exports.listCommissions = (0, pieces_framework_1.createAction)({
10
- auth: __1.promotekitAuth,
11
- name: 'list_commissions',
12
- displayName: 'List Commissions',
13
- description: 'List all commissions in your PromoteKit account.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Retrieve a paginated list of commissions earned in the PromoteKit account. Use to enumerate or browse commissions rather than look one up by a known ID. Supports page and per-page limit (max 100); read-only and safe to repeat.',
17
- idempotent: true,
18
- },
19
- props: {
20
- page: pieces_framework_1.Property.Number({
21
- displayName: 'Page',
22
- description: 'Page number to retrieve. Defaults to 1.',
23
- required: false,
24
- defaultValue: 1,
25
- }),
26
- limit: pieces_framework_1.Property.Number({
27
- displayName: 'Limit',
28
- description: 'Number of commissions per page (max 100). Defaults to 10.',
29
- required: false,
30
- defaultValue: 10,
31
- }),
32
- },
33
- run(context) {
34
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
- var _a, _b;
36
- const response = yield (0, common_1.promotekitApiCall)({
37
- token: context.auth.secret_text,
38
- method: pieces_common_1.HttpMethod.GET,
39
- path: '/commissions',
40
- queryParams: {
41
- page: String((_a = context.propsValue.page) !== null && _a !== void 0 ? _a : 1),
42
- limit: String((_b = context.propsValue.limit) !== null && _b !== void 0 ? _b : 10),
43
- },
44
- });
45
- return response.body.data.map(common_1.promotekitCommon.flattenCommission);
46
- });
47
- },
48
- });
49
- //# sourceMappingURL=list-commissions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-commissions.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-commissions.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,6BAAuC;AACvC,sCAAgE;AAEnD,QAAA,eAAe,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,kBAAc;IACpB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,kDAAkD;IAC/D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,oOAAoO;QACjP,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,CAAC;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,2DAA2D;YACxE,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,EAAE;SACjB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAErC;gBACD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,cAAc;gBACpB,WAAW,EAAE;oBACX,IAAI,EAAE,MAAM,CAAC,MAAA,OAAO,CAAC,UAAU,CAAC,IAAI,mCAAI,CAAC,CAAC;oBAC1C,KAAK,EAAE,MAAM,CAAC,MAAA,OAAO,CAAC,UAAU,CAAC,KAAK,mCAAI,EAAE,CAAC;iBAC9C;aACF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,yBAAgB,CAAC,iBAAiB,CAAC,CAAC;QACpE,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const listPayouts: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- page: import("@activepieces/pieces-framework").NumberProperty<false>;
3
- limit: import("@activepieces/pieces-framework").NumberProperty<false>;
4
- }>;
5
- //# sourceMappingURL=list-payouts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-payouts.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-payouts.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW;;;EAsCtB,CAAC"}
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listPayouts = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- const common_1 = require("../common");
9
- exports.listPayouts = (0, pieces_framework_1.createAction)({
10
- auth: __1.promotekitAuth,
11
- name: 'list_payouts',
12
- displayName: 'List Payouts',
13
- description: 'List all payouts in your PromoteKit account.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Retrieve a paginated list of payouts to affiliates in the PromoteKit account. Use to enumerate or browse payouts rather than look one up by a known ID. Supports page and per-page limit (max 100); read-only and safe to repeat.',
17
- idempotent: true,
18
- },
19
- props: {
20
- page: pieces_framework_1.Property.Number({
21
- displayName: 'Page',
22
- description: 'Page number to retrieve. Defaults to 1.',
23
- required: false,
24
- defaultValue: 1,
25
- }),
26
- limit: pieces_framework_1.Property.Number({
27
- displayName: 'Limit',
28
- description: 'Number of payouts per page (max 100). Defaults to 10.',
29
- required: false,
30
- defaultValue: 10,
31
- }),
32
- },
33
- run(context) {
34
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
- var _a, _b;
36
- const response = yield (0, common_1.promotekitApiCall)({
37
- token: context.auth.secret_text,
38
- method: pieces_common_1.HttpMethod.GET,
39
- path: '/payouts',
40
- queryParams: {
41
- page: String((_a = context.propsValue.page) !== null && _a !== void 0 ? _a : 1),
42
- limit: String((_b = context.propsValue.limit) !== null && _b !== void 0 ? _b : 10),
43
- },
44
- });
45
- return response.body.data.map(common_1.promotekitCommon.flattenPayout);
46
- });
47
- },
48
- });
49
- //# sourceMappingURL=list-payouts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-payouts.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-payouts.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,+DAAyD;AACzD,6BAAuC;AACvC,sCAAgE;AAEnD,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,kBAAc;IACpB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,8CAA8C;IAC3D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EAAE,mOAAmO;QAChP,UAAU,EAAE,IAAI;KACjB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACpB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,yCAAyC;YACtD,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,CAAC;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,uDAAuD;YACpE,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,EAAE;SACjB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,QAAQ,GAAG,MAAM,IAAA,0BAAiB,EAErC;gBACD,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,WAAW;gBAC/B,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE;oBACX,IAAI,EAAE,MAAM,CAAC,MAAA,OAAO,CAAC,UAAU,CAAC,IAAI,mCAAI,CAAC,CAAC;oBAC1C,KAAK,EAAE,MAAM,CAAC,MAAA,OAAO,CAAC,UAAU,CAAC,KAAK,mCAAI,EAAE,CAAC;iBAC9C;aACF,CAAC,CAAC;YACH,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,yBAAgB,CAAC,aAAa,CAAC,CAAC;QAChE,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const listReferrals: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- page: import("@activepieces/pieces-framework").NumberProperty<false>;
3
- limit: import("@activepieces/pieces-framework").NumberProperty<false>;
4
- }>;
5
- //# sourceMappingURL=list-referrals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-referrals.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-referrals.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,aAAa;;;EAsCxB,CAAC"}
@@ -1,49 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listReferrals = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- const __1 = require("../..");
8
- const common_1 = require("../common");
9
- exports.listReferrals = (0, pieces_framework_1.createAction)({
10
- auth: __1.promotekitAuth,
11
- name: 'list_referrals',
12
- displayName: 'List Referrals',
13
- description: 'List all referrals in your PromoteKit account.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Retrieve a paginated list of referrals (referred customers) in the PromoteKit account. Use to enumerate or browse referrals rather than look one up by a known ID. Supports page and per-page limit (max 100); read-only and safe to repeat.',
17
- idempotent: true,
18
- },
19
- props: {
20
- page: pieces_framework_1.Property.Number({
21
- displayName: 'Page',
22
- description: 'Page number to retrieve. Defaults to 1.',
23
- required: false,
24
- defaultValue: 1,
25
- }),
26
- limit: pieces_framework_1.Property.Number({
27
- displayName: 'Limit',
28
- description: 'Number of referrals per page (max 100). Defaults to 10.',
29
- required: false,
30
- defaultValue: 10,
31
- }),
32
- },
33
- run(context) {
34
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
- var _a, _b;
36
- const response = yield (0, common_1.promotekitApiCall)({
37
- token: context.auth.secret_text,
38
- method: pieces_common_1.HttpMethod.GET,
39
- path: '/referrals',
40
- queryParams: {
41
- page: String((_a = context.propsValue.page) !== null && _a !== void 0 ? _a : 1),
42
- limit: String((_b = context.propsValue.limit) !== null && _b !== void 0 ? _b : 10),
43
- },
44
- });
45
- return response.body.data.map(common_1.promotekitCommon.flattenReferral);
46
- });
47
- },
48
- });
49
- //# sourceMappingURL=list-referrals.js.map