@activepieces/piece-slack 0.17.1 → 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 -58
  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 -35
  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 -51
  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 -30
  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 -53
  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 -29
  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 -77
  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 -48
  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 -36
  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 -41
  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 -30
  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 -57
  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 -24
  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 -31
  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 -39
  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 -128
  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 -128
  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 -38
  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 -48
  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 -58
  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 -84
  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 -34
  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 -48
  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 -57
  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 -48
  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 -61
  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 -43
  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 -63
  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 -74
  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 -98
  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 -54
  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 -63
  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 -104
  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 -57
  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 -45
  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 -51
  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 -80
  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 -77
  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 -35
  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 -50
  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 -90
  193. package/src/lib/triggers/new-user.js.map +0 -1
@@ -1,63 +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
- props: {},
24
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
25
- sampleData: sampleData,
26
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
27
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
28
- context.app.createListeners({
29
- events: ['channel_created'],
30
- identifierValue: teamId,
31
- });
32
- }),
33
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
34
- // Ignored
35
- }),
36
- test: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
37
- const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(context.auth));
38
- const response = yield client.conversations.list({
39
- exclude_archived: true,
40
- limit: 10,
41
- types: 'public_channel,private_channel',
42
- });
43
- if (!response.channels) {
44
- return [];
45
- }
46
- return response.channels.map((channel) => {
47
- return {
48
- type: 'channel_created',
49
- channel: {
50
- id: channel.id,
51
- name: channel.name,
52
- created: channel.created,
53
- creator: channel.creator,
54
- },
55
- };
56
- });
57
- }),
58
- run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
59
- const payloadBody = context.payload.body;
60
- return [payloadBody.event];
61
- }),
62
- });
63
- //# 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,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,oCAAoC;IACjD,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,kCAAe,CA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,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiF3C,CAAC"}
@@ -1,74 +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
- props: {
16
- user: (0, props_1.userId)(true),
17
- commands: pieces_framework_1.Property.Array({
18
- displayName: 'Commands',
19
- description: 'List of valid commands that the bot should respond to (e.g., help, ocr, remind)',
20
- required: true,
21
- defaultValue: ['help'],
22
- }),
23
- ignoreBots: pieces_framework_1.Property.Checkbox({
24
- displayName: 'Ignore Bot Messages ?',
25
- required: true,
26
- defaultValue: true,
27
- }),
28
- ignoreSelfMessages: pieces_framework_1.Property.Checkbox({
29
- displayName: 'Ignore Message from Yourself ?',
30
- required: true,
31
- defaultValue: false,
32
- }),
33
- },
34
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
35
- sampleData: undefined,
36
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
37
- // Older OAuth2 has team_id, newer has team.id
38
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
39
- context.app.createListeners({
40
- events: ['message'],
41
- identifierValue: teamId,
42
- });
43
- }),
44
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
45
- // Ignored
46
- }),
47
- run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
48
- var _a;
49
- const payloadBody = context.payload.body;
50
- const commands = (_a = context.propsValue.commands) !== null && _a !== void 0 ? _a : [];
51
- const user = context.propsValue.user;
52
- const authUserId = yield (0, auth_helpers_1.getUserId)(context.auth);
53
- if (payloadBody.event.channel_type !== 'im') {
54
- return [];
55
- }
56
- // Check for bot messages if configured to ignore them
57
- if ((context.propsValue.ignoreBots && payloadBody.event.bot_id) ||
58
- (context.propsValue.ignoreSelfMessages && payloadBody.event.user === authUserId)) {
59
- return [];
60
- }
61
- // Check for mention and parse command
62
- if (user && payloadBody.event.text) {
63
- const parsedCommand = (0, utils_1.parseCommand)(payloadBody.event.text, user, commands);
64
- if (parsedCommand && commands.includes(parsedCommand.command)) {
65
- // Return event with parsed command
66
- return [
67
- Object.assign(Object.assign({}, payloadBody.event), { parsed_command: parsedCommand }),
68
- ];
69
- }
70
- }
71
- return [];
72
- }),
73
- });
74
- //# sourceMappingURL=new-command-in-direct-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-command-in-direct-message.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-command-in-direct-message.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,2CAAyC;AACzC,kCAAoC;AACpC,2CAA+C;AAC/C,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,wGAAwG;IAC1G,KAAK,EAAE;Q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IAAI,WAAW,CAAC,KAAK,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;YAC1C,OAAO,EAAE,CAAC;QACd,CAAC;QAED,sDAAsD;QACxD,IACC,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC;YAC3D,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,EAC/E,CAAC;YACF,OAAO,EAAE,CAAC;QACX,CAAC;QAEC,sCAAsC;QACtC,IAAI,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YACnC,MAAM,aAAa,GAAG,IAAA,oBAAY,EAChC,WAAW,CAAC,KAAK,CAAC,IAAI,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,63 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare 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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwGrB,CAAC"}
@@ -1,98 +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
- props: {
16
- info: props_1.multiSelectChannelInfo,
17
- user: (0, props_1.userId)(true),
18
- commands: pieces_framework_1.Property.Array({
19
- displayName: 'Commands',
20
- description: 'List of valid commands that the bot should respond to (e.g., help, ocr, remind)',
21
- required: true,
22
- defaultValue: ['help'],
23
- }),
24
- channels: pieces_framework_1.Property.MultiSelectDropdown({
25
- auth: auth_1.slackAuth,
26
- displayName: 'Channels',
27
- description: 'If no channel is selected, the flow will be triggered for commands in all channels',
28
- required: false,
29
- refreshers: [],
30
- options(_a) {
31
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth }) {
32
- if (!auth) {
33
- return {
34
- disabled: true,
35
- placeholder: 'connect slack account',
36
- options: [],
37
- };
38
- }
39
- const accessToken = (0, auth_helpers_1.getBotToken)(auth);
40
- const channels = yield (0, props_1.getChannels)(accessToken);
41
- return {
42
- disabled: false,
43
- placeholder: 'Select channel',
44
- options: channels,
45
- };
46
- });
47
- },
48
- }),
49
- ignoreBots: pieces_framework_1.Property.Checkbox({
50
- displayName: 'Ignore Bot Messages ?',
51
- required: true,
52
- defaultValue: true,
53
- }),
54
- },
55
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
56
- sampleData: undefined,
57
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
58
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
59
- context.app.createListeners({
60
- events: ['message'],
61
- identifierValue: teamId,
62
- });
63
- }),
64
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
65
- // Ignored
66
- }),
67
- run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
68
- var _a, _b;
69
- const payloadBody = context.payload.body;
70
- const channels = (_a = context.propsValue.channels) !== null && _a !== void 0 ? _a : [];
71
- const commands = (_b = context.propsValue.commands) !== null && _b !== void 0 ? _b : [];
72
- const user = context.propsValue.user;
73
- // check if it's channel message
74
- if (!['channel', 'group'].includes(payloadBody.event.channel_type)) {
75
- return [];
76
- }
77
- // Check if we should process this channel
78
- if (!(channels.length === 0 || channels.includes(payloadBody.event.channel))) {
79
- return [];
80
- }
81
- // Check for bot messages if configured to ignore them
82
- if (context.propsValue.ignoreBots && payloadBody.event.bot_id) {
83
- return [];
84
- }
85
- // Check for mention and parse command
86
- if (user && payloadBody.event.text) {
87
- const parsedCommand = (0, utils_1.parseCommand)(payloadBody.event.text, user, commands);
88
- if (parsedCommand && commands.includes(parsedCommand.command)) {
89
- // Return event with parsed command
90
- return [
91
- Object.assign(Object.assign({}, payloadBody.event), { parsed_command: parsedCommand }),
92
- ];
93
- }
94
- }
95
- return [];
96
- }),
97
- });
98
- //# 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;IACrC,WAAW,EACT,oFAAoF;IACtF,KAAK,EAAE;QACL,IAAI,EAAE,8BAAsB;QAC5B,IAAI,EAAE,IAAA,cAAM,EAAC,IAAI,CAAC;QAClB,QAAQ,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACvB,WAAW,EAAE,UAAU;YACvB,WAAW,EACT,iFAAiF;YACnF,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,CAAC,MAAM,CAAC;SACvB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,mBAAmB,CAAC;YACrC,IAAI,EAAE,gBAAS;YACf,WAAW,EAAE,UAAU;YACvB,WAAW,EACT,oFAAoF;YACtF,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,EAAE;YACR,OAAO;6EAAC,EAAE,IAAI,EAAE;oBACpB,IAAI,CAAC,IAAI,EAAE,CAAC;w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IAAc,CAAC;QAG/C,gCAAgC;QAClC,IAAI,CAAC,CAAC,SAAS,EAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;YACnE,OAAO,EAAE,CAAC;QACX,CAAC;QAEC,0CAA0C;QAC1C,IACE,CAAC,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EACxE,CAAC;YACD,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,sDAAsD;QACtD,IAAI,OAAO,CAAC,UAAU,CAAC,UAAU,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;YAC9D,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,sCAAsC;QACtC,IAAI,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YACnC,MAAM,aAAa,GAAG,IAAA,oBAAY,EAChC,WAAW,CAAC,KAAK,CAAC,IAAI,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;;;;;;;;;;;;;;;;;;;;;;;;EAgDlC,CAAC"}
@@ -1,54 +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
- props: {
14
- ignoreBots: pieces_framework_1.Property.Checkbox({
15
- displayName: 'Ignore Bot Messages ?',
16
- required: true,
17
- defaultValue: false,
18
- }),
19
- ignoreSelfMessages: pieces_framework_1.Property.Checkbox({
20
- displayName: 'Ignore Message from Yourself ?',
21
- required: true,
22
- defaultValue: false,
23
- }),
24
- },
25
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
26
- sampleData: undefined,
27
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
28
- // Older OAuth2 has team_id, newer has team.id
29
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
30
- context.app.createListeners({
31
- events: ['message'],
32
- identifierValue: teamId,
33
- });
34
- }),
35
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
36
- // Ignored
37
- }),
38
- run(context) {
39
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
40
- const payloadBody = context.payload.body;
41
- const userId = yield (0, auth_helpers_1.getUserId)(context.auth);
42
- if (payloadBody.event.channel_type !== 'im') {
43
- return [];
44
- }
45
- // check for bot messages
46
- if ((context.propsValue.ignoreBots && payloadBody.event.bot_id) ||
47
- (context.propsValue.ignoreSelfMessages && payloadBody.event.user === userId)) {
48
- return [];
49
- }
50
- return [payloadBody.event];
51
- });
52
- },
53
- });
54
- //# 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,KAAK,EAAE;QACN,UAAU,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC7B,WAAW,EAAE,uBAAuB;YACpC,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,KAAK;SACnB,CAAC;QACF,kBAAkB,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACrC,WAAW,EAAE,gCAAgC;YAC7C,QAAQ,EAAE,IAAI;YACd,YAAY,EAAE,KAAK;SACnB,CAAC;KACF;IACD,IAAI,EAAE,kCAAe,CAAC,WAAW;IACjC,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,CAAO,OAAO,EAAE,EAAE;QAC3B,8CAA8C;QAC9C,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,OAAO,CAAC,IAAsB,CAAC,CAAC;QAC/D,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;YAC3B,MAAM,EAAE,CAAC,SAAS,CAAC;YACnB,eAAe,EAAE,MAAM;SACvB,CAAC,CAAC;IACJ,CAAC,CAAA;IACD,SAAS,EAAE,CAAO,OAAO,EAAE,EAAE;QAC5B,UAAU;IACX,CAAC,CAAA;IAEK,GAAG,CAAC,OAAO;;YAChB,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,IAAmB,CAAC;YACxD,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,OAAO,CAAC,IAAsB,CAAC,CAAA;YAE9D,IAAI,WAAW,CAAC,KAAK,CAAC,YAAY,KAAK,IAAI,EAAE,CAAC;gBAC7C,OAAO,EAAE,CAAC;YACX,CAAC;YACD,yBAAyB;YACzB,IACC,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC;gBAC3D,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,EAC3E,CAAC;gBACF,OAAO,EAAE,CAAC;YACX,CAAC;YAED,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6D3C,CAAC"}
@@ -1,63 +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
- props: {
15
- user: (0, props_1.userId)(true),
16
- ignoreBots: pieces_framework_1.Property.Checkbox({
17
- displayName: 'Ignore Bot Messages ?',
18
- required: true,
19
- defaultValue: false,
20
- }),
21
- ignoreSelfMessages: pieces_framework_1.Property.Checkbox({
22
- displayName: 'Ignore Message from Yourself ?',
23
- required: true,
24
- defaultValue: false,
25
- }),
26
- },
27
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
28
- sampleData: undefined,
29
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
30
- // Older OAuth2 has team_id, newer has team.id
31
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
32
- context.app.createListeners({
33
- events: ['message'],
34
- identifierValue: teamId,
35
- });
36
- }),
37
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
38
- // Ignored
39
- }),
40
- run(context) {
41
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
42
- var _a;
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 &&
51
- payloadBody.event.user === userId)) {
52
- return [];
53
- }
54
- //check for mention
55
- if (context.propsValue.user &&
56
- ((_a = payloadBody.event.text) === null || _a === void 0 ? void 0 : _a.includes(`<@${context.propsValue.user}>`))) {
57
- return [payloadBody.event];
58
- }
59
- return [];
60
- });
61
- },
62
- });
63
- //# 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,KAAK,EAAE;QACL,IAAI,EAAE,IAAA,cAAM,EAAC,IAAI,CAAC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