@coasy/piece-coasy 0.1.0 → 0.1.2-dev.1
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 +5 -1
- package/dist/packages/pieces/community/framework/packages/pieces/community/framework/README.md +11 -0
- package/dist/packages/shared/packages/shared/README.md +7 -0
- package/package.json +1 -1
- package/src/lib/actions/create-voucher.ts +14 -14
- package/src/lib/common/triggers.ts +40 -25
- package/src/lib/triggers/cancelled-membership.ts +38 -21
- package/src/lib/triggers/cancelled-order-item.ts +48 -21
- package/src/lib/triggers/cancelled-order.ts +48 -21
- package/src/lib/triggers/cancelled-orderprocess.ts +40 -22
- package/src/lib/triggers/cancelled-subscription.ts +38 -21
- package/src/lib/triggers/get-events.ts +27 -20
- package/src/lib/triggers/new-event-participant.ts +43 -21
- package/src/lib/triggers/new-lead.ts +33 -22
- package/src/lib/triggers/new-membership.ts +38 -21
- package/src/lib/triggers/new-order-item.ts +46 -25
- package/src/lib/triggers/new-order.ts +48 -21
- package/src/lib/triggers/new-subscription.ts +38 -21
- package/src/lib/triggers/new-webinar-participant.ts +48 -30
- package/src/lib/triggers/webinar-participant-attend.ts +50 -38
- package/src/lib/triggers/webinar-participant-reminder.ts +48 -37
|
@@ -1,34 +1,56 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createTrigger,
|
|
3
|
+
Property,
|
|
4
|
+
TriggerStrategy,
|
|
5
|
+
} from '@activepieces/pieces-framework';
|
|
2
6
|
import { coasyAuth } from '../..';
|
|
3
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
createCoasyTrigger,
|
|
9
|
+
destroyCoasyTrigger,
|
|
10
|
+
testCoasyTrigger,
|
|
11
|
+
} from '../common/triggers';
|
|
4
12
|
|
|
5
|
-
const triggerName =
|
|
13
|
+
const triggerName = 'NEW_EVENT_PARTICIPANT';
|
|
6
14
|
|
|
7
15
|
export const newEventParticipant = createTrigger({
|
|
8
16
|
auth: coasyAuth,
|
|
9
17
|
name: 'newEventParticipant',
|
|
10
18
|
displayName: 'New Event Participant',
|
|
11
19
|
description: 'Triggers when a new Event Participant is created.',
|
|
12
|
-
props: {
|
|
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
|
+
},
|
|
13
32
|
sampleData: {},
|
|
14
33
|
type: TriggerStrategy.WEBHOOK,
|
|
15
|
-
onEnable: (context) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
+
}),
|
|
31
53
|
async run(context) {
|
|
32
54
|
return [context.payload.body];
|
|
33
|
-
}
|
|
55
|
+
},
|
|
34
56
|
});
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createTrigger,
|
|
3
|
+
Property,
|
|
4
|
+
TriggerStrategy,
|
|
5
|
+
} from '@activepieces/pieces-framework';
|
|
2
6
|
import { coasyAuth } from '../..';
|
|
3
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
createCoasyTrigger,
|
|
9
|
+
destroyCoasyTrigger,
|
|
10
|
+
testCoasyTrigger,
|
|
11
|
+
} from '../common/triggers';
|
|
4
12
|
|
|
5
|
-
const triggerName =
|
|
13
|
+
const triggerName = 'NEW_LEAD';
|
|
6
14
|
|
|
7
15
|
export const newLead = createTrigger({
|
|
8
16
|
auth: coasyAuth,
|
|
@@ -13,28 +21,31 @@ export const newLead = createTrigger({
|
|
|
13
21
|
funnelId: Property.ShortText({
|
|
14
22
|
displayName: 'Funnel ID',
|
|
15
23
|
description: 'ID of funnel to react to',
|
|
16
|
-
required: false
|
|
17
|
-
})
|
|
24
|
+
required: false,
|
|
25
|
+
}),
|
|
18
26
|
},
|
|
19
27
|
sampleData: {},
|
|
20
28
|
type: TriggerStrategy.WEBHOOK,
|
|
21
|
-
onEnable: (context) =>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
+
}),
|
|
37
48
|
async run(context) {
|
|
38
49
|
return [context.payload.body];
|
|
39
|
-
}
|
|
50
|
+
},
|
|
40
51
|
});
|
|
@@ -1,34 +1,51 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createTrigger,
|
|
3
|
+
Property,
|
|
4
|
+
TriggerStrategy,
|
|
5
|
+
} from '@activepieces/pieces-framework';
|
|
2
6
|
import { coasyAuth } from '../..';
|
|
3
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
createCoasyTrigger,
|
|
9
|
+
destroyCoasyTrigger,
|
|
10
|
+
testCoasyTrigger,
|
|
11
|
+
} from '../common/triggers';
|
|
4
12
|
|
|
5
|
-
const triggerName =
|
|
13
|
+
const triggerName = 'NEW_MEMBERSHIP';
|
|
6
14
|
|
|
7
15
|
export const newMembership = createTrigger({
|
|
8
16
|
auth: coasyAuth,
|
|
9
17
|
name: 'newMembership',
|
|
10
18
|
displayName: 'New Membership',
|
|
11
19
|
description: 'Triggers when a new membership is created.',
|
|
12
|
-
props: {
|
|
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
|
+
},
|
|
13
27
|
sampleData: {},
|
|
14
28
|
type: TriggerStrategy.WEBHOOK,
|
|
15
|
-
onEnable: (context) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
+
}),
|
|
31
48
|
async run(context) {
|
|
32
49
|
return [context.payload.body];
|
|
33
|
-
}
|
|
50
|
+
},
|
|
34
51
|
});
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createTrigger,
|
|
3
|
+
Property,
|
|
4
|
+
TriggerStrategy,
|
|
5
|
+
} from '@activepieces/pieces-framework';
|
|
2
6
|
import { coasyAuth } from '../..';
|
|
3
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
createCoasyTrigger,
|
|
9
|
+
destroyCoasyTrigger,
|
|
10
|
+
testCoasyTrigger,
|
|
11
|
+
} from '../common/triggers';
|
|
4
12
|
|
|
5
|
-
const triggerName =
|
|
13
|
+
const triggerName = 'NEW_ORDER_ITEM';
|
|
6
14
|
|
|
7
15
|
export const newOrderItem = createTrigger({
|
|
8
16
|
auth: coasyAuth,
|
|
@@ -10,32 +18,45 @@ export const newOrderItem = createTrigger({
|
|
|
10
18
|
displayName: 'New Order Item',
|
|
11
19
|
description: 'Triggers for each item in a new Order.',
|
|
12
20
|
props: {
|
|
13
|
-
|
|
14
|
-
displayName: 'Offer IDs',
|
|
15
|
-
description: 'IDs of
|
|
16
|
-
required: false
|
|
17
|
-
})
|
|
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
|
+
}),
|
|
18
36
|
},
|
|
19
37
|
|
|
20
38
|
sampleData: {},
|
|
21
39
|
type: TriggerStrategy.WEBHOOK,
|
|
22
|
-
onEnable: (context) =>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
+
}),
|
|
38
59
|
async run(context) {
|
|
39
60
|
return [context.payload.body];
|
|
40
|
-
}
|
|
61
|
+
},
|
|
41
62
|
});
|
|
@@ -1,34 +1,61 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createTrigger,
|
|
3
|
+
Property,
|
|
4
|
+
TriggerStrategy,
|
|
5
|
+
} from '@activepieces/pieces-framework';
|
|
2
6
|
import { coasyAuth } from '../..';
|
|
3
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
createCoasyTrigger,
|
|
9
|
+
destroyCoasyTrigger,
|
|
10
|
+
testCoasyTrigger,
|
|
11
|
+
} from '../common/triggers';
|
|
4
12
|
|
|
5
|
-
const triggerName =
|
|
13
|
+
const triggerName = 'NEW_ORDER';
|
|
6
14
|
|
|
7
15
|
export const newOrder = createTrigger({
|
|
8
16
|
auth: coasyAuth,
|
|
9
17
|
name: 'newOrder',
|
|
10
18
|
displayName: 'New Order',
|
|
11
19
|
description: 'Triggers when a new order is created.',
|
|
12
|
-
props: {
|
|
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
|
+
},
|
|
13
37
|
sampleData: {},
|
|
14
38
|
type: TriggerStrategy.WEBHOOK,
|
|
15
|
-
onEnable: (context) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
+
}),
|
|
31
58
|
async run(context) {
|
|
32
59
|
return [context.payload.body];
|
|
33
|
-
}
|
|
60
|
+
},
|
|
34
61
|
});
|
|
@@ -1,34 +1,51 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createTrigger,
|
|
3
|
+
Property,
|
|
4
|
+
TriggerStrategy,
|
|
5
|
+
} from '@activepieces/pieces-framework';
|
|
2
6
|
import { coasyAuth } from '../..';
|
|
3
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
createCoasyTrigger,
|
|
9
|
+
destroyCoasyTrigger,
|
|
10
|
+
testCoasyTrigger,
|
|
11
|
+
} from '../common/triggers';
|
|
4
12
|
|
|
5
|
-
const triggerName =
|
|
13
|
+
const triggerName = 'NEW_SUBSCRIPTION';
|
|
6
14
|
|
|
7
15
|
export const newSubscription = createTrigger({
|
|
8
16
|
auth: coasyAuth,
|
|
9
17
|
name: 'newSubscription',
|
|
10
18
|
displayName: 'New Subscription',
|
|
11
19
|
description: 'Triggers when a new subscription is created.',
|
|
12
|
-
props: {
|
|
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
|
+
},
|
|
13
27
|
sampleData: {},
|
|
14
28
|
type: TriggerStrategy.WEBHOOK,
|
|
15
|
-
onEnable: (context) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
+
}),
|
|
31
48
|
async run(context) {
|
|
32
49
|
return [context.payload.body];
|
|
33
|
-
}
|
|
50
|
+
},
|
|
34
51
|
});
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createTrigger,
|
|
3
|
+
Property,
|
|
4
|
+
TriggerStrategy,
|
|
5
|
+
} from '@activepieces/pieces-framework';
|
|
2
6
|
import { coasyAuth } from '../..';
|
|
3
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
createCoasyTrigger,
|
|
9
|
+
destroyCoasyTrigger,
|
|
10
|
+
testCoasyTrigger,
|
|
11
|
+
} from '../common/triggers';
|
|
4
12
|
|
|
5
|
-
const triggerName =
|
|
13
|
+
const triggerName = 'NEW_WEBINAR_PARTICIPANT';
|
|
6
14
|
|
|
7
15
|
export const newWebinarParticipant = createTrigger({
|
|
8
16
|
auth: coasyAuth,
|
|
@@ -13,42 +21,52 @@ export const newWebinarParticipant = createTrigger({
|
|
|
13
21
|
webinarIds: Property.Array({
|
|
14
22
|
displayName: 'Webinar IDs',
|
|
15
23
|
description: 'IDs of webinar to react to',
|
|
16
|
-
required: false
|
|
24
|
+
required: false,
|
|
17
25
|
}),
|
|
18
26
|
selectedStartType: Property.StaticDropdown({
|
|
19
27
|
displayName: 'Selected start type',
|
|
20
28
|
description: 'filter only those participants',
|
|
21
29
|
required: false,
|
|
22
30
|
options: {
|
|
23
|
-
options: [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
options: [
|
|
32
|
+
{
|
|
33
|
+
label: 'Upcoming',
|
|
34
|
+
value: 'UPCOMING',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: 'Attended',
|
|
38
|
+
value: 'ATTENDED',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: 'Not Attended',
|
|
42
|
+
value: 'NOT_ATTENDED',
|
|
43
|
+
},
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
}),
|
|
32
47
|
},
|
|
33
48
|
sampleData: {},
|
|
34
49
|
type: TriggerStrategy.WEBHOOK,
|
|
35
|
-
onEnable
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
+
}),
|
|
51
69
|
async run(context) {
|
|
52
70
|
return [context.payload.body];
|
|
53
|
-
}
|
|
71
|
+
},
|
|
54
72
|
});
|
|
@@ -1,61 +1,73 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
createTrigger,
|
|
3
|
+
Property,
|
|
4
|
+
TriggerStrategy,
|
|
5
|
+
} from '@activepieces/pieces-framework';
|
|
2
6
|
import { coasyAuth } from '../..';
|
|
3
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
createCoasyTrigger,
|
|
9
|
+
destroyCoasyTrigger,
|
|
10
|
+
testCoasyTrigger,
|
|
11
|
+
} from '../common/triggers';
|
|
4
12
|
|
|
5
|
-
const triggerName =
|
|
13
|
+
const triggerName = 'WEBINAR_PARTICIPANT_ATTEND';
|
|
6
14
|
|
|
7
15
|
export const webinarParticipantAttend = createTrigger({
|
|
8
16
|
auth: coasyAuth,
|
|
9
17
|
name: 'webinarParticipantAttend',
|
|
10
18
|
displayName: 'Webinar Participant Attend',
|
|
11
|
-
description:
|
|
19
|
+
description:
|
|
20
|
+
'Triggers when a webinar participant has attended or not attended',
|
|
12
21
|
props: {
|
|
13
|
-
|
|
14
|
-
displayName: '
|
|
15
|
-
description: '
|
|
16
|
-
required: false
|
|
17
|
-
}),
|
|
18
|
-
status: Property.StaticDropdown({
|
|
19
|
-
displayName: 'Status',
|
|
20
|
-
description: 'filter only participants by',
|
|
22
|
+
selectedStartType: Property.StaticDropdown({
|
|
23
|
+
displayName: 'Selected start type',
|
|
24
|
+
description: 'filter only those participants',
|
|
21
25
|
required: false,
|
|
22
26
|
options: {
|
|
23
27
|
options: [
|
|
24
28
|
{
|
|
25
29
|
label: 'Upcoming',
|
|
26
|
-
value: 'UPCOMING'
|
|
30
|
+
value: 'UPCOMING',
|
|
27
31
|
},
|
|
28
32
|
{
|
|
29
|
-
label: '
|
|
30
|
-
value: '
|
|
33
|
+
label: 'Attended',
|
|
34
|
+
value: 'ATTENDED',
|
|
31
35
|
},
|
|
32
36
|
{
|
|
33
|
-
label: 'Not
|
|
34
|
-
value: '
|
|
35
|
-
}
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
})
|
|
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
|
+
}),
|
|
39
48
|
},
|
|
40
49
|
sampleData: {},
|
|
41
50
|
type: TriggerStrategy.WEBHOOK,
|
|
42
|
-
onEnable: (context) =>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
|
+
}),
|
|
58
70
|
async run(context) {
|
|
59
71
|
return [context.payload.body];
|
|
60
|
-
}
|
|
72
|
+
},
|
|
61
73
|
});
|