@activepieces/piece-clickfunnels 0.1.4 → 0.1.6

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 (56) hide show
  1. package/package.json +7 -22
  2. package/src/index.js +13 -64
  3. package/README.md +0 -7
  4. package/src/index.d.ts +0 -4
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/apply-tag-to-contact.d.ts +0 -21
  7. package/src/lib/actions/apply-tag-to-contact.js +0 -32
  8. package/src/lib/actions/apply-tag-to-contact.js.map +0 -1
  9. package/src/lib/actions/create-opportunity.d.ts +0 -35
  10. package/src/lib/actions/create-opportunity.js +0 -51
  11. package/src/lib/actions/create-opportunity.js.map +0 -1
  12. package/src/lib/actions/enroll-a-contact-into-a-course.d.ts +0 -21
  13. package/src/lib/actions/enroll-a-contact-into-a-course.js +0 -32
  14. package/src/lib/actions/enroll-a-contact-into-a-course.js.map +0 -1
  15. package/src/lib/actions/remove-tag-from-contact.d.ts +0 -21
  16. package/src/lib/actions/remove-tag-from-contact.js +0 -29
  17. package/src/lib/actions/remove-tag-from-contact.js.map +0 -1
  18. package/src/lib/actions/search-contacts.d.ts +0 -14
  19. package/src/lib/actions/search-contacts.js +0 -30
  20. package/src/lib/actions/search-contacts.js.map +0 -1
  21. package/src/lib/actions/update-or-create-contact.d.ts +0 -22
  22. package/src/lib/actions/update-or-create-contact.js +0 -58
  23. package/src/lib/actions/update-or-create-contact.js.map +0 -1
  24. package/src/lib/common/constants.d.ts +0 -18
  25. package/src/lib/common/constants.js +0 -50
  26. package/src/lib/common/constants.js.map +0 -1
  27. package/src/lib/common/props.d.ts +0 -43
  28. package/src/lib/common/props.js +0 -420
  29. package/src/lib/common/props.js.map +0 -1
  30. package/src/lib/common/requests.d.ts +0 -21
  31. package/src/lib/common/requests.js +0 -179
  32. package/src/lib/common/requests.js.map +0 -1
  33. package/src/lib/triggers/contact-completed-course.d.ts +0 -50
  34. package/src/lib/triggers/contact-completed-course.js +0 -62
  35. package/src/lib/triggers/contact-completed-course.js.map +0 -1
  36. package/src/lib/triggers/contact-identified.d.ts +0 -50
  37. package/src/lib/triggers/contact-identified.js +0 -62
  38. package/src/lib/triggers/contact-identified.js.map +0 -1
  39. package/src/lib/triggers/contact-submitted-form.d.ts +0 -50
  40. package/src/lib/triggers/contact-submitted-form.js +0 -62
  41. package/src/lib/triggers/contact-submitted-form.js.map +0 -1
  42. package/src/lib/triggers/contact-suspended-from-course.d.ts +0 -50
  43. package/src/lib/triggers/contact-suspended-from-course.js +0 -62
  44. package/src/lib/triggers/contact-suspended-from-course.js.map +0 -1
  45. package/src/lib/triggers/course-enrollment-created-for-contact.d.ts +0 -50
  46. package/src/lib/triggers/course-enrollment-created-for-contact.js +0 -62
  47. package/src/lib/triggers/course-enrollment-created-for-contact.js.map +0 -1
  48. package/src/lib/triggers/one-time-order-paid.d.ts +0 -50
  49. package/src/lib/triggers/one-time-order-paid.js +0 -62
  50. package/src/lib/triggers/one-time-order-paid.js.map +0 -1
  51. package/src/lib/triggers/scheduled-appointment-event-created.d.ts +0 -50
  52. package/src/lib/triggers/scheduled-appointment-event-created.js +0 -62
  53. package/src/lib/triggers/scheduled-appointment-event-created.js.map +0 -1
  54. package/src/lib/triggers/subscription-invoice-paid.d.ts +0 -50
  55. package/src/lib/triggers/subscription-invoice-paid.js +0 -62
  56. package/src/lib/triggers/subscription-invoice-paid.js.map +0 -1
