@activepieces/piece-respond-io 0.0.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/README.md +7 -0
- package/package.json +38 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +59 -0
- package/src/index.js.map +1 -0
- package/src/lib/actions/add-comment-to-conversation.d.ts +6 -0
- package/src/lib/actions/add-comment-to-conversation.js +43 -0
- package/src/lib/actions/add-comment-to-conversation.js.map +1 -0
- package/src/lib/actions/add-tag-to-contact.d.ts +6 -0
- package/src/lib/actions/add-tag-to-contact.js +55 -0
- package/src/lib/actions/add-tag-to-contact.js.map +1 -0
- package/src/lib/actions/assign-or-unassign-conversation.d.ts +16 -0
- package/src/lib/actions/assign-or-unassign-conversation.js +44 -0
- package/src/lib/actions/assign-or-unassign-conversation.js.map +1 -0
- package/src/lib/actions/create-contact.d.ts +13 -0
- package/src/lib/actions/create-contact.js +127 -0
- package/src/lib/actions/create-contact.js.map +1 -0
- package/src/lib/actions/create-or-update-contact.d.ts +13 -0
- package/src/lib/actions/create-or-update-contact.js +129 -0
- package/src/lib/actions/create-or-update-contact.js.map +1 -0
- package/src/lib/actions/delete-contact.d.ts +5 -0
- package/src/lib/actions/delete-contact.js +29 -0
- package/src/lib/actions/delete-contact.js.map +1 -0
- package/src/lib/actions/find-contact.d.ts +8 -0
- package/src/lib/actions/find-contact.js +66 -0
- package/src/lib/actions/find-contact.js.map +1 -0
- package/src/lib/actions/open-conversation.d.ts +5 -0
- package/src/lib/actions/open-conversation.js +32 -0
- package/src/lib/actions/open-conversation.js.map +1 -0
- package/src/lib/common/auth.d.ts +4 -0
- package/src/lib/common/auth.js +45 -0
- package/src/lib/common/auth.js.map +1 -0
- package/src/lib/common/client.d.ts +10 -0
- package/src/lib/common/client.js +56 -0
- package/src/lib/common/client.js.map +1 -0
- package/src/lib/common/props.d.ts +2 -0
- package/src/lib/common/props.js +116 -0
- package/src/lib/common/props.js.map +1 -0
- package/src/lib/triggers/contact-tag-updated.d.ts +14 -0
- package/src/lib/triggers/contact-tag-updated.js +47 -0
- package/src/lib/triggers/contact-tag-updated.js.map +1 -0
- package/src/lib/triggers/contact-updated.d.ts +14 -0
- package/src/lib/triggers/contact-updated.js +47 -0
- package/src/lib/triggers/contact-updated.js.map +1 -0
- package/src/lib/triggers/conversation-closed.d.ts +14 -0
- package/src/lib/triggers/conversation-closed.js +47 -0
- package/src/lib/triggers/conversation-closed.js.map +1 -0
- package/src/lib/triggers/conversation-opened.d.ts +14 -0
- package/src/lib/triggers/conversation-opened.js +84 -0
- package/src/lib/triggers/conversation-opened.js.map +1 -0
- package/src/lib/triggers/new-contact.d.ts +14 -0
- package/src/lib/triggers/new-contact.js +47 -0
- package/src/lib/triggers/new-contact.js.map +1 -0
- package/src/lib/triggers/new-incoming-message.d.ts +14 -0
- package/src/lib/triggers/new-incoming-message.js +47 -0
- package/src/lib/triggers/new-incoming-message.js.map +1 -0
- package/src/lib/triggers/new-outgoing-message.d.ts +14 -0
- package/src/lib/triggers/new-outgoing-message.js +47 -0
- package/src/lib/triggers/new-outgoing-message.js.map +1 -0
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.conversationOpenedTrigger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const auth_1 = require("../common/auth");
|
|
7
|
+
exports.conversationOpenedTrigger = (0, pieces_framework_1.createTrigger)({
|
|
8
|
+
auth: auth_1.respondIoAuth,
|
|
9
|
+
name: 'conversation_opened',
|
|
10
|
+
displayName: 'Conversation Opened',
|
|
11
|
+
description: 'Triggers when a new conversation is opened.',
|
|
12
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
13
|
+
props: {
|
|
14
|
+
webhookInstructions: pieces_framework_1.Property.MarkDown({
|
|
15
|
+
value: `
|
|
16
|
+
To use this trigger, you need to manually set up a webhook in your Respond.io account:
|
|
17
|
+
|
|
18
|
+
1. Login to your Respond.io account.
|
|
19
|
+
2. Go to Settings > Integrations > Webhooks.
|
|
20
|
+
3. Click on "Add Webhook" or "Create New Webhook".
|
|
21
|
+
4. Add the following URL in the **Webhook URL** field:
|
|
22
|
+
\`\`\`text
|
|
23
|
+
{{webhookUrl}}
|
|
24
|
+
\`\`\`
|
|
25
|
+
5. Select **conversation.opened** from the event types.
|
|
26
|
+
6. Click Save to create the webhook.
|
|
27
|
+
`,
|
|
28
|
+
}),
|
|
29
|
+
},
|
|
30
|
+
onEnable(context) {
|
|
31
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
// No need to register webhooks programmatically as user will do it manually
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
onDisable(context) {
|
|
36
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
// No need to unregister webhooks as user will do it manually
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
run(context) {
|
|
41
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const payload = context.payload.body;
|
|
43
|
+
if (payload.event_type !== 'conversation.opened')
|
|
44
|
+
return [];
|
|
45
|
+
return [payload];
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
test() {
|
|
49
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
return [
|
|
51
|
+
{
|
|
52
|
+
event_type: 'conversation.opened',
|
|
53
|
+
event_id: '8b9c2905-7a38-4aad-a6b7-b9120dc140fe',
|
|
54
|
+
contact: {
|
|
55
|
+
id: 1,
|
|
56
|
+
firstName: 'John',
|
|
57
|
+
lastName: 'Doe',
|
|
58
|
+
phone: '+60123456789',
|
|
59
|
+
email: 'johndoe@sample.com',
|
|
60
|
+
language: 'en',
|
|
61
|
+
profilePic: 'https://cdn.chatapi.net/johndoe.png',
|
|
62
|
+
countryCode: 'MY',
|
|
63
|
+
status: 'open',
|
|
64
|
+
assignee: {
|
|
65
|
+
id: 2,
|
|
66
|
+
firstName: 'John',
|
|
67
|
+
lastName: 'Doe',
|
|
68
|
+
email: 'johndoe@sample.com',
|
|
69
|
+
},
|
|
70
|
+
created_at: 1663274081,
|
|
71
|
+
},
|
|
72
|
+
conversation: {
|
|
73
|
+
source: 'api',
|
|
74
|
+
conversationOpenedAt: 1663274081,
|
|
75
|
+
firstIncomingMessage: 'hello',
|
|
76
|
+
firstIncomingMessageChannelId: 1,
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
];
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
sampleData: {},
|
|
83
|
+
});
|
|
84
|
+
//# sourceMappingURL=conversation-opened.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation-opened.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/respond-io/src/lib/triggers/conversation-opened.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AAExC,yCAA+C;AAElC,QAAA,yBAAyB,GAAG,IAAA,gCAAa,EAAC;IACrD,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,6CAA6C;IAC1D,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,KAAK,EAAE;QACL,mBAAmB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACrC,KAAK,EAAE;;;;;;;;;;;;WAYF;SACN,CAAC;KACH;IAEK,QAAQ,CAAC,OAAO;;YACpB,4EAA4E;QAC9E,CAAC;KAAA;IAEK,SAAS,CAAC,OAAO;;YACrB,6DAA6D;QAC/D,CAAC;KAAA;IAEK,GAAG,CAAC,OAAO;;YACf,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,IAI/B,CAAC;YAEF,IAAI,OAAO,CAAC,UAAU,KAAK,qBAAqB;gBAAE,OAAO,EAAE,CAAC;YAE5D,OAAO,CAAC,OAAO,CAAC,CAAC;QACnB,CAAC;KAAA;IAEK,IAAI;;YACR,OAAO;gBACL;oBACE,UAAU,EAAE,qBAAqB;oBACjC,QAAQ,EAAE,sCAAsC;oBAChD,OAAO,EAAE;wBACP,EAAE,EAAE,CAAC;wBACL,SAAS,EAAE,MAAM;wBACjB,QAAQ,EAAE,KAAK;wBACf,KAAK,EAAE,cAAc;wBACrB,KAAK,EAAE,oBAAoB;wBAC3B,QAAQ,EAAE,IAAI;wBACd,UAAU,EAAE,qCAAqC;wBACjD,WAAW,EAAE,IAAI;wBACjB,MAAM,EAAE,MAAM;wBACd,QAAQ,EAAE;4BACR,EAAE,EAAE,CAAC;4BACL,SAAS,EAAE,MAAM;4BACjB,QAAQ,EAAE,KAAK;4BACf,KAAK,EAAE,oBAAoB;yBAC5B;wBACD,UAAU,EAAE,UAAU;qBACvB;oBACD,YAAY,EAAE;wBACZ,MAAM,EAAE,KAAK;wBACb,oBAAoB,EAAE,UAAU;wBAChC,oBAAoB,EAAE,OAAO;wBAC7B,6BAA6B,EAAE,CAAC;qBACjC;iBACF;aACF,CAAC;QACJ,CAAC;KAAA;IAED,UAAU,EAAE,EAAE;CACf,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const newContactTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
}>, {
|
|
5
|
+
webhookInstructions: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
6
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
+
}>, {
|
|
9
|
+
webhookInstructions: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
10
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
11
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
12
|
+
}>, {
|
|
13
|
+
webhookInstructions: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newContactTrigger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const auth_1 = require("../common/auth");
|
|
7
|
+
exports.newContactTrigger = (0, pieces_framework_1.createTrigger)({
|
|
8
|
+
name: 'new_contact',
|
|
9
|
+
displayName: 'New Contact',
|
|
10
|
+
description: 'Triggers when a new contact is created in Respond.io.',
|
|
11
|
+
auth: auth_1.respondIoAuth,
|
|
12
|
+
props: {
|
|
13
|
+
webhookInstructions: pieces_framework_1.Property.MarkDown({
|
|
14
|
+
value: `
|
|
15
|
+
To use this trigger, you need to manually set up a webhook in your Respond.io account:
|
|
16
|
+
|
|
17
|
+
1. Login to your Respond.io account.
|
|
18
|
+
2. Go to Settings > Integrations > Webhooks.
|
|
19
|
+
3. Click on "Add Webhook" or "Create New Webhook".
|
|
20
|
+
4. Add the following URL in the **Webhook URL** field:
|
|
21
|
+
\`\`\`text
|
|
22
|
+
{{webhookUrl}}
|
|
23
|
+
\`\`\`
|
|
24
|
+
5. Select **contact.created** from the event types.
|
|
25
|
+
6. Click Save to create the webhook.
|
|
26
|
+
`,
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
29
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
30
|
+
sampleData: undefined,
|
|
31
|
+
onEnable(context) {
|
|
32
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
// No need to register webhooks programmatically as user will do it manually
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
onDisable(context) {
|
|
37
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
// No need to unregister webhooks as user will do it manually
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
run(context) {
|
|
42
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return [context.payload.body];
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=new-contact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-contact.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/respond-io/src/lib/triggers/new-contact.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AAExC,yCAA+C;AAElC,QAAA,iBAAiB,GAAG,IAAA,gCAAa,EAAC;IAC7C,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,uDAAuD;IACpE,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE;QACL,mBAAmB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACrC,KAAK,EAAE;;;;;;;;;;;;IAYT;SACC,CAAC;KACH;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,UAAU,EAAE,SAAS;IAEf,QAAQ,CAAC,OAAO;;YACpB,4EAA4E;QAC9E,CAAC;KAAA;IAEK,SAAS,CAAC,OAAO;;YACrB,6DAA6D;QAC/D,CAAC;KAAA;IAEK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const newIncomingMessageTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
}>, {
|
|
5
|
+
webhookInstructions: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
6
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
+
}>, {
|
|
9
|
+
webhookInstructions: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
10
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
11
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
12
|
+
}>, {
|
|
13
|
+
webhookInstructions: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newIncomingMessageTrigger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const auth_1 = require("../common/auth");
|
|
7
|
+
exports.newIncomingMessageTrigger = (0, pieces_framework_1.createTrigger)({
|
|
8
|
+
name: 'new_incoming_message',
|
|
9
|
+
displayName: 'New Incoming Message',
|
|
10
|
+
description: 'Triggers when a new message is received from a contact.',
|
|
11
|
+
auth: auth_1.respondIoAuth,
|
|
12
|
+
props: {
|
|
13
|
+
webhookInstructions: pieces_framework_1.Property.MarkDown({
|
|
14
|
+
value: `
|
|
15
|
+
To use this trigger, you need to manually set up a webhook in your Respond.io account:
|
|
16
|
+
|
|
17
|
+
1. Login to your Respond.io account.
|
|
18
|
+
2. Go to Settings > Integrations > Webhooks.
|
|
19
|
+
3. Click on "Add Webhook" or "Create New Webhook".
|
|
20
|
+
4. Add the following URL in the **Webhook URL** field:
|
|
21
|
+
\`\`\`text
|
|
22
|
+
{{webhookUrl}}
|
|
23
|
+
\`\`\`
|
|
24
|
+
5. Select **message.received** from the event types.
|
|
25
|
+
6. Click Save to create the webhook.
|
|
26
|
+
`,
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
29
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
30
|
+
sampleData: undefined,
|
|
31
|
+
onEnable(context) {
|
|
32
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
// No need to register webhooks programmatically as user will do it manually
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
onDisable(context) {
|
|
37
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
// No need to unregister webhooks as user will do it manually
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
run(context) {
|
|
42
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return [context.payload.body];
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=new-incoming-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-incoming-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/respond-io/src/lib/triggers/new-incoming-message.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,yCAA+C;AAElC,QAAA,yBAAyB,GAAG,IAAA,gCAAa,EAAC;IACrD,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,yDAAyD;IACtE,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE;QACL,mBAAmB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACrC,KAAK,EAAE;;;;;;;;;;;;IAYT;SACC,CAAC;KACH;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,UAAU,EAAE,SAAS;IACf,QAAQ,CAAC,OAAO;;YACpB,4EAA4E;QAC9E,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,6DAA6D;QAC/D,CAAC;KAAA;IAEK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TriggerStrategy } from '@activepieces/pieces-framework';
|
|
2
|
+
export declare const newOutgoingMessageTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
3
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
4
|
+
}>, {
|
|
5
|
+
webhookInstructions: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
6
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
7
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
8
|
+
}>, {
|
|
9
|
+
webhookInstructions: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
10
|
+
}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, import("@activepieces/pieces-framework").CustomAuthProperty<{
|
|
11
|
+
token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
|
|
12
|
+
}>, {
|
|
13
|
+
webhookInstructions: import("dist/packages/pieces/community/framework/src/lib/property/input/markdown-property").MarkDownProperty;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newOutgoingMessageTrigger = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
6
|
+
const auth_1 = require("../common/auth");
|
|
7
|
+
exports.newOutgoingMessageTrigger = (0, pieces_framework_1.createTrigger)({
|
|
8
|
+
name: 'new_outgoing_message',
|
|
9
|
+
displayName: 'New Outgoing Message',
|
|
10
|
+
description: 'Triggers when a message is sent from Respond.io.',
|
|
11
|
+
auth: auth_1.respondIoAuth,
|
|
12
|
+
props: {
|
|
13
|
+
webhookInstructions: pieces_framework_1.Property.MarkDown({
|
|
14
|
+
value: `
|
|
15
|
+
To use this trigger, you need to manually set up a webhook in your Respond.io account:
|
|
16
|
+
|
|
17
|
+
1. Login to your Respond.io account.
|
|
18
|
+
2. Go to Settings > Integrations > Webhooks.
|
|
19
|
+
3. Click on "Add Webhook" or "Create New Webhook".
|
|
20
|
+
4. Add the following URL in the **Webhook URL** field:
|
|
21
|
+
\`\`\`text
|
|
22
|
+
{{webhookUrl}}
|
|
23
|
+
\`\`\`
|
|
24
|
+
5. Select **message.sent** from the event types.
|
|
25
|
+
6. Click Save to create the webhook.
|
|
26
|
+
`,
|
|
27
|
+
}),
|
|
28
|
+
},
|
|
29
|
+
type: pieces_framework_1.TriggerStrategy.WEBHOOK,
|
|
30
|
+
sampleData: undefined,
|
|
31
|
+
onEnable(context) {
|
|
32
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
// No need to register webhooks programmatically as user will do it manually
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
onDisable(context) {
|
|
37
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
// No need to unregister webhooks as user will do it manually
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
run(context) {
|
|
42
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
return [context.payload.body];
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=new-outgoing-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"new-outgoing-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/respond-io/src/lib/triggers/new-outgoing-message.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,yCAA+C;AAElC,QAAA,yBAAyB,GAAG,IAAA,gCAAa,EAAC;IACrD,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,sBAAsB;IACnC,WAAW,EAAE,kDAAkD;IAC/D,IAAI,EAAE,oBAAa;IACnB,KAAK,EAAE;QACL,mBAAmB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACrC,KAAK,EAAE;;;;;;;;;;;;IAYT;SACC,CAAC;KACH;IACD,IAAI,EAAE,kCAAe,CAAC,OAAO;IAC7B,UAAU,EAAE,SAAS;IACf,QAAQ,CAAC,OAAO;;YACpB,4EAA4E;QAC9E,CAAC;KAAA;IACK,SAAS,CAAC,OAAO;;YACrB,6DAA6D;QAC/D,CAAC;KAAA;IAEK,GAAG,CAAC,OAAO;;YACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChC,CAAC;KAAA;CACF,CAAC,CAAC"}
|