@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.
Files changed (59) hide show
  1. package/README.md +7 -0
  2. package/package.json +38 -0
  3. package/src/index.d.ts +3 -0
  4. package/src/index.js +59 -0
  5. package/src/index.js.map +1 -0
  6. package/src/lib/actions/add-comment-to-conversation.d.ts +6 -0
  7. package/src/lib/actions/add-comment-to-conversation.js +43 -0
  8. package/src/lib/actions/add-comment-to-conversation.js.map +1 -0
  9. package/src/lib/actions/add-tag-to-contact.d.ts +6 -0
  10. package/src/lib/actions/add-tag-to-contact.js +55 -0
  11. package/src/lib/actions/add-tag-to-contact.js.map +1 -0
  12. package/src/lib/actions/assign-or-unassign-conversation.d.ts +16 -0
  13. package/src/lib/actions/assign-or-unassign-conversation.js +44 -0
  14. package/src/lib/actions/assign-or-unassign-conversation.js.map +1 -0
  15. package/src/lib/actions/create-contact.d.ts +13 -0
  16. package/src/lib/actions/create-contact.js +127 -0
  17. package/src/lib/actions/create-contact.js.map +1 -0
  18. package/src/lib/actions/create-or-update-contact.d.ts +13 -0
  19. package/src/lib/actions/create-or-update-contact.js +129 -0
  20. package/src/lib/actions/create-or-update-contact.js.map +1 -0
  21. package/src/lib/actions/delete-contact.d.ts +5 -0
  22. package/src/lib/actions/delete-contact.js +29 -0
  23. package/src/lib/actions/delete-contact.js.map +1 -0
  24. package/src/lib/actions/find-contact.d.ts +8 -0
  25. package/src/lib/actions/find-contact.js +66 -0
  26. package/src/lib/actions/find-contact.js.map +1 -0
  27. package/src/lib/actions/open-conversation.d.ts +5 -0
  28. package/src/lib/actions/open-conversation.js +32 -0
  29. package/src/lib/actions/open-conversation.js.map +1 -0
  30. package/src/lib/common/auth.d.ts +4 -0
  31. package/src/lib/common/auth.js +45 -0
  32. package/src/lib/common/auth.js.map +1 -0
  33. package/src/lib/common/client.d.ts +10 -0
  34. package/src/lib/common/client.js +56 -0
  35. package/src/lib/common/client.js.map +1 -0
  36. package/src/lib/common/props.d.ts +2 -0
  37. package/src/lib/common/props.js +116 -0
  38. package/src/lib/common/props.js.map +1 -0
  39. package/src/lib/triggers/contact-tag-updated.d.ts +14 -0
  40. package/src/lib/triggers/contact-tag-updated.js +47 -0
  41. package/src/lib/triggers/contact-tag-updated.js.map +1 -0
  42. package/src/lib/triggers/contact-updated.d.ts +14 -0
  43. package/src/lib/triggers/contact-updated.js +47 -0
  44. package/src/lib/triggers/contact-updated.js.map +1 -0
  45. package/src/lib/triggers/conversation-closed.d.ts +14 -0
  46. package/src/lib/triggers/conversation-closed.js +47 -0
  47. package/src/lib/triggers/conversation-closed.js.map +1 -0
  48. package/src/lib/triggers/conversation-opened.d.ts +14 -0
  49. package/src/lib/triggers/conversation-opened.js +84 -0
  50. package/src/lib/triggers/conversation-opened.js.map +1 -0
  51. package/src/lib/triggers/new-contact.d.ts +14 -0
  52. package/src/lib/triggers/new-contact.js +47 -0
  53. package/src/lib/triggers/new-contact.js.map +1 -0
  54. package/src/lib/triggers/new-incoming-message.d.ts +14 -0
  55. package/src/lib/triggers/new-incoming-message.js +47 -0
  56. package/src/lib/triggers/new-incoming-message.js.map +1 -0
  57. package/src/lib/triggers/new-outgoing-message.d.ts +14 -0
  58. package/src/lib/triggers/new-outgoing-message.js +47 -0
  59. package/src/lib/triggers/new-outgoing-message.js.map +1 -0
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deleteContact = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@activepieces/pieces-common");
6
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
7
+ const client_1 = require("../common/client");
8
+ const auth_1 = require("../common/auth");
9
+ const props_1 = require("../common/props");
10
+ exports.deleteContact = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.respondIoAuth,
12
+ name: 'delete_contact',
13
+ displayName: 'Delete Contact',
14
+ description: 'Permanently delete a contact from Respond.io.',
15
+ props: {
16
+ identifier: props_1.contactIdentifierDropdown,
17
+ },
18
+ run(_a) {
19
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue, auth }) {
20
+ const { identifier } = propsValue;
21
+ return yield (0, client_1.respondIoApiCall)({
22
+ method: pieces_common_1.HttpMethod.DELETE,
23
+ url: `/contact/${identifier}`,
24
+ auth: auth,
25
+ });
26
+ });
27
+ },
28
+ });
29
+ //# sourceMappingURL=delete-contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete-contact.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/respond-io/src/lib/actions/delete-contact.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAA8D;AAC9D,6CAAoD;AACpD,yCAA+C;AAC/C,2CAA4D;AAE/C,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,+CAA+C;IAC5D,KAAK,EAAE;QACL,UAAU,EAAE,iCAAyB;KACtC;IACK,GAAG;qEAAC,EAAE,UAAU,EAAE,IAAI,EAAE;YAC5B,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC;YAElC,OAAO,MAAM,IAAA,yBAAgB,EAAC;gBAC5B,MAAM,EAAE,0BAAU,CAAC,MAAM;gBACzB,GAAG,EAAE,YAAY,UAAU,EAAE;gBAC7B,IAAI,EAAE,IAAI;aACX,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const findContact: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
+ }>, {
4
+ search: import("@activepieces/pieces-framework").ShortTextProperty<true>;
5
+ timezone: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
+ limit: import("@activepieces/pieces-framework").NumberProperty<false>;
7
+ cursorId: import("@activepieces/pieces-framework").NumberProperty<false>;
8
+ }>;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findContact = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@activepieces/pieces-common");
6
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
7
+ const client_1 = require("../common/client");
8
+ const auth_1 = require("../common/auth");
9
+ exports.findContact = (0, pieces_framework_1.createAction)({
10
+ auth: auth_1.respondIoAuth,
11
+ name: 'find_contact',
12
+ displayName: 'Find Contact',
13
+ description: 'Search for contacts by name, email, or phone number in Respond.io.',
14
+ props: {
15
+ search: pieces_framework_1.Property.ShortText({
16
+ displayName: 'Search Term',
17
+ description: 'The value to search for (e.g., email address, phone number, or name).',
18
+ required: true,
19
+ }),
20
+ timezone: pieces_framework_1.Property.ShortText({
21
+ displayName: 'Timezone',
22
+ description: 'Timezone for the search (e.g., "Asia/Kuala_Lumpur"). Optional.',
23
+ required: false,
24
+ }),
25
+ limit: pieces_framework_1.Property.Number({
26
+ displayName: 'Result Limit',
27
+ description: 'Number of contacts to return (1-99). Default is 10.',
28
+ required: false,
29
+ defaultValue: 10,
30
+ }),
31
+ cursorId: pieces_framework_1.Property.Number({
32
+ displayName: 'Cursor ID',
33
+ description: 'Contact ID to start from for pagination. Optional.',
34
+ required: false,
35
+ }),
36
+ },
37
+ run(_a) {
38
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue, auth }) {
39
+ const { search, timezone, limit = 10, cursorId } = propsValue;
40
+ // Validate limit (API requirement: >= 1 < 100)
41
+ if (limit < 1 || limit >= 100) {
42
+ throw new Error('Limit must be between 1 and 99.');
43
+ }
44
+ // Build query parameters
45
+ const queryParams = [`limit=${limit}`];
46
+ if (cursorId) {
47
+ queryParams.push(`cursorId=${cursorId}`);
48
+ }
49
+ // Build request body
50
+ const body = {
51
+ search,
52
+ filter: { $and: [] }
53
+ };
54
+ if (timezone) {
55
+ body.timezone = timezone;
56
+ }
57
+ return yield (0, client_1.respondIoApiCall)({
58
+ method: pieces_common_1.HttpMethod.POST,
59
+ url: `/contact/list?${queryParams.join('&')}`,
60
+ auth: auth,
61
+ body,
62
+ });
63
+ });
64
+ },
65
+ });
66
+ //# sourceMappingURL=find-contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"find-contact.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/respond-io/src/lib/actions/find-contact.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAAwE;AACxE,6CAAoD;AACpD,yCAA+C;AAElC,QAAA,WAAW,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,oEAAoE;IACjF,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,aAAa;YAC1B,WAAW,EACT,uEAAuE;YACzE,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,UAAU;YACvB,WAAW,EACT,gEAAgE;YAClE,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACrB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,qDAAqD;YAClE,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,EAAE;SACjB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,MAAM,CAAC;YACxB,WAAW,EAAE,WAAW;YACxB,WAAW,EAAE,oDAAoD;YACjE,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,UAAU,EAAE,IAAI,EAAE;YAC5B,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAC;YAE9D,+CAA+C;YAC/C,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,IAAI,GAAG,EAAE,CAAC;gBAC9B,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;YACrD,CAAC;YAED,yBAAyB;YACzB,MAAM,WAAW,GAAG,CAAC,SAAS,KAAK,EAAE,CAAC,CAAC;YACvC,IAAI,QAAQ,EAAE,CAAC;gBACb,WAAW,CAAC,IAAI,CAAC,YAAY,QAAQ,EAAE,CAAC,CAAC;YAC3C,CAAC;YAED,qBAAqB;YACrB,MAAM,IAAI,GAIN;gBACF,MAAM;gBACN,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;aACrB,CAAC;YAEF,IAAI,QAAQ,EAAE,CAAC;gBACb,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC3B,CAAC;YAED,OAAO,MAAM,IAAA,yBAAgB,EAAC;gBAC5B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,iBAAiB,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBAC7C,IAAI,EAAE,IAAI;gBACV,IAAI;aACL,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const openConversation: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").CustomAuthProperty<{
2
+ token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
+ }>, {
4
+ identifier: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
5
+ }>;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.openConversation = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@activepieces/pieces-common");
6
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
7
+ const client_1 = require("../common/client");
8
+ const auth_1 = require("../common/auth");
9
+ const props_1 = require("../common/props");
10
+ exports.openConversation = (0, pieces_framework_1.createAction)({
11
+ auth: auth_1.respondIoAuth,
12
+ name: 'open_conversation',
13
+ displayName: 'Open Conversation',
14
+ description: 'Mark a conversation as open in Respond.io.',
15
+ props: {
16
+ identifier: props_1.contactIdentifierDropdown,
17
+ },
18
+ run(_a) {
19
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue, auth }) {
20
+ const { identifier } = propsValue;
21
+ return yield (0, client_1.respondIoApiCall)({
22
+ method: pieces_common_1.HttpMethod.POST,
23
+ url: `/contact/${identifier}/conversation/status`,
24
+ auth: auth,
25
+ body: {
26
+ status: 'open',
27
+ },
28
+ });
29
+ });
30
+ },
31
+ });
32
+ //# sourceMappingURL=open-conversation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-conversation.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/respond-io/src/lib/actions/open-conversation.ts"],"names":[],"mappings":";;;;AAAA,+DAAyD;AACzD,qEAA8D;AAC9D,6CAAoD;AACpD,yCAA+C;AAC/C,2CAA4D;AAE/C,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC3C,IAAI,EAAE,oBAAa;IACnB,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,4CAA4C;IACzD,KAAK,EAAE;QACL,UAAU,EAAE,iCAAyB;KACtC;IACK,GAAG;qEAAC,EAAE,UAAU,EAAE,IAAI,EAAE;YAC5B,MAAM,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC;YAElC,OAAO,MAAM,IAAA,yBAAgB,EAAC;gBAC5B,MAAM,EAAE,0BAAU,CAAC,IAAI;gBACvB,GAAG,EAAE,YAAY,UAAU,sBAAsB;gBACjD,IAAI,EAAE,IAAI;gBACV,IAAI,EAAE;oBACJ,MAAM,EAAE,MAAM;iBACf;aACF,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const RespondIoAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
2
+ export declare const respondIoAuth: import("@activepieces/pieces-framework").CustomAuthProperty<{
3
+ token: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
+ }>;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.respondIoAuth = exports.RespondIoAuth = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const client_1 = require("./client");
7
+ const pieces_common_1 = require("@activepieces/pieces-common");
8
+ // For typing purposes in the client
9
+ exports.RespondIoAuth = pieces_framework_1.PieceAuth.SecretText({
10
+ displayName: 'API Token',
11
+ description: 'Your Respond.io API v2 Token.',
12
+ required: true,
13
+ });
14
+ exports.respondIoAuth = pieces_framework_1.PieceAuth.CustomAuth({
15
+ description: `
16
+ Please follow these steps to get your Respond.io API token:
17
+
18
+ 1. Log in to your Respond.io account.
19
+ 2. In the left sidebar, navigate to Settings.
20
+ 3. Under Workspace Settings, click on Integrations.
21
+ 4. Locate and click on the Developer API option.
22
+ 5. Within the Developer API section, find your API key or generate a new one if needed.`,
23
+ props: {
24
+ token: exports.RespondIoAuth,
25
+ },
26
+ validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
27
+ try {
28
+ // This endpoint lists space users, a simple way to validate the token.
29
+ yield (0, client_1.respondIoApiCall)({
30
+ method: pieces_common_1.HttpMethod.GET,
31
+ url: '/space/user',
32
+ auth: auth,
33
+ });
34
+ return { valid: true };
35
+ }
36
+ catch (e) {
37
+ return {
38
+ valid: false,
39
+ error: 'Invalid API Token',
40
+ };
41
+ }
42
+ }),
43
+ required: true,
44
+ });
45
+ //# sourceMappingURL=auth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/respond-io/src/lib/common/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAA2D;AAC3D,qCAA4C;AAC5C,+DAAyD;AAEzD,oCAAoC;AACvB,QAAA,aAAa,GAAG,4BAAS,CAAC,UAAU,CAAC;IAChD,WAAW,EAAE,WAAW;IACxB,WAAW,EAAE,+BAA+B;IAC5C,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,4BAAS,CAAC,UAAU,CAAC;IAChD,WAAW,EAAE;;;;;;;0FAO2E;IACxF,KAAK,EAAE;QACL,KAAK,EAAE,qBAAa;KACrB;IACD,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACvB,IAAI,CAAC;YACH,uEAAuE;YACvE,MAAM,IAAA,yBAAgB,EAAC;gBACrB,MAAM,EAAE,0BAAU,CAAC,GAAG;gBACtB,GAAG,EAAE,aAAa;gBAClB,IAAI,EAAE,IAAI;aACX,CAAC,CAAC;YACH,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO;gBACL,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,mBAAmB;aAC3B,CAAC;QACJ,CAAC;IACH,CAAC,CAAA;IACD,QAAQ,EAAE,IAAI;CACf,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { HttpMethod, HttpMessageBody } from '@activepieces/pieces-common';
2
+ import { PiecePropValueSchema } from '@activepieces/pieces-framework';
3
+ import { respondIoAuth } from './auth';
4
+ export type RespondIoApiCallParams = {
5
+ method: HttpMethod;
6
+ url: string;
7
+ body?: unknown;
8
+ auth: PiecePropValueSchema<typeof respondIoAuth>;
9
+ };
10
+ export declare function respondIoApiCall<T extends HttpMessageBody>({ method, url, body, auth }: RespondIoApiCallParams): Promise<T>;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.respondIoApiCall = respondIoApiCall;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_common_1 = require("@activepieces/pieces-common");
6
+ function respondIoApiCall(_a) {
7
+ return tslib_1.__awaiter(this, arguments, void 0, function* ({ method, url, body, auth }) {
8
+ var _b, _c, _d;
9
+ const request = {
10
+ method,
11
+ url: `https://api.respond.io/v2${url}`,
12
+ authentication: {
13
+ type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
14
+ token: auth.token
15
+ },
16
+ headers: {
17
+ 'Content-Type': 'application/json',
18
+ accept: 'application/json'
19
+ },
20
+ body
21
+ };
22
+ try {
23
+ const response = yield pieces_common_1.httpClient.sendRequest(request);
24
+ return response.body;
25
+ }
26
+ catch (error) {
27
+ const err = error;
28
+ const status = (_b = err.response) === null || _b === void 0 ? void 0 : _b.status;
29
+ const apiMessage = ((_d = (_c = err.response) === null || _c === void 0 ? void 0 : _c.body) === null || _d === void 0 ? void 0 : _d.message) || 'No details provided';
30
+ // Provide specific, user-friendly error messages based on status codes
31
+ switch (status) {
32
+ case 400:
33
+ throw new Error(`Bad Request: The request format is incorrect or missing required data. Please check your input values. Details: ${apiMessage}`);
34
+ case 401:
35
+ throw new Error(`Authentication Error: Your API token is invalid or expired. Please check your Respond.io API token in the connection settings. Details: ${apiMessage}`);
36
+ case 403:
37
+ throw new Error(`Access Forbidden: Your API token doesn't have permission for this operation. Please check your Respond.io account permissions. Details: ${apiMessage}`);
38
+ case 404:
39
+ throw new Error(`Resource Not Found: The requested contact, conversation, or resource doesn't exist in your Respond.io workspace. Details: ${apiMessage}`);
40
+ case 409:
41
+ throw new Error(`Conflict: The resource already exists or there's a data conflict. This often happens when trying to create a contact with an existing identifier. Details: ${apiMessage}`);
42
+ case 429:
43
+ throw new Error(`Rate Limit Exceeded: Too many requests to Respond.io API. Please wait a moment before trying again. Details: ${apiMessage}`);
44
+ case 449:
45
+ throw new Error(`Request Failed: The request could not be completed. This may be a temporary issue with Respond.io services. Please try again later. Details: ${apiMessage}`);
46
+ case 500:
47
+ throw new Error(`Server Error: Respond.io is experiencing technical difficulties. Please try again later or contact Respond.io support. Details: ${apiMessage}`);
48
+ default: {
49
+ const fallbackMessage = err.message || 'Unknown error occurred';
50
+ throw new Error(`Respond.io API Error (Status ${status || 'Unknown'}): ${apiMessage || fallbackMessage}`);
51
+ }
52
+ }
53
+ }
54
+ });
55
+ }
56
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/respond-io/src/lib/common/client.ts"],"names":[],"mappings":";;AAiBA,4CA+EC;;AAhGD,+DAMqC;AAWrC,SAAsB,gBAAgB;iEAA4B,EAChE,MAAM,EACN,GAAG,EACH,IAAI,EACJ,IAAI,EACmB;;QACvB,MAAM,OAAO,GAAgB;YAC3B,MAAM;YACN,GAAG,EAAE,4BAA4B,GAAG,EAAE;YACtC,cAAc,EAAE;gBACd,IAAI,EAAE,kCAAkB,CAAC,YAAY;gBACrC,KAAK,EAAE,IAAI,CAAC,KAAK;aAClB;YACD,OAAO,EAAE;gBACP,cAAc,EAAE,kBAAkB;gBAClC,MAAM,EAAE,kBAAkB;aAC3B;YACD,IAAI;SACL,CAAC;QAEF,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAAI,OAAO,CAAC,CAAC;YAC1D,OAAO,QAAQ,CAAC,IAAI,CAAC;QACvB,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,MAAM,GAAG,GAAG,KAMX,CAAC;YAEF,MAAM,MAAM,GAAG,MAAA,GAAG,CAAC,QAAQ,0CAAE,MAAM,CAAC;YACpC,MAAM,UAAU,GAAG,CAAA,MAAA,MAAA,GAAG,CAAC,QAAQ,0CAAE,IAAI,0CAAE,OAAO,KAAI,qBAAqB,CAAC;YAExE,uEAAuE;YACvE,QAAQ,MAAM,EAAE,CAAC;gBACf,KAAK,GAAG;oBACN,MAAM,IAAI,KAAK,CACb,mHAAmH,UAAU,EAAE,CAChI,CAAC;gBACJ,KAAK,GAAG;oBACN,MAAM,IAAI,KAAK,CACb,2IAA2I,UAAU,EAAE,CACxJ,CAAC;gBACJ,KAAK,GAAG;oBACN,MAAM,IAAI,KAAK,CACb,2IAA2I,UAAU,EAAE,CACxJ,CAAC;gBACJ,KAAK,GAAG;oBACN,MAAM,IAAI,KAAK,CACb,6HAA6H,UAAU,EAAE,CAC1I,CAAC;gBACJ,KAAK,GAAG;oBACN,MAAM,IAAI,KAAK,CACb,8JAA8J,UAAU,EAAE,CAC3K,CAAC;gBACJ,KAAK,GAAG;oBACN,MAAM,IAAI,KAAK,CACb,gHAAgH,UAAU,EAAE,CAC7H,CAAC;gBACJ,KAAK,GAAG;oBACN,MAAM,IAAI,KAAK,CACb,gJAAgJ,UAAU,EAAE,CAC7J,CAAC;gBACJ,KAAK,GAAG;oBACN,MAAM,IAAI,KAAK,CACb,mIAAmI,UAAU,EAAE,CAChJ,CAAC;gBACJ,OAAO,CAAC,CAAC,CAAC;oBACR,MAAM,eAAe,GAAG,GAAG,CAAC,OAAO,IAAI,wBAAwB,CAAC;oBAChE,MAAM,IAAI,KAAK,CACb,gCAAgC,MAAM,IAAI,SAAS,MACjD,UAAU,IAAI,eAChB,EAAE,CACH,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CAAA"}
@@ -0,0 +1,2 @@
1
+ export declare const contactIdentifierDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
2
+ export declare const assigneeDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, true>;
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.assigneeDropdown = exports.contactIdentifierDropdown = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const pieces_framework_1 = require("@activepieces/pieces-framework");
6
+ const pieces_common_1 = require("@activepieces/pieces-common");
7
+ const client_1 = require("./client");
8
+ // --- Contact Dropdown ---
9
+ exports.contactIdentifierDropdown = pieces_framework_1.Property.Dropdown({
10
+ displayName: 'Contact',
11
+ description: 'Select the contact.',
12
+ required: true,
13
+ refreshers: ['auth'],
14
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
15
+ if (!auth) {
16
+ return {
17
+ disabled: true,
18
+ options: [],
19
+ placeholder: 'Connect your Respond.io account first',
20
+ };
21
+ }
22
+ try {
23
+ const response = yield (0, client_1.respondIoApiCall)({
24
+ auth: auth,
25
+ method: pieces_common_1.HttpMethod.POST,
26
+ url: '/contact/list',
27
+ body: {
28
+ search: '',
29
+ filter: {
30
+ $and: [],
31
+ },
32
+ timezone: 'UTC',
33
+ },
34
+ });
35
+ const contacts = response.items;
36
+ if (contacts.length === 0) {
37
+ return {
38
+ disabled: true,
39
+ options: [],
40
+ placeholder: 'No contacts found in your workspace.',
41
+ };
42
+ }
43
+ return {
44
+ disabled: false,
45
+ options: contacts.map((contact) => {
46
+ const contactInfo = contact.email || contact.phone || `ID: ${contact.id}`;
47
+ return {
48
+ label: `${contact.firstName || ''} ${contact.lastName || ''} (${contactInfo})`.trim(),
49
+ value: `id:${contact.id}`,
50
+ };
51
+ }),
52
+ };
53
+ }
54
+ catch (error) {
55
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
56
+ return {
57
+ disabled: true,
58
+ options: [],
59
+ placeholder: `Error loading contacts: ${errorMessage}`,
60
+ };
61
+ }
62
+ }),
63
+ });
64
+ // --- Assignee (User) Dropdown ---
65
+ exports.assigneeDropdown = pieces_framework_1.Property.Dropdown({
66
+ displayName: 'Assignee',
67
+ description: 'Select the user to assign the conversation to.',
68
+ required: true,
69
+ refreshers: ['auth'],
70
+ options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
71
+ if (!auth) {
72
+ return {
73
+ disabled: true,
74
+ options: [],
75
+ placeholder: 'Connect your Respond.io account first',
76
+ };
77
+ }
78
+ try {
79
+ const response = yield (0, client_1.respondIoApiCall)({
80
+ auth: auth,
81
+ method: pieces_common_1.HttpMethod.GET,
82
+ url: '/space/user',
83
+ });
84
+ const users = response.items;
85
+ if (users.length === 0) {
86
+ return {
87
+ disabled: true,
88
+ options: [],
89
+ placeholder: 'No users found in your workspace.',
90
+ };
91
+ }
92
+ return {
93
+ disabled: false,
94
+ options: [
95
+ {
96
+ label: 'Unassigned',
97
+ value: 'null', // MUST be string "null"
98
+ },
99
+ ...users.map((user) => ({
100
+ label: `${user.firstName} ${user.lastName} (${user.email})`,
101
+ value: user.id.toString(), // always string
102
+ })),
103
+ ],
104
+ };
105
+ }
106
+ catch (error) {
107
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
108
+ return {
109
+ disabled: true,
110
+ options: [],
111
+ placeholder: `Error loading users: ${errorMessage}`,
112
+ };
113
+ }
114
+ }),
115
+ });
116
+ //# sourceMappingURL=props.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/respond-io/src/lib/common/props.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,14 @@
1
+ import { TriggerStrategy } from '@activepieces/pieces-framework';
2
+ export declare const contactTagUpdatedTrigger: 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.contactTagUpdatedTrigger = 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.contactTagUpdatedTrigger = (0, pieces_framework_1.createTrigger)({
8
+ name: 'contact_tag_updated',
9
+ displayName: 'Contact Tag Updated',
10
+ description: 'Triggers when a tag is added or removed from a contact 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.tag.updated** 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=contact-tag-updated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact-tag-updated.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/respond-io/src/lib/triggers/contact-tag-updated.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AAExC,yCAA+C;AAElC,QAAA,wBAAwB,GAAG,IAAA,gCAAa,EAAC;IACpD,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,uEAAuE;IACpF,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 contactUpdatedTrigger: 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.contactUpdatedTrigger = 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.contactUpdatedTrigger = (0, pieces_framework_1.createTrigger)({
8
+ name: 'contact_updated',
9
+ displayName: 'Contact Updated',
10
+ description: 'Triggers when an existing contact is updated 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.updated** 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=contact-updated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact-updated.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/respond-io/src/lib/triggers/contact-updated.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,yCAA+C;AAElC,QAAA,qBAAqB,GAAG,IAAA,gCAAa,EAAC;IACjD,IAAI,EAAE,iBAAiB;IACvB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,6DAA6D;IAC1E,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 conversationClosedTrigger: 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.conversationClosedTrigger = 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.conversationClosedTrigger = (0, pieces_framework_1.createTrigger)({
8
+ name: 'conversation_closed',
9
+ displayName: 'Conversation Closed',
10
+ description: 'Triggers when a conversation is closed.',
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 **conversation.closed** 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=conversation-closed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation-closed.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/respond-io/src/lib/triggers/conversation-closed.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AAExC,yCAA+C;AAElC,QAAA,yBAAyB,GAAG,IAAA,gCAAa,EAAC;IACrD,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,yCAAyC;IACtD,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 conversationOpenedTrigger: 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
+ }>;