@@ -1,50 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const oneTimeOrderPaid: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- }>, {
6
- teamId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
7
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
9
- }>>;
10
- workspaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
11
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
12
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
13
- }>>;
14
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
15
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
16
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
17
- }>, {
18
- teamId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
19
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
20
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
21
- }>>;
22
- workspaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
23
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
24
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
25
- }>>;
26
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
27
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
28
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
29
- }>, {
30
- teamId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
31
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
32
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
33
- }>>;
34
- workspaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
35
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
36
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
37
- }>>;
38
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
39
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
40
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
41
- }>, {
42
- teamId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
43
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
44
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
45
- }>>;
46
- workspaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
47
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
48
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
49
- }>>;
50
- }>;
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.oneTimeOrderPaid = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const constants_1 = require("../common/constants");
7
- const props_1 = require("../common/props");
8
- const requests_1 = require("../common/requests");
9
- const CACHE_KEY = 'clickfunnels_onetime_order_paid_trigger';
10
- const MODULE_NAME = 'One-Time Order Paid';
11
- exports.oneTimeOrderPaid = (0, pieces_framework_1.createTrigger)({
12
- auth: constants_1.clickfunnelsAuth,
13
- name: 'OneTimeOrderPaid',
14
- displayName: MODULE_NAME,
15
- description: 'Triggers when a customer pays a one-time order.',
16
- props: {
17
- teamId: (0, props_1.teamsDropdown)(['auth']),
18
- workspaceId: (0, props_1.workspacesDropdown)(['auth', 'teamId']),
19
- },
20
- sampleData: {},
21
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
22
- onEnable(_a) {
23
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, webhookUrl, propsValue: { workspaceId }, store }) {
24
- if (!workspaceId) {
25
- throw new Error('Workspace ID is required. Please select a workspace.');
26
- }
27
- try {
28
- const response = yield requests_1.clickfunnelsApiService.createWebhook(auth.props, workspaceId, {
29
- webhooks_outgoing_endpoint: {
30
- url: webhookUrl,
31
- name: `ActivePieces ${MODULE_NAME} Webhook - ${Date.now()}`,
32
- event_type_ids: ['one-time-order.completed'],
33
- },
34
- });
35
- const webhookId = response.id;
36
- yield store.put(CACHE_KEY, { webhookId });
37
- }
38
- catch (error) {
39
- console.error('Failed to create ClickFunnels webhook:', error);
40
- throw new Error(`Failed to create webhook: ${error instanceof Error ? error.message : 'Unknown error'}`);
41
- }
42
- });
43
- },
44
- onDisable(_a) {
45
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, store }) {
46
- const cachedData = (yield store.get(CACHE_KEY));
47
- if (cachedData) {
48
- yield requests_1.clickfunnelsApiService
49
- .deleteWebhook(auth.props, cachedData.webhookId)
50
- .then(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
51
- yield store.delete(CACHE_KEY);
52
- }));
53
- }
54
- });
55
- },
56
- run(context) {
57
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
58
- return [context.payload.body];
59
- });
60
- },
61
- });
62
- //# sourceMappingURL=one-time-order-paid.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"one-time-order-paid.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/clickfunnels/src/lib/triggers/one-time-order-paid.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,mDAAuD;AACvD,2CAAoE;AACpE,iDAA4D;AAE5D,MAAM,SAAS,GAAG,yCAAyC,CAAC;AAC5D,MAAM,WAAW,GAAG,qBAAqB,CAAC;AAE7B,QAAA,gBAAgB,GAAG,IAAA,gCAAa,EAAC;IAC5C,IAAI,EAAE,4BAAgB;IACtB,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,WAAW;IACxB,W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GAAG,CAAC,SAAS,CAAC,CAAQ,CAAC;YAEvD,IAAI,UAAU,EAAE,CAAC;gBACf,MAAM,iCAAsB;qBACzB,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC;qBAC/C,IAAI,CAAC,GAAS,EAAE;oBACf,MAAM,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;gBAChC,CAAC,CAAA,CAAC,CAAC;YACP,CAAC;QACH,CAAC;KAAA;IACK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,50 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const scheduledAppointmentEventCreated: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- }>, {
6
- teamId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
7
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
9
- }>>;
10
- workspaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
11
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
12
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
13
- }>>;
14
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
15
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
16
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
17
- }>, {
18
- teamId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
19
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
20
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
21
- }>>;
22
- workspaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
23
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
24
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
25
- }>>;
26
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
27
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
28
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
29
- }>, {
30
- teamId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
31
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
32
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
33
- }>>;
34
- workspaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
35
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
36
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
37
- }>>;
38
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
39
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
40
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
41
- }>, {
42
- teamId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
43
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
44
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
45
- }>>;
46
- workspaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
47
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
48
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
49
- }>>;
50
- }>;
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.scheduledAppointmentEventCreated = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const constants_1 = require("../common/constants");
7
- const props_1 = require("../common/props");
8
- const requests_1 = require("../common/requests");
9
- const CACHE_KEY = 'clickfunnels_scheduled_appointment_event_created_trigger';
10
- const MODULE_NAME = 'Scheduled Appointment Event';
11
- exports.scheduledAppointmentEventCreated = (0, pieces_framework_1.createTrigger)({
12
- auth: constants_1.clickfunnelsAuth,
13
- name: 'scheduledAppointmentEventCreated',
14
- displayName: `${MODULE_NAME} Created`,
15
- description: 'Triggers when a scheduled appointment event is created.',
16
- props: {
17
- teamId: (0, props_1.teamsDropdown)(['auth']),
18
- workspaceId: (0, props_1.workspacesDropdown)(['auth', 'teamId']),
19
- },
20
- sampleData: {},
21
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
22
- onEnable(_a) {
23
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, webhookUrl, propsValue: { workspaceId }, store }) {
24
- if (!workspaceId) {
25
- throw new Error('Workspace ID is required. Please select a workspace.');
26
- }
27
- try {
28
- const response = yield requests_1.clickfunnelsApiService.createWebhook(auth.props, workspaceId, {
29
- webhooks_outgoing_endpoint: {
30
- url: webhookUrl,
31
- name: `ActivePieces ${MODULE_NAME} Webhook - ${Date.now()}`,
32
- event_type_ids: ['appointments/scheduled_event.created'],
33
- },
34
- });
35
- const webhookId = response.id;
36
- yield store.put(CACHE_KEY, { webhookId });
37
- }
38
- catch (error) {
39
- console.error('Failed to create ClickFunnels webhook:', error);
40
- throw new Error(`Failed to create webhook: ${error instanceof Error ? error.message : 'Unknown error'}`);
41
- }
42
- });
43
- },
44
- onDisable(_a) {
45
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, store }) {
46
- const cachedData = (yield store.get(CACHE_KEY));
47
- if (cachedData) {
48
- yield requests_1.clickfunnelsApiService
49
- .deleteWebhook(auth.props, cachedData.webhookId)
50
- .then(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
51
- yield store.delete(CACHE_KEY);
52
- }));
53
- }
54
- });
55
- },
56
- run(context) {
57
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
58
- return [context.payload.body];
59
- });
60
- },
61
- });
62
- //# sourceMappingURL=scheduled-appointment-event-created.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scheduled-appointment-event-created.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/clickfunnels/src/lib/triggers/scheduled-appointment-event-created.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,mDAAuD;AACvD,2CAAoE;AACpE,iDAA4D;AAE5D,MAAM,SAAS,GAAG,0DAA0D,CAAC;AAC7E,MAAM,WAAW,GAAG,6BAA6B,CAAC;AAErC,QAAA,gCAAgC,GAAG,IAAA,gCAAa,EAAC;IAC5D,IAAI,EAAE,4BAAgB;IACtB,IAAI,EAAE,kCAAkC;IACxC,WAAW,EAAE,GAAG,WAAW,UAAU;IACrC,WAAW,EAAE,yDAAyD;IACtE,KAAK,EAAE;QACL,MAAM,EAAE,IAAA,qBAAa,EAAC,CAAC,MAAM,CAAC,CAAC;QAC/B,WAAW,EAAE,IAAA,0BAAkB,EAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KACpD;IACD,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE;YACrE,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,MAAM,IAAI,KAA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AA;CACF,CAAC,CAAC"}
@@ -1,50 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const subscriptionInvoicePaid: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
3
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- }>, {
6
- teamId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
7
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
8
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
9
- }>>;
10
- workspaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
11
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
12
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
13
- }>>;
14
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
15
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
16
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
17
- }>, {
18
- teamId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
19
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
20
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
21
- }>>;
22
- workspaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
23
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
24
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
25
- }>>;
26
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, import("@activepieces/pieces-framework").CustomAuthProperty<{
27
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
28
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
29
- }>, {
30
- teamId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
31
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
32
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
33
- }>>;
34
- workspaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
35
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
36
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
37
- }>>;
38
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
39
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
40
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
41
- }>, {
42
- teamId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
43
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
44
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
45
- }>>;
46
- workspaceId: import("@activepieces/pieces-framework").DropdownProperty<unknown, true, import("@activepieces/pieces-framework").CustomAuthProperty<{
47
- subdomain: import("@activepieces/pieces-framework").ShortTextProperty<true>;
48
- apiKey: import("@activepieces/pieces-framework").SecretTextProperty<true>;
49
- }>>;
50
- }>;
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.subscriptionInvoicePaid = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const constants_1 = require("../common/constants");
7
- const props_1 = require("../common/props");
8
- const requests_1 = require("../common/requests");
9
- const CACHE_KEY = 'clickfunnels_subscription_invoice_paid_trigger';
10
- const MODULE_NAME = 'Subscription Invoice Paid';
11
- exports.subscriptionInvoicePaid = (0, pieces_framework_1.createTrigger)({
12
- auth: constants_1.clickfunnelsAuth,
13
- name: 'subscriptionInvoicePaid',
14
- displayName: MODULE_NAME,
15
- description: 'Triggers when a subscription invoice is paid.',
16
- props: {
17
- teamId: (0, props_1.teamsDropdown)(['auth']),
18
- workspaceId: (0, props_1.workspacesDropdown)(['auth', 'teamId']),
19
- },
20
- sampleData: {},
21
- type: pieces_framework_1.TriggerStrategy.WEBHOOK,
22
- onEnable(_a) {
23
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, webhookUrl, propsValue: { workspaceId }, store }) {
24
- if (!workspaceId) {
25
- throw new Error('Workspace ID is required. Please select a workspace.');
26
- }
27
- try {
28
- const response = yield requests_1.clickfunnelsApiService.createWebhook(auth.props, workspaceId, {
29
- webhooks_outgoing_endpoint: {
30
- url: webhookUrl,
31
- name: `ActivePieces ${MODULE_NAME} Webhook - ${Date.now()}`,
32
- event_type_ids: ['subscription.invoice.paid'],
33
- },
34
- });
35
- const webhookId = response.id;
36
- yield store.put(CACHE_KEY, { webhookId });
37
- }
38
- catch (error) {
39
- console.error('Failed to create ClickFunnels webhook:', error);
40
- throw new Error(`Failed to create webhook: ${error instanceof Error ? error.message : 'Unknown error'}`);
41
- }
42
- });
43
- },
44
- onDisable(_a) {
45
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, store }) {
46
- const cachedData = (yield store.get(CACHE_KEY));
47
- if (cachedData) {
48
- yield requests_1.clickfunnelsApiService
49
- .deleteWebhook(auth.props, cachedData.webhookId)
50
- .then(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
51
- yield store.delete(CACHE_KEY);
52
- }));
53
- }
54
- });
55
- },
56
- run(context) {
57
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
58
- return [context.payload.body];
59
- });
60
- },
61
- });
62
- //# sourceMappingURL=subscription-invoice-paid.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscription-invoice-paid.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/clickfunnels/src/lib/triggers/subscription-invoice-paid.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,mDAAuD;AACvD,2CAAoE;AACpE,iDAA4D;AAE5D,MAAM,SAAS,GAAG,gDAAgD,CAAC;AACnE,MAAM,WAAW,GAAG,2BAA2B,CAAC;AAEnC,QAAA,uBAAuB,GAAG,IAAA,gCAAa,EAAC;IACnD,IAAI,EAAE,4BAAgB;IACtB,IAAI,EAAE,yBAAyB;IAC/B,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,+CAA+C;IAC5D,KAAK,EAAE;QACL,MAAM,EAAE,IAAA,qBAAa,EAAC,CAAC,MAAM,CAAC,CAAC;QAC/B,WAAW,EAAE,IAAA,0BAAkB,EAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KACpD;IACD,UAAU,EAAE,EAAE;IACd,IAAI,EAAE,kCAAe,CAAC,OAAO;IACvB,QAAQ;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE;YACrE,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;YAC1E,CAAC;YAED,IAAI,CAAC;gBACH,MAAM,QAAQ,GAAQ,MAAM,iCAAsB,CAAC,aAAa,CAC9D,IAAI,CAAC,KAAK,EACV,WAAqB,EACrB;oBACE,0BAA0B,EAAE;wBAC1B,GAAG,EAAE,UAAU;wBACf,IAAI,EAAE,gBAAgB,WAAW,cAAc,IAAI,CAAC,GAAG,EAAE,EAAE;wBAC3D,cAAc,EAAE,CAAC,2BAA2B,CAAC;qBAC9C;iBACF,CACF,CAAC;gBAEF,MAAM,SAAS,GAAG,QAAQ,CAAC,EAAE,CAAC;gBAE9B,MAAM,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,EA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