@coasy/piece-coasy 0.1.3 → 0.1.5
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/dist/packages/pieces/community/coasy/packages/pieces/community/coasy/README.md +146 -0
- 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 -48
- package/src/lib/actions/create-event-participant.ts +0 -25
- package/src/lib/actions/create-voucher.ts +0 -46
- 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 -61
- 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,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
|
-
});
|
|
@@ -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_SUBSCRIPTION';
|
|
14
|
-
|
|
15
|
-
export const newSubscription = createTrigger({
|
|
16
|
-
auth: coasyAuth,
|
|
17
|
-
name: 'newSubscription',
|
|
18
|
-
displayName: 'New Subscription',
|
|
19
|
-
description: 'Triggers when a new subscription 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,73 +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 = 'WEBINAR_PARTICIPANT_ATTEND';
|
|
14
|
-
|
|
15
|
-
export const webinarParticipantAttend = createTrigger({
|
|
16
|
-
auth: coasyAuth,
|
|
17
|
-
name: 'webinarParticipantAttend',
|
|
18
|
-
displayName: 'Webinar Participant Attend',
|
|
19
|
-
description:
|
|
20
|
-
'Triggers when a webinar participant has attended or not attended',
|
|
21
|
-
props: {
|
|
22
|
-
selectedStartType: Property.StaticDropdown({
|
|
23
|
-
displayName: 'Selected start type',
|
|
24
|
-
description: 'filter only those participants',
|
|
25
|
-
required: false,
|
|
26
|
-
options: {
|
|
27
|
-
options: [
|
|
28
|
-
{
|
|
29
|
-
label: 'Upcoming',
|
|
30
|
-
value: 'UPCOMING',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
label: 'Attended',
|
|
34
|
-
value: 'ATTENDED',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
label: 'Not Attended',
|
|
38
|
-
value: 'NOT_ATTENDED',
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
},
|
|
42
|
-
}),
|
|
43
|
-
webinarIds: Property.Array({
|
|
44
|
-
displayName: 'Webinar IDs',
|
|
45
|
-
description: 'IDs of webinar to react to',
|
|
46
|
-
required: false,
|
|
47
|
-
}),
|
|
48
|
-
},
|
|
49
|
-
sampleData: {},
|
|
50
|
-
type: TriggerStrategy.WEBHOOK,
|
|
51
|
-
onEnable: (context) =>
|
|
52
|
-
createCoasyTrigger({
|
|
53
|
-
triggerName,
|
|
54
|
-
webhookUrl: context.webhookUrl,
|
|
55
|
-
auth: context.auth,
|
|
56
|
-
filter: context.propsValue,
|
|
57
|
-
store: context.store,
|
|
58
|
-
}),
|
|
59
|
-
onDisable: (context) =>
|
|
60
|
-
destroyCoasyTrigger({
|
|
61
|
-
triggerName,
|
|
62
|
-
auth: context.auth,
|
|
63
|
-
store: context.store,
|
|
64
|
-
}),
|
|
65
|
-
test: (context) =>
|
|
66
|
-
testCoasyTrigger({
|
|
67
|
-
triggerName,
|
|
68
|
-
auth: context.auth,
|
|
69
|
-
}),
|
|
70
|
-
async run(context) {
|
|
71
|
-
return [context.payload.body];
|
|
72
|
-
},
|
|
73
|
-
});
|
|
@@ -1,72 +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 = 'WEBINAR_PARTICIPANT_REMINDER';
|
|
14
|
-
|
|
15
|
-
export const webinarParticipantReminder = createTrigger({
|
|
16
|
-
auth: coasyAuth,
|
|
17
|
-
name: 'webinarParticipantReminder',
|
|
18
|
-
displayName: 'Webinar Participant Reminder',
|
|
19
|
-
description: 'Triggers when a webinar participant is reminded',
|
|
20
|
-
props: {
|
|
21
|
-
selectedStartType: Property.StaticDropdown({
|
|
22
|
-
displayName: 'Selected start type',
|
|
23
|
-
description: 'filter only those participants',
|
|
24
|
-
required: false,
|
|
25
|
-
options: {
|
|
26
|
-
options: [
|
|
27
|
-
{
|
|
28
|
-
label: 'Upcoming',
|
|
29
|
-
value: 'UPCOMING',
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
label: 'Attended',
|
|
33
|
-
value: 'ATTENDED',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
label: 'Not Attended',
|
|
37
|
-
value: 'NOT_ATTENDED',
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
}),
|
|
42
|
-
webinarIds: Property.Array({
|
|
43
|
-
displayName: 'Webinar IDs',
|
|
44
|
-
description: 'IDs of webinar to react to',
|
|
45
|
-
required: false,
|
|
46
|
-
}),
|
|
47
|
-
},
|
|
48
|
-
sampleData: {},
|
|
49
|
-
type: TriggerStrategy.WEBHOOK,
|
|
50
|
-
onEnable: (context) =>
|
|
51
|
-
createCoasyTrigger({
|
|
52
|
-
triggerName,
|
|
53
|
-
webhookUrl: context.webhookUrl,
|
|
54
|
-
auth: context.auth,
|
|
55
|
-
filter: context.propsValue,
|
|
56
|
-
store: context.store,
|
|
57
|
-
}),
|
|
58
|
-
onDisable: (context) =>
|
|
59
|
-
destroyCoasyTrigger({
|
|
60
|
-
triggerName,
|
|
61
|
-
auth: context.auth,
|
|
62
|
-
store: context.store,
|
|
63
|
-
}),
|
|
64
|
-
test: (context) =>
|
|
65
|
-
testCoasyTrigger({
|
|
66
|
-
triggerName,
|
|
67
|
-
auth: context.auth,
|
|
68
|
-
}),
|
|
69
|
-
async run(context) {
|
|
70
|
-
return [context.payload.body];
|
|
71
|
-
},
|
|
72
|
-
});
|