@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,38 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getGroupByHandleAction = 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
- exports.getGroupByHandleAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.slackAuth,
11
- name: 'get_group_by_handle',
12
- displayName: 'Get User Group by Handle',
13
- description: 'Finds a Slack user group by its handle (e.g., @user-group) and returns its details. To mention this group in a message, map the returned ID using the syntax <!subteam^ID>. Read more: https://api.slack.com/reference/surfaces/formatting#mentioning-groups',
14
- audience: 'both',
15
- aiMetadata: { description: 'Look up a Slack user group (subteam) by its handle and return the group, including its ID for building an <!subteam^ID> mention; read-only and repeatable. Use this for groups, not individuals (use Find User by Handle/ID for people). Matches case-insensitively on the handle and errors if no group has that handle.', idempotent: true },
16
- props: {
17
- handle: pieces_framework_1.Property.ShortText({
18
- displayName: 'Group Handle',
19
- description: 'Group handle without the leading @',
20
- required: true,
21
- }),
22
- },
23
- run(context) {
24
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
- var _a;
26
- const token = (0, auth_helpers_1.getBotToken)(context.auth);
27
- const client = new web_api_1.WebClient(token);
28
- const searchHandle = context.propsValue.handle.replace('@', '').toLowerCase();
29
- const response = yield client.usergroups.list();
30
- const group = (_a = response.usergroups) === null || _a === void 0 ? void 0 : _a.find((g) => g.handle && g.handle.toLowerCase() === searchHandle);
31
- if (!group) {
32
- throw new Error(`User group with handle '@${searchHandle}' not found.`);
33
- }
34
- return group;
35
- });
36
- },
37
- });
38
- //# sourceMappingURL=get-group-by-handle.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-group-by-handle.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-group-by-handle.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAAoC;AACpC,4CAA2C;AAC3C,yDAAqE;AAExD,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,8PAA8P;IAC3Q,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,2TAA2T,EAAE,UAAU,EAAE,IAAI,EAAE;IAC1W,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,oCAAoC;YACjD,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;;YACf,MAAM,KAAK,GAAG,IAAA,0BAAW,EAAC,OAAO,CAAC,IAAsB,CAAC,CAAC;YAC1D,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC;YACpC,MAAM,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;YAE9E,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;YAEhD,MAAM,KAAK,GAAG,MAAA,QAAQ,CAAC,UAAU,0CAAE,IAAI,CACrC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,YAAY,CAC3D,CAAC;YAEF,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,IAAI,KAAK,CAAC,4BAA4B,YAAY,cAAc,CAAC,CAAC;YAC1E,CAAC;YAED,OAAO,KAAK,CAAC;QACf,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- export declare const getMessageAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
- }>)[], {
5
- info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
6
- channel: 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
- ts: import("@activepieces/pieces-framework").ShortTextProperty<true>;
11
- }>;
12
- //# sourceMappingURL=get-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/get-message.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,gBAAgB;;;;;;;;;;EA+B3B,CAAC"}
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getMessageAction = 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 utils_1 = require("../common/utils");
9
- const web_api_1 = require("@slack/web-api");
10
- const auth_helpers_1 = require("../common/auth-helpers");
11
- exports.getMessageAction = (0, pieces_framework_1.createAction)({
12
- name: 'get-message',
13
- displayName: 'Get Message by Timestamp',
14
- description: `Retrieves a specific message from a channel history using the message's timestamp.`,
15
- audience: 'both',
16
- aiMetadata: { description: "Fetch a single message from a channel by its exact timestamp; read-only and repeatable. Use this when you already have the message ts and channel; use Get channel history to read a range of messages or Search messages to find one by content.", idempotent: true },
17
- auth: auth_1.slackAuth,
18
- props: {
19
- info: props_1.singleSelectChannelInfo,
20
- channel: (0, props_1.slackChannel)(true),
21
- ts: pieces_framework_1.Property.ShortText({
22
- displayName: 'Message Timestamp',
23
- description: 'Please provide the timestamp of the message you wish to retrieve, such as `1710304378.475129`. Alternatively, you can easily obtain the message link by clicking on the three dots next to the message and selecting the `Copy link` option.',
24
- required: true,
25
- }),
26
- },
27
- run(_a) {
28
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
29
- const messageTimestamp = (0, utils_1.processMessageTimestamp)(propsValue.ts);
30
- if (!messageTimestamp) {
31
- throw new Error('Invalid Timestamp Value.');
32
- }
33
- const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(auth));
34
- return yield client.conversations.history({
35
- channel: propsValue.channel,
36
- oldest: messageTimestamp,
37
- limit: 1,
38
- inclusive: true,
39
- });
40
- });
41
- },
42
- });
43
- //# sourceMappingURL=get-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/get-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAAoC;AACpC,2CAAwE;AACxE,2CAA0D;AAC1D,4CAA2C;AAC3C,yDAAqE;AAExD,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IAC5C,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,oFAAoF;IACjG,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,mPAAmP,EAAE,UAAU,EAAE,IAAI,EAAE;IAClS,IAAI,EAAE,gBAAS;IACf,KAAK,EAAE;QACN,IAAI,EAAE,+BAAuB;QAC7B,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,EAAE,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACtB,WAAW,EAAE,mBAAmB;YAChC,WAAW,EACV,8OAA8O;YAC/O,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC7B,MAAM,gBAAgB,GAAG,IAAA,+BAAuB,EAAC,UAAU,CAAC,EAAE,CAAC,CAAC;YAChE,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;YAC7C,CAAC;YACD,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,IAAA,0BAAW,EAAC,IAAsB,CAAC,CAAC,CAAC;YAElE,OAAO,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC;gBACzC,OAAO,EAAE,UAAU,CAAC,OAAO;gBAC3B,MAAM,EAAE,gBAAgB;gBACxB,KAAK,EAAE,CAAC;gBACR,SAAS,EAAE,IAAI;aACf,CAAC,CAAC;QACJ,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- export declare const inviteUserToChannelAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
- }>)[], {
5
- info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
6
- channel: 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
- userId: import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
11
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
12
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
13
- }>)[]>;
14
- }>;
15
- //# sourceMappingURL=invite-user-to-channel.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invite-user-to-channel.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/invite-user-to-channel.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;EAoBpC,CAAC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.inviteUserToChannelAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const auth_1 = require("../auth");
6
- const pieces_framework_1 = require("@activepieces/pieces-framework");
7
- const props_1 = require("../common/props");
8
- const web_api_1 = require("@slack/web-api");
9
- const auth_helpers_1 = require("../common/auth-helpers");
10
- exports.inviteUserToChannelAction = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.slackAuth,
12
- name: 'invite-user-to-channel',
13
- displayName: 'Invite User to Channel',
14
- description: 'Invites an existing User to an existing channel.',
15
- audience: 'both',
16
- aiMetadata: { description: 'Add an existing workspace user to an existing channel as a member. Both the channel and the user must already exist. Effectively idempotent in result since a user already in the channel stays a member, though Slack returns an error if they are already present.', idempotent: false },
17
- props: {
18
- info: props_1.singleSelectChannelInfo,
19
- channel: (0, props_1.slackChannel)(true),
20
- userId: (0, props_1.userId)(true),
21
- },
22
- run(context) {
23
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
- const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(context.auth));
25
- return yield client.conversations.invite({
26
- channel: context.propsValue.channel,
27
- users: `${context.propsValue.userId}`,
28
- });
29
- });
30
- },
31
- });
32
- //# sourceMappingURL=invite-user-to-channel.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"invite-user-to-channel.js","sourceRoot":"","sources":["../../../../src/lib/actions/invite-user-to-channel.ts"],"names":[],"mappings":";;;;AAAA,kCAAoC;AACpC,qEAA8D;AAC9D,2CAAgF;AAChF,4CAA2C;AAC3C,yDAAqE;AAExD,QAAA,yBAAyB,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,wBAAwB;IACrC,WAAW,EAAE,kDAAkD;IAC/D,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,sQAAsQ,EAAE,UAAU,EAAE,KAAK,EAAE;IACtT,KAAK,EAAE;QACN,IAAI,EAAE,+BAAuB;QAC7B,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,MAAM,EAAE,IAAA,cAAM,EAAC,IAAI,CAAC;KACpB;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,IAAA,0BAAW,EAAC,OAAO,CAAC,IAAsB,CAAC,CAAC,CAAC;YAE1E,OAAO,MAAM,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC;gBACxC,OAAO,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO;gBACnC,KAAK,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE;aACrC,CAAC,CAAC;QACJ,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- export declare const listUsers: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
- }>)[], {
5
- includeBots: import("@activepieces/pieces-framework").CheckboxProperty<true>;
6
- includeDisabled: import("@activepieces/pieces-framework").CheckboxProperty<true>;
7
- }>;
8
- //# sourceMappingURL=list-users.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-users.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/list-users.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS;;;;;;EAuCpB,CAAC"}
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.listUsers = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const web_api_1 = require("@slack/web-api");
7
- const auth_1 = require("../auth");
8
- const auth_helpers_1 = require("../common/auth-helpers");
9
- exports.listUsers = (0, pieces_framework_1.createAction)({
10
- // auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication,
11
- name: 'listUsers',
12
- displayName: 'List users',
13
- description: 'List all users of the workspace',
14
- audience: 'both',
15
- aiMetadata: { description: 'List every member of the workspace, paging through all results, with toggles to include bots and disabled/deactivated users; read-only and repeatable. Use this to enumerate or scan all users; use Find User by ID or Find User by Handle when you already know which single user you want.', idempotent: true },
16
- props: {
17
- includeBots: pieces_framework_1.Property.Checkbox({
18
- displayName: 'Include bots?',
19
- required: true,
20
- defaultValue: false,
21
- }),
22
- includeDisabled: pieces_framework_1.Property.Checkbox({
23
- displayName: 'Include disabled users?',
24
- required: true,
25
- defaultValue: false,
26
- }),
27
- },
28
- auth: auth_1.slackAuth,
29
- run(_a) {
30
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
31
- var _b, e_1, _c, _d;
32
- const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(auth));
33
- const results = [];
34
- try {
35
- for (var _e = true, _f = tslib_1.__asyncValues(client.paginate('users.list', {
36
- limit: 1000, // Only limits page size, not total number of results
37
- })), _g; _g = yield _f.next(), _b = _g.done, !_b; _e = true) {
38
- _d = _g.value;
39
- _e = false;
40
- const page = _d;
41
- const response = page;
42
- if (response.members) {
43
- results.push(...response.members.filter((member) => (propsValue.includeDisabled || !member.deleted) &&
44
- (propsValue.includeBots || !member.is_bot)));
45
- }
46
- }
47
- }
48
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
49
- finally {
50
- try {
51
- if (!_e && !_b && (_c = _f.return)) yield _c.call(_f);
52
- }
53
- finally { if (e_1) throw e_1.error; }
54
- }
55
- return results;
56
- });
57
- },
58
- });
59
- //# sourceMappingURL=list-users.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"list-users.js","sourceRoot":"","sources":["../../../../src/lib/actions/list-users.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,4CAA8D;AAC9D,kCAAoC;AAEpC,yDAAqE;AAExD,QAAA,SAAS,GAAG,IAAA,+BAAY,EAAC;IACpC,2FAA2F;IAC3F,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,YAAY;IACzB,WAAW,EAAE,iCAAiC;IAC9C,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAA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ction<import("@activepieces/pieces-framework").PieceAuthProperty, {
2
- markdown: import("@activepieces/pieces-framework").LongTextProperty<true>;
3
- }>;
4
- //# sourceMappingURL=markdown-to-slack-format.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markdown-to-slack-format.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/markdown-to-slack-format.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB;;EAkBhC,CAAC"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.markdownToSlackFormat = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const slackify_markdown_1 = tslib_1.__importDefault(require("slackify-markdown"));
7
- exports.markdownToSlackFormat = (0, pieces_framework_1.createAction)({
8
- name: 'markdownToSlackFormat',
9
- displayName: 'Markdown to Slack format',
10
- description: "Convert Markdown-formatted text to Slack's pseudo - markdown syntax",
11
- audience: 'both',
12
- aiMetadata: { description: "Convert standard Markdown into Slack's mrkdwn dialect so links, bold, and lists render correctly in messages; a pure local text transform that needs no auth and is fully repeatable for the same input. Use this to prepare text before sending it through a Slack message action.", idempotent: true },
13
- requireAuth: false,
14
- props: {
15
- markdown: pieces_framework_1.Property.LongText({
16
- displayName: 'Markdown text',
17
- required: true,
18
- }),
19
- },
20
- run(_a) {
21
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ propsValue }) {
22
- return (0, slackify_markdown_1.default)(propsValue.markdown);
23
- });
24
- },
25
- });
26
- //# sourceMappingURL=markdown-to-slack-format.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"markdown-to-slack-format.js","sourceRoot":"","sources":["../../../../src/lib/actions/markdown-to-slack-format.ts"],"names":[],"mappings":";;;;AAAA,qEAGwC;AACxC,kFAAiD;AAEpC,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IAChD,IAAI,EAAE,uBAAuB;IAC7B,WAAW,EAAE,0BAA0B;IACvC,WAAW,EACT,qEAAqE;IACvE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,qRAAqR,EAAE,UAAU,EAAE,IAAI,EAAE;IACpU,WAAW,EAAE,KAAK;IAClB,KAAK,EAAE;QACL,QAAQ,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,WAAW,EAAE,eAAe;YAC5B,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IAEK,GAAG;qEAAC,EAAE,UAAU,EAAE;YACtB,OAAO,IAAA,2BAAgB,EAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- export declare const requestActionDirectMessageAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
- }>)[], {
5
- userId: import("@activepieces/pieces-framework").DropdownProperty<string, true, (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
- }>)[]>;
9
- text: import("@activepieces/pieces-framework").LongTextProperty<true>;
10
- actions: import("@activepieces/pieces-framework").ArrayProperty<false> | import("@activepieces/pieces-framework").ArrayProperty<true>;
11
- username: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
- profilePicture: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
- mentionOriginFlow: import("@activepieces/pieces-framework").CheckboxProperty<false>;
14
- }>;
15
- //# sourceMappingURL=request-action-direct-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-action-direct-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/request-action-direct-message.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;EAsB3C,CAAC"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.requestActionDirectMessageAction = 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 shared_1 = require("@activepieces/shared");
8
- const props_1 = require("../common/props");
9
- const request_action_1 = require("../common/request-action");
10
- exports.requestActionDirectMessageAction = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.slackAuth,
12
- name: 'request_action_direct_message',
13
- displayName: 'Request Action from A User',
14
- description: 'Send a message to a user and wait until the user selects an action',
15
- audience: 'both',
16
- aiMetadata: { description: 'Send a direct message with interactive buttons to a user and pause the flow until that user clicks one of the defined actions, then resume with their choice. Use this for a human-in-the-loop decision via DM; use Request Approval in a Channel for a simple approve/disapprove gate in a channel. Sends a new message each run, so it is not idempotent.', idempotent: false },
17
- props: {
18
- userId: (0, props_1.userId)(true),
19
- text: props_1.text,
20
- actions: props_1.actions,
21
- username: props_1.username,
22
- profilePicture: props_1.profilePicture,
23
- mentionOriginFlow: props_1.mentionOriginFlow,
24
- },
25
- run(context) {
26
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
- const { userId } = context.propsValue;
28
- (0, shared_1.assertNotNullOrUndefined)(userId, 'userId');
29
- return yield (0, request_action_1.requestAction)(userId, context);
30
- });
31
- },
32
- });
33
- //# sourceMappingURL=request-action-direct-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-action-direct-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/request-action-direct-message.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,kCAAoC;AACpC,iDAAgE;AAChE,2CAOyB;AACzB,6DAAyD;AAE5C,QAAA,gCAAgC,GAAG,IAAA,+BAAY,EAAC;IAC3D,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,4BAA4B;IACzC,WAAW,EACT,oEAAoE;IACtE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,6VAA6V,EAAE,UAAU,EAAE,KAAK,EAAE;IAC7Y,KAAK,EAAE;QACL,MAAM,EAAE,IAAA,cAAM,EAAC,IAAI,CAAC;QACpB,IAAI,EAAJ,YAAI;QACJ,OAAO,EAAP,eAAO;QACP,QAAQ,EAAR,gBAAQ;QACR,cAAc,EAAd,sBAAc;QACd,iBAAiB,EAAjB,yBAAiB;KAClB;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACtC,IAAA,iCAAwB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;YAE3C,OAAO,MAAM,IAAA,8BAAa,EAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC9C,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,18 +0,0 @@
1
- export declare const requestActionMessageAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
- }>)[], {
5
- info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
6
- channel: 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
- text: import("@activepieces/pieces-framework").LongTextProperty<true>;
11
- actions: import("@activepieces/pieces-framework").ArrayProperty<false> | import("@activepieces/pieces-framework").ArrayProperty<true>;
12
- threadTs: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
- username: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
- profilePicture: import("@activepieces/pieces-framework").ShortTextProperty<false>;
15
- replyBroadcast: import("@activepieces/pieces-framework").CheckboxProperty<false>;
16
- mentionOriginFlow: import("@activepieces/pieces-framework").CheckboxProperty<false>;
17
- }>;
18
- //# sourceMappingURL=request-action-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-action-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/request-action-message.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;EAkCrC,CAAC"}
@@ -1,44 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.requestActionMessageAction = 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 shared_1 = require("@activepieces/shared");
8
- const props_1 = require("../common/props");
9
- const request_action_1 = require("../common/request-action");
10
- exports.requestActionMessageAction = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.slackAuth,
12
- name: 'request_action_message',
13
- displayName: 'Request Action in A Channel',
14
- description: 'Send a message in a channel and wait until an action is selected',
15
- audience: 'both',
16
- aiMetadata: {
17
- description: 'Post a message with interactive action buttons to a Slack channel and pause the flow until a recipient clicks one, then resume with the chosen action. Pick this for human-in-the-loop branching in a shared channel; use Request Approval from A User for a private approve/disapprove DM. Not idempotent: each run posts a new message and creates a fresh wait.',
18
- idempotent: false,
19
- },
20
- props: {
21
- info: props_1.singleSelectChannelInfo,
22
- channel: (0, props_1.slackChannel)(true),
23
- text: props_1.text,
24
- actions: props_1.actions,
25
- threadTs: props_1.threadTs,
26
- username: props_1.username,
27
- profilePicture: props_1.profilePicture,
28
- replyBroadcast: pieces_framework_1.Property.Checkbox({
29
- displayName: 'Broadcast reply to channel',
30
- description: 'When replying to a thread, also make the message visible to everyone in the channel (only applicable when Thread Timestamp is provided)',
31
- required: false,
32
- defaultValue: false,
33
- }),
34
- mentionOriginFlow: props_1.mentionOriginFlow,
35
- },
36
- run(context) {
37
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
38
- const { channel } = context.propsValue;
39
- (0, shared_1.assertNotNullOrUndefined)(channel, 'channel');
40
- return yield (0, request_action_1.requestAction)(channel, context);
41
- });
42
- },
43
- });
44
- //# sourceMappingURL=request-action-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-action-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/request-action-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAAoC;AACpC,iDAAgE;AAChE,2CASyB;AACzB,6DAAyD;AAE5C,QAAA,0BAA0B,GAAG,IAAA,+BAAY,EAAC;IACrD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,6BAA6B;IAC1C,WAAW,EACT,kEAAkE;IACpE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,oWAAoW;QACtW,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,+BAAuB;QAC7B,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,IAAI,EAAJ,YAAI;QACJ,OAAO,EAAP,eAAO;QACP,QAAQ,EAAR,gBAAQ;QACR,QAAQ,EAAR,gBAAQ;QACR,cAAc,EAAd,sBAAc;QACd,cAAc,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAChC,WAAW,EAAE,4BAA4B;YACzC,WAAW,EAAE,yIAAyI;YACtJ,QAAQ,EAAE,KAAK;YACf,YAAY,EAAE,KAAK;SACpB,CAAC;QACF,iBAAiB,EAAjB,yBAAiB;KAClB;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACvC,IAAA,iCAAwB,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YAE7C,OAAO,MAAM,IAAA,8BAAa,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,14 +0,0 @@
1
- export declare const requestApprovalDirectMessageAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
- }>)[], {
5
- userId: import("@activepieces/pieces-framework").DropdownProperty<string, true, (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
- }>)[]>;
9
- text: import("@activepieces/pieces-framework").LongTextProperty<true>;
10
- username: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
- profilePicture: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
- mentionOriginFlow: import("@activepieces/pieces-framework").CheckboxProperty<false>;
13
- }>;
14
- //# sourceMappingURL=request-approval-direct-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-approval-direct-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/request-approval-direct-message.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,kCAAkC;;;;;;;;;;;;EAgI7C,CAAC"}
@@ -1,133 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.requestApprovalDirectMessageAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const utils_1 = require("../common/utils");
7
- const auth_1 = require("../auth");
8
- const shared_1 = require("@activepieces/shared");
9
- const props_1 = require("../common/props");
10
- const web_api_1 = require("@slack/web-api");
11
- const auth_helpers_1 = require("../common/auth-helpers");
12
- exports.requestApprovalDirectMessageAction = (0, pieces_framework_1.createAction)({
13
- auth: auth_1.slackAuth,
14
- name: 'request_approval_direct_message',
15
- displayName: 'Request Approval from A User',
16
- description: 'Send approval message to a user and then wait until the message is approved or disapproved',
17
- audience: 'both',
18
- aiMetadata: {
19
- description: 'Direct-message one Slack user an approval request with Approve/Disapprove buttons and pause the flow until they respond. Pick this for a private one-to-one approval gate; use Request Action in A Channel to ask a whole channel. Not idempotent: each run sends a new DM and creates a fresh wait.',
20
- idempotent: false,
21
- },
22
- props: {
23
- userId: (0, props_1.userId)(true),
24
- text: props_1.text,
25
- username: props_1.username,
26
- profilePicture: props_1.profilePicture,
27
- mentionOriginFlow: props_1.mentionOriginFlow,
28
- },
29
- run(context) {
30
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
31
- if (context.executionType === shared_1.ExecutionType.BEGIN) {
32
- const token = (0, auth_helpers_1.getBotToken)(context.auth);
33
- const { userId, username, profilePicture, mentionOriginFlow } = context.propsValue;
34
- (0, shared_1.assertNotNullOrUndefined)(token, 'token');
35
- (0, shared_1.assertNotNullOrUndefined)(props_1.text, 'text');
36
- (0, shared_1.assertNotNullOrUndefined)(userId, 'userId');
37
- const waitpoint = yield context.run.createWaitpoint({
38
- type: 'WEBHOOK',
39
- });
40
- const postMessage = yield (0, utils_1.slackSendMessage)({
41
- token,
42
- text: `${context.propsValue.text}`,
43
- username,
44
- profilePicture,
45
- conversationId: userId,
46
- });
47
- const dmId = postMessage.channel;
48
- const messageTs = postMessage.ts;
49
- const approvalLink = waitpoint.buildResumeUrl({
50
- queryParams: { action: 'approve', channel: dmId, messageTs },
51
- });
52
- const disapprovalLink = waitpoint.buildResumeUrl({
53
- queryParams: { action: 'disapprove', channel: dmId, messageTs },
54
- });
55
- const client = new web_api_1.WebClient(token);
56
- yield client.chat.update({
57
- ts: messageTs,
58
- channel: dmId,
59
- text: context.propsValue.text,
60
- blocks: [
61
- ...(0, utils_1.textToSectionBlocks)(`${context.propsValue.text}`),
62
- {
63
- type: 'actions',
64
- block_id: 'actions',
65
- elements: [
66
- {
67
- type: 'button',
68
- text: {
69
- type: 'plain_text',
70
- text: 'Approve',
71
- },
72
- style: 'primary',
73
- value: approvalLink,
74
- action_id: 'approve',
75
- },
76
- {
77
- type: 'button',
78
- text: {
79
- type: 'plain_text',
80
- text: 'Disapprove',
81
- },
82
- style: 'danger',
83
- value: disapprovalLink,
84
- action_id: 'disapprove',
85
- },
86
- ],
87
- },
88
- ...(mentionOriginFlow ? [(0, utils_1.buildFlowOriginContextBlock)(context)] : []),
89
- ],
90
- });
91
- context.run.waitForWaitpoint(waitpoint.id);
92
- return {
93
- approved: false, // default approval is false
94
- messageTs
95
- };
96
- }
97
- else {
98
- const approved = context.resumePayload.queryParams['action'] === 'approve';
99
- const channel = context.resumePayload.queryParams['channel'];
100
- const messageTs = context.resumePayload.queryParams['messageTs'];
101
- const token = (0, auth_helpers_1.getBotToken)(context.auth);
102
- try {
103
- if (token && channel && messageTs) {
104
- const client = new web_api_1.WebClient(token);
105
- const statusText = approved ? 'Approved' : 'Disapproved';
106
- yield client.chat.update({
107
- channel,
108
- ts: messageTs,
109
- text: `${context.propsValue.text}\n\n${statusText}`,
110
- blocks: [
111
- ...(0, utils_1.textToSectionBlocks)(`${context.propsValue.text}`),
112
- {
113
- type: 'section',
114
- text: {
115
- type: 'mrkdwn',
116
- text: approved
117
- ? ':white_check_mark: *Approved*'
118
- : ':x: *Disapproved*',
119
- },
120
- },
121
- ],
122
- });
123
- }
124
- }
125
- catch (e) {
126
- // Ignore errors from updating the message, as it's cosmetic
127
- }
128
- return { approved, messageTs };
129
- }
130
- });
131
- },
132
- });
133
- //# sourceMappingURL=request-approval-direct-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-approval-direct-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/request-approval-direct-message.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,2CAAqG;AACrG,kCAAoC;AACpC,iDAG8B;AAC9B,2CAA4F;AAC5F,4CAAoE;AACpE,yDAAqE;AAExD,QAAA,kCAAkC,GAAG,IAAA,+BAAY,EAAC;IAC7D,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,iCAAiC;IACvC,WAAW,EAAE,8BAA8B;IAC3C,WAAW,EACT,4FAA4F;IAC9F,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,sSAAsS;QACxS,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,IAAA,cAAM,EAAC,IAAI,CAAC;QACpB,IAAI,EAAJ,YAAI;QACJ,QAAQ,EAAR,gBAAQ;QACR,cAAc,EAAd,sBAAc;QACd,iBAAiB,EAAjB,yBAAiB;KAClB;IACK,GAAG,CAAC,OAAO;;YACf,IAAI,OAAO,CAAC,aAAa,KAAK,sBAAa,CAAC,KAAK,EAAE,CAAC;gBAClD,MAAM,KAAK,GAAG,IAAA,0BAAW,EAAC,OAAO,CAAC,IAAsB,CAAC,CAAC;gBAC1D,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;gBAEnF,IAAA,iCAAwB,EAAC,KAAK,EAAE,OAAO,CAAC,CAAC;gBACzC,IAAA,iCAAwB,EAAC,YAAI,EAAE,MAAM,CAAC,CAAC;gBACvC,IAAA,iCAAwB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;gBAE3C,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;oBAClD,IAAI,EAAE,SAAS;iBAChB,CAAC,CAAC;gBAEH,MAAM,WAAW,GAAG,MAAM,IAAA,wBAAgB,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IAAI,EAAE,CAAC;gCACpD;oCACE,IAAI,EAAE,SAAS;oCACf,IAAI,EAAE;wCACJ,IAAI,EAAE,QAAQ;wCACd,IAAI,EAAE,QAAQ;4CACZ,CAAC,CAAC,+BAA+B;4CACjC,CAAC,CAAC,mBAAmB;qCACxB;iCACF;6BACF;yBACF,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,4DAA4D;gBAC9D,CAAC;gBAED,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;YACjC,CAAC;QACH,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,15 +0,0 @@
1
- export declare const requestSendApprovalMessageAction: import("@activepieces/pieces-framework").IAction<(import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
2
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
3
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
4
- }>)[], {
5
- info: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
6
- channel: 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
- text: import("@activepieces/pieces-framework").LongTextProperty<true>;
11
- username: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
- profilePicture: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
- mentionOriginFlow: import("@activepieces/pieces-framework").CheckboxProperty<false>;
14
- }>;
15
- //# sourceMappingURL=request-approval-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-approval-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/request-approval-message.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;EA2H3C,CAAC"}