@coasy/piece-coasy 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +1 -5
- package/package.json +1 -1
- package/src/index.ts +8 -57
- package/src/lib/actions/create-funnel-participant.ts +17 -10
- package/src/lib/common/coasyClient.ts +9 -11
- package/src/lib/common/triggers.ts +25 -40
- package/src/lib/triggers/new-auth-event.ts +37 -49
- package/src/lib/triggers/new-funnel-participant.ts +2 -2
- package/src/lib/triggers/new-webinar-participant.ts +30 -57
- package/src/lib/actions/create-event-participant.ts +0 -25
- package/src/lib/actions/create-voucher.ts +0 -20
- package/src/lib/actions/enroll-user-course.ts +0 -30
- package/src/lib/actions/find-event.ts +0 -20
- package/src/lib/common/actions.ts +0 -24
- package/src/lib/triggers/cancelled-membership.ts +0 -51
- package/src/lib/triggers/cancelled-order-item.ts +0 -61
- package/src/lib/triggers/cancelled-order.ts +0 -65
- package/src/lib/triggers/cancelled-orderprocess.ts +0 -52
- package/src/lib/triggers/cancelled-subscription.ts +0 -51
- package/src/lib/triggers/get-events.ts +0 -41
- package/src/lib/triggers/new-app-user-sign-up.ts +0 -34
- package/src/lib/triggers/new-customer.ts +0 -34
- package/src/lib/triggers/new-event-participant.ts +0 -56
- package/src/lib/triggers/new-lead.ts +0 -51
- package/src/lib/triggers/new-membership.ts +0 -51
- package/src/lib/triggers/new-order-item.ts +0 -62
- package/src/lib/triggers/new-order.ts +0 -61
- package/src/lib/triggers/new-subscription.ts +0 -51
- package/src/lib/triggers/webinar-participant-attend.ts +0 -73
- package/src/lib/triggers/webinar-participant-reminder.ts +0 -72
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createTrigger,
|
|
3
|
-
Property,
|
|
4
|
-
TriggerStrategy,
|
|
5
|
-
} from '@activepieces/pieces-framework';
|
|
6
|
-
import { coasyAuth } from '../..';
|
|
7
|
-
import {
|
|
8
|
-
createCoasyTrigger,
|
|
9
|
-
destroyCoasyTrigger,
|
|
10
|
-
testCoasyTrigger,
|
|
11
|
-
} from '../common/triggers';
|
|
12
|
-
|
|
13
|
-
const triggerName = 'CANCELLED_MEMBERSHIP';
|
|
14
|
-
|
|
15
|
-
export const cancelledMembership = createTrigger({
|
|
16
|
-
auth: coasyAuth,
|
|
17
|
-
name: 'cancelledMembership',
|
|
18
|
-
displayName: 'Cancelled Membership',
|
|
19
|
-
description: 'Triggers when a customer requests a membership cancellation.',
|
|
20
|
-
props: {
|
|
21
|
-
membershipTypeIds: Property.Array({
|
|
22
|
-
displayName: 'Membership Type IDs',
|
|
23
|
-
description: 'IDs of membership types to react to',
|
|
24
|
-
required: false,
|
|
25
|
-
}),
|
|
26
|
-
},
|
|
27
|
-
sampleData: {},
|
|
28
|
-
type: TriggerStrategy.WEBHOOK,
|
|
29
|
-
onEnable: (context) =>
|
|
30
|
-
createCoasyTrigger({
|
|
31
|
-
triggerName,
|
|
32
|
-
webhookUrl: context.webhookUrl,
|
|
33
|
-
auth: context.auth,
|
|
34
|
-
filter: context.propsValue,
|
|
35
|
-
store: context.store,
|
|
36
|
-
}),
|
|
37
|
-
onDisable: (context) =>
|
|
38
|
-
destroyCoasyTrigger({
|
|
39
|
-
triggerName,
|
|
40
|
-
auth: context.auth,
|
|
41
|
-
store: context.store,
|
|
42
|
-
}),
|
|
43
|
-
test: (context) =>
|
|
44
|
-
testCoasyTrigger({
|
|
45
|
-
triggerName,
|
|
46
|
-
auth: context.auth,
|
|
47
|
-
}),
|
|
48
|
-
async run(context) {
|
|
49
|
-
return [context.payload.body];
|
|
50
|
-
},
|
|
51
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createTrigger,
|
|
3
|
-
Property,
|
|
4
|
-
TriggerStrategy,
|
|
5
|
-
} from '@activepieces/pieces-framework';
|
|
6
|
-
import { coasyAuth } from '../..';
|
|
7
|
-
import {
|
|
8
|
-
createCoasyTrigger,
|
|
9
|
-
destroyCoasyTrigger,
|
|
10
|
-
testCoasyTrigger,
|
|
11
|
-
} from '../common/triggers';
|
|
12
|
-
|
|
13
|
-
const triggerName = 'CANCELLED_ORDER_ITEM';
|
|
14
|
-
|
|
15
|
-
export const cancelledOrderItem = createTrigger({
|
|
16
|
-
auth: coasyAuth,
|
|
17
|
-
name: 'cancelledOrderItem',
|
|
18
|
-
displayName: 'Cancelled Order Item',
|
|
19
|
-
description: 'Triggers when an order item is cancelled.',
|
|
20
|
-
props: {
|
|
21
|
-
mainOfferIds: Property.Array({
|
|
22
|
-
displayName: 'Main Offer IDs',
|
|
23
|
-
description: 'IDs of main offers to react to',
|
|
24
|
-
required: false,
|
|
25
|
-
}),
|
|
26
|
-
selectedPaymentPlans: Property.Array({
|
|
27
|
-
displayName: 'Selected Payment Plans',
|
|
28
|
-
description: 'Payment plans to filter by',
|
|
29
|
-
required: false,
|
|
30
|
-
}),
|
|
31
|
-
selectedShippingOptions: Property.Array({
|
|
32
|
-
displayName: 'Selected Shipping Options',
|
|
33
|
-
description: 'Shipping options to filter by',
|
|
34
|
-
required: false,
|
|
35
|
-
}),
|
|
36
|
-
},
|
|
37
|
-
sampleData: {},
|
|
38
|
-
type: TriggerStrategy.WEBHOOK,
|
|
39
|
-
onEnable: (context) =>
|
|
40
|
-
createCoasyTrigger({
|
|
41
|
-
triggerName,
|
|
42
|
-
webhookUrl: context.webhookUrl,
|
|
43
|
-
auth: context.auth,
|
|
44
|
-
filter: context.propsValue,
|
|
45
|
-
store: context.store,
|
|
46
|
-
}),
|
|
47
|
-
onDisable: (context) =>
|
|
48
|
-
destroyCoasyTrigger({
|
|
49
|
-
triggerName,
|
|
50
|
-
auth: context.auth,
|
|
51
|
-
store: context.store,
|
|
52
|
-
}),
|
|
53
|
-
test: (context) =>
|
|
54
|
-
testCoasyTrigger({
|
|
55
|
-
triggerName,
|
|
56
|
-
auth: context.auth,
|
|
57
|
-
}),
|
|
58
|
-
async run(context) {
|
|
59
|
-
return [context.payload.body];
|
|
60
|
-
},
|
|
61
|
-
});
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
<<<<<<< Updated upstream
|
|
2
|
-
import {
|
|
3
|
-
createTrigger,
|
|
4
|
-
Property,
|
|
5
|
-
TriggerStrategy,
|
|
6
|
-
} from '@activepieces/pieces-framework';
|
|
7
|
-
=======
|
|
8
|
-
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
|
|
9
|
-
>>>>>>> Stashed changes
|
|
10
|
-
import { coasyAuth } from '../..';
|
|
11
|
-
import {
|
|
12
|
-
createCoasyTrigger,
|
|
13
|
-
destroyCoasyTrigger,
|
|
14
|
-
testCoasyTrigger,
|
|
15
|
-
} from '../common/triggers';
|
|
16
|
-
|
|
17
|
-
const triggerName = 'CANCELLED_ORDER';
|
|
18
|
-
|
|
19
|
-
export const cancelledOrder = createTrigger({
|
|
20
|
-
auth: coasyAuth,
|
|
21
|
-
name: 'cancelledOrder',
|
|
22
|
-
displayName: 'Cancelled Order',
|
|
23
|
-
description: 'Triggers when an order is cancelled.',
|
|
24
|
-
props: {
|
|
25
|
-
mainOfferIds: Property.Array({
|
|
26
|
-
displayName: 'Main Offer IDs',
|
|
27
|
-
description: 'IDs of main offers to react to',
|
|
28
|
-
required: false,
|
|
29
|
-
}),
|
|
30
|
-
selectedPaymentPlans: Property.Array({
|
|
31
|
-
displayName: 'Selected Payment Plans',
|
|
32
|
-
description: 'Payment plans to filter by',
|
|
33
|
-
required: false,
|
|
34
|
-
}),
|
|
35
|
-
selectedShippingOptions: Property.Array({
|
|
36
|
-
displayName: 'Selected Shipping Options',
|
|
37
|
-
description: 'Shipping options to filter by',
|
|
38
|
-
required: false,
|
|
39
|
-
}),
|
|
40
|
-
},
|
|
41
|
-
sampleData: {},
|
|
42
|
-
type: TriggerStrategy.WEBHOOK,
|
|
43
|
-
onEnable: (context) =>
|
|
44
|
-
createCoasyTrigger({
|
|
45
|
-
triggerName,
|
|
46
|
-
webhookUrl: context.webhookUrl,
|
|
47
|
-
auth: context.auth,
|
|
48
|
-
filter: context.propsValue,
|
|
49
|
-
store: context.store,
|
|
50
|
-
}),
|
|
51
|
-
onDisable: (context) =>
|
|
52
|
-
destroyCoasyTrigger({
|
|
53
|
-
triggerName,
|
|
54
|
-
auth: context.auth,
|
|
55
|
-
store: context.store,
|
|
56
|
-
}),
|
|
57
|
-
test: (context) =>
|
|
58
|
-
testCoasyTrigger({
|
|
59
|
-
triggerName,
|
|
60
|
-
auth: context.auth,
|
|
61
|
-
}),
|
|
62
|
-
async run(context) {
|
|
63
|
-
return [context.payload.body];
|
|
64
|
-
},
|
|
65
|
-
});
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createTrigger,
|
|
3
|
-
Property,
|
|
4
|
-
TriggerStrategy,
|
|
5
|
-
} from '@activepieces/pieces-framework';
|
|
6
|
-
import { coasyAuth } from '../..';
|
|
7
|
-
import {
|
|
8
|
-
createCoasyTrigger,
|
|
9
|
-
destroyCoasyTrigger,
|
|
10
|
-
testCoasyTrigger,
|
|
11
|
-
} from '../common/triggers';
|
|
12
|
-
|
|
13
|
-
const triggerName = 'CANCELLED_ORDERPROCESS';
|
|
14
|
-
|
|
15
|
-
export const cancelledOrderprocess = createTrigger({
|
|
16
|
-
auth: coasyAuth,
|
|
17
|
-
name: 'cancelledOrderprocess',
|
|
18
|
-
displayName: 'Cancelled Order Process',
|
|
19
|
-
description:
|
|
20
|
-
'Triggers when a customer starts checkout but does not finish within 1 hour.',
|
|
21
|
-
props: {
|
|
22
|
-
mainOfferIds: Property.Array({
|
|
23
|
-
displayName: 'Main Offer IDs',
|
|
24
|
-
description: 'IDs of main offers to react to',
|
|
25
|
-
required: false,
|
|
26
|
-
}),
|
|
27
|
-
},
|
|
28
|
-
sampleData: {},
|
|
29
|
-
type: TriggerStrategy.WEBHOOK,
|
|
30
|
-
onEnable: (context) =>
|
|
31
|
-
createCoasyTrigger({
|
|
32
|
-
triggerName,
|
|
33
|
-
webhookUrl: context.webhookUrl,
|
|
34
|
-
auth: context.auth,
|
|
35
|
-
filter: context.propsValue,
|
|
36
|
-
store: context.store,
|
|
37
|
-
}),
|
|
38
|
-
onDisable: (context) =>
|
|
39
|
-
destroyCoasyTrigger({
|
|
40
|
-
triggerName,
|
|
41
|
-
auth: context.auth,
|
|
42
|
-
store: context.store,
|
|
43
|
-
}),
|
|
44
|
-
test: (context) =>
|
|
45
|
-
testCoasyTrigger({
|
|
46
|
-
triggerName,
|
|
47
|
-
auth: context.auth,
|
|
48
|
-
}),
|
|
49
|
-
async run(context) {
|
|
50
|
-
return [context.payload.body];
|
|
51
|
-
},
|
|
52
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createTrigger,
|
|
3
|
-
Property,
|
|
4
|
-
TriggerStrategy,
|
|
5
|
-
} from '@activepieces/pieces-framework';
|
|
6
|
-
import { coasyAuth } from '../..';
|
|
7
|
-
import {
|
|
8
|
-
createCoasyTrigger,
|
|
9
|
-
destroyCoasyTrigger,
|
|
10
|
-
testCoasyTrigger,
|
|
11
|
-
} from '../common/triggers';
|
|
12
|
-
|
|
13
|
-
const triggerName = 'CANCELLED_SUBSCRIPTION';
|
|
14
|
-
|
|
15
|
-
export const cancelledSubscription = createTrigger({
|
|
16
|
-
auth: coasyAuth,
|
|
17
|
-
name: 'cancelledSubscription',
|
|
18
|
-
displayName: 'Cancelled Subscription',
|
|
19
|
-
description: 'Triggers when a customer requests a subscription cancellation.',
|
|
20
|
-
props: {
|
|
21
|
-
membershipTypeIds: Property.Array({
|
|
22
|
-
displayName: 'Membership Type IDs',
|
|
23
|
-
description: 'IDs of membership types to react to',
|
|
24
|
-
required: false,
|
|
25
|
-
}),
|
|
26
|
-
},
|
|
27
|
-
sampleData: {},
|
|
28
|
-
type: TriggerStrategy.WEBHOOK,
|
|
29
|
-
onEnable: (context) =>
|
|
30
|
-
createCoasyTrigger({
|
|
31
|
-
triggerName,
|
|
32
|
-
webhookUrl: context.webhookUrl,
|
|
33
|
-
auth: context.auth,
|
|
34
|
-
filter: context.propsValue,
|
|
35
|
-
store: context.store,
|
|
36
|
-
}),
|
|
37
|
-
onDisable: (context) =>
|
|
38
|
-
destroyCoasyTrigger({
|
|
39
|
-
triggerName,
|
|
40
|
-
auth: context.auth,
|
|
41
|
-
store: context.store,
|
|
42
|
-
}),
|
|
43
|
-
test: (context) =>
|
|
44
|
-
testCoasyTrigger({
|
|
45
|
-
triggerName,
|
|
46
|
-
auth: context.auth,
|
|
47
|
-
}),
|
|
48
|
-
async run(context) {
|
|
49
|
-
return [context.payload.body];
|
|
50
|
-
},
|
|
51
|
-
});
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { createTrigger, TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
import { coasyAuth } from '../..';
|
|
3
|
-
import {
|
|
4
|
-
createCoasyTrigger,
|
|
5
|
-
destroyCoasyTrigger,
|
|
6
|
-
testCoasyTrigger,
|
|
7
|
-
} from '../common/triggers';
|
|
8
|
-
|
|
9
|
-
const triggerName = 'GET_EVENTS';
|
|
10
|
-
|
|
11
|
-
export const getEvents = createTrigger({
|
|
12
|
-
auth: coasyAuth,
|
|
13
|
-
name: 'getEvents',
|
|
14
|
-
displayName: 'Get Events',
|
|
15
|
-
description: 'Get a list of all events.',
|
|
16
|
-
props: {},
|
|
17
|
-
sampleData: {},
|
|
18
|
-
type: TriggerStrategy.WEBHOOK,
|
|
19
|
-
onEnable: (context) =>
|
|
20
|
-
createCoasyTrigger({
|
|
21
|
-
triggerName,
|
|
22
|
-
webhookUrl: context.webhookUrl,
|
|
23
|
-
auth: context.auth,
|
|
24
|
-
filter: context.propsValue,
|
|
25
|
-
store: context.store,
|
|
26
|
-
}),
|
|
27
|
-
onDisable: (context) =>
|
|
28
|
-
destroyCoasyTrigger({
|
|
29
|
-
triggerName,
|
|
30
|
-
auth: context.auth,
|
|
31
|
-
store: context.store,
|
|
32
|
-
}),
|
|
33
|
-
test: (context) =>
|
|
34
|
-
testCoasyTrigger({
|
|
35
|
-
triggerName,
|
|
36
|
-
auth: context.auth,
|
|
37
|
-
}),
|
|
38
|
-
async run(context) {
|
|
39
|
-
return [context.payload.body];
|
|
40
|
-
},
|
|
41
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { createTrigger, Property, TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
import { coasyAuth } from '../..';
|
|
3
|
-
import { createCoasyTrigger, destroyCoasyTrigger, testCoasyTrigger } from '../common/triggers';
|
|
4
|
-
|
|
5
|
-
const triggerName = "NEW_APP_USER_SIGN_UP";
|
|
6
|
-
|
|
7
|
-
export const newAppUserSignUp = createTrigger({
|
|
8
|
-
auth: coasyAuth,
|
|
9
|
-
name: 'newAppUserSignUp',
|
|
10
|
-
displayName: 'New App User Sign Up',
|
|
11
|
-
description: 'Triggers when a new app user sign up.',
|
|
12
|
-
props: {},
|
|
13
|
-
sampleData: {},
|
|
14
|
-
type: TriggerStrategy.WEBHOOK,
|
|
15
|
-
onEnable: (context) => createCoasyTrigger({
|
|
16
|
-
triggerName,
|
|
17
|
-
webhookUrl: context.webhookUrl,
|
|
18
|
-
auth: context.auth,
|
|
19
|
-
filter: context.propsValue,
|
|
20
|
-
store: context.store
|
|
21
|
-
}),
|
|
22
|
-
onDisable: (context) => destroyCoasyTrigger({
|
|
23
|
-
triggerName,
|
|
24
|
-
auth: context.auth,
|
|
25
|
-
store: context.store
|
|
26
|
-
}),
|
|
27
|
-
test: (context) => testCoasyTrigger({
|
|
28
|
-
triggerName,
|
|
29
|
-
auth: context.auth
|
|
30
|
-
}),
|
|
31
|
-
async run(context) {
|
|
32
|
-
return [context.payload.body];
|
|
33
|
-
}
|
|
34
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { createTrigger, Property, TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
-
import { coasyAuth } from '../..';
|
|
3
|
-
import { createCoasyTrigger, destroyCoasyTrigger, testCoasyTrigger } from '../common/triggers';
|
|
4
|
-
|
|
5
|
-
const triggerName = "NEW_CUSTOMER";
|
|
6
|
-
|
|
7
|
-
export const newCustomer = createTrigger({
|
|
8
|
-
auth: coasyAuth,
|
|
9
|
-
name: 'newCustomer',
|
|
10
|
-
displayName: 'New Customer',
|
|
11
|
-
description: 'Triggers when a new Customer is created.',
|
|
12
|
-
props: {},
|
|
13
|
-
sampleData: {},
|
|
14
|
-
type: TriggerStrategy.WEBHOOK,
|
|
15
|
-
onEnable: (context) => createCoasyTrigger({
|
|
16
|
-
triggerName,
|
|
17
|
-
webhookUrl: context.webhookUrl,
|
|
18
|
-
auth: context.auth,
|
|
19
|
-
filter: context.propsValue,
|
|
20
|
-
store: context.store
|
|
21
|
-
}),
|
|
22
|
-
onDisable: (context) => destroyCoasyTrigger({
|
|
23
|
-
triggerName,
|
|
24
|
-
auth: context.auth,
|
|
25
|
-
store: context.store
|
|
26
|
-
}),
|
|
27
|
-
test: (context) => testCoasyTrigger({
|
|
28
|
-
triggerName,
|
|
29
|
-
auth: context.auth
|
|
30
|
-
}),
|
|
31
|
-
async run(context) {
|
|
32
|
-
return [context.payload.body];
|
|
33
|
-
}
|
|
34
|
-
});
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createTrigger,
|
|
3
|
-
Property,
|
|
4
|
-
TriggerStrategy,
|
|
5
|
-
} from '@activepieces/pieces-framework';
|
|
6
|
-
import { coasyAuth } from '../..';
|
|
7
|
-
import {
|
|
8
|
-
createCoasyTrigger,
|
|
9
|
-
destroyCoasyTrigger,
|
|
10
|
-
testCoasyTrigger,
|
|
11
|
-
} from '../common/triggers';
|
|
12
|
-
|
|
13
|
-
const triggerName = 'NEW_EVENT_PARTICIPANT';
|
|
14
|
-
|
|
15
|
-
export const newEventParticipant = createTrigger({
|
|
16
|
-
auth: coasyAuth,
|
|
17
|
-
name: 'newEventParticipant',
|
|
18
|
-
displayName: 'New Event Participant',
|
|
19
|
-
description: 'Triggers when a new Event Participant is created.',
|
|
20
|
-
props: {
|
|
21
|
-
eventIds: Property.Array({
|
|
22
|
-
displayName: 'Event IDs',
|
|
23
|
-
description: 'IDs of events to react to',
|
|
24
|
-
required: false,
|
|
25
|
-
}),
|
|
26
|
-
eventTypeIds: Property.Array({
|
|
27
|
-
displayName: 'Event Type IDs',
|
|
28
|
-
description: 'IDs of event types to react to',
|
|
29
|
-
required: false,
|
|
30
|
-
}),
|
|
31
|
-
},
|
|
32
|
-
sampleData: {},
|
|
33
|
-
type: TriggerStrategy.WEBHOOK,
|
|
34
|
-
onEnable: (context) =>
|
|
35
|
-
createCoasyTrigger({
|
|
36
|
-
triggerName,
|
|
37
|
-
webhookUrl: context.webhookUrl,
|
|
38
|
-
auth: context.auth,
|
|
39
|
-
filter: context.propsValue,
|
|
40
|
-
store: context.store,
|
|
41
|
-
}),
|
|
42
|
-
onDisable: (context) =>
|
|
43
|
-
destroyCoasyTrigger({
|
|
44
|
-
triggerName,
|
|
45
|
-
auth: context.auth,
|
|
46
|
-
store: context.store,
|
|
47
|
-
}),
|
|
48
|
-
test: (context) =>
|
|
49
|
-
testCoasyTrigger({
|
|
50
|
-
triggerName,
|
|
51
|
-
auth: context.auth,
|
|
52
|
-
}),
|
|
53
|
-
async run(context) {
|
|
54
|
-
return [context.payload.body];
|
|
55
|
-
},
|
|
56
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createTrigger,
|
|
3
|
-
Property,
|
|
4
|
-
TriggerStrategy,
|
|
5
|
-
} from '@activepieces/pieces-framework';
|
|
6
|
-
import { coasyAuth } from '../..';
|
|
7
|
-
import {
|
|
8
|
-
createCoasyTrigger,
|
|
9
|
-
destroyCoasyTrigger,
|
|
10
|
-
testCoasyTrigger,
|
|
11
|
-
} from '../common/triggers';
|
|
12
|
-
|
|
13
|
-
const triggerName = 'NEW_LEAD';
|
|
14
|
-
|
|
15
|
-
export const newLead = createTrigger({
|
|
16
|
-
auth: coasyAuth,
|
|
17
|
-
name: 'newLead',
|
|
18
|
-
displayName: 'New Lead',
|
|
19
|
-
description: 'Triggers when a new lead is created.',
|
|
20
|
-
props: {
|
|
21
|
-
funnelId: Property.ShortText({
|
|
22
|
-
displayName: 'Funnel ID',
|
|
23
|
-
description: 'ID of funnel to react to',
|
|
24
|
-
required: false,
|
|
25
|
-
}),
|
|
26
|
-
},
|
|
27
|
-
sampleData: {},
|
|
28
|
-
type: TriggerStrategy.WEBHOOK,
|
|
29
|
-
onEnable: (context) =>
|
|
30
|
-
createCoasyTrigger({
|
|
31
|
-
triggerName,
|
|
32
|
-
webhookUrl: context.webhookUrl,
|
|
33
|
-
auth: context.auth,
|
|
34
|
-
filter: context.propsValue,
|
|
35
|
-
store: context.store,
|
|
36
|
-
}),
|
|
37
|
-
onDisable: (context) =>
|
|
38
|
-
destroyCoasyTrigger({
|
|
39
|
-
triggerName,
|
|
40
|
-
auth: context.auth,
|
|
41
|
-
store: context.store,
|
|
42
|
-
}),
|
|
43
|
-
test: (context) =>
|
|
44
|
-
testCoasyTrigger({
|
|
45
|
-
triggerName,
|
|
46
|
-
auth: context.auth,
|
|
47
|
-
}),
|
|
48
|
-
async run(context) {
|
|
49
|
-
return [context.payload.body];
|
|
50
|
-
},
|
|
51
|
-
});
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createTrigger,
|
|
3
|
-
Property,
|
|
4
|
-
TriggerStrategy,
|
|
5
|
-
} from '@activepieces/pieces-framework';
|
|
6
|
-
import { coasyAuth } from '../..';
|
|
7
|
-
import {
|
|
8
|
-
createCoasyTrigger,
|
|
9
|
-
destroyCoasyTrigger,
|
|
10
|
-
testCoasyTrigger,
|
|
11
|
-
} from '../common/triggers';
|
|
12
|
-
|
|
13
|
-
const triggerName = 'NEW_MEMBERSHIP';
|
|
14
|
-
|
|
15
|
-
export const newMembership = createTrigger({
|
|
16
|
-
auth: coasyAuth,
|
|
17
|
-
name: 'newMembership',
|
|
18
|
-
displayName: 'New Membership',
|
|
19
|
-
description: 'Triggers when a new membership is created.',
|
|
20
|
-
props: {
|
|
21
|
-
membershipTypeIds: Property.Array({
|
|
22
|
-
displayName: 'Membership Type IDs',
|
|
23
|
-
description: 'IDs of membership types to react to',
|
|
24
|
-
required: false,
|
|
25
|
-
}),
|
|
26
|
-
},
|
|
27
|
-
sampleData: {},
|
|
28
|
-
type: TriggerStrategy.WEBHOOK,
|
|
29
|
-
onEnable: (context) =>
|
|
30
|
-
createCoasyTrigger({
|
|
31
|
-
triggerName,
|
|
32
|
-
webhookUrl: context.webhookUrl,
|
|
33
|
-
auth: context.auth,
|
|
34
|
-
filter: context.propsValue,
|
|
35
|
-
store: context.store,
|
|
36
|
-
}),
|
|
37
|
-
onDisable: (context) =>
|
|
38
|
-
destroyCoasyTrigger({
|
|
39
|
-
triggerName,
|
|
40
|
-
auth: context.auth,
|
|
41
|
-
store: context.store,
|
|
42
|
-
}),
|
|
43
|
-
test: (context) =>
|
|
44
|
-
testCoasyTrigger({
|
|
45
|
-
triggerName,
|
|
46
|
-
auth: context.auth,
|
|
47
|
-
}),
|
|
48
|
-
async run(context) {
|
|
49
|
-
return [context.payload.body];
|
|
50
|
-
},
|
|
51
|
-
});
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createTrigger,
|
|
3
|
-
Property,
|
|
4
|
-
TriggerStrategy,
|
|
5
|
-
} from '@activepieces/pieces-framework';
|
|
6
|
-
import { coasyAuth } from '../..';
|
|
7
|
-
import {
|
|
8
|
-
createCoasyTrigger,
|
|
9
|
-
destroyCoasyTrigger,
|
|
10
|
-
testCoasyTrigger,
|
|
11
|
-
} from '../common/triggers';
|
|
12
|
-
|
|
13
|
-
const triggerName = 'NEW_ORDER_ITEM';
|
|
14
|
-
|
|
15
|
-
export const newOrderItem = createTrigger({
|
|
16
|
-
auth: coasyAuth,
|
|
17
|
-
name: 'newOrderItem',
|
|
18
|
-
displayName: 'New Order Item',
|
|
19
|
-
description: 'Triggers for each item in a new Order.',
|
|
20
|
-
props: {
|
|
21
|
-
mainOfferIds: Property.Array({
|
|
22
|
-
displayName: 'Main Offer IDs',
|
|
23
|
-
description: 'IDs of main offers to react to',
|
|
24
|
-
required: false,
|
|
25
|
-
}),
|
|
26
|
-
selectedPaymentPlans: Property.Array({
|
|
27
|
-
displayName: 'Selected Payment Plans',
|
|
28
|
-
description: 'Payment plans to filter by',
|
|
29
|
-
required: false,
|
|
30
|
-
}),
|
|
31
|
-
selectedShippingOptions: Property.Array({
|
|
32
|
-
displayName: 'Selected Shipping Options',
|
|
33
|
-
description: 'Shipping options to filter by',
|
|
34
|
-
required: false,
|
|
35
|
-
}),
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
sampleData: {},
|
|
39
|
-
type: TriggerStrategy.WEBHOOK,
|
|
40
|
-
onEnable: (context) =>
|
|
41
|
-
createCoasyTrigger({
|
|
42
|
-
triggerName,
|
|
43
|
-
webhookUrl: context.webhookUrl,
|
|
44
|
-
auth: context.auth,
|
|
45
|
-
filter: context.propsValue,
|
|
46
|
-
store: context.store,
|
|
47
|
-
}),
|
|
48
|
-
onDisable: (context) =>
|
|
49
|
-
destroyCoasyTrigger({
|
|
50
|
-
triggerName,
|
|
51
|
-
auth: context.auth,
|
|
52
|
-
store: context.store,
|
|
53
|
-
}),
|
|
54
|
-
test: (context) =>
|
|
55
|
-
testCoasyTrigger({
|
|
56
|
-
triggerName,
|
|
57
|
-
auth: context.auth,
|
|
58
|
-
}),
|
|
59
|
-
async run(context) {
|
|
60
|
-
return [context.payload.body];
|
|
61
|
-
},
|
|
62
|
-
});
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createTrigger,
|
|
3
|
-
Property,
|
|
4
|
-
TriggerStrategy,
|
|
5
|
-
} from '@activepieces/pieces-framework';
|
|
6
|
-
import { coasyAuth } from '../..';
|
|
7
|
-
import {
|
|
8
|
-
createCoasyTrigger,
|
|
9
|
-
destroyCoasyTrigger,
|
|
10
|
-
testCoasyTrigger,
|
|
11
|
-
} from '../common/triggers';
|
|
12
|
-
|
|
13
|
-
const triggerName = 'NEW_ORDER';
|
|
14
|
-
|
|
15
|
-
export const newOrder = createTrigger({
|
|
16
|
-
auth: coasyAuth,
|
|
17
|
-
name: 'newOrder',
|
|
18
|
-
displayName: 'New Order',
|
|
19
|
-
description: 'Triggers when a new order is created.',
|
|
20
|
-
props: {
|
|
21
|
-
mainOfferIds: Property.Array({
|
|
22
|
-
displayName: 'Main Offer IDs',
|
|
23
|
-
description: 'IDs of main offers to react to',
|
|
24
|
-
required: false,
|
|
25
|
-
}),
|
|
26
|
-
selectedPaymentPlans: Property.Array({
|
|
27
|
-
displayName: 'Selected Payment Plans',
|
|
28
|
-
description: 'Payment plans to filter by',
|
|
29
|
-
required: false,
|
|
30
|
-
}),
|
|
31
|
-
selectedShippingOptions: Property.Array({
|
|
32
|
-
displayName: 'Selected Shipping Options',
|
|
33
|
-
description: 'Shipping options to filter by',
|
|
34
|
-
required: false,
|
|
35
|
-
}),
|
|
36
|
-
},
|
|
37
|
-
sampleData: {},
|
|
38
|
-
type: TriggerStrategy.WEBHOOK,
|
|
39
|
-
onEnable: (context) =>
|
|
40
|
-
createCoasyTrigger({
|
|
41
|
-
triggerName,
|
|
42
|
-
webhookUrl: context.webhookUrl,
|
|
43
|
-
auth: context.auth,
|
|
44
|
-
filter: context.propsValue,
|
|
45
|
-
store: context.store,
|
|
46
|
-
}),
|
|
47
|
-
onDisable: (context) =>
|
|
48
|
-
destroyCoasyTrigger({
|
|
49
|
-
triggerName,
|
|
50
|
-
auth: context.auth,
|
|
51
|
-
store: context.store,
|
|
52
|
-
}),
|
|
53
|
-
test: (context) =>
|
|
54
|
-
testCoasyTrigger({
|
|
55
|
-
triggerName,
|
|
56
|
-
auth: context.auth,
|
|
57
|
-
}),
|
|
58
|
-
async run(context) {
|
|
59
|
-
return [context.payload.body];
|
|
60
|
-
},
|
|
61
|
-
});
|