@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,130 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.requestSendApprovalMessageAction = 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.requestSendApprovalMessageAction = (0, pieces_framework_1.createAction)({
13
- auth: auth_1.slackAuth,
14
- name: 'request_approval_message',
15
- displayName: 'Request Approval in a Channel',
16
- description: 'Send approval message to a channel and then wait until the message is approved or disapproved',
17
- audience: 'both',
18
- aiMetadata: { description: 'Post a message with Approve/Disapprove buttons to a channel and pause the flow until someone clicks one, then resume with the boolean outcome. Use this for a simple approval gate visible to a channel; use Request Action from A User for a private DM with custom action choices. Posts a new message each run, so it is not idempotent.', idempotent: false },
19
- props: {
20
- info: props_1.singleSelectChannelInfo,
21
- channel: (0, props_1.slackChannel)(true),
22
- text: props_1.text,
23
- username: props_1.username,
24
- profilePicture: props_1.profilePicture,
25
- mentionOriginFlow: props_1.mentionOriginFlow,
26
- },
27
- run(context) {
28
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
- if (context.executionType === shared_1.ExecutionType.BEGIN) {
30
- const token = (0, auth_helpers_1.getBotToken)(context.auth);
31
- const { channel, username, profilePicture, mentionOriginFlow } = context.propsValue;
32
- (0, shared_1.assertNotNullOrUndefined)(token, 'token');
33
- (0, shared_1.assertNotNullOrUndefined)(props_1.text, 'text');
34
- (0, shared_1.assertNotNullOrUndefined)(channel, 'channel');
35
- const waitpoint = yield context.run.createWaitpoint({
36
- type: 'WEBHOOK',
37
- });
38
- const postMessage = yield (0, utils_1.slackSendMessage)({
39
- token,
40
- text: `${context.propsValue.text}`,
41
- username,
42
- profilePicture,
43
- conversationId: channel,
44
- });
45
- const messageTs = postMessage.ts;
46
- const approvalLink = waitpoint.buildResumeUrl({
47
- queryParams: { action: 'approve', channel, messageTs },
48
- });
49
- const disapprovalLink = waitpoint.buildResumeUrl({
50
- queryParams: { action: 'disapprove', channel, messageTs },
51
- });
52
- const client = new web_api_1.WebClient(token);
53
- yield client.chat.update({
54
- channel: channel,
55
- ts: messageTs,
56
- text: context.propsValue.text,
57
- blocks: [
58
- ...(0, utils_1.textToSectionBlocks)(`${context.propsValue.text}`),
59
- {
60
- type: 'actions',
61
- block_id: 'actions',
62
- elements: [
63
- {
64
- type: 'button',
65
- text: {
66
- type: 'plain_text',
67
- text: 'Approve',
68
- },
69
- style: 'primary',
70
- value: approvalLink,
71
- action_id: 'approve',
72
- },
73
- {
74
- type: 'button',
75
- text: {
76
- type: 'plain_text',
77
- text: 'Disapprove',
78
- },
79
- style: 'danger',
80
- value: disapprovalLink,
81
- action_id: 'disapprove',
82
- },
83
- ],
84
- },
85
- ...(mentionOriginFlow ? [(0, utils_1.buildFlowOriginContextBlock)(context)] : []),
86
- ],
87
- });
88
- context.run.waitForWaitpoint(waitpoint.id);
89
- return {
90
- approved: false, // default approval is false
91
- messageTs
92
- };
93
- }
94
- else {
95
- const approved = context.resumePayload.queryParams['action'] === 'approve';
96
- const channel = context.resumePayload.queryParams['channel'];
97
- const messageTs = context.resumePayload.queryParams['messageTs'];
98
- const token = (0, auth_helpers_1.getBotToken)(context.auth);
99
- try {
100
- if (token && channel && messageTs) {
101
- const client = new web_api_1.WebClient(token);
102
- const statusText = approved ? 'Approved' : 'Disapproved';
103
- yield client.chat.update({
104
- channel,
105
- ts: messageTs,
106
- text: `${context.propsValue.text}\n\n${statusText}`,
107
- blocks: [
108
- ...(0, utils_1.textToSectionBlocks)(`${context.propsValue.text}`),
109
- {
110
- type: 'section',
111
- text: {
112
- type: 'mrkdwn',
113
- text: approved
114
- ? ':white_check_mark: *Approved*'
115
- : ':x: *Disapproved*',
116
- },
117
- },
118
- ],
119
- });
120
- }
121
- }
122
- catch (e) {
123
- // Ignore errors from updating the message, as it's cosmetic
124
- }
125
- return { approved, messageTs };
126
- }
127
- });
128
- },
129
- });
130
- //# sourceMappingURL=request-approval-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-approval-message.js","sourceRoot":"","sources":["../../../../src/lib/actions/request-approval-message.ts"],"names":[],"mappings":";;;;AAAA,qEAA8D;AAC9D,2CAAqG;AACrG,kCAAoC;AACpC,iDAG8B;AAC9B,2CAOyB;AACzB,4CAAoE;AACpE,yDAAqE;AAExD,QAAA,gCAAgC,GAAG,IAAA,+BAAY,EAAC;IAC3D,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE,+BAA+B;IAC5C,WAAW,EACT,+FAA+F;IACjG,QAAQ,EAAE,MAAM;IAChB,UAAU,EA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ieces/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
- channel: 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
- threadTs: import("@activepieces/pieces-framework").ShortTextProperty<true>;
10
- }>;
11
- //# sourceMappingURL=retrieve-thread-messages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"retrieve-thread-messages.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/retrieve-thread-messages.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,sBAAsB;;;;;;;;;EA2BjC,CAAC"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.retrieveThreadMessages = 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 utils_1 = require("../common/utils");
10
- const auth_helpers_1 = require("../common/auth-helpers");
11
- exports.retrieveThreadMessages = (0, pieces_framework_1.createAction)({
12
- name: 'retrieveThreadMessages',
13
- displayName: 'Retrieve Thread Messages',
14
- description: 'Retrieves thread messages by channel and thread timestamp.',
15
- audience: 'both',
16
- aiMetadata: { description: 'Retrieve all replies in a thread given the channel and the parent message timestamp; read-only and repeatable. The timestamp must be that of the parent message, not a reply. Use this to read a conversation thread; use Get channel history for top-level channel messages.', idempotent: true },
17
- auth: auth_1.slackAuth,
18
- props: {
19
- channel: (0, props_1.slackChannel)(true),
20
- threadTs: pieces_framework_1.Property.ShortText({
21
- displayName: 'Thread ts',
22
- description: 'Provide the ts (timestamp) value of the **parent** message to retrieve replies of this message. Do not use the ts value of the reply itself; use its parent instead. For example `1710304378.475129`.Alternatively, you can easily obtain the message link by clicking on the three dots next to the parent message and selecting the `Copy link` option.',
23
- required: true,
24
- }),
25
- },
26
- run(_a) {
27
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
28
- const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(auth));
29
- const messageTimestamp = (0, utils_1.processMessageTimestamp)(propsValue.threadTs);
30
- if (!messageTimestamp) {
31
- throw new Error('Invalid Timestamp Value.');
32
- }
33
- return yield client.conversations.replies({
34
- channel: propsValue.channel,
35
- ts: messageTimestamp,
36
- });
37
- });
38
- },
39
- });
40
- //# sourceMappingURL=retrieve-thread-messages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"retrieve-thread-messages.js","sourceRoot":"","sources":["../../../../src/lib/actions/retrieve-thread-messages.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAAoC;AACpC,4CAA2C;AAC3C,2CAA+C;AAC/C,2CAA0D;AAC1D,yDAAqE;AAExD,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,0BAA0B;IACvC,WAAW,EAAE,4DAA4D;IACzE,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,+QAA+Q,EAAE,UAAU,EAAE,IAAI,EAAE;IAC9T,IAAI,EAAE,gBAAS;IACf,KAAK,EAAE;QACL,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,QAAQ,EAAE,2BAAQ,CAAC,SAAS,CAAC;YAC3B,WAAW,EAAE,WAAW;YACxB,WAAW,EACT,2VAA2V;YAC7V,QAAQ,EAAE,IAAI;SACf,CAAC;KACH;IACK,GAAG;qEAAC,EAAE,IAAI,EAAE,UAAU,EAAE;YAC5B,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,IAAA,0BAAW,EAAC,IAAsB,CAAC,CAAC,CAAC;YAChE,MAAM,gBAAgB,GAAG,IAAA,+BAAuB,EAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YACpE,IAAI,CAAC,gBAAgB,EAAE,CAAC;gBACtB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;YAC9C,CAAC;YACL,OAAO,MAAM,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC;gBACxC,OAAO,EAAE,UAAU,CAAC,OAAO;gBAC3B,EAAE,EAAE,gBAAgB;aACrB,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,7 +0,0 @@
1
- export declare const searchMessages: 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
- query: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
- }>;
7
- //# sourceMappingURL=search-messages.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-messages.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/search-messages.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,cAAc;;;;;EAuCzB,CAAC"}
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.searchMessages = 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.searchMessages = (0, pieces_framework_1.createAction)({
10
- name: 'searchMessages',
11
- displayName: 'Search messages',
12
- description: 'Searches for messages matching a query',
13
- audience: 'both',
14
- aiMetadata: { description: 'Search across the workspace for messages matching a query string and return all matching messages, paging through every result; read-only and repeatable. Requires a user token (search is not available to bot tokens). Use this to find messages anywhere by content; use Get channel history or Get Message by Timestamp when you already know the channel.', idempotent: true },
15
- auth: auth_1.slackAuth,
16
- props: {
17
- query: pieces_framework_1.Property.ShortText({
18
- displayName: 'Search query',
19
- required: true,
20
- }),
21
- },
22
- run(_a) {
23
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
24
- var _b, _c, _d;
25
- const userToken = (0, auth_helpers_1.requireUserToken)(auth);
26
- const client = new web_api_1.WebClient(userToken);
27
- const matches = [];
28
- // We can't use the usual "for await ... of" syntax with client.paginate
29
- // Because search.messages uses a bastardized version of cursor-based pagination
30
- // Where you need to pass * as first cursor
31
- // https://api.slack.com/methods/search.messages#arg_cursor
32
- let cursor = '*';
33
- do {
34
- const page = yield client.search.messages({
35
- query: propsValue.query,
36
- count: 100,
37
- // @ts-expect-error TS2353 - SDK is not aware cursor is actually supported
38
- cursor,
39
- });
40
- if ((_b = page.messages) === null || _b === void 0 ? void 0 : _b.matches) {
41
- matches.push(...page.messages.matches);
42
- }
43
- // @ts-expect-error TS2353 - SDK is not aware next_cursor is actually returned
44
- cursor = (_d = (_c = page.messages) === null || _c === void 0 ? void 0 : _c.pagination) === null || _d === void 0 ? void 0 : _d.next_cursor;
45
- } while (cursor);
46
- return matches;
47
- });
48
- },
49
- });
50
- //# sourceMappingURL=search-messages.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"search-messages.js","sourceRoot":"","sources":["../../../../src/lib/actions/search-messages.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kCAAoC;AACpC,4CAA2C;AAC3C,yDAA0E;AAE7D,QAAA,cAAc,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,gBAAgB;IACtB,WAA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ieces-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
- iconEmoji: import("@activepieces/pieces-framework").ShortTextProperty<false>;
13
- mentionOriginFlow: import("@activepieces/pieces-framework").CheckboxProperty<false>;
14
- blocks: import("@activepieces/pieces-framework").JsonProperty<false>;
15
- unfurlLinks: import("@activepieces/pieces-framework").CheckboxProperty<false>;
16
- }>;
17
- //# sourceMappingURL=send-direct-message-action.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"send-direct-message-action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/send-direct-message-action.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;EAmDvC,CAAC"}
@@ -1,60 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.slackSendDirectMessageAction = 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 auth_helpers_1 = require("../common/auth-helpers");
11
- exports.slackSendDirectMessageAction = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.slackAuth,
13
- name: 'send_direct_message',
14
- displayName: 'Send Message To A User',
15
- description: 'Send message to a user',
16
- audience: 'both',
17
- aiMetadata: { description: 'Send a direct message to a single user by user ID, with optional Block Kit blocks, custom username/icon, and link unfurling. Each call posts a new DM, so it is not idempotent. Use this to message one person privately; use Send Message To A Channel to post in a channel.', idempotent: false },
18
- props: {
19
- userId: (0, props_1.userId)(true),
20
- text: props_1.text,
21
- username: props_1.username,
22
- profilePicture: props_1.profilePicture,
23
- iconEmoji: props_1.iconEmoji,
24
- mentionOriginFlow: props_1.mentionOriginFlow,
25
- blocks: props_1.blocks,
26
- unfurlLinks: pieces_framework_1.Property.Checkbox({
27
- displayName: 'Unfurl Links',
28
- description: 'Enable link unfurling for this message',
29
- required: false,
30
- defaultValue: true,
31
- }),
32
- },
33
- run(context) {
34
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
35
- const token = (0, auth_helpers_1.getBotToken)(context.auth);
36
- const { text, userId, blocks, unfurlLinks, mentionOriginFlow } = context.propsValue;
37
- (0, shared_1.assertNotNullOrUndefined)(token, 'token');
38
- (0, shared_1.assertNotNullOrUndefined)(text, 'text');
39
- (0, shared_1.assertNotNullOrUndefined)(userId, 'userId');
40
- const blockList = [...(0, utils_1.textToSectionBlocks)(text)];
41
- if (blocks && Array.isArray(blocks)) {
42
- blockList.push(...blocks);
43
- }
44
- if (mentionOriginFlow) {
45
- blockList.push((0, utils_1.buildFlowOriginContextBlock)(context));
46
- }
47
- return (0, utils_1.slackSendMessage)({
48
- token,
49
- text,
50
- username: context.propsValue.username,
51
- profilePicture: context.propsValue.profilePicture,
52
- iconEmoji: context.propsValue.iconEmoji,
53
- conversationId: userId,
54
- blocks: blockList,
55
- unfurlLinks,
56
- });
57
- });
58
- },
59
- });
60
- //# sourceMappingURL=send-direct-message-action.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"send-direct-message-action.js","sourceRoot":"","sources":["../../../../src/lib/actions/send-direct-message-action.ts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AAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBACnC,SAAS,CAAC,IAAI,CAAC,GAAI,MAA4C,CAAC,CAAA;YAClE,CAAC;YAED,IAAG,iBAAiB,EAAE,CAAC;gBACrB,SAAS,CAAC,IAAI,CAAC,IAAA,mCAA2B,EAAC,OAAO,CAAC,CAAC,CAAC;YACvD,CAAC;YAED,OAAO,IAAA,wBAAgB,EAAC;gBACtB,KAAK;gBACL,IAAI;gBACJ,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAC,QAAQ;gBACrC,cAAc,EAAE,OAAO,CAAC,UAAU,CAAC,cAAc;gBACjD,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,SAAS;gBACvC,cAAc,EAAE,MAAM;gBACtB,MAAM,EAAC,SAAS;gBAChB,WAAW;aACZ,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,22 +0,0 @@
1
- export declare const slackSendMessageAction: 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<false>;
11
- sendAsBot: import("@activepieces/pieces-framework").CheckboxProperty<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
- iconEmoji: import("@activepieces/pieces-framework").ShortTextProperty<false>;
16
- file: import("@activepieces/pieces-framework").FileProperty<false>;
17
- replyBroadcast: import("@activepieces/pieces-framework").CheckboxProperty<false>;
18
- mentionOriginFlow: import("@activepieces/pieces-framework").CheckboxProperty<false>;
19
- unfurlLinks: import("@activepieces/pieces-framework").CheckboxProperty<false>;
20
- blocks: import("@activepieces/pieces-framework").JsonProperty<false>;
21
- }>;
22
- //# sourceMappingURL=send-message-action.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"send-message-action.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/send-message-action.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;EAkFjC,CAAC"}
@@ -1,86 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.slackSendMessageAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const props_1 = require("../common/props");
7
- const utils_1 = require("../common/utils");
8
- const auth_1 = require("../auth");
9
- const auth_helpers_1 = require("../common/auth-helpers");
10
- exports.slackSendMessageAction = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.slackAuth,
12
- name: 'send_channel_message',
13
- displayName: 'Send Message To A Channel',
14
- description: 'Send message to a channel',
15
- audience: 'both',
16
- aiMetadata: { description: 'Post a message to a channel, with optional Block Kit blocks, file attachment, custom username/icon, and link unfurling; can post as the bot or as the authenticated user. Provide a thread timestamp to reply within a thread (and optionally broadcast that reply to the channel). Each call posts a new message, so it is not idempotent; requires either message text or blocks. Use Send Message To A User for a private DM.', idempotent: false },
17
- props: {
18
- info: props_1.singleSelectChannelInfo,
19
- channel: (0, props_1.slackChannel)(true),
20
- text: pieces_framework_1.Property.LongText({
21
- displayName: 'Message',
22
- description: 'The text of your message. When using Block Kit blocks, this is used as a fallback for notifications.',
23
- required: false,
24
- }),
25
- sendAsBot: pieces_framework_1.Property.Checkbox({
26
- displayName: 'Send as a bot?',
27
- required: true,
28
- defaultValue: true
29
- }),
30
- threadTs: props_1.threadTs,
31
- username: props_1.username,
32
- profilePicture: props_1.profilePicture,
33
- iconEmoji: props_1.iconEmoji,
34
- file: pieces_framework_1.Property.File({
35
- displayName: 'Attachment',
36
- required: false,
37
- }),
38
- replyBroadcast: pieces_framework_1.Property.Checkbox({
39
- displayName: 'Broadcast reply to channel',
40
- description: 'When replying to a thread, also make the message visible to everyone in the channel (only applicable when Thread Timestamp is provided)',
41
- required: false,
42
- defaultValue: false,
43
- }),
44
- mentionOriginFlow: props_1.mentionOriginFlow,
45
- unfurlLinks: pieces_framework_1.Property.Checkbox({
46
- displayName: 'Unfurl Links',
47
- description: 'Enable link unfurling for this message',
48
- required: false,
49
- defaultValue: true,
50
- }),
51
- blocks: props_1.blocks,
52
- },
53
- run(context) {
54
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
55
- const { text, channel, sendAsBot, username, profilePicture, iconEmoji, threadTs, file, mentionOriginFlow, blocks, replyBroadcast, unfurlLinks } = context.propsValue;
56
- const token = sendAsBot ? (0, auth_helpers_1.getBotToken)(context.auth) : (0, auth_helpers_1.requireUserToken)(context.auth);
57
- if (!text && (!blocks || !Array.isArray(blocks) || blocks.length === 0)) {
58
- throw new Error('Either Message or Block Kit blocks must be provided');
59
- }
60
- const blockList = [];
61
- if (text) {
62
- blockList.push(...(0, utils_1.textToSectionBlocks)(text));
63
- }
64
- if (blocks && Array.isArray(blocks) && blocks.length > 0) {
65
- blockList.push(...blocks);
66
- }
67
- if (mentionOriginFlow) {
68
- blockList.push((0, utils_1.buildFlowOriginContextBlock)(context));
69
- }
70
- return (0, utils_1.slackSendMessage)({
71
- token,
72
- text: text || undefined,
73
- username,
74
- profilePicture,
75
- iconEmoji,
76
- conversationId: channel,
77
- threadTs: threadTs ? (0, utils_1.processMessageTimestamp)(threadTs) : undefined,
78
- file,
79
- blocks: blockList.length > 0 ? blockList : undefined,
80
- replyBroadcast,
81
- unfurlLinks,
82
- });
83
- });
84
- },
85
- });
86
- //# sourceMappingURL=send-message-action.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"send-message-action.js","sourceRoot":"","sources":["../../../../src/lib/actions/send-message-action.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,2CASyB;AACzB,2CAA8H;AAC9H,kCAAoC;AAEpC,yDAAuF;AAG1E,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,2BAA2B;IACxC,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,kaAAka,EAAE,UAAU,EAAE,KAAK,EAAE;IACld,KAAK,EAAE;QACL,IAAI,EAAE,+BAAuB;QAC7B,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,IAAI,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACtB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,sGAAsG;YACnH,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,SAAS,EAAC,2BAAQ,CAAC,QAAQ,CAAC;YAC1B,WAAW,EAAC,gBAAgB;YAC5B,QAAQ,EAAC,IAAI;YACb,YAAY,EAAC,IAAI;SAClB,CAAC;QACF,QAAQ,EAAR,gBAAQ;QACR,QAAQ,EAAR,gBAAQ;QACR,cAAc,EAAd,sBAAc;QACd,SAAS,EAAT,iBAAS;QACT,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAClB,WAAW,EAAE,YAAY;YACzB,QAAQ,EAAE,KAAK;SAChB,CAAC;QACF,cAAc,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YAChC,WAAW,EAAE,4BAA4B;YACzC,WAAW,EAAE,yI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AAiB,EAAE,CAAC;gBACrB,SAAS,CAAC,IAAI,CAAC,IAAA,mCAA2B,EAAC,OAAO,CAAC,CAAC,CAAC;YACvD,CAAC;YAED,OAAO,IAAA,wBAAgB,EAAC;gBACtB,KAAK;gBACL,IAAI,EAAE,IAAI,IAAI,SAAS;gBACvB,QAAQ;gBACR,cAAc;gBACd,SAAS;gBACT,cAAc,EAAE,OAAO;gBACvB,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAA,+BAAuB,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS;gBAClE,IAAI;gBACJ,MAAM,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;gBACpD,cAAc;gBACd,WAAW;aACZ,CAAC,CAAC;QACL,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,12 +0,0 @@
1
- export declare const setChannelTopicAction: 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
- topic: import("@activepieces/pieces-framework").LongTextProperty<true>;
11
- }>;
12
- //# sourceMappingURL=set-channel-topic.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"set-channel-topic.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/set-channel-topic.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,qBAAqB;;;;;;;;;;EAwBhC,CAAC"}
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setChannelTopicAction = 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.setChannelTopicAction = (0, pieces_framework_1.createAction)({
11
- auth: auth_1.slackAuth,
12
- name: 'set-channel-topic',
13
- displayName: 'Set Channel Topic',
14
- description: 'Sets the topic on a selected channel.',
15
- audience: 'both',
16
- aiMetadata: { description: 'Set (overwrite) the topic of a selected channel. Idempotent: re-running with the same topic leaves the channel in the same state. The bot must be a member of the channel.', idempotent: true },
17
- props: {
18
- info: props_1.singleSelectChannelInfo,
19
- channel: (0, props_1.slackChannel)(true),
20
- topic: pieces_framework_1.Property.LongText({
21
- displayName: 'Topic',
22
- required: true,
23
- }),
24
- },
25
- run(context) {
26
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
27
- const { channel, topic } = context.propsValue;
28
- const client = new web_api_1.WebClient((0, auth_helpers_1.getBotToken)(context.auth));
29
- return yield client.conversations.setTopic({
30
- channel,
31
- topic,
32
- });
33
- });
34
- },
35
- });
36
- //# sourceMappingURL=set-channel-topic.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"set-channel-topic.js","sourceRoot":"","sources":["../../../../src/lib/actions/set-channel-topic.ts"],"names":[],"mappings":";;;;AAAA,kCAAoC;AACpC,qEAAwE;AACxE,2CAAwE;AACxE,4CAA2C;AAC3C,yDAAqE;AAExD,QAAA,qBAAqB,GAAG,IAAA,+BAAY,EAAC;IACjD,IAAI,EAAE,gBAAS;IACf,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,uCAAuC;IACpD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,EAAE,WAAW,EAAE,4KAA4K,EAAE,UAAU,EAAE,IAAI,EAAE;IAC3N,KAAK,EAAE;QACN,IAAI,EAAE,+BAAuB;QAC7B,OAAO,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC;QAC3B,KAAK,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACxB,WAAW,EAAE,OAAO;YACpB,QAAQ,EAAE,IAAI;SACd,CAAC;KACF;IACK,GAAG,CAAC,OAAO;;YAChB,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC9C,MAAM,MAAM,GAAG,IAAI,mBAAS,CAAC,IAAA,0BAAW,EAAC,OAAO,CAAC,IAAsB,CAAC,CAAC,CAAC;YAE1E,OAAO,MAAM,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC;gBAC1C,OAAO;gBACP,KAAK;aACL,CAAC,CAAC;QACJ,CAAC;KAAA;CACD,CAAC,CAAC"}
@@ -1,9 +0,0 @@
1
- export declare const setUserStatusAction: 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
- text: import("@activepieces/pieces-framework").ShortTextProperty<true>;
6
- emoji: import("@activepieces/pieces-framework").ShortTextProperty<false>;
7
- expiration: import("@activepieces/pieces-framework").NumberProperty<false>;
8
- }>;
9
- //# sourceMappingURL=set-user-status.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"set-user-status.d.ts","sourceRoot":"","sources":["../../../../src/lib/actions/set-user-status.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,mBAAmB;;;;;;;EAsC9B,CAAC"}
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setUserStatusAction = 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 zod_1 = require("zod");
9
- const pieces_common_1 = require("@activepieces/pieces-common");
10
- const auth_helpers_1 = require("../common/auth-helpers");
11
- exports.setUserStatusAction = (0, pieces_framework_1.createAction)({
12
- auth: auth_1.slackAuth,
13
- name: 'slack-set-user-status',
14
- displayName: 'Set User Status',
15
- description: "Sets a user's custom status",
16
- audience: 'both',
17
- aiMetadata: { description: "Set the authenticated user's custom status text and optional emoji, optionally with a Unix-timestamp expiration; requires a user token, not a bot token. This overwrites any existing status, so re-running with the same input is idempotent. Status text is capped at 100 characters.", idempotent: true },
18
- props: {
19
- text: pieces_framework_1.Property.ShortText({
20
- displayName: 'Text',
21
- required: true,
22
- }),
23
- emoji: pieces_framework_1.Property.ShortText({
24
- displayName: 'Emoji',
25
- required: false,
26
- description: 'Emoji shortname (standard or custom), e.g. :tada: or :train:',
27
- }),
28
- expiration: pieces_framework_1.Property.Number({
29
- displayName: 'Expires at',
30
- description: 'Unix timestamp - if not set, the status will not expire',
31
- required: false,
32
- }),
33
- },
34
- run(_a) {
35
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ auth, propsValue }) {
36
- yield pieces_common_1.propsValidation.validateZod(propsValue, {
37
- text: zod_1.z.string().max(100),
38
- });
39
- const client = new web_api_1.WebClient((0, auth_helpers_1.requireUserToken)(auth));
40
- return yield client.users.profile.set({
41
- profile: {
42
- status_text: propsValue.text,
43
- status_emoji: propsValue.emoji,
44
- status_expiration: propsValue.expiration,
45
- },
46
- });
47
- });
48
- },
49
- });
50
- //# sourceMappingURL=set-user-status.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"set-user-status.js","sourceRoot":"","sources":["../../../../src/lib/actions/set-user-status.ts"],"names":[],"mappings":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