@activepieces/piece-clickfunnels 0.1.5 → 0.1.7
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.
- package/package.json +7 -12
- package/src/index.js +13 -64
- package/src/index.d.ts +0 -5
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/apply-tag-to-contact.d.ts +0 -22
- package/src/lib/actions/apply-tag-to-contact.d.ts.map +0 -1
- package/src/lib/actions/apply-tag-to-contact.js +0 -37
- package/src/lib/actions/apply-tag-to-contact.js.map +0 -1
- package/src/lib/actions/create-opportunity.d.ts +0 -36
- package/src/lib/actions/create-opportunity.d.ts.map +0 -1
- package/src/lib/actions/create-opportunity.js +0 -56
- package/src/lib/actions/create-opportunity.js.map +0 -1
- package/src/lib/actions/enroll-a-contact-into-a-course.d.ts +0 -22
- package/src/lib/actions/enroll-a-contact-into-a-course.d.ts.map +0 -1
- package/src/lib/actions/enroll-a-contact-into-a-course.js +0 -37
- package/src/lib/actions/enroll-a-contact-into-a-course.js.map +0 -1
- package/src/lib/actions/remove-tag-from-contact.d.ts +0 -22
- package/src/lib/actions/remove-tag-from-contact.d.ts.map +0 -1
- package/src/lib/actions/remove-tag-from-contact.js +0 -34
- package/src/lib/actions/remove-tag-from-contact.js.map +0 -1
- package/src/lib/actions/search-contacts.d.ts +0 -15
- package/src/lib/actions/search-contacts.d.ts.map +0 -1
- package/src/lib/actions/search-contacts.js +0 -35
- package/src/lib/actions/search-contacts.js.map +0 -1
- package/src/lib/actions/update-or-create-contact.d.ts +0 -23
- package/src/lib/actions/update-or-create-contact.d.ts.map +0 -1
- package/src/lib/actions/update-or-create-contact.js +0 -63
- package/src/lib/actions/update-or-create-contact.js.map +0 -1
- package/src/lib/common/constants.d.ts +0 -19
- package/src/lib/common/constants.d.ts.map +0 -1
- package/src/lib/common/constants.js +0 -50
- package/src/lib/common/constants.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -44
- package/src/lib/common/props.d.ts.map +0 -1
- package/src/lib/common/props.js +0 -420
- package/src/lib/common/props.js.map +0 -1
- package/src/lib/common/requests.d.ts +0 -22
- package/src/lib/common/requests.d.ts.map +0 -1
- package/src/lib/common/requests.js +0 -179
- package/src/lib/common/requests.js.map +0 -1
- package/src/lib/triggers/contact-completed-course.d.ts +0 -51
- package/src/lib/triggers/contact-completed-course.d.ts.map +0 -1
- package/src/lib/triggers/contact-completed-course.js +0 -65
- package/src/lib/triggers/contact-completed-course.js.map +0 -1
- package/src/lib/triggers/contact-identified.d.ts +0 -51
- package/src/lib/triggers/contact-identified.d.ts.map +0 -1
- package/src/lib/triggers/contact-identified.js +0 -65
- package/src/lib/triggers/contact-identified.js.map +0 -1
- package/src/lib/triggers/contact-submitted-form.d.ts +0 -51
- package/src/lib/triggers/contact-submitted-form.d.ts.map +0 -1
- package/src/lib/triggers/contact-submitted-form.js +0 -65
- package/src/lib/triggers/contact-submitted-form.js.map +0 -1
- package/src/lib/triggers/contact-suspended-from-course.d.ts +0 -51
- package/src/lib/triggers/contact-suspended-from-course.d.ts.map +0 -1
- package/src/lib/triggers/contact-suspended-from-course.js +0 -65
- package/src/lib/triggers/contact-suspended-from-course.js.map +0 -1
- package/src/lib/triggers/course-enrollment-created-for-contact.d.ts +0 -51
- package/src/lib/triggers/course-enrollment-created-for-contact.d.ts.map +0 -1
- package/src/lib/triggers/course-enrollment-created-for-contact.js +0 -65
- package/src/lib/triggers/course-enrollment-created-for-contact.js.map +0 -1
- package/src/lib/triggers/one-time-order-paid.d.ts +0 -51
- package/src/lib/triggers/one-time-order-paid.d.ts.map +0 -1
- package/src/lib/triggers/one-time-order-paid.js +0 -65
- package/src/lib/triggers/one-time-order-paid.js.map +0 -1
- package/src/lib/triggers/scheduled-appointment-event-created.d.ts +0 -51
- package/src/lib/triggers/scheduled-appointment-event-created.d.ts.map +0 -1
- package/src/lib/triggers/scheduled-appointment-event-created.js +0 -65
- package/src/lib/triggers/scheduled-appointment-event-created.js.map +0 -1
- package/src/lib/triggers/subscription-invoice-paid.d.ts +0 -51
- package/src/lib/triggers/subscription-invoice-paid.d.ts.map +0 -1
- package/src/lib/triggers/subscription-invoice-paid.js +0 -65
- package/src/lib/triggers/subscription-invoice-paid.js.map +0 -1
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const contactCompletedCourse: 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
|
-
}>;
|
|
51
|
-
//# sourceMappingURL=contact-completed-course.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contact-completed-course.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/contact-completed-course.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAQhF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DjC,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.contactCompletedCourse = 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_contact_completed_course_trigger';
|
|
10
|
-
const MODULE_NAME = 'Contact Completed Course';
|
|
11
|
-
exports.contactCompletedCourse = (0, pieces_framework_1.createTrigger)({
|
|
12
|
-
auth: constants_1.clickfunnelsAuth,
|
|
13
|
-
name: 'contactCompletedCourse',
|
|
14
|
-
displayName: MODULE_NAME,
|
|
15
|
-
description: 'Triggers when a contact completes a course.',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Fires when a contact completes a course in the selected ClickFunnels workspace, representing the enrollment reaching completed status. Delivers the enrollment payload.',
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
teamId: (0, props_1.teamsDropdown)(['auth']),
|
|
21
|
-
workspaceId: (0, props_1.workspacesDropdown)(['auth', 'teamId']),
|
|
22
|
-
},
|
|
23
|
-
sampleData: {},
|
|
24
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
25
|
-
onEnable(_a) {
|
|
26
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, webhookUrl, propsValue: { workspaceId }, store }) {
|
|
27
|
-
if (!workspaceId) {
|
|
28
|
-
throw new Error('Workspace ID is required. Please select a workspace.');
|
|
29
|
-
}
|
|
30
|
-
try {
|
|
31
|
-
const response = yield requests_1.clickfunnelsApiService.createWebhook(auth.props, workspaceId, {
|
|
32
|
-
webhooks_outgoing_endpoint: {
|
|
33
|
-
url: webhookUrl,
|
|
34
|
-
name: `ActivePieces ${MODULE_NAME} Webhook - ${Date.now()}`,
|
|
35
|
-
event_type_ids: ['courses/enrollment.course_completed'],
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
const webhookId = response.id;
|
|
39
|
-
yield store.put(CACHE_KEY, { webhookId });
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
console.error('Failed to create ClickFunnels webhook:', error);
|
|
43
|
-
throw new Error(`Failed to create webhook: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
onDisable(_a) {
|
|
48
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, store }) {
|
|
49
|
-
const cachedData = (yield store.get(CACHE_KEY));
|
|
50
|
-
if (cachedData) {
|
|
51
|
-
yield requests_1.clickfunnelsApiService
|
|
52
|
-
.deleteWebhook(auth.props, cachedData.webhookId)
|
|
53
|
-
.then(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
yield store.delete(CACHE_KEY);
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
run(context) {
|
|
60
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
return [context.payload.body];
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
//# sourceMappingURL=contact-completed-course.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contact-completed-course.js","sourceRoot":"","sources":["../../../../src/lib/triggers/contact-completed-course.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,mDAAuD;AACvD,2CAAoE;AACpE,iDAA4D;AAE5D,MAAM,SAAS,GAAG,+CAA+C,CAAC;AAClE,MAAM,WAAW,GAAG,0BAA0B,CAAC;AAElC,QAAA,sBAAsB,GAAG,IAAA,gCAAa,EAAC;IAClD,IAAI,EAAE,4BAAgB;IACtB,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,6CAA6C;IAC1D,UAAU,EAAE;QACV,WAAW,EACT,yKAAyK;KAC5K;IACD,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,qCAAqC,CAAC;qBACxD;iBACF,CACF,CAAC;gBAEF,MAAM,SAAS,GAAG,QAAQ,CAAC,EAAE,CAAC;gBAE9B,MAAM,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;YAC5C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;gBAC/D,MAAM,IAAI,KAAK,CACb,6BACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAC3C,EAAE,CACH,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;IACK,SAAS;qEAAC,EAAE,IAAI,EAAE,KAAK,EAAE;YAC7B,MAAM,UAAU,GAAG,CAAC,MAAM,KAAK,CAAC,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,51 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const contactIdentified: 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
|
-
}>;
|
|
51
|
-
//# sourceMappingURL=contact-identified.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contact-identified.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/contact-identified.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAQhF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2D5B,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.contactIdentified = 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_contact_identified_trigger';
|
|
10
|
-
const MODULE_NAME = 'Contact Identified';
|
|
11
|
-
exports.contactIdentified = (0, pieces_framework_1.createTrigger)({
|
|
12
|
-
auth: constants_1.clickfunnelsAuth,
|
|
13
|
-
name: 'contactIdentified',
|
|
14
|
-
displayName: MODULE_NAME,
|
|
15
|
-
description: 'Triggers when a new contact is identified by email/phone.',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Fires when a contact is identified (by email or phone) in the selected ClickFunnels workspace, representing a visitor becoming a known contact. Delivers the contact payload.',
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
teamId: (0, props_1.teamsDropdown)(['auth']),
|
|
21
|
-
workspaceId: (0, props_1.workspacesDropdown)(['auth', 'teamId']),
|
|
22
|
-
},
|
|
23
|
-
sampleData: {},
|
|
24
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
25
|
-
onEnable(_a) {
|
|
26
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, webhookUrl, propsValue: { workspaceId }, store }) {
|
|
27
|
-
if (!workspaceId) {
|
|
28
|
-
throw new Error('Workspace ID is required. Please select a workspace.');
|
|
29
|
-
}
|
|
30
|
-
try {
|
|
31
|
-
const response = yield requests_1.clickfunnelsApiService.createWebhook(auth.props, workspaceId, {
|
|
32
|
-
webhooks_outgoing_endpoint: {
|
|
33
|
-
url: webhookUrl,
|
|
34
|
-
name: `ActivePieces ${MODULE_NAME} Webhook - ${Date.now()}`,
|
|
35
|
-
event_type_ids: ['contact.identified'],
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
const webhookId = response.id;
|
|
39
|
-
yield store.put(CACHE_KEY, { webhookId });
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
console.error('Failed to create ClickFunnels webhook:', error);
|
|
43
|
-
throw new Error(`Failed to create webhook: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
onDisable(_a) {
|
|
48
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, store }) {
|
|
49
|
-
const cachedData = (yield store.get(CACHE_KEY));
|
|
50
|
-
if (cachedData) {
|
|
51
|
-
yield requests_1.clickfunnelsApiService
|
|
52
|
-
.deleteWebhook(auth.props, cachedData.webhookId)
|
|
53
|
-
.then(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
yield store.delete(CACHE_KEY);
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
run(context) {
|
|
60
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
return [context.payload.body];
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
//# sourceMappingURL=contact-identified.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contact-identified.js","sourceRoot":"","sources":["../../../../src/lib/triggers/contact-identified.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,mDAAuD;AACvD,2CAAoE;AACpE,iDAA4D;AAE5D,MAAM,SAAS,GAAG,yCAAyC,CAAC;AAC5D,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAE5B,QAAA,iBAAiB,GAAG,IAAA,gCAAa,EAAC;IAC7C,IAAI,EAAE,4BAAgB;IACtB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,2DAA2D;IACxE,UAAU,EAAE;QACV,WAAW,EACT,+KAA+K;KAClL;IACD,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,oBAAoB,CAAC;qBACvC;iBACF,CACF,CAAC;gBAEF,MAAM,SAAS,GAAG,QAAQ,CAAC,EAAE,CAAC;gBAE9B,MAAM,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;YAC5C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;gBAC/D,MAAM,IAAI,KAAK,CACb,6BACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAC3C,EAAE,CACH,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;IACK,SAAS;qEAAC,EAAE,IAAI,EAAE,KAAK,EAAE;YAC7B,MAAM,UAAU,GAAG,CAAC,MAAM,KAAK,CAAC,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,51 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const contactSubmittedForm: 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
|
-
}>;
|
|
51
|
-
//# sourceMappingURL=contact-submitted-form.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contact-submitted-form.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/contact-submitted-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAQhF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2D/B,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.contactSubmittedForm = 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_contact_submitted_form_trigger';
|
|
10
|
-
const MODULE_NAME = 'Contact Submitted Form';
|
|
11
|
-
exports.contactSubmittedForm = (0, pieces_framework_1.createTrigger)({
|
|
12
|
-
auth: constants_1.clickfunnelsAuth,
|
|
13
|
-
name: 'contactSubmittedForm',
|
|
14
|
-
displayName: MODULE_NAME,
|
|
15
|
-
description: 'Triggers each time a contact submits a form (opt-in or order).',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Fires each time a contact submits a form (such as an opt-in or order form) in the selected ClickFunnels workspace. Delivers the form submission payload.',
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
teamId: (0, props_1.teamsDropdown)(['auth']),
|
|
21
|
-
workspaceId: (0, props_1.workspacesDropdown)(['auth', 'teamId']),
|
|
22
|
-
},
|
|
23
|
-
sampleData: {},
|
|
24
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
25
|
-
onEnable(_a) {
|
|
26
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, webhookUrl, propsValue: { workspaceId }, store }) {
|
|
27
|
-
if (!workspaceId) {
|
|
28
|
-
throw new Error('Workspace ID is required. Please select a workspace.');
|
|
29
|
-
}
|
|
30
|
-
try {
|
|
31
|
-
const response = yield requests_1.clickfunnelsApiService.createWebhook(auth.props, workspaceId, {
|
|
32
|
-
webhooks_outgoing_endpoint: {
|
|
33
|
-
url: webhookUrl,
|
|
34
|
-
name: `ActivePieces ${MODULE_NAME} Webhook - ${Date.now()}`,
|
|
35
|
-
event_type_ids: ['form_submission.created'],
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
const webhookId = response.id;
|
|
39
|
-
yield store.put(CACHE_KEY, { webhookId });
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
console.error('Failed to create ClickFunnels webhook:', error);
|
|
43
|
-
throw new Error(`Failed to create webhook: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
onDisable(_a) {
|
|
48
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, store }) {
|
|
49
|
-
const cachedData = (yield store.get(CACHE_KEY));
|
|
50
|
-
if (cachedData) {
|
|
51
|
-
yield requests_1.clickfunnelsApiService
|
|
52
|
-
.deleteWebhook(auth.props, cachedData.webhookId)
|
|
53
|
-
.then(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
yield store.delete(CACHE_KEY);
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
run(context) {
|
|
60
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
return [context.payload.body];
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
//# sourceMappingURL=contact-submitted-form.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contact-submitted-form.js","sourceRoot":"","sources":["../../../../src/lib/triggers/contact-submitted-form.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,mDAAuD;AACvD,2CAAoE;AACpE,iDAA4D;AAE5D,MAAM,SAAS,GAAG,6CAA6C,CAAC;AAChE,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAEhC,QAAA,oBAAoB,GAAG,IAAA,gCAAa,EAAC;IAChD,IAAI,EAAE,4BAAgB;IACtB,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,gEAAgE;IAC7E,UAAU,EAAE;QACV,WAAW,EACT,0JAA0J;KAC7J;IACD,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,yBAAyB,CAAC;qBAC5C;iBACF,CACF,CAAC;gBAEF,MAAM,SAAS,GAAG,QAAQ,CAAC,EAAE,CAAC;gBAE9B,MAAM,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;YAC5C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;gBAC/D,MAAM,IAAI,KAAK,CACb,6BACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAC3C,EAAE,CACH,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;IACK,SAAS;qEAAC,EAAE,IAAI,EAAE,KAAK,EAAE;YAC7B,MAAM,UAAU,GAAG,CAAC,MAAM,KAAK,CAAC,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,51 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const contactSuspendedFromCourse: 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
|
-
}>;
|
|
51
|
-
//# sourceMappingURL=contact-suspended-from-course.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contact-suspended-from-course.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/contact-suspended-from-course.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAQhF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DrC,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.contactSuspendedFromCourse = 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_contact_suspended_from_course_trigger';
|
|
10
|
-
const MODULE_NAME = 'Contact Suspended';
|
|
11
|
-
exports.contactSuspendedFromCourse = (0, pieces_framework_1.createTrigger)({
|
|
12
|
-
auth: constants_1.clickfunnelsAuth,
|
|
13
|
-
name: 'contactSuspendedFromCourse',
|
|
14
|
-
displayName: `${MODULE_NAME} From Course`,
|
|
15
|
-
description: 'Triggers when a contact is suspended from a course.',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Fires when a contact is suspended from a course in the selected ClickFunnels workspace, representing the enrollment being revoked or paused. Delivers the enrollment payload.',
|
|
18
|
-
},
|
|
19
|
-
props: {
|
|
20
|
-
teamId: (0, props_1.teamsDropdown)(['auth']),
|
|
21
|
-
workspaceId: (0, props_1.workspacesDropdown)(['auth', 'teamId']),
|
|
22
|
-
},
|
|
23
|
-
sampleData: {},
|
|
24
|
-
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
25
|
-
onEnable(_a) {
|
|
26
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, webhookUrl, propsValue: { workspaceId }, store }) {
|
|
27
|
-
if (!workspaceId) {
|
|
28
|
-
throw new Error('Workspace ID is required. Please select a workspace.');
|
|
29
|
-
}
|
|
30
|
-
try {
|
|
31
|
-
const response = yield requests_1.clickfunnelsApiService.createWebhook(auth.props, workspaceId, {
|
|
32
|
-
webhooks_outgoing_endpoint: {
|
|
33
|
-
url: webhookUrl,
|
|
34
|
-
name: `ActivePieces ${MODULE_NAME} Webhook - ${Date.now()}`,
|
|
35
|
-
event_type_ids: ['courses/enrollment.suspended'],
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
const webhookId = response.id;
|
|
39
|
-
yield store.put(CACHE_KEY, { webhookId });
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
console.error('Failed to create ClickFunnels webhook:', error);
|
|
43
|
-
throw new Error(`Failed to create webhook: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
},
|
|
47
|
-
onDisable(_a) {
|
|
48
|
-
return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, store }) {
|
|
49
|
-
const cachedData = (yield store.get(CACHE_KEY));
|
|
50
|
-
if (cachedData) {
|
|
51
|
-
yield requests_1.clickfunnelsApiService
|
|
52
|
-
.deleteWebhook(auth.props, cachedData.webhookId)
|
|
53
|
-
.then(() => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
yield store.delete(CACHE_KEY);
|
|
55
|
-
}));
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
},
|
|
59
|
-
run(context) {
|
|
60
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
return [context.payload.body];
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
});
|
|
65
|
-
//# sourceMappingURL=contact-suspended-from-course.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"contact-suspended-from-course.js","sourceRoot":"","sources":["../../../../src/lib/triggers/contact-suspended-from-course.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,mDAAuD;AACvD,2CAAoE;AACpE,iDAA4D;AAE5D,MAAM,SAAS,GAAG,oDAAoD,CAAC;AACvE,MAAM,WAAW,GAAG,mBAAmB,CAAC;AAE3B,QAAA,0BAA0B,GAAG,IAAA,gCAAa,EAAC;IACtD,IAAI,EAAE,4BAAgB;IACtB,IAAI,EAAE,4BAA4B;IAClC,WAAW,EAAE,GAAG,WAAW,cAAc;IACzC,WAAW,EAAE,qDAAqD;IAClE,UAAU,EAAE;QACV,WAAW,EACT,+KAA+K;KAClL;IACD,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,8BAA8B,CAAC;qBACjD;iBACF,CACF,CAAC;gBAEF,MAAM,SAAS,GAAG,QAAQ,CAAC,EAAE,CAAC;gBAE9B,MAAM,KAAK,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,SAAS,EAAE,CAAC,CAAC;YAC5C,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,wCAAwC,EAAE,KAAK,CAAC,CAAC;gBAC/D,MAAM,IAAI,KAAK,CACb,6BACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAC3C,EAAE,CACH,CAAC;YACJ,CAAC;QACH,CAAC;KAAA;IACK,SAAS;qEAAC,EAAE,IAAI,EAAE,KAAK,EAAE;YAC7B,MAAM,UAAU,GAAG,CAAC,MAAM,KAAK,CAAC,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,51 +0,0 @@
|
|
|
1
|
-
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
export declare const courseEnrollmentCreatedForContact: 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
|
-
}>;
|
|
51
|
-
//# sourceMappingURL=course-enrollment-created-for-contact.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"course-enrollment-created-for-contact.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/course-enrollment-created-for-contact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAQhF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2D5C,CAAC"}
|