@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,15 +0,0 @@
1
- export declare const updateMessage: 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
- text: import("@activepieces/pieces-framework").LongTextProperty<true>;
12
- mentionOriginFlow: import("@activepieces/pieces-framework").CheckboxProperty<false>;
13
- blocks: import("@activepieces/pieces-framework").JsonProperty<false>;
14
- }>;
15
- //# sourceMappingURL=update-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-message.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-message.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,aAAa;;;;;;;;;;;;;EAsDxB,CAAC"}
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateMessage = 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.updateMessage = (0, pieces_framework_1.createAction)({
12
- // auth: check https://www.activepieces.com/docs/developers/piece-reference/authentication,
13
- name: 'updateMessage',
14
- displayName: 'Update message',
15
- description: 'Update an existing message',
16
- audience: 'both',
17
- aiMetadata: {
18
- description: 'Edit an already-posted Slack message in place, replacing its text and blocks, identified by channel and message timestamp (ts). Pick this to revise content the flow previously sent rather than posting a new one; use Delete Message to remove it instead. Idempotent: re-running with the same inputs leaves the message in the same final state.',
19
- idempotent: true,
20
- },
21
- auth: auth_1.slackAuth,
22
- props: {
23
- info: props_1.singleSelectChannelInfo,
24
- channel: (0, props_1.slackChannel)(true),
25
- ts: pieces_framework_1.Property.ShortText({
26
- displayName: 'Message Timestamp',
27
- description: 'Please provide the timestamp of the message you wish to update, 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.',
28
- required: true,
29
- }),
30
- text: pieces_framework_1.Property.LongText({
31
- displayName: 'Message',
32
- description: 'The updated text of your message',
33
- required: true,
34
- }),
35
- mentionOriginFlow: props_1.mentionOriginFlow,
36
- blocks: props_1.blocks,
37
- },
38
- run(context) {
39
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
40
- const { auth, propsValue } = context;
41
- const messageTimestamp = (0, utils_1.processMessageTimestamp)(propsValue.ts);
42
- if (!messageTimestamp) {
43
- throw new Error('Invalid Timestamp Value.');
44
- }
45
- const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(auth));
46
- const blockList = [...(0, utils_1.textToSectionBlocks)(propsValue.text)];
47
- if (propsValue.blocks && Array.isArray(propsValue.blocks) && propsValue.blocks.length > 0) {
48
- blockList.push(...propsValue.blocks);
49
- }
50
- if (propsValue.mentionOriginFlow) {
51
- blockList.push((0, utils_1.buildFlowOriginContextBlock)(context));
52
- }
53
- return yield client.chat.update({
54
- channel: propsValue.channel,
55
- ts: messageTimestamp,
56
- text: propsValue.text,
57
- blocks: blockList,
58
- });
59
- });
60
- },
61
- });
62
- //# sourceMappingURL=update-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAAoC;AACpC,2CAAmG;AACnG,2CAA4G;AAC5G,4CAA6D;AAC7D,yDAAqE;AAExD,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACxC,2FAA2F;IAC3F,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,4BAA4B;IACzC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,sVAAsV;QACxV,UAAU,EAAE,IAAI;KACjB;IACD,IAAI,EAAE,gBAAS;IACf,KAAK,EAAE;QACL,IAAI,EAAE,+BAAuB;QAC7B,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,EAAE,EAAE,2BAAQ,CA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EAAE,UAAU,CAAC,IAAI;gBACrB,MAAM,EAAE,SAAS;aAClB,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,10 +0,0 @@
1
- export declare const updateProfileAction: 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
- firstName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
6
- lastName: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
- email: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
- userId: import("@activepieces/pieces-framework").ShortTextProperty<false>;
9
- }>;
10
- //# sourceMappingURL=update-profile.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-profile.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-profile.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB;;;;;;;;EAuC9B,CAAC"}
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateProfileAction = 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 web_api_1 = require("@slack/web-api");
8
- const auth_helpers_1 = require("../common/auth-helpers");
9
- exports.updateProfileAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.slackAuth,
11
- name: 'slack-update-profile',
12
- displayName: 'Update Profile',
13
- description: 'Update basic profile field such as name or title.',
14
- audience: 'both',
15
- aiMetadata: { description: "Update basic profile fields (first name, last name, email) for the authenticated user, or for another user when an admin specifies a user ID; requires a user token. Setting the same values again is idempotent. Note that changing the email triggers Slack notification emails to both addresses, and editing another user is admin-only on paid teams.", idempotent: true },
16
- props: {
17
- firstName: pieces_framework_1.Property.ShortText({
18
- displayName: 'First Name',
19
- required: false,
20
- }),
21
- lastName: pieces_framework_1.Property.ShortText({
22
- displayName: 'Last Name',
23
- required: false,
24
- }),
25
- email: pieces_framework_1.Property.ShortText({
26
- displayName: 'Email',
27
- description: `Changing a user's email address will send an email to both the old and new addresses, and also post a slackbot message to the user informing them of the change.`,
28
- required: false,
29
- }),
30
- userId: pieces_framework_1.Property.ShortText({
31
- displayName: 'User',
32
- description: 'ID of user to change. This argument may only be specified by admins on paid teams.You can use **Find User by Email** action to retrieve ID.',
33
- required: false,
34
- }),
35
- },
36
- run(_a) {
37
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
38
- const client = new web_api_1.WebClient((0, auth_helpers_1.requireUserToken)(auth));
39
- return client.users.profile.set({
40
- profile: {
41
- first_name: propsValue.firstName,
42
- last_name: propsValue.lastName,
43
- email: propsValue.email,
44
- },
45
- user: propsValue.userId,
46
- });
47
- });
48
- },
49
- });
50
- //# sourceMappingURL=update-profile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-profile.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-profile.ts"],"names":[],"mappings":";;;;AAAA,kCAAoC;AACpC,qEAAwE;AACxE,4CAA2C;AAC3C,yDAA0E;AAE7D,QAAA,mBAAmB,GAAG,IAAA,+BAAY,EAAC;IAC9C,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,mDAAmD;IAChE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,4VAA4V,EAAE,UAAU,EAAE,IAAI,EAAE;IAC3Y,KAAK,EAAE;QACL,SAAS,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC5B,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,KAAK,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,WAAW,EAAE,kKAAkK;YAC/K,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,MAAM;YACnB,WAAW,EACT,6IAA6I;YAC/I,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,IAAA,+BAAgB,EAAC,IAAsB,CAAC,CAAC,CAAC;YACvE,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC;gBAC9B,OAAO,EAAE;oBACP,UAAU,EAAE,UAAU,CAAC,SAAS;oBAChC,SAAS,EAAE,UAAU,CAAC,QAAQ;oBAC9B,KAAK,EAAE,UAAU,CAAC,KAAK;iBACxB;gBACD,IAAI,EAAE,UAAU,CAAC,MAAM;aACxB,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- export declare const updateGroupUsersAction: 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
- handle: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
- userIds: import("@activepieces/pieces-framework").ArrayProperty<false>;
7
- appendUsers: import("@activepieces/pieces-framework").CheckboxProperty<true>;
8
- }>;
9
- //# sourceMappingURL=update-user-groups.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-user-groups.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/update-user-groups.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,sBAAsB;;;;;;;EAgEjC,CAAC"}
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateGroupUsersAction = 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.updateGroupUsersAction = (0, pieces_framework_1.createAction)({
10
- auth: auth_1.slackAuth,
11
- name: 'update_group_users',
12
- displayName: 'Update User Group Members',
13
- description: 'Add users to or overwrite the member list of a Slack user group.',
14
- audience: 'both',
15
- aiMetadata: {
16
- description: 'Set the membership of a Slack user group, found by its handle, to a given list of user IDs. Defaults to appending the IDs to current members; with "Append" off it replaces the entire member list (clearing it if no IDs are given), which is idempotent. Append mode is not idempotent. Requires a user token and errors if the handle is not found.',
17
- idempotent: false,
18
- },
19
- props: {
20
- handle: pieces_framework_1.Property.ShortText({
21
- displayName: 'Group Handle',
22
- description: 'Group handle without the leading @',
23
- required: true,
24
- }),
25
- userIds: pieces_framework_1.Property.Array({
26
- displayName: 'User IDs',
27
- description: 'The list of Slack User IDs to update this group with. Leave empty to clear the group (if not appending).',
28
- required: false,
29
- }),
30
- appendUsers: pieces_framework_1.Property.Checkbox({
31
- displayName: 'Append to existing members?',
32
- description: 'If checked, these users will be added to the current group. If unchecked, the current group members will be completely replaced by these users.',
33
- required: true,
34
- defaultValue: true,
35
- }),
36
- },
37
- run(context) {
38
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
39
- var _a;
40
- const auth = context.auth;
41
- const botClient = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(auth));
42
- const userClient = new web_api_1.WebClient((0, auth_helpers_1.requireUserToken)(auth));
43
- const searchHandle = context.propsValue.handle.replace('@', '').toLowerCase();
44
- const rawUserIds = (context.propsValue.userIds || []);
45
- const userIds = rawUserIds.filter((id) => id && id.trim() !== '');
46
- const appendUsers = context.propsValue.appendUsers;
47
- const listResponse = yield botClient.usergroups.list({ include_users: true });
48
- const group = (_a = listResponse.usergroups) === null || _a === void 0 ? void 0 : _a.find((g) => g.handle && g.handle.toLowerCase() === searchHandle);
49
- if (!group || !group.id) {
50
- throw new Error(`User group with handle '@${searchHandle}' not found.`);
51
- }
52
- let finalUserIds = userIds;
53
- if (appendUsers) {
54
- const existingUsers = group.users || [];
55
- finalUserIds = Array.from(new Set([...existingUsers, ...userIds]));
56
- }
57
- const usersString = finalUserIds.join(', ');
58
- const updateResponse = yield userClient.usergroups.users.update({
59
- usergroup: group.id,
60
- users: usersString,
61
- });
62
- return updateResponse;
63
- });
64
- },
65
- });
66
- //# sourceMappingURL=update-user-groups.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-user-groups.js","sourceRoot":"","sources":["../../../../src/lib/actions/update-user-groups.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAAoC;AACpC,4CAA2C;AAC3C,yDAAuF;AAE1E,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,kEAAkE;IAC/E,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE;QACV,WAAW,EACT,wVAAwV;QAC1V,UAAU,EAAE,KAAK;KAClB;IACD,KAAK,EAAE;QACL,MAAM,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACzB,WAAW,EAAE,cAAc;YAC3B,WAAW,EAAE,oCAAoC;YACjD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,KAAK,CAAC;YACtB,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,0GAA0G;YACvH,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,WAAW,EAAE,2BAAQ,C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AED,IAAI,YAAY,GAAG,OAAO,CAAC;YAE3B,IAAI,WAAW,EAAE,CAAC;gBAChB,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;gBACxC,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,aAAa,EAAE,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACrE,CAAC;YAED,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE5C,MAAM,cAAc,GAAG,MAAM,UAAU,CAAC,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC;gBAC9D,SAAS,EAAE,KAAK,CAAC,EAAE;gBACnB,KAAK,EAAE,WAAW;aACnB,CAAC,CAAC;YAEH,OAAO,cAAc,CAAC;QACxB,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- export declare const uploadFile: 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
- file: import("@activepieces/pieces-framework").FileProperty<true>;
6
- title: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
- filename: import("@activepieces/pieces-framework").ShortTextProperty<false>;
8
- channel: 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
- }>;
13
- //# sourceMappingURL=upload-file.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload-file.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/upload-file.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,UAAU;;;;;;;;;;;EAgCrB,CAAC"}
@@ -1,45 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uploadFile = 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 props_1 = require("../common/props");
9
- const auth_helpers_1 = require("../common/auth-helpers");
10
- exports.uploadFile = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.slackAuth,
12
- name: 'uploadFile',
13
- displayName: 'Upload file',
14
- description: 'Upload file without sharing it to a channel or user',
15
- audience: 'both',
16
- aiMetadata: { description: 'Upload a file to Slack, optionally sharing it into a channel and setting a title and filename. Each call creates a new file, so it is not idempotent. To attach a file inline with a message instead, use the attachment option on Send Message To A Channel.', idempotent: false },
17
- props: {
18
- file: pieces_framework_1.Property.File({
19
- displayName: 'Attachment',
20
- required: true,
21
- }),
22
- title: pieces_framework_1.Property.ShortText({
23
- displayName: 'Title',
24
- required: false,
25
- }),
26
- filename: pieces_framework_1.Property.ShortText({
27
- displayName: 'Filename',
28
- required: false,
29
- }),
30
- channel: (0, props_1.slackChannel)(false),
31
- },
32
- run(context) {
33
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
34
- const token = (0, auth_helpers_1.getBotToken)(context.auth);
35
- const { file, title, filename, channel } = context.propsValue;
36
- const client = new web_api_1.WebClient(token);
37
- return yield client.files.uploadV2({
38
- file_uploads: [{ file: file.data, filename: filename || file.filename }],
39
- title: title,
40
- channel_id: channel,
41
- });
42
- });
43
- },
44
- });
45
- //# sourceMappingURL=upload-file.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload-file.js","sourceRoot":"","sources":["../../../../src/lib/actions/upload-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAAoC;AACpC,4CAA2C;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 -1,6 +0,0 @@
1
- export declare const slackOAuth2Auth: import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props>;
2
- export declare const slackAuth: (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
- //# sourceMappingURL=auth.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,+GAuC1B,CAAC;AAwCH,eAAO,MAAM,SAAS;;;KAAqC,CAAC"}
package/src/lib/auth.js DELETED
@@ -1,84 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.slackAuth = exports.slackOAuth2Auth = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const pieces_common_1 = require("@activepieces/pieces-common");
7
- exports.slackOAuth2Auth = pieces_framework_1.PieceAuth.OAuth2({
8
- description: 'Authenticate via a Slack OAuth flow.',
9
- authUrl: 'https://slack.com/oauth/v2/authorize?user_scope=search:read,users.profile:write,reactions:read,reactions:write,im:history,stars:read,channels:write,groups:write,im:write,mpim:write,channels:write.invites,groups:write.invites,channels:history,groups:history,chat:write,users:read,usergroups:write',
10
- tokenUrl: 'https://slack.com/api/oauth.v2.access',
11
- required: true,
12
- scope: [
13
- 'channels:read',
14
- 'channels:manage',
15
- 'channels:history',
16
- 'chat:write',
17
- 'groups:read',
18
- 'groups:write',
19
- 'groups:history',
20
- 'reactions:read',
21
- 'mpim:read',
22
- 'mpim:write',
23
- 'mpim:history',
24
- 'im:write',
25
- 'im:read',
26
- 'im:history',
27
- 'users:read',
28
- 'files:write',
29
- 'files:read',
30
- 'users:read.email',
31
- 'reactions:write',
32
- 'usergroups:read',
33
- 'usergroups:write',
34
- 'chat:write.customize',
35
- 'links:read',
36
- 'links:write',
37
- 'emoji:read',
38
- 'users.profile:read',
39
- 'channels:write.invites',
40
- 'groups:write.invites',
41
- 'channels:join',
42
- 'conversations.connect:write'
43
- ],
44
- });
45
- const slackCustomAuth = pieces_framework_1.PieceAuth.CustomAuth({
46
- displayName: 'Bot Token',
47
- description: 'Authenticate using a Slack bot token (and optional user token).',
48
- required: true,
49
- props: {
50
- botToken: pieces_framework_1.PieceAuth.SecretText({
51
- displayName: 'Bot Token',
52
- description: 'The bot token for your Slack app (starts with xoxb-)',
53
- required: true,
54
- }),
55
- userToken: pieces_framework_1.PieceAuth.SecretText({
56
- displayName: 'User Token',
57
- description: 'Optional user token for actions that require user-level access (starts with xoxp-)',
58
- required: false,
59
- }),
60
- },
61
- validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
62
- try {
63
- const response = yield pieces_common_1.httpClient.sendRequest({
64
- method: pieces_common_1.HttpMethod.GET,
65
- url: 'https://slack.com/api/auth.test',
66
- headers: {
67
- Authorization: `Bearer ${auth.botToken}`,
68
- },
69
- });
70
- if (!response.body.ok) {
71
- return {
72
- valid: false,
73
- error: `Slack auth test failed: ${response.body.error}`,
74
- };
75
- }
76
- return { valid: true };
77
- }
78
- catch (e) {
79
- return { valid: false, error: e.message };
80
- }
81
- }),
82
- });
83
- exports.slackAuth = [exports.slackOAuth2Auth, slackCustomAuth];
84
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/lib/auth.ts"],"names":[],"mappings":";;;;AAAA,qEAA2D;AAC3D,+DAAqE;AAExD,QAAA,eAAe,GAAG,4BAAS,CAAC,MAAM,CAAC;IAC9C,WAAW,EACT,sCAAsC;IACxC,OAAO,EACL,ySAAyS;IAC3S,QAAQ,EAAE,uCAAuC;IACjD,QAAQ,EAAE,IAA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AAK,EAAE,2BAA2B,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE;iBACxD,CAAC;YACJ,CAAC;YACD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAG,CAAW,CAAC,OAAO,EAAE,CAAC;QACvD,CAAC;IACH,CAAC,CAAA;CACF,CAAC,CAAC;AAEU,QAAA,SAAS,GAAG,CAAC,uBAAe,EAAE,eAAe,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- import { AppConnectionValueForAuthProperty } from '@activepieces/pieces-framework';
2
- import type { slackAuth } from '../auth';
3
- export type SlackAuthValue = AppConnectionValueForAuthProperty<typeof slackAuth>;
4
- export declare function getBotToken(auth: SlackAuthValue): string;
5
- export declare function getUserToken(auth: SlackAuthValue): string | undefined;
6
- export declare function requireUserToken(auth: SlackAuthValue): string;
7
- export declare function getTeamId(auth: SlackAuthValue): Promise<string>;
8
- export declare function getUserId(auth: SlackAuthValue): Promise<string>;
9
- //# sourceMappingURL=auth-helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-helpers.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/auth-helpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iCAAiC,EAAE,MAAM,gCAAgC,CAAC;AAEnF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG,iCAAiC,CAC5D,OAAO,SAAS,CACjB,CAAC;AAyBF,wBAAgB,WAAW,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAMxD;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAOrE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,CAU7D;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBrE;AAGD,wBAAsB,SAAS,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBrE"}
@@ -1,82 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getBotToken = getBotToken;
4
- exports.getUserToken = getUserToken;
5
- exports.requireUserToken = requireUserToken;
6
- exports.getTeamId = getTeamId;
7
- exports.getUserId = getUserId;
8
- const tslib_1 = require("tslib");
9
- const shared_1 = require("@activepieces/shared");
10
- const pieces_common_1 = require("@activepieces/pieces-common");
11
- function isCustomAuth(auth) {
12
- return auth.type === shared_1.AppConnectionType.CUSTOM_AUTH;
13
- }
14
- function getBotToken(auth) {
15
- const a = auth;
16
- if (isCustomAuth(a)) {
17
- return a.props.botToken;
18
- }
19
- return a.access_token;
20
- }
21
- function getUserToken(auth) {
22
- var _a, _b;
23
- const a = auth;
24
- if (isCustomAuth(a)) {
25
- return a.props.userToken || undefined;
26
- }
27
- return (_b = (_a = a.data) === null || _a === void 0 ? void 0 : _a['authed_user']) === null || _b === void 0 ? void 0 : _b.access_token;
28
- }
29
- function requireUserToken(auth) {
30
- const token = getUserToken(auth);
31
- if (!token) {
32
- throw new Error(JSON.stringify({
33
- message: 'Missing user token, please re-authenticate',
34
- }));
35
- }
36
- return token;
37
- }
38
- function getTeamId(auth) {
39
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
40
- var _a;
41
- const a = auth;
42
- if (!isCustomAuth(a)) {
43
- return ((_a = a.data['team_id']) !== null && _a !== void 0 ? _a : a.data['team']['id']);
44
- }
45
- const response = yield pieces_common_1.httpClient.sendRequest({
46
- method: pieces_common_1.HttpMethod.GET,
47
- url: 'https://slack.com/api/auth.test',
48
- headers: {
49
- Authorization: `Bearer ${a.props.botToken}`,
50
- },
51
- });
52
- if (!response.body.ok) {
53
- throw new Error('Failed to get team ID from Slack auth.test');
54
- }
55
- return response.body.team_id;
56
- });
57
- }
58
- function getUserId(auth) {
59
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
60
- var _a;
61
- const a = auth;
62
- if (!isCustomAuth(a)) {
63
- const userId = (_a = a.data['authed_user']) === null || _a === void 0 ? void 0 : _a.id;
64
- if (!userId) {
65
- throw new Error('Failed to get user ID from Slack auth data');
66
- }
67
- return userId;
68
- }
69
- const response = yield pieces_common_1.httpClient.sendRequest({
70
- method: pieces_common_1.HttpMethod.GET,
71
- url: 'https://slack.com/api/auth.test',
72
- headers: {
73
- Authorization: `Bearer ${a.props.botToken}`,
74
- },
75
- });
76
- if (!response.body.ok) {
77
- throw new Error('Failed to get user ID from Slack auth.test');
78
- }
79
- return response.body.user_id;
80
- });
81
- }
82
- //# sourceMappingURL=auth-helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth-helpers.js","sourceRoot":"","sources":["../../../../src/lib/common/auth-helpers.ts"],"names":[],"mappings":";;AAgCA,kCAMC;AAED,oCAOC;AAED,4CAUC;AAED,8BAsBC;AAGD,8BAuBC;;AA7GD,iDAAyD;AAEzD,+DAAqE;AA0BrE,SAAS,YAAY,CAAC,IAAe;IACnC,OAAO,IAAI,CAAC,IAAI,KAAK,0BAAiB,CAAC,WAAW,CAAC;AACrD,CAAC;AAED,SAAgB,WAAW,CAAC,IAAoB;IAC9C,MAAM,CAAC,GAAG,IAAiB,CAAC;IAC5B,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;QACpB,OAAO,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC1B,CAAC;IACD,OAAO,CAAC,CAAC,YAAY,CAAC;AACxB,CAAC;AAED,SAAgB,YAAY,CAAC,IAAoB;;IAC/C,MAAM,CAAC,GAAG,IAAiB,CAAC;IAC5B,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC;QACpB,OAAO,CAAC,CAAC,KAAK,CAAC,SAAS,IAAI,SAAS,CAAC;IACxC,CAAC;IACD,OAAO,MA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AAE,EAAE,CAAC;YACjF,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;YAChE,CAAC;YACD,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,0BAAU,CAAC,WAAW,CAG1C;YACD,MAAM,EAAE,0BAAU,CAAC,GAAG;YACtB,GAAG,EAAE,iCAAiC;YACtC,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE;aAC5C;SACF,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;IAC/B,CAAC;CAAA"}
@@ -1,37 +0,0 @@
1
- export declare const multiSelectChannelInfo: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
2
- export declare const singleSelectChannelInfo: import("@activepieces/pieces-framework/dist/src/lib/property/input/markdown-property").MarkDownProperty;
3
- export declare const slackChannel: <R extends boolean>(required: R) => R extends true ? import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
4
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
5
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
6
- }>)[]> : import("@activepieces/pieces-framework").DropdownProperty<string, false, (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
- export declare const username: import("@activepieces/pieces-framework").ShortTextProperty<false>;
11
- export declare const profilePicture: import("@activepieces/pieces-framework").ShortTextProperty<false>;
12
- export declare const iconEmoji: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
- export declare const threadTs: import("@activepieces/pieces-framework").ShortTextProperty<false>;
14
- export declare const mentionOriginFlow: import("@activepieces/pieces-framework").CheckboxProperty<false>;
15
- export declare const blocks: import("@activepieces/pieces-framework").JsonProperty<false>;
16
- export declare const userId: <R extends boolean>(required: R) => R extends true ? import("@activepieces/pieces-framework").DropdownProperty<string, true, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
17
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
18
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
19
- }>)[]> : import("@activepieces/pieces-framework").DropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
20
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
21
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
22
- }>)[]>;
23
- export declare const userIds: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
24
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
25
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
26
- }>)[]>;
27
- export declare const usergroupIds: import("@activepieces/pieces-framework").MultiSelectDropdownProperty<string, false, (import("@activepieces/pieces-framework").OAuth2Property<import("@activepieces/pieces-framework").OAuth2Props> | import("@activepieces/pieces-framework").CustomAuthProperty<{
28
- botToken: import("@activepieces/pieces-framework").SecretTextProperty<true>;
29
- userToken: import("@activepieces/pieces-framework").SecretTextProperty<false>;
30
- }>)[]>;
31
- export declare const text: import("@activepieces/pieces-framework").LongTextProperty<true>;
32
- export declare const actions: import("@activepieces/pieces-framework").ArrayProperty<false> | import("@activepieces/pieces-framework").ArrayProperty<true>;
33
- export declare function getChannels(accessToken: string): Promise<{
34
- label: string;
35
- value: string;
36
- }[]>;
37
- //# sourceMappingURL=props.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../../src/lib/common/props.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,sBAAsB,yGAIjC,CAAC;AAEH,eAAO,MAAM,uBAAuB,yGAKlC,CAAC;AAEH,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,OAAO,YAAY,CAAC;;;;;;MA0BvD,CAAC;AAEL,eAAO,MAAM,QAAQ,mEAInB,CAAC;AAEH,eAAO,MAAM,cAAc,mEAIzB,CAAC;AAEH,eAAO,MAAM,SAAS,mEAIpB,CAAC;AAEH,eAAO,MAAM,QAAQ,mEAKnB,CAAC;AAEH,eAAO,MAAM,iBAAiB,kEAM5B,CAAC;AAEH,eAAO,MAAM,MAAM,8DAKjB,CAAC;AAEH,eAAO,MAAM,MAAM,GAAI,CAAC,SAAS,OAAO,YAAY,CAAC;;;;;;MAsBjD,CAAC;AAEL,eAAO,MAAM,OAAO;;;MAqBlB,CAAC;AAEH,eAAO,MAAM,YAAY;;;MA4BvB,CAAC;AAEH,eAAO,MAAM,IAAI,iEAGf,CAAC;AAEH,eAAO,MAAM,OAAO,8HAqBlB,CAAC;AAuBH,wBAAsB,WAAW,CAAC,WAAW,EAAE,MAAM;WAE1B,MAAM;WAAS,MAAM;KAwB/C"}