@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,83 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newReactionAdded = 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.newReactionAdded = (0, pieces_framework_1.createTrigger)({
10
- auth: auth_1.slackAuth,
11
- name: 'new_reaction_added',
12
- displayName: 'New Reaction',
13
- description: 'Triggers when a new reaction is added to a message',
14
- aiMetadata: {
15
- description: 'Fires when an emoji reaction is added to a message in the Slack workspace. Can be optionally filtered to specific emojis, a specific user, or specific channels. The event payload identifies the user who added the reaction, the emoji name, and the message item it was added to.',
16
- },
17
- props: {
18
- info: props_1.multiSelectChannelInfo,
19
- emojis: pieces_framework_1.Property.Array({
20
- displayName: 'Emojis (E.g fire, smile)',
21
- description: 'Select emojis to trigger on',
22
- required: false,
23
- }),
24
- user: (0, props_1.userId)(false),
25
- channels: pieces_framework_1.Property.MultiSelectDropdown({
26
- auth: auth_1.slackAuth,
27
- displayName: 'Channels',
28
- description: 'If no channel is selected, the flow will be triggered for reactions in all channels the app has access to',
29
- required: false,
30
- refreshers: [],
31
- options(_a) {
32
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth }) {
33
- if (!auth) {
34
- return {
35
- disabled: true,
36
- placeholder: 'connect slack account',
37
- options: [],
38
- };
39
- }
40
- const accessToken = (0, auth_helpers_1.getBotToken)(auth);
41
- const channels = yield (0, props_1.getChannels)(accessToken);
42
- return {
43
- disabled: false,
44
- placeholder: 'Select channels',
45
- options: channels,
46
- };
47
- });
48
- },
49
- }),
50
- },
51
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
52
- sampleData: undefined,
53
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
54
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
55
- context.app.createListeners({
56
- events: ['reaction_added'],
57
- identifierValue: teamId,
58
- });
59
- }),
60
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
61
- // Ignored
62
- }),
63
- run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
64
- var _a, _b;
65
- const payloadBody = context.payload.body;
66
- const channels = (_a = context.propsValue.channels) !== null && _a !== void 0 ? _a : [];
67
- const emojis = (_b = context.propsValue.emojis) !== null && _b !== void 0 ? _b : [];
68
- // Filter by user if specified
69
- if (context.propsValue.user && payloadBody.event.user !== context.propsValue.user) {
70
- return [];
71
- }
72
- // Filter by emoji if specified
73
- if (emojis.length > 0 && !emojis.includes(payloadBody.event.reaction)) {
74
- return [];
75
- }
76
- // Filter by channels - if no channels selected, trigger for all
77
- if (channels.length > 0 && !channels.includes(payloadBody.event.item.channel)) {
78
- return [];
79
- }
80
- return [payloadBody.event];
81
- }),
82
- });
83
- //# sourceMappingURL=new-reaction-added.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-reaction-added.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-reaction-added.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,kCAAoC;AACpC,2CAA8E;AAC9E,yDAAgF;AAGnE,QAAA,gBAAgB,GAAG,IAAA,gCAAa,EAAC;IAC5C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,oDAAoD;IACjE,UAAU,EAAE;QACV,WAAW,EACT,sRAAsR;KACzR;IACD,KAAK,EAAE;QACL,IAAI,EAAE,8BAAsB;QAC5B,MAAM,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACrB,WAAW,EAAE,0BAA0B;YACvC,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,IAAA,cAAM,EAAC,KAAK,CAAC;QACnB,QAAQ,EAAE,2BAAQ,CAAC,mBAAmB,CAAC;YACrC,IAAI,EAAE,gBAAS;YACf,WAAW,EAAE,UAAU;YACvB,WAAW,EACT,2GAA2G;YAC7G,QAAQ,EAAE,KAAK;YACf,UAAU,EAAE,EAAE;YACR,OAAO;6EAAC,EAAE,IAAI,EAAE;oBACpB,IAAI,CAAC,IAAI,EAAE,CAAC;wBACV,OAAO;4BACL,QAAQ,EAAE,IAAI;4BACd,WAAW,EAAE,uBAAuB;4BACpC,OAAO,EAAE,EAAE;yBACZ,CAAC;oBACJ,CAAC;oBACD,MAAM,WAAW,GAAG,IAAA,0BAAW,EAAC,IAAsB,CAAC,CAAC;oBACxD,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAW,EAAC,WAAW,CAAC,CAAC;oBAChD,OAAO;wBACL,QAAQ,EAAE,KAAK;wBACf,WAAW,EAAE,iBAAiB;wB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AO,CAAC,EAAE,CAAC;YAC9E,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -1,59 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const newReactionRemoved: 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
- emojis: import("@activepieces/pieces-framework").ArrayProperty<false>;
8
- user: import("@activepieces/pieces-framework").DropdownProperty<string, false, (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
- 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
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, (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
- info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
21
- emojis: import("@activepieces/pieces-framework").ArrayProperty<false>;
22
- user: import("@activepieces/pieces-framework").DropdownProperty<string, false, (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
- channels: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, (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
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
31
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
32
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
33
- }>)[], {
34
- info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
35
- emojis: import("@activepieces/pieces-framework").ArrayProperty<false>;
36
- user: import("@activepieces/pieces-framework").DropdownProperty<string, false, (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
- channels: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
41
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
42
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
43
- }>)[]>;
44
- }> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
45
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
46
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
47
- }>)[], {
48
- info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
49
- emojis: import("@activepieces/pieces-framework").ArrayProperty<false>;
50
- user: import("@activepieces/pieces-framework").DropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
51
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
52
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
53
- }>)[]>;
54
- channels: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
55
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
56
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
57
- }>)[]>;
58
- }>;
59
- //# sourceMappingURL=new-reaction-removed.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-reaction-removed.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-reaction-removed.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EAEhB,MAAM,gCAAgC,CAAC;AAKxC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyE7B,CAAC"}
@@ -1,80 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newReactionRemoved = 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.newReactionRemoved = (0, pieces_framework_1.createTrigger)({
10
- auth: auth_1.slackAuth,
11
- name: 'new_reaction_removed',
12
- displayName: 'Reaction Removed',
13
- description: 'Triggers when a reaction is removed from a message',
14
- aiMetadata: {
15
- description: 'Fires when an emoji reaction is removed from a message in the Slack workspace. Can be optionally filtered to specific emojis, a specific user, or specific channels. The event payload identifies the user who removed the reaction, the emoji name, and the message item it was removed from.',
16
- },
17
- props: {
18
- info: props_1.multiSelectChannelInfo,
19
- emojis: pieces_framework_1.Property.Array({
20
- displayName: 'Emojis (E.g fire, smile)',
21
- description: 'Select emojis to trigger on',
22
- required: false,
23
- }),
24
- user: (0, props_1.userId)(false),
25
- channels: pieces_framework_1.Property.MultiSelectDropdown({
26
- auth: auth_1.slackAuth,
27
- displayName: 'Channels',
28
- description: 'If no channel is selected, the flow will be triggered for reactions removed in all channels the app has access to',
29
- required: false,
30
- refreshers: [],
31
- options(_a) {
32
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth }) {
33
- if (!auth) {
34
- return {
35
- disabled: true,
36
- placeholder: 'connect slack account',
37
- options: [],
38
- };
39
- }
40
- const accessToken = (0, auth_helpers_1.getBotToken)(auth);
41
- const channels = yield (0, props_1.getChannels)(accessToken);
42
- return {
43
- disabled: false,
44
- placeholder: 'Select channels',
45
- options: channels,
46
- };
47
- });
48
- },
49
- }),
50
- },
51
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
52
- sampleData: undefined,
53
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
54
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
55
- context.app.createListeners({
56
- events: ['reaction_removed'],
57
- identifierValue: teamId,
58
- });
59
- }),
60
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
61
- // Ignored
62
- }),
63
- run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
64
- var _a, _b;
65
- const payloadBody = context.payload.body;
66
- const channels = (_a = context.propsValue.channels) !== null && _a !== void 0 ? _a : [];
67
- const emojis = (_b = context.propsValue.emojis) !== null && _b !== void 0 ? _b : [];
68
- if (context.propsValue.user && payloadBody.event.user !== context.propsValue.user) {
69
- return [];
70
- }
71
- if (emojis.length > 0 && !emojis.includes(payloadBody.event.reaction)) {
72
- return [];
73
- }
74
- if (channels.length > 0 && !channels.includes(payloadBody.event.item.channel)) {
75
- return [];
76
- }
77
- return [payloadBody.event];
78
- }),
79
- });
80
- //# sourceMappingURL=new-reaction-removed.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-reaction-removed.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-reaction-removed.ts"],"names":[],"mappings":";;;;AAAA,qEAIwC;AACxC,kCAAoC;AACpC,2CAA8E;AAC9E,yDAAgF;AAEnE,QAAA,kBAAkB,GAAG,IAAA,gCAAa,EAAC;IAC9C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EAAE,oDAAoD;IACjE,UAAU,EAAE;QACV,WAAW,EACT,gSAAgS;KACnS;IACD,KAAK,EAAE;QACL,IAAI,EAAE,8BAAsB;QAC5B,MAAM,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACrB,WAAW,EAAE,0BAA0B;YACvC,WAAW,EAAE,6BAA6B;YAC1C,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,IAAI,EAAE,IAAA,cAAM,EAAC,KAAK,CAAC;QACnB,QAAQ,EAAE,2BAAQ,CAAC,mBAAmB,CAAC;YACrC,IAAI,EAAE,g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AE7D,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YAClF,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;YACtE,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9E,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAA;CACF,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const newSavedMessageTrigger: 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
- }>)[], {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
6
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
7
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
8
- }>)[], {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, (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
- }>)[], {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
12
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
13
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
14
- }>)[], {}>;
15
- //# sourceMappingURL=new-saved-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-saved-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-saved-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AAIhF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;UAiCjC,CAAC"}
@@ -1,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newSavedMessageTrigger = 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.newSavedMessageTrigger = (0, pieces_framework_1.createTrigger)({
9
- auth: auth_1.slackAuth,
10
- name: 'new-saved-message',
11
- displayName: 'New Saved Message',
12
- description: 'Triggers when you save a message.',
13
- aiMetadata: {
14
- description: 'Fires when the connected Slack user saves (stars) a message. Only star_added events whose saved item is a message fire; saving other item types does not trigger. The event payload is the saved item, including its channel and message reference.',
15
- },
16
- props: {},
17
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
18
- sampleData: undefined,
19
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
20
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
21
- context.app.createListeners({
22
- events: ['star_added'],
23
- identifierValue: teamId,
24
- });
25
- }),
26
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
27
- // Ignored
28
- }),
29
- run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
30
- const payloadBody = context.payload.body;
31
- // check if it's saved message
32
- if (payloadBody.event.type === 'star_added' && payloadBody.event.item.type === 'message') {
33
- return [payloadBody.event.item];
34
- }
35
- return [];
36
- }),
37
- });
38
- //# sourceMappingURL=new-saved-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-saved-message.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-saved-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,kCAAoC;AACpC,yDAAmE;AAEtD,QAAA,sBAAsB,GAAG,IAAA,gCAAa,EAAC;IACnD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,mCAAmC;IAChD,UAAU,EAAE;QACX,WAAW,EACV,qPAAqP;KACtP;IACD,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,kCAAe,CAAC,WAAW;IACjC,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,CAAO,OAAO,EAAE,EAAE;QAC3B,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,OAAO,CAAC,IAAsB,CAAC,CAAC;QAC/D,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;YAC3B,MAAM,EAAE,CAAC,YAAY,CAAC;YACtB,eAAe,EAAE,MAAM;SACvB,CAAC,CAAC;IACJ,CAAC,CAAA;IACD,SAAS,EAAE,CAAO,OAAO,EAAE,EAAE;QAC5B,UAAU;IACX,CAAC,CAAA;IAED,GAAG,EAAE,CAAO,OAAO,EAAE,EAAE;QACtB,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,IAAmB,CAAC;QAExD,8BAA8B;QAC9B,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,KAAI,SAAS,EAAE,CAAC;YACzF,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,EAAE,CAAC;IACX,CAAC,CAAA;CACD,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const newTeamCustomEmojiTrigger: 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
- }>)[], {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
6
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
7
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
8
- }>)[], {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, (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
- }>)[], {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
12
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
13
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
14
- }>)[], {}>;
15
- //# sourceMappingURL=new-team-custom-emoji.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-team-custom-emoji.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-team-custom-emoji.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AAUhF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;UA8CpC,CAAC"}
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newTeamCustomEmojiTrigger = 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
- id: 'heart',
11
- image: 'https://emoji.slack-edge.com/T06BTHUEFFF/heart/84a171ae62daacc7.jpg',
12
- };
13
- exports.newTeamCustomEmojiTrigger = (0, pieces_framework_1.createTrigger)({
14
- auth: auth_1.slackAuth,
15
- name: 'new-team-custom-emoji',
16
- displayName: 'New Team Custom Emoji',
17
- description: 'Triggers when a custom emoji has been added to a team.',
18
- aiMetadata: {
19
- description: 'Fires when a new custom emoji is added to the Slack workspace (an emoji_changed event with the "add" subtype). The event payload includes the emoji id (name) and the image URL of the added emoji.',
20
- },
21
- props: {},
22
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
23
- sampleData,
24
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
25
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
26
- context.app.createListeners({
27
- events: ['emoji_changed'],
28
- identifierValue: teamId,
29
- });
30
- }),
31
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
32
- // Ignored
33
- }),
34
- test: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
35
- const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(context.auth));
36
- const response = yield client.emoji.list();
37
- if (!response.emoji)
38
- return [sampleData];
39
- return Object.entries(response.emoji).map(([id, image]) => ({
40
- id,
41
- image,
42
- }));
43
- }),
44
- run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
45
- const payloadBody = context.payload.body;
46
- // check if it's emoji message
47
- if (payloadBody.event.type !== 'emoji_changed' && payloadBody.event.subtype !== 'add') {
48
- return [];
49
- }
50
- return [{ id: payloadBody.event.name, image: payloadBody.event.value }];
51
- }),
52
- });
53
- //# sourceMappingURL=new-team-custom-emoji.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-team-custom-emoji.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-team-custom-emoji.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,kCAAoC;AACpC,4CAA2C;AAC3C,yDAAgF;AAEhF,MAAM,UAAU,GAAG;IAClB,EAAE,EAAE,OAAO;IACX,KAAK,EAAE,qEAAqE;CAC5E,CAAC;AAEW,QAAA,yBAAyB,GAAG,IAAA,gCAAa,EAAC;IACtD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,wDAAwD;IACrE,UAAU,EAAE;QACX,WAAW,EACV,qMAAqM;KACtM;IACD,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,kCAAe,CAAC,WAAW;IACjC,UAAU;IACV,QAAQ,EAAE,CAAO,OAAO,EAAE,EAAE;QAC3B,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,OAAO,CAAC,IAAsB,CAAC,CAAC;QAC/D,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;YAC3B,MAAM,EAAE,CAAC,eAAe,CAAC;YACzB,eAAe,EAAE,MAAM;SACvB,CAAC,CAAC;IACJ,CAAC,CAAA;IACD,SAAS,EAAE,CAAO,OAAO,EAAE,EAAE;QAC5B,UAAU;IACX,CAAC,CAAA;IAED,IAAI,EAAE,CAAO,OAAO,EAAE,EAAE;QACvB,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,IAAA,0BAAW,EAAC,OAAO,CAAC,IAAsB,CAAC,CAAC,CAAC;QAE1E,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAE3C,IAAI,CAAC,QAAQ,CAAC,KAAK;YAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QAEzC,OAAO,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3D,EAAE;YACF,KAAK;SACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAA;IAED,GAAG,EAAE,CAAO,OAAO,EAAE,EAAE;QACtB,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,IAAmB,CAAC;QAExD,8BAA8B;QAC9B,IAAI,WAAW,CAAC,KAAK,CAAC,IAAI,KAAK,eAAe,IAAI,WAAW,CAAC,KAAK,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;YACvF,OAAO,EAAE,CAAC;QACX,CAAC;QAED,OAAO,CAAC,EAAE,EAAE,EAAE,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;IACzE,CAAC,CAAA;CACD,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- import { TriggerStrategy } from '@activepieces/pieces-framework';
2
- export declare const newUserTrigger: 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
- }>)[], {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.POLLING, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
6
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
7
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
8
- }>)[], {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.MANUAL, (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
- }>)[], {}> | import("@activepieces/pieces-framework").ITrigger<TriggerStrategy.APP_WEBHOOK, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
12
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
13
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
14
- }>)[], {}>;
15
- //# sourceMappingURL=new-user.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-user.d.ts","sourceRoot":"","sources":["../../../../src/lib/triggers/new-user.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAiB,MAAM,gCAAgC,CAAC;AAqDhF,eAAO,MAAM,cAAc;;;;;;;;;;;;UA2CzB,CAAC"}
@@ -1,93 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.newUserTrigger = 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
- id: 'USLACKBOT',
11
- team_id: 'T06BTHUEFFF',
12
- name: 'slackbot',
13
- deleted: false,
14
- color: '757575',
15
- real_name: 'Slackbot',
16
- tz: 'America/Los_Angeles',
17
- tz_label: 'Pacific Daylight Time',
18
- tz_offset: -25200,
19
- profile: {
20
- title: '',
21
- phone: '',
22
- skype: '',
23
- real_name: 'Slackbot',
24
- real_name_normalized: 'Slackbot',
25
- display_name: 'Slackbot',
26
- display_name_normalized: 'Slackbot',
27
- fields: {},
28
- status_text: '',
29
- status_emoji: '',
30
- status_emoji_display_info: [],
31
- status_expiration: 0,
32
- avatar_hash: 'sv41d8cd98f0',
33
- always_active: true,
34
- first_name: 'slackbot',
35
- last_name: '',
36
- image_24: 'https://a.slack-edge.com/80588/img/slackbot_24.png',
37
- image_32: 'https://a.slack-edge.com/80588/img/slackbot_32.png',
38
- image_48: 'https://a.slack-edge.com/80588/img/slackbot_48.png',
39
- image_72: 'https://a.slack-edge.com/80588/img/slackbot_72.png',
40
- image_192: 'https://a.slack-edge.com/80588/marketing/img/avatars/slackbot/avatar-slackbot.png',
41
- image_512: 'https://a.slack-edge.com/80588/img/slackbot_512.png',
42
- status_text_canonical: '',
43
- team: 'T06BTHUEFFF',
44
- },
45
- is_admin: false,
46
- is_owner: false,
47
- is_primary_owner: false,
48
- is_restricted: false,
49
- is_ultra_restricted: false,
50
- is_bot: false,
51
- is_app_user: false,
52
- updated: 0,
53
- is_email_confirmed: false,
54
- who_can_share_contact_card: 'EVERYONE',
55
- };
56
- exports.newUserTrigger = (0, pieces_framework_1.createTrigger)({
57
- auth: auth_1.slackAuth,
58
- name: 'new-user',
59
- displayName: 'New User',
60
- description: 'Triggers when a new user is created / first joins your org.',
61
- aiMetadata: {
62
- description: 'Fires when a new member joins the Slack workspace (a team_join event). The event payload is the new user object, including their id, name, profile, and account flags.',
63
- },
64
- props: {},
65
- type: pieces_framework_1.TriggerStrategy.APP_WEBHOOK,
66
- sampleData,
67
- onEnable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
68
- const teamId = yield (0, auth_helpers_1.getTeamId)(context.auth);
69
- context.app.createListeners({
70
- events: ['team_join'],
71
- identifierValue: teamId,
72
- });
73
- }),
74
- onDisable: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
75
- // Ignored
76
- }),
77
- test: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
78
- const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(context.auth));
79
- const response = yield client.users.list({ limit: 10 });
80
- if (!response.members)
81
- return [sampleData];
82
- return response.members;
83
- }),
84
- run: (context) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
85
- const payloadBody = context.payload.body;
86
- // check if it's emoji message
87
- if (payloadBody.event.type !== 'team_join') {
88
- return [];
89
- }
90
- return [payloadBody.event.user];
91
- }),
92
- });
93
- //# sourceMappingURL=new-user.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new-user.js","sourceRoot":"","sources":["../../../../src/lib/triggers/new-user.ts"],"names":[],"mappings":";;;;AAAA,qEAAgF;AAChF,kCAAoC;AACpC,4CAA2C;AAC3C,yDAAgF;AAEhF,MAAM,UAAU,GAAG;IAClB,EAAE,EAAE,WAAW;IACf,OAAO,EAAE,aAAa;IACtB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,QAAQ;IACf,SAAS,EAAE,UAAU;IACrB,EAAE,EAAE,qBAAqB;IACzB,QAAQ,EAAE,uBAAuB;IACjC,SAAS,EAAE,CAAC,KAAK;IACjB,OAAO,EAAE;QACR,KAAK,EAAE,EAAE;QACT,KAAK,EAAE,EAAE;QACT,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,UAAU;QACrB,oBAAoB,EAAE,UAAU;QAChC,YAAY,EAAE,UAAU;QACxB,uBAAuB,EAAE,UAAU;QACnC,MAAM,EAAE,EAAE;QACV,WAAW,EAAE,EAAE;QACf,YAAY,EAAE,EAAE;QAChB,yBAAyB,EAAE,EAAE;QAC7B,iBAAiB,EAAE,CAAC;QACpB,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