@activepieces/piece-slack 0.17.2 → 0.17.3

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 (193) hide show
  1. package/package.json +7 -15
  2. package/src/index.js +96 -208
  3. package/src/index.d.ts +0 -6
  4. package/src/index.d.ts.map +0 -1
  5. package/src/index.js.map +0 -1
  6. package/src/lib/actions/add-reaction-to-message.d.ts +0 -14
  7. package/src/lib/actions/add-reaction-to-message.d.ts.map +0 -1
  8. package/src/lib/actions/add-reaction-to-message.js +0 -60
  9. package/src/lib/actions/add-reaction-to-message.js.map +0 -1
  10. package/src/lib/actions/create-channel.d.ts +0 -8
  11. package/src/lib/actions/create-channel.d.ts.map +0 -1
  12. package/src/lib/actions/create-channel.js +0 -37
  13. package/src/lib/actions/create-channel.js.map +0 -1
  14. package/src/lib/actions/delete-message.d.ts +0 -12
  15. package/src/lib/actions/delete-message.d.ts.map +0 -1
  16. package/src/lib/actions/delete-message.js +0 -56
  17. package/src/lib/actions/delete-message.js.map +0 -1
  18. package/src/lib/actions/find-user-by-email.d.ts +0 -7
  19. package/src/lib/actions/find-user-by-email.d.ts.map +0 -1
  20. package/src/lib/actions/find-user-by-email.js +0 -35
  21. package/src/lib/actions/find-user-by-email.js.map +0 -1
  22. package/src/lib/actions/find-user-by-handle.d.ts +0 -7
  23. package/src/lib/actions/find-user-by-handle.d.ts.map +0 -1
  24. package/src/lib/actions/find-user-by-handle.js +0 -55
  25. package/src/lib/actions/find-user-by-handle.js.map +0 -1
  26. package/src/lib/actions/find-user-by-id.d.ts +0 -7
  27. package/src/lib/actions/find-user-by-id.d.ts.map +0 -1
  28. package/src/lib/actions/find-user-by-id.js +0 -31
  29. package/src/lib/actions/find-user-by-id.js.map +0 -1
  30. package/src/lib/actions/get-channel-history.d.ts +0 -15
  31. package/src/lib/actions/get-channel-history.d.ts.map +0 -1
  32. package/src/lib/actions/get-channel-history.js +0 -79
  33. package/src/lib/actions/get-channel-history.js.map +0 -1
  34. package/src/lib/actions/get-file.d.ts +0 -7
  35. package/src/lib/actions/get-file.d.ts.map +0 -1
  36. package/src/lib/actions/get-file.js +0 -53
  37. package/src/lib/actions/get-file.js.map +0 -1
  38. package/src/lib/actions/get-group-by-handle.d.ts +0 -7
  39. package/src/lib/actions/get-group-by-handle.d.ts.map +0 -1
  40. package/src/lib/actions/get-group-by-handle.js +0 -38
  41. package/src/lib/actions/get-group-by-handle.js.map +0 -1
  42. package/src/lib/actions/get-message.d.ts +0 -12
  43. package/src/lib/actions/get-message.d.ts.map +0 -1
  44. package/src/lib/actions/get-message.js +0 -43
  45. package/src/lib/actions/get-message.js.map +0 -1
  46. package/src/lib/actions/invite-user-to-channel.d.ts +0 -15
  47. package/src/lib/actions/invite-user-to-channel.d.ts.map +0 -1
  48. package/src/lib/actions/invite-user-to-channel.js +0 -32
  49. package/src/lib/actions/invite-user-to-channel.js.map +0 -1
  50. package/src/lib/actions/list-users.d.ts +0 -8
  51. package/src/lib/actions/list-users.d.ts.map +0 -1
  52. package/src/lib/actions/list-users.js +0 -59
  53. package/src/lib/actions/list-users.js.map +0 -1
  54. package/src/lib/actions/markdown-to-slack-format.d.ts +0 -4
  55. package/src/lib/actions/markdown-to-slack-format.d.ts.map +0 -1
  56. package/src/lib/actions/markdown-to-slack-format.js +0 -26
  57. package/src/lib/actions/markdown-to-slack-format.js.map +0 -1
  58. package/src/lib/actions/request-action-direct-message.d.ts +0 -15
  59. package/src/lib/actions/request-action-direct-message.d.ts.map +0 -1
  60. package/src/lib/actions/request-action-direct-message.js +0 -33
  61. package/src/lib/actions/request-action-direct-message.js.map +0 -1
  62. package/src/lib/actions/request-action-message.d.ts +0 -18
  63. package/src/lib/actions/request-action-message.d.ts.map +0 -1
  64. package/src/lib/actions/request-action-message.js +0 -44
  65. package/src/lib/actions/request-action-message.js.map +0 -1
  66. package/src/lib/actions/request-approval-direct-message.d.ts +0 -14
  67. package/src/lib/actions/request-approval-direct-message.d.ts.map +0 -1
  68. package/src/lib/actions/request-approval-direct-message.js +0 -133
  69. package/src/lib/actions/request-approval-direct-message.js.map +0 -1
  70. package/src/lib/actions/request-approval-message.d.ts +0 -15
  71. package/src/lib/actions/request-approval-message.d.ts.map +0 -1
  72. package/src/lib/actions/request-approval-message.js +0 -130
  73. package/src/lib/actions/request-approval-message.js.map +0 -1
  74. package/src/lib/actions/retrieve-thread-messages.d.ts +0 -11
  75. package/src/lib/actions/retrieve-thread-messages.d.ts.map +0 -1
  76. package/src/lib/actions/retrieve-thread-messages.js +0 -40
  77. package/src/lib/actions/retrieve-thread-messages.js.map +0 -1
  78. package/src/lib/actions/search-messages.d.ts +0 -7
  79. package/src/lib/actions/search-messages.d.ts.map +0 -1
  80. package/src/lib/actions/search-messages.js +0 -50
  81. package/src/lib/actions/search-messages.js.map +0 -1
  82. package/src/lib/actions/send-direct-message-action.d.ts +0 -17
  83. package/src/lib/actions/send-direct-message-action.d.ts.map +0 -1
  84. package/src/lib/actions/send-direct-message-action.js +0 -60
  85. package/src/lib/actions/send-direct-message-action.js.map +0 -1
  86. package/src/lib/actions/send-message-action.d.ts +0 -22
  87. package/src/lib/actions/send-message-action.d.ts.map +0 -1
  88. package/src/lib/actions/send-message-action.js +0 -86
  89. package/src/lib/actions/send-message-action.js.map +0 -1
  90. package/src/lib/actions/set-channel-topic.d.ts +0 -12
  91. package/src/lib/actions/set-channel-topic.d.ts.map +0 -1
  92. package/src/lib/actions/set-channel-topic.js +0 -36
  93. package/src/lib/actions/set-channel-topic.js.map +0 -1
  94. package/src/lib/actions/set-user-status.d.ts +0 -9
  95. package/src/lib/actions/set-user-status.d.ts.map +0 -1
  96. package/src/lib/actions/set-user-status.js +0 -50
  97. package/src/lib/actions/set-user-status.js.map +0 -1
  98. package/src/lib/actions/update-message.d.ts +0 -15
  99. package/src/lib/actions/update-message.d.ts.map +0 -1
  100. package/src/lib/actions/update-message.js +0 -62
  101. package/src/lib/actions/update-message.js.map +0 -1
  102. package/src/lib/actions/update-profile.d.ts +0 -10
  103. package/src/lib/actions/update-profile.d.ts.map +0 -1
  104. package/src/lib/actions/update-profile.js +0 -50
  105. package/src/lib/actions/update-profile.js.map +0 -1
  106. package/src/lib/actions/update-user-groups.d.ts +0 -9
  107. package/src/lib/actions/update-user-groups.d.ts.map +0 -1
  108. package/src/lib/actions/update-user-groups.js +0 -66
  109. package/src/lib/actions/update-user-groups.js.map +0 -1
  110. package/src/lib/actions/upload-file.d.ts +0 -13
  111. package/src/lib/actions/upload-file.d.ts.map +0 -1
  112. package/src/lib/actions/upload-file.js +0 -45
  113. package/src/lib/actions/upload-file.js.map +0 -1
  114. package/src/lib/auth.d.ts +0 -6
  115. package/src/lib/auth.d.ts.map +0 -1
  116. package/src/lib/auth.js +0 -84
  117. package/src/lib/auth.js.map +0 -1
  118. package/src/lib/common/auth-helpers.d.ts +0 -9
  119. package/src/lib/common/auth-helpers.d.ts.map +0 -1
  120. package/src/lib/common/auth-helpers.js +0 -82
  121. package/src/lib/common/auth-helpers.js.map +0 -1
  122. package/src/lib/common/props.d.ts +0 -37
  123. package/src/lib/common/props.d.ts.map +0 -1
  124. package/src/lib/common/props.js +0 -247
  125. package/src/lib/common/props.js.map +0 -1
  126. package/src/lib/common/request-action.d.ts +0 -41
  127. package/src/lib/common/request-action.d.ts.map +0 -1
  128. package/src/lib/common/request-action.js +0 -114
  129. package/src/lib/common/request-action.js.map +0 -1
  130. package/src/lib/common/types.d.ts +0 -10
  131. package/src/lib/common/types.d.ts.map +0 -1
  132. package/src/lib/common/types.js +0 -3
  133. package/src/lib/common/types.js.map +0 -1
  134. package/src/lib/common/utils.d.ts +0 -41
  135. package/src/lib/common/utils.d.ts.map +0 -1
  136. package/src/lib/common/utils.js +0 -134
  137. package/src/lib/common/utils.js.map +0 -1
  138. package/src/lib/triggers/new-channel.d.ts +0 -15
  139. package/src/lib/triggers/new-channel.d.ts.map +0 -1
  140. package/src/lib/triggers/new-channel.js +0 -66
  141. package/src/lib/triggers/new-channel.js.map +0 -1
  142. package/src/lib/triggers/new-command-in-direct-message.d.ts +0 -47
  143. package/src/lib/triggers/new-command-in-direct-message.d.ts.map +0 -1
  144. package/src/lib/triggers/new-command-in-direct-message.js +0 -77
  145. package/src/lib/triggers/new-command-in-direct-message.js.map +0 -1
  146. package/src/lib/triggers/new-command.d.ts +0 -63
  147. package/src/lib/triggers/new-command.d.ts.map +0 -1
  148. package/src/lib/triggers/new-command.js +0 -101
  149. package/src/lib/triggers/new-command.js.map +0 -1
  150. package/src/lib/triggers/new-direct-message.d.ts +0 -27
  151. package/src/lib/triggers/new-direct-message.d.ts.map +0 -1
  152. package/src/lib/triggers/new-direct-message.js +0 -57
  153. package/src/lib/triggers/new-direct-message.js.map +0 -1
  154. package/src/lib/triggers/new-mention-in-direct-message.d.ts +0 -43
  155. package/src/lib/triggers/new-mention-in-direct-message.d.ts.map +0 -1
  156. package/src/lib/triggers/new-mention-in-direct-message.js +0 -66
  157. package/src/lib/triggers/new-mention-in-direct-message.js.map +0 -1
  158. package/src/lib/triggers/new-mention.d.ts +0 -79
  159. package/src/lib/triggers/new-mention.d.ts.map +0 -1
  160. package/src/lib/triggers/new-mention.js +0 -107
  161. package/src/lib/triggers/new-mention.js.map +0 -1
  162. package/src/lib/triggers/new-message-in-channel.d.ts +0 -43
  163. package/src/lib/triggers/new-message-in-channel.d.ts.map +0 -1
  164. package/src/lib/triggers/new-message-in-channel.js +0 -60
  165. package/src/lib/triggers/new-message-in-channel.js.map +0 -1
  166. package/src/lib/triggers/new-message.d.ts +0 -23
  167. package/src/lib/triggers/new-message.d.ts.map +0 -1
  168. package/src/lib/triggers/new-message.js +0 -48
  169. package/src/lib/triggers/new-message.js.map +0 -1
  170. package/src/lib/triggers/new-modal-interaction.d.ts +0 -23
  171. package/src/lib/triggers/new-modal-interaction.d.ts.map +0 -1
  172. package/src/lib/triggers/new-modal-interaction.js +0 -54
  173. package/src/lib/triggers/new-modal-interaction.js.map +0 -1
  174. package/src/lib/triggers/new-reaction-added.d.ts +0 -59
  175. package/src/lib/triggers/new-reaction-added.d.ts.map +0 -1
  176. package/src/lib/triggers/new-reaction-added.js +0 -83
  177. package/src/lib/triggers/new-reaction-added.js.map +0 -1
  178. package/src/lib/triggers/new-reaction-removed.d.ts +0 -59
  179. package/src/lib/triggers/new-reaction-removed.d.ts.map +0 -1
  180. package/src/lib/triggers/new-reaction-removed.js +0 -80
  181. package/src/lib/triggers/new-reaction-removed.js.map +0 -1
  182. package/src/lib/triggers/new-saved-message.d.ts +0 -15
  183. package/src/lib/triggers/new-saved-message.d.ts.map +0 -1
  184. package/src/lib/triggers/new-saved-message.js +0 -38
  185. package/src/lib/triggers/new-saved-message.js.map +0 -1
  186. package/src/lib/triggers/new-team-custom-emoji.d.ts +0 -15
  187. package/src/lib/triggers/new-team-custom-emoji.d.ts.map +0 -1
  188. package/src/lib/triggers/new-team-custom-emoji.js +0 -53
  189. package/src/lib/triggers/new-team-custom-emoji.js.map +0 -1
  190. package/src/lib/triggers/new-user.d.ts +0 -15
  191. package/src/lib/triggers/new-user.d.ts.map +0 -1
  192. package/src/lib/triggers/new-user.js +0 -93
  193. package/src/lib/triggers/new-user.js.map +0 -1
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.channelCreated = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../auth");
7
- const web_api_1 = require("@slack/web-api");
8
- const auth_helpers_1 = require("../common/auth-helpers");
9
- const sampleData = {
10
- type: 'channel_created',
11
- channel: {
12
- id: 'C024BE91L',
13
- name: 'fun',
14
- created: 1360782804,
15
- creator: 'U024BE7LH',
16
- },
17
- };
18
- exports.channelCreated = (0, pieces_framework_1.createTrigger)({
19
- auth: auth_1.slackAuth,
20
- name: 'channel_created',
21
- displayName: 'Channel created',
22
- description: 'Triggers when a channel is created',
23
- aiMetadata: {
24
- description: 'Fires when a new public or private channel is created in the connected Slack workspace. The event payload includes the new channel id, name, creation timestamp, and the id of the user who created it.',
25
- },
26
- props: {},
27
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
28
- sampleData: sampleData,
29
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
30
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
31
- context.app.createListeners({
32
- events: ['channel_created'],
33
- identifierValue: teamId,
34
- });
35
- }),
36
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
37
- // Ignored
38
- }),
39
- test: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
40
- const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(context.auth));
41
- const response = yield client.conversations.list({
42
- exclude_archived: true,
43
- limit: 10,
44
- types: 'public_channel,private_channel',
45
- });
46
- if (!response.channels) {
47
- return [];
48
- }
49
- return response.channels.map((channel) => {
50
- return {
51
- type: 'channel_created',
52
- channel: {
53
- id: channel.id,
54
- name: channel.name,
55
- created: channel.created,
56
- creator: channel.creator,
57
- },
58
- };
59
- });
60
- }),
61
- run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
62
- const payloadBody = context.payload.body;
63
- return [payloadBody.event];
64
- }),
65
- });
66
- //# sourceMappingURL=new-channel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-channel.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-channel.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,kCAAoC;AACpC,4CAA2C;AAC3C,yDAAgF;AAEhF,MAAM,UAAU,GAAG;IACjB,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE;QACP,EAAE,EAAE,WAAW;QACf,IAAI,EAAE,KAAK;QACX,OAAO,EAAE,UAAU;QACnB,OAAO,EAAE,WAAW;KACrB;CACF,CAAC;AAEW,QAAA,cAAc,GAAG,IAAA,gCAAa,EAAC;IAC1C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,iBAAiB;IACvB,W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L,CAAC,CAAA;IAED,GAAG,EAAE,CAAO,OAAO,EAAE,EAAE;QACrB,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,IAAmB,CAAC;QACxD,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -1,47 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const newCommandInDirectMessageTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
3
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
5
- }>)[], {
6
- user: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
7
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
9
- }>)[]>;
10
- commands: import("@activepieces/pieces-framework").ArrayProperty<true>;
11
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
12
- ignoreSelfMessages: import("@activepieces/pieces-framework").CheckboxProperty<true>;
13
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
14
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
15
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
16
- }>)[], {
17
- user: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
18
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
19
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
20
- }>)[]>;
21
- commands: import("@activepieces/pieces-framework").ArrayProperty<true>;
22
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
23
- ignoreSelfMessages: import("@activepieces/pieces-framework").CheckboxProperty<true>;
24
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
25
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
26
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
27
- }>)[], {
28
- user: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
29
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
30
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
31
- }>)[]>;
32
- commands: import("@activepieces/pieces-framework").ArrayProperty<true>;
33
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
34
- ignoreSelfMessages: import("@activepieces/pieces-framework").CheckboxProperty<true>;
35
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
36
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
37
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
38
- }>)[], {
39
- user: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
40
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
41
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
42
- }>)[]>;
43
- commands: import("@activepieces/pieces-framework").ArrayProperty<true>;
44
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
45
- ignoreSelfMessages: import("@activepieces/pieces-framework").CheckboxProperty<true>;
46
- }>;
47
- //# sourceMappingURL=new-command-in-direct-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-command-in-direct-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-command-in-direct-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAMxC,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqF3C,CAAC"}
@@ -1,77 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newCommandInDirectMessageTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const props_1 = require("../common/props");
7
- const auth_1 = require("../auth");
8
- const utils_1 = require("../common/utils");
9
- const auth_helpers_1 = require("../common/auth-helpers");
10
- exports.newCommandInDirectMessageTrigger = (0, pieces_framework_1.createTrigger)({
11
- auth: auth_1.slackAuth,
12
- name: 'new-command-in-direct-message',
13
- displayName: 'New Command in Direct Message',
14
- description: 'Triggers when a specific command is sent to the bot (e.g., @bot command arg1 arg2) via Direct Message.',
15
- aiMetadata: {
16
- description: 'Fires when a direct message (im channel) addressed to the bot contains one of the configured commands (e.g., "@bot help" or "@bot remind"). Only messages in DM channels matching the listed commands fire; bot messages and the user\'s own messages can be optionally ignored. The event payload includes the original message plus a parsed_command object with the recognized command and its arguments.',
17
- },
18
- props: {
19
- user: (0, props_1.userId)(true),
20
- commands: pieces_framework_1.Property.Array({
21
- displayName: 'Commands',
22
- description: 'List of valid commands that the bot should respond to (e.g., help, ocr, remind)',
23
- required: true,
24
- defaultValue: ['help'],
25
- }),
26
- ignoreBots: pieces_framework_1.Property.Checkbox({
27
- displayName: 'Ignore Bot Messages ?',
28
- required: true,
29
- defaultValue: true,
30
- }),
31
- ignoreSelfMessages: pieces_framework_1.Property.Checkbox({
32
- displayName: 'Ignore Message from Yourself ?',
33
- required: true,
34
- defaultValue: false,
35
- }),
36
- },
37
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
38
- sampleData: undefined,
39
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
40
- // Older OAuth2 has team_id, newer has team.id
41
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
42
- context.app.createListeners({
43
- events: ['message'],
44
- identifierValue: teamId,
45
- });
46
- }),
47
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
48
- // Ignored
49
- }),
50
- run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
51
- var _a;
52
- const payloadBody = context.payload.body;
53
- const commands = (_a = context.propsValue.commands) !== null && _a !== void 0 ? _a : [];
54
- const user = context.propsValue.user;
55
- const authUserId = yield (0, auth_helpers_1.getUserId)(context.auth);
56
- if (payloadBody.event.channel_type !== 'im') {
57
- return [];
58
- }
59
- // Check for bot messages if configured to ignore them
60
- if ((context.propsValue.ignoreBots && payloadBody.event.bot_id) ||
61
- (context.propsValue.ignoreSelfMessages && payloadBody.event.user === authUserId)) {
62
- return [];
63
- }
64
- // Check for mention and parse command
65
- if (user && payloadBody.event.text) {
66
- const parsedCommand = (0, utils_1.parseCommand)(payloadBody.event.text, user, commands);
67
- if (parsedCommand && commands.includes(parsedCommand.command)) {
68
- // Return event with parsed command
69
- return [
70
- Object.assign(Object.assign({}, payloadBody.event), { parsed_command: parsedCommand }),
71
- ];
72
- }
73
- }
74
- return [];
75
- }),
76
- });
77
- //# sourceMappingURL=new-command-in-direct-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-command-in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const newCommand: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
3
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
5
- }>)[], {
6
- info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
7
- user: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
8
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
9
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
10
- }>)[]>;
11
- commands: import("@activepieces/pieces-framework").ArrayProperty<true>;
12
- channels: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
13
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
14
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
15
- }>)[]>;
16
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
17
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
18
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
19
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
20
- }>)[], {
21
- info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
22
- user: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
23
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
24
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
25
- }>)[]>;
26
- commands: import("@activepieces/pieces-framework").ArrayProperty<true>;
27
- channels: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
28
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
29
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
30
- }>)[]>;
31
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
32
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
33
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
34
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
35
- }>)[], {
36
- info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
37
- user: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
38
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
39
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
40
- }>)[]>;
41
- commands: import("@activepieces/pieces-framework").ArrayProperty<true>;
42
- channels: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
43
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
44
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
45
- }>)[]>;
46
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
47
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
48
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
49
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
50
- }>)[], {
51
- info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
52
- user: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
53
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
54
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
55
- }>)[]>;
56
- commands: import("@activepieces/pieces-framework").ArrayProperty<true>;
57
- channels: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
58
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
59
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
60
- }>)[]>;
61
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
62
- }>;
63
- //# sourceMappingURL=new-command.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-command.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAMxC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4GrB,CAAC"}
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newCommand = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const props_1 = require("../common/props");
7
- const auth_1 = require("../auth");
8
- const utils_1 = require("../common/utils");
9
- const auth_helpers_1 = require("../common/auth-helpers");
10
- exports.newCommand = (0, pieces_framework_1.createTrigger)({
11
- auth: auth_1.slackAuth,
12
- name: 'new_command',
13
- displayName: 'New Command in Channel',
14
- description: 'Triggers when a specific command is sent to the bot (e.g., @bot command arg1 arg2)',
15
- aiMetadata: {
16
- description: 'Fires when a channel or group message addressed to the bot contains one of the configured commands (e.g., "@bot help" or "@bot ocr"). Can be optionally filtered to specific channels, and bot messages can be ignored. The event payload includes the original message plus a parsed_command object with the recognized command and its arguments.',
17
- },
18
- props: {
19
- info: props_1.multiSelectChannelInfo,
20
- user: (0, props_1.userId)(true),
21
- commands: pieces_framework_1.Property.Array({
22
- displayName: 'Commands',
23
- description: 'List of valid commands that the bot should respond to (e.g., help, ocr, remind)',
24
- required: true,
25
- defaultValue: ['help'],
26
- }),
27
- channels: pieces_framework_1.Property.MultiSelectDropdown({
28
- auth: auth_1.slackAuth,
29
- displayName: 'Channels',
30
- description: 'If no channel is selected, the flow will be triggered for commands in all channels',
31
- required: false,
32
- refreshers: [],
33
- options(_a) {
34
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth }) {
35
- if (!auth) {
36
- return {
37
- disabled: true,
38
- placeholder: 'connect slack account',
39
- options: [],
40
- };
41
- }
42
- const accessToken = (0, auth_helpers_1.getBotToken)(auth);
43
- const channels = yield (0, props_1.getChannels)(accessToken);
44
- return {
45
- disabled: false,
46
- placeholder: 'Select channel',
47
- options: channels,
48
- };
49
- });
50
- },
51
- }),
52
- ignoreBots: pieces_framework_1.Property.Checkbox({
53
- displayName: 'Ignore Bot Messages ?',
54
- required: true,
55
- defaultValue: true,
56
- }),
57
- },
58
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
59
- sampleData: undefined,
60
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
61
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
62
- context.app.createListeners({
63
- events: ['message'],
64
- identifierValue: teamId,
65
- });
66
- }),
67
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
68
- // Ignored
69
- }),
70
- run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
71
- var _a, _b;
72
- const payloadBody = context.payload.body;
73
- const channels = (_a = context.propsValue.channels) !== null && _a !== void 0 ? _a : [];
74
- const commands = (_b = context.propsValue.commands) !== null && _b !== void 0 ? _b : [];
75
- const user = context.propsValue.user;
76
- // check if it's channel message
77
- if (!['channel', 'group'].includes(payloadBody.event.channel_type)) {
78
- return [];
79
- }
80
- // Check if we should process this channel
81
- if (!(channels.length === 0 || channels.includes(payloadBody.event.channel))) {
82
- return [];
83
- }
84
- // Check for bot messages if configured to ignore them
85
- if (context.propsValue.ignoreBots && payloadBody.event.bot_id) {
86
- return [];
87
- }
88
- // Check for mention and parse command
89
- if (user && payloadBody.event.text) {
90
- const parsedCommand = (0, utils_1.parseCommand)(payloadBody.event.text, user, commands);
91
- if (parsedCommand && commands.includes(parsedCommand.command)) {
92
- // Return event with parsed command
93
- return [
94
- Object.assign(Object.assign({}, payloadBody.event), { parsed_command: parsedCommand }),
95
- ];
96
- }
97
- }
98
- return [];
99
- }),
100
- });
101
- //# sourceMappingURL=new-command.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-command.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-command.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,2CAA8E;AAC9E,kCAAoC;AACpC,2CAA+C;AAC/C,yDAAgF;AAEnE,QAAA,UAAU,GAAG,IAAA,gCAAa,EAAC;IACtC,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,wBAAwB;IAC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AI,EACtB,IAAI,EACJ,QAAQ,CACT,CAAC;YAEF,IAAI,aAAa,IAAI,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;gBAC9D,mCAAmC;gBACnC,OAAO;oDAEA,WAAW,CAAC,KAAK,KACpB,cAAc,EAAE,aAAa;iBAEhC,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -1,27 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const newDirectMessageTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
3
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
5
- }>)[], {
6
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
7
- ignoreSelfMessages: import("@activepieces/pieces-framework").CheckboxProperty<true>;
8
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
9
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
10
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
11
- }>)[], {
12
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
13
- ignoreSelfMessages: import("@activepieces/pieces-framework").CheckboxProperty<true>;
14
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
15
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
16
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
17
- }>)[], {
18
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
19
- ignoreSelfMessages: import("@activepieces/pieces-framework").CheckboxProperty<true>;
20
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
21
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
22
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
23
- }>)[], {
24
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
25
- ignoreSelfMessages: import("@activepieces/pieces-framework").CheckboxProperty<true>;
26
- }>;
27
- //# sourceMappingURL=new-direct-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-direct-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-direct-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AAM1F,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;EAoDlC,CAAC"}
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newDirectMessageTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../auth");
7
- const auth_helpers_1 = require("../common/auth-helpers");
8
- exports.newDirectMessageTrigger = (0, pieces_framework_1.createTrigger)({
9
- auth: auth_1.slackAuth,
10
- name: 'new-direct-message',
11
- displayName: 'New Direct Message',
12
- description: 'Triggers when a message was posted in a direct message channel.',
13
- aiMetadata: {
14
- description: 'Fires when a new message is posted in a direct message (im) channel with the connected Slack app. Bot messages and the connected user\'s own messages can be optionally ignored. The event payload is the Slack message event, including its channel, text, and sender.',
15
- },
16
- props: {
17
- ignoreBots: pieces_framework_1.Property.Checkbox({
18
- displayName: 'Ignore Bot Messages ?',
19
- required: true,
20
- defaultValue: false,
21
- }),
22
- ignoreSelfMessages: pieces_framework_1.Property.Checkbox({
23
- displayName: 'Ignore Message from Yourself ?',
24
- required: true,
25
- defaultValue: false,
26
- }),
27
- },
28
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
29
- sampleData: undefined,
30
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
31
- // Older OAuth2 has team_id, newer has team.id
32
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
33
- context.app.createListeners({
34
- events: ['message'],
35
- identifierValue: teamId,
36
- });
37
- }),
38
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
39
- // Ignored
40
- }),
41
- run(context) {
42
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
43
- const payloadBody = context.payload.body;
44
- const userId = yield (0, auth_helpers_1.getUserId)(context.auth);
45
- if (payloadBody.event.channel_type !== 'im') {
46
- return [];
47
- }
48
- // check for bot messages
49
- if ((context.propsValue.ignoreBots && payloadBody.event.bot_id) ||
50
- (context.propsValue.ignoreSelfMessages && payloadBody.event.user === userId)) {
51
- return [];
52
- }
53
- return [payloadBody.event];
54
- });
55
- },
56
- });
57
- //# sourceMappingURL=new-direct-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-direct-message.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-direct-message.ts"],"names":[],"mappings":";;;;AAAA,qEAA0F;AAC1F,kCAAoC;AACpC,yDAA8E;AAIjE,QAAA,uBAAuB,GAAG,IAAA,gCAAa,EAAC;IACpD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EAAE,iEAAiE;IAC9E,UAAU,EAAE;QACX,WAAW,EACV,yQAAyQ;KAC1Q;IACD,KAAK,EAAE;QACN,UAAU,EAAE,2BAAQ,CAA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,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -1,43 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const newMentionInDirectMessageTrigger: import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
3
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
4
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
5
- }>)[], {
6
- user: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
7
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
8
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
9
- }>)[]>;
10
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
11
- ignoreSelfMessages: import("@activepieces/pieces-framework").CheckboxProperty<true>;
12
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
13
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
14
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
15
- }>)[], {
16
- user: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
17
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
18
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
19
- }>)[]>;
20
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
21
- ignoreSelfMessages: import("@activepieces/pieces-framework").CheckboxProperty<true>;
22
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
23
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
24
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
25
- }>)[], {
26
- user: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
27
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
28
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
29
- }>)[]>;
30
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
31
- ignoreSelfMessages: import("@activepieces/pieces-framework").CheckboxProperty<true>;
32
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
33
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
34
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
35
- }>)[], {
36
- user: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
37
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
38
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
39
- }>)[]>;
40
- ignoreBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
41
- ignoreSelfMessages: import("@activepieces/pieces-framework").CheckboxProperty<true>;
42
- }>;
43
- //# sourceMappingURL=new-mention-in-direct-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-mention-in-direct-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-mention-in-direct-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAKxC,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiE3C,CAAC"}
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newMentionInDirectMessageTrigger = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const auth_1 = require("../auth");
7
- const props_1 = require("../common/props");
8
- const auth_helpers_1 = require("../common/auth-helpers");
9
- exports.newMentionInDirectMessageTrigger = (0, pieces_framework_1.createTrigger)({
10
- auth: auth_1.slackAuth,
11
- name: 'new-mention-in-direct-message',
12
- displayName: 'New Mention in Direct Message',
13
- description: 'Triggers when a username is mentioned in a direct message channel.',
14
- aiMetadata: {
15
- description: 'Fires when the configured user is @-mentioned in a direct message (im channel). Only messages in DM channels that contain the mention token for the selected user fire; bot messages and the user\'s own messages can be optionally ignored. The event payload is the Slack message event including its text, channel, and sender.',
16
- },
17
- props: {
18
- user: (0, props_1.userId)(true),
19
- ignoreBots: pieces_framework_1.Property.Checkbox({
20
- displayName: 'Ignore Bot Messages ?',
21
- required: true,
22
- defaultValue: false,
23
- }),
24
- ignoreSelfMessages: pieces_framework_1.Property.Checkbox({
25
- displayName: 'Ignore Message from Yourself ?',
26
- required: true,
27
- defaultValue: false,
28
- }),
29
- },
30
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
31
- sampleData: undefined,
32
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
33
- // Older OAuth2 has team_id, newer has team.id
34
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
35
- context.app.createListeners({
36
- events: ['message'],
37
- identifierValue: teamId,
38
- });
39
- }),
40
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
41
- // Ignored
42
- }),
43
- run(context) {
44
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
45
- var _a;
46
- const payloadBody = context.payload.body;
47
- const userId = yield (0, auth_helpers_1.getUserId)(context.auth);
48
- if (payloadBody.event.channel_type !== 'im') {
49
- return [];
50
- }
51
- // check for bot messages
52
- if ((context.propsValue.ignoreBots && payloadBody.event.bot_id) ||
53
- (context.propsValue.ignoreSelfMessages &&
54
- payloadBody.event.user === userId)) {
55
- return [];
56
- }
57
- //check for mention
58
- if (context.propsValue.user &&
59
- ((_a = payloadBody.event.text) === null || _a === void 0 ? void 0 : _a.includes(`<@${context.propsValue.user}>`))) {
60
- return [payloadBody.event];
61
- }
62
- return [];
63
- });
64
- },
65
- });
66
- //# sourceMappingURL=new-mention-in-direct-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-mention-in-direct-message.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-mention-in-direct-message.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,kCAAoC;AACpC,2CAAyC;AACzC,yDAA8E;AAEjE,QAAA,gCAAgC,GAAG,IAAA,gCAAa,EAAC;IAC5D,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,+BAA+B;IAC5C,WAAW,EACT,oEAAoE;IACtE,UAAU,EAAE;QACV,WAAW,EACT,oUAAoU;KACvU;IACD,KAAK,EAAE;QACL,IAAI,EAAE,IAAA,cAAM,EAAC,IAAI,CAAC;QAClB,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC5B,WAAW,EAAE,uBAAuB;YACpC,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,KAAK;SACpB,CAAC;QACF,kBAAkB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACpC,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,KAAK;SACpB,CAAC;KACH;IACD,IAAI,EAAE,kCA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