@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,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.courseEnrollmentCreatedForContact = 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_course_enrollment_created_for_contact_trigger';
|
|
10
|
-
const MODULE_NAME = 'Course Enrollment Created';
|
|
11
|
-
exports.courseEnrollmentCreatedForContact = (0, pieces_framework_1.createTrigger)({
|
|
12
|
-
auth: constants_1.clickfunnelsAuth,
|
|
13
|
-
name: 'courseEnrollmentCreatedForContact',
|
|
14
|
-
displayName: `${MODULE_NAME} for contact`,
|
|
15
|
-
description: 'Triggers when a course enrollment is created for a contact.',
|
|
16
|
-
aiMetadata: {
|
|
17
|
-
description: 'Fires when a contact is enrolled into a course in the selected ClickFunnels workspace, representing newly granted course access. Delivers the course 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.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=course-enrollment-created-for-contact.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"course-enrollment-created-for-contact.js","sourceRoot":"","sources":["../../../../src/lib/triggers/course-enrollment-created-for-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,mDA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,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 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
|
-
}>;
|
|
51
|
-
//# sourceMappingURL=one-time-order-paid.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"one-time-order-paid.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/one-time-order-paid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAQhF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2D3B,CAAC"}
|
|
@@ -1,65 +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
|
-
aiMetadata: {
|
|
17
|
-
description: 'Fires when a one-time (non-subscription) order is completed/paid in the selected ClickFunnels workspace, representing a successful single-purchase payment. Delivers the order 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: ['one-time-order.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=one-time-order-paid.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"one-time-order-paid.js","sourceRoot":"","sources":["../../../../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,EAA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E,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 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
|
-
}>;
|
|
51
|
-
//# sourceMappingURL=scheduled-appointment-event-created.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-appointment-event-created.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/scheduled-appointment-event-created.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAQhF,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2D3C,CAAC"}
|
|
@@ -1,65 +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
|
-
aiMetadata: {
|
|
17
|
-
description: 'Fires when a scheduled appointment event is created in the selected ClickFunnels workspace, representing a newly booked appointment. Delivers the appointment event 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: ['appointments/scheduled_event.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=scheduled-appointment-event-created.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-appointment-event-created.js","sourceRoot":"","sources":["../../../../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,UAAU,EAAE;QACV,WAAW,EACT,8KAA8K;KACjL;IACD,KAAK,EAAE;QACL,MAAM,EAAE,IAAA,qBAAa,EAAC,CAAC,MAAM,CAAC,CAAC;QAC/B,WAAW,E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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 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
|
-
}>;
|
|
51
|
-
//# sourceMappingURL=subscription-invoice-paid.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-invoice-paid.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/subscription-invoice-paid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAQhF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2DlC,CAAC"}
|
|
@@ -1,65 +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
|
-
aiMetadata: {
|
|
17
|
-
description: 'Fires when a subscription invoice is paid in the selected ClickFunnels workspace, representing a successful recurring-billing payment. Delivers the invoice 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: ['subscription.invoice.paid'],
|
|
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=subscription-invoice-paid.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subscription-invoice-paid.js","sourceRoot":"","sources":["../../../../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,UAAU,EAAE;QACV,WAAW,EACT,sKAAsK;KACzK;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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