@slack/bolt 3.5.0 → 3.8.0

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 (137) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +1 -1
  3. package/README.md +11 -4
  4. package/dist/package.json +88 -0
  5. package/package.json +18 -20
  6. package/dist/App.d.ts +0 -156
  7. package/dist/App.d.ts.map +0 -1
  8. package/dist/App.js +0 -721
  9. package/dist/App.js.map +0 -1
  10. package/dist/WorkflowStep.d.ts +0 -106
  11. package/dist/WorkflowStep.d.ts.map +0 -1
  12. package/dist/WorkflowStep.js +0 -199
  13. package/dist/WorkflowStep.js.map +0 -1
  14. package/dist/conversation-store.d.ts +0 -31
  15. package/dist/conversation-store.d.ts.map +0 -1
  16. package/dist/conversation-store.js +0 -72
  17. package/dist/conversation-store.js.map +0 -1
  18. package/dist/errors.d.ts +0 -71
  19. package/dist/errors.d.ts.map +0 -1
  20. package/dist/errors.js +0 -104
  21. package/dist/errors.js.map +0 -1
  22. package/dist/helpers.d.ts +0 -24
  23. package/dist/helpers.d.ts.map +0 -1
  24. package/dist/helpers.js +0 -99
  25. package/dist/helpers.js.map +0 -1
  26. package/dist/index.d.ts +0 -13
  27. package/dist/index.d.ts.map +0 -1
  28. package/dist/index.js +0 -43
  29. package/dist/index.js.map +0 -1
  30. package/dist/middleware/builtin.d.ts +0 -52
  31. package/dist/middleware/builtin.d.ts.map +0 -1
  32. package/dist/middleware/builtin.js +0 -330
  33. package/dist/middleware/builtin.js.map +0 -1
  34. package/dist/middleware/process.d.ts +0 -5
  35. package/dist/middleware/process.d.ts.map +0 -1
  36. package/dist/middleware/process.js +0 -26
  37. package/dist/middleware/process.js.map +0 -1
  38. package/dist/receivers/AwsLambdaReceiver.d.ts +0 -50
  39. package/dist/receivers/AwsLambdaReceiver.d.ts.map +0 -1
  40. package/dist/receivers/AwsLambdaReceiver.js +0 -192
  41. package/dist/receivers/AwsLambdaReceiver.js.map +0 -1
  42. package/dist/receivers/ExpressReceiver.d.ts +0 -64
  43. package/dist/receivers/ExpressReceiver.d.ts.map +0 -1
  44. package/dist/receivers/ExpressReceiver.js +0 -365
  45. package/dist/receivers/ExpressReceiver.js.map +0 -1
  46. package/dist/receivers/HTTPReceiver.d.ts +0 -60
  47. package/dist/receivers/HTTPReceiver.d.ts.map +0 -1
  48. package/dist/receivers/HTTPReceiver.js +0 -357
  49. package/dist/receivers/HTTPReceiver.js.map +0 -1
  50. package/dist/receivers/SocketModeReceiver.d.ts +0 -44
  51. package/dist/receivers/SocketModeReceiver.d.ts.map +0 -1
  52. package/dist/receivers/SocketModeReceiver.js +0 -111
  53. package/dist/receivers/SocketModeReceiver.js.map +0 -1
  54. package/dist/receivers/render-html-for-install-path.d.ts +0 -2
  55. package/dist/receivers/render-html-for-install-path.d.ts.map +0 -1
  56. package/dist/receivers/render-html-for-install-path.js +0 -20
  57. package/dist/receivers/render-html-for-install-path.js.map +0 -1
  58. package/dist/receivers/verify-request.d.ts +0 -40
  59. package/dist/receivers/verify-request.d.ts.map +0 -1
  60. package/dist/receivers/verify-request.js +0 -94
  61. package/dist/receivers/verify-request.js.map +0 -1
  62. package/dist/types/actions/block-action.d.ts +0 -224
  63. package/dist/types/actions/block-action.d.ts.map +0 -1
  64. package/dist/types/actions/block-action.js +0 -3
  65. package/dist/types/actions/block-action.js.map +0 -1
  66. package/dist/types/actions/dialog-action.d.ts +0 -47
  67. package/dist/types/actions/dialog-action.d.ts.map +0 -1
  68. package/dist/types/actions/dialog-action.js +0 -3
  69. package/dist/types/actions/dialog-action.js.map +0 -1
  70. package/dist/types/actions/index.d.ts +0 -46
  71. package/dist/types/actions/index.d.ts.map +0 -1
  72. package/dist/types/actions/index.js +0 -17
  73. package/dist/types/actions/index.js.map +0 -1
  74. package/dist/types/actions/interactive-message.d.ts +0 -66
  75. package/dist/types/actions/interactive-message.d.ts.map +0 -1
  76. package/dist/types/actions/interactive-message.js +0 -3
  77. package/dist/types/actions/interactive-message.js.map +0 -1
  78. package/dist/types/actions/workflow-step-edit.d.ts +0 -49
  79. package/dist/types/actions/workflow-step-edit.d.ts.map +0 -1
  80. package/dist/types/actions/workflow-step-edit.js +0 -3
  81. package/dist/types/actions/workflow-step-edit.js.map +0 -1
  82. package/dist/types/command/index.d.ts +0 -36
  83. package/dist/types/command/index.d.ts.map +0 -1
  84. package/dist/types/command/index.js +0 -3
  85. package/dist/types/command/index.js.map +0 -1
  86. package/dist/types/events/base-events.d.ts +0 -622
  87. package/dist/types/events/base-events.d.ts.map +0 -1
  88. package/dist/types/events/base-events.js +0 -5
  89. package/dist/types/events/base-events.js.map +0 -1
  90. package/dist/types/events/index.d.ts +0 -63
  91. package/dist/types/events/index.d.ts.map +0 -1
  92. package/dist/types/events/index.js +0 -14
  93. package/dist/types/events/index.js.map +0 -1
  94. package/dist/types/events/message-events.d.ts +0 -312
  95. package/dist/types/events/message-events.d.ts.map +0 -1
  96. package/dist/types/events/message-events.js +0 -3
  97. package/dist/types/events/message-events.js.map +0 -1
  98. package/dist/types/helpers.d.ts +0 -17
  99. package/dist/types/helpers.d.ts.map +0 -1
  100. package/dist/types/helpers.js +0 -3
  101. package/dist/types/helpers.js.map +0 -1
  102. package/dist/types/index.d.ts +0 -10
  103. package/dist/types/index.d.ts.map +0 -1
  104. package/dist/types/index.js +0 -22
  105. package/dist/types/index.js.map +0 -1
  106. package/dist/types/middleware.d.ts +0 -56
  107. package/dist/types/middleware.d.ts.map +0 -1
  108. package/dist/types/middleware.js +0 -3
  109. package/dist/types/middleware.js.map +0 -1
  110. package/dist/types/options/index.d.ts +0 -192
  111. package/dist/types/options/index.d.ts.map +0 -1
  112. package/dist/types/options/index.js +0 -3
  113. package/dist/types/options/index.js.map +0 -1
  114. package/dist/types/receiver.d.ts +0 -13
  115. package/dist/types/receiver.d.ts.map +0 -1
  116. package/dist/types/receiver.js +0 -3
  117. package/dist/types/receiver.js.map +0 -1
  118. package/dist/types/shortcuts/global-shortcut.d.ts +0 -29
  119. package/dist/types/shortcuts/global-shortcut.d.ts.map +0 -1
  120. package/dist/types/shortcuts/global-shortcut.js +0 -3
  121. package/dist/types/shortcuts/global-shortcut.js.map +0 -1
  122. package/dist/types/shortcuts/index.d.ts +0 -23
  123. package/dist/types/shortcuts/index.d.ts.map +0 -1
  124. package/dist/types/shortcuts/index.js +0 -16
  125. package/dist/types/shortcuts/index.js.map +0 -1
  126. package/dist/types/shortcuts/message-shortcut.d.ts +0 -43
  127. package/dist/types/shortcuts/message-shortcut.d.ts.map +0 -1
  128. package/dist/types/shortcuts/message-shortcut.js +0 -3
  129. package/dist/types/shortcuts/message-shortcut.js.map +0 -1
  130. package/dist/types/utilities.d.ts +0 -23
  131. package/dist/types/utilities.d.ts.map +0 -1
  132. package/dist/types/utilities.js +0 -3
  133. package/dist/types/utilities.js.map +0 -1
  134. package/dist/types/view/index.d.ts +0 -175
  135. package/dist/types/view/index.d.ts.map +0 -1
  136. package/dist/types/view/index.js +0 -3
  137. package/dist/types/view/index.js.map +0 -1
@@ -1,94 +0,0 @@
1
- "use strict";
2
- /**
3
- * Functions used to verify the authenticity of incoming HTTP requests from Slack.
4
- *
5
- * The functions in this file are intentionally generic (don't depend on any particular web framework) and
6
- * time-independent (for testing) so they can be used in a wide variety of applications. The intention is to distribute
7
- * these functions in its own package.
8
- *
9
- * For now, there is some duplication between the contents of this file and ExpressReceiver.ts. Later, the duplication
10
- * can be reduced by implementing the equivalent functionality in terms of the functions in this file.
11
- */
12
- var __importDefault = (this && this.__importDefault) || function (mod) {
13
- return (mod && mod.__esModule) ? mod : { "default": mod };
14
- };
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.verify = void 0;
17
- const crypto_1 = require("crypto");
18
- const raw_body_1 = __importDefault(require("raw-body"));
19
- const tsscmp_1 = __importDefault(require("tsscmp"));
20
- /**
21
- * Verify the authenticity of an incoming HTTP request from Slack and buffer the HTTP body.
22
- *
23
- * When verification succeeds, the returned promise is resolved. When verification fails, the returned promise is
24
- * rejected with an error describing the reason. IMPORTANT: The error messages may contain sensitive information about
25
- * failures, do not return the error message text to users in a production environment. It's recommended to catch all
26
- * errors and return an opaque failure (HTTP status code 401, no body).
27
- *
28
- * Verification requires consuming `req` as a Readable stream. If the `req` was consumed before this function is called,
29
- * then this function expects it to be stored as a Buffer at `req.rawBody`. This is a convention used by infrastructure
30
- * platforms such as Google Cloud Platform. When the function returns, the buffered body is stored at the `req.rawBody`
31
- * property for further handling.
32
- *
33
- * The function is designed to be curry-able for use as a standard http RequestListener, and therefore keeps `req` and
34
- * `res` are the last arguments. However, the function is also async, which means when it is curried for use as a
35
- * RequestListener, the caller should also capture and use the return value.
36
- */
37
- async function verify(options, req, _res) {
38
- var _a;
39
- const { signingSecret } = options;
40
- // Consume the readable stream (or use the previously consumed readable stream)
41
- const bufferedReq = await bufferIncomingMessage(req);
42
- // Find the relevant request headers
43
- const signature = getHeader(req, 'x-slack-signature');
44
- const requestTimestampSec = Number(getHeader(req, 'x-slack-request-timestamp'));
45
- if (Number.isNaN(requestTimestampSec)) {
46
- throw new Error(`${verifyErrorPrefix}: header x-slack-request-timestamp did not have the expected type (${requestTimestampSec})`);
47
- }
48
- // Calculate time-dependent values
49
- const nowMsFn = (_a = options.nowMs) !== null && _a !== void 0 ? _a : (() => Date.now());
50
- const nowMs = nowMsFn();
51
- const fiveMinutesAgoSec = Math.floor(nowMs / 1000) - 60 * 5;
52
- // Enforce verification rules
53
- // Rule 1: Check staleness
54
- if (requestTimestampSec < fiveMinutesAgoSec) {
55
- throw new Error(`${verifyErrorPrefix}: stale`);
56
- }
57
- // Rule 2: Check signature
58
- // Separate parts of signature
59
- const [signatureVersion, signatureHash] = signature.split('=');
60
- // Only handle known versions
61
- if (signatureVersion !== 'v0') {
62
- throw new Error(`${verifyErrorPrefix}: unknown signature version`);
63
- }
64
- // Compute our own signature hash
65
- const hmac = crypto_1.createHmac('sha256', signingSecret);
66
- hmac.update(`${signatureVersion}:${requestTimestampSec}:${bufferedReq.rawBody.toString()}`);
67
- const ourSignatureHash = hmac.digest('hex');
68
- if (!tsscmp_1.default(signatureHash, ourSignatureHash)) {
69
- throw new Error(`${verifyErrorPrefix}: signature mismatch`);
70
- }
71
- // Checks have passed! Return the value that has a side effect (the buffered request)
72
- return bufferedReq;
73
- }
74
- exports.verify = verify;
75
- async function bufferIncomingMessage(req) {
76
- if (isBufferedIncomingMessage(req)) {
77
- return req;
78
- }
79
- const bufferedRequest = req;
80
- bufferedRequest.rawBody = await raw_body_1.default(req);
81
- return bufferedRequest;
82
- }
83
- function isBufferedIncomingMessage(req) {
84
- return Buffer.isBuffer(req.rawBody);
85
- }
86
- function getHeader(req, header) {
87
- const value = req.headers[header];
88
- if (value === undefined || Array.isArray(value)) {
89
- throw new Error(`${verifyErrorPrefix}: header ${header} did not have the expected type (${value})`);
90
- }
91
- return value;
92
- }
93
- const verifyErrorPrefix = 'Failed to verify authenticity';
94
- //# sourceMappingURL=verify-request.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"verify-request.js","sourceRoot":"","sources":["../../src/receivers/verify-request.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;;;;AAEH,mCAAoC;AACpC,wDAA+B;AAC/B,oDAA4B;AAc5B;;;;;;;;;;;;;;;;GAgBG;AACI,KAAK,UAAU,MAAM,CAC1B,OAAsB,EACtB,GAAoB,EACpB,IAAqB;;IAErB,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAElC,+EAA+E;IAC/E,MAAM,WAAW,GAAG,MAAM,qBAAqB,CAAC,GAAG,CAAC,CAAC;IAErD,oCAAoC;IACpC,MAAM,SAAS,GAAG,SAAS,CAAC,GAAG,EAAE,mBAAmB,CAAC,CAAC;IACtD,MAAM,mBAAmB,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,2BAA2B,CAAC,CAAC,CAAC;IAChF,IAAI,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE;QACrC,MAAM,IAAI,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C,GAAoB;IACvD,IAAI,yBAAyB,CAAC,GAAG,CAAC,EAAE;QAClC,OAAO,GAAG,CAAC;KACZ;IACD,MAAM,eAAe,GAAG,GAA8B,CAAC;IACvD,eAAe,CAAC,OAAO,GAAG,MAAM,kBAAO,CAAC,GAAG,CAAC,CAAC;IAC7C,OAAO,eAAe,CAAC;AACzB,CAAC;AAED,SAAS,yBAAyB,CAAC,GAAoB;IACrD,OAAO,MAAM,CAAC,QAAQ,CAAE,GAA+B,CAAC,OAAO,CAAC,CAAC;AACnE,CAAC;AAED,SAAS,SAAS,CAAC,GAAoB,EAAE,MAAc;IACrD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAClC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QAC/C,MAAM,IAAI,KAAK,CAAC,GAAG,iBAAiB,YAAY,MAAM,oCAAoC,KAAK,GAAG,CAAC,CAAC;KACrG;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,iBAAiB,GAAG,+BAA+B,CAAC"}
@@ -1,224 +0,0 @@
1
- import { PlainTextElement, Confirmation, Option } from '@slack/types';
2
- import { StringIndexed } from '../helpers';
3
- import { ViewOutput } from '../view';
4
- /**
5
- * All known actions from in Slack's interactive elements
6
- *
7
- * This is a discriminated union. The discriminant is the `type` property.
8
- */
9
- export declare type BlockElementAction = ButtonAction | UsersSelectAction | MultiUsersSelectAction | StaticSelectAction | MultiStaticSelectAction | ConversationsSelectAction | MultiConversationsSelectAction | ChannelsSelectAction | MultiChannelsSelectAction | ExternalSelectAction | MultiExternalSelectAction | OverflowAction | DatepickerAction | RadioButtonsAction | CheckboxesAction | PlainTextInputAction;
10
- /**
11
- * Any action from Slack's interactive elements
12
- *
13
- * This type is used to represent actions that aren't known ahead of time. Each of the known element actions also
14
- * implement this interface.
15
- */
16
- export interface BasicElementAction<T extends string = string> {
17
- type: T;
18
- block_id: string;
19
- action_id: string;
20
- action_ts: string;
21
- }
22
- /**
23
- * An action from a button element
24
- */
25
- export interface ButtonAction extends BasicElementAction<'button'> {
26
- value: string;
27
- text: PlainTextElement;
28
- url?: string;
29
- confirm?: Confirmation;
30
- }
31
- /**
32
- * An action from a select menu with static options
33
- */
34
- export interface StaticSelectAction extends BasicElementAction<'static_select'> {
35
- selected_option: {
36
- text: PlainTextElement;
37
- value: string;
38
- };
39
- initial_option?: Option;
40
- placeholder?: PlainTextElement;
41
- confirm?: Confirmation;
42
- }
43
- /**
44
- * An action from a multi select menu with static options
45
- */
46
- export interface MultiStaticSelectAction extends BasicElementAction<'multi_static_select'> {
47
- selected_options: {
48
- text: PlainTextElement;
49
- value: string;
50
- }[];
51
- initial_options?: Option[];
52
- placeholder?: PlainTextElement;
53
- confirm?: Confirmation;
54
- }
55
- /**
56
- * An action from a select menu with user list
57
- */
58
- export interface UsersSelectAction extends BasicElementAction<'users_select'> {
59
- selected_user: string;
60
- initial_user?: string;
61
- placeholder?: PlainTextElement;
62
- confirm?: Confirmation;
63
- }
64
- /**
65
- * An action from a multi select menu with user list
66
- */
67
- export interface MultiUsersSelectAction extends BasicElementAction<'multi_users_select'> {
68
- selected_users: string[];
69
- initial_users?: string[];
70
- placeholder?: PlainTextElement;
71
- confirm?: Confirmation;
72
- }
73
- /**
74
- * An action from a select menu with conversations list
75
- */
76
- export interface ConversationsSelectAction extends BasicElementAction<'conversations_select'> {
77
- selected_conversation: string;
78
- initial_conversation?: string;
79
- placeholder?: PlainTextElement;
80
- confirm?: Confirmation;
81
- }
82
- /**
83
- * An action from a multi select menu with conversations list
84
- */
85
- export interface MultiConversationsSelectAction extends BasicElementAction<'multi_conversations_select'> {
86
- selected_conversations: string[];
87
- initial_conversations?: string[];
88
- placeholder?: PlainTextElement;
89
- confirm?: Confirmation;
90
- }
91
- /**
92
- * An action from a select menu with channels list
93
- */
94
- export interface ChannelsSelectAction extends BasicElementAction<'channels_select'> {
95
- selected_channel: string;
96
- initial_channel?: string;
97
- placeholder?: PlainTextElement;
98
- confirm?: Confirmation;
99
- }
100
- /**
101
- * An action from a multi select menu with channels list
102
- */
103
- export interface MultiChannelsSelectAction extends BasicElementAction<'multi_channels_select'> {
104
- selected_channels: string[];
105
- initial_channels?: string[];
106
- placeholder?: PlainTextElement;
107
- confirm?: Confirmation;
108
- }
109
- /**
110
- * An action from a select menu with external data source
111
- */
112
- export interface ExternalSelectAction extends BasicElementAction<'external_select'> {
113
- selected_option?: Option;
114
- initial_option?: Option;
115
- placeholder?: PlainTextElement;
116
- min_query_length?: number;
117
- confirm?: Confirmation;
118
- }
119
- /**
120
- * An action from a multi select menu with external data source
121
- */
122
- export interface MultiExternalSelectAction extends BasicElementAction<'multi_external_select'> {
123
- selected_options?: Option[];
124
- initial_options?: Option[];
125
- placeholder?: PlainTextElement;
126
- min_query_length?: number;
127
- confirm?: Confirmation;
128
- }
129
- /**
130
- * An action from an overflow menu element
131
- */
132
- export interface OverflowAction extends BasicElementAction<'overflow'> {
133
- selected_option: {
134
- text: PlainTextElement;
135
- value: string;
136
- };
137
- confirm?: Confirmation;
138
- }
139
- /**
140
- * An action from a date picker element
141
- */
142
- export interface DatepickerAction extends BasicElementAction<'datepicker'> {
143
- selected_date: string | null;
144
- initial_date?: string;
145
- placeholder?: PlainTextElement;
146
- confirm?: Confirmation;
147
- }
148
- /**
149
- * An action from a radio button element
150
- */
151
- export interface RadioButtonsAction extends BasicElementAction<'radio_buttons'> {
152
- selected_option: Option | null;
153
- initial_option?: Option;
154
- confirm?: Confirmation;
155
- }
156
- /**
157
- * An action from a checkboxes element
158
- */
159
- export interface CheckboxesAction extends BasicElementAction<'checkboxes'> {
160
- selected_options: Option[];
161
- initial_options?: Option[];
162
- confirm?: Confirmation;
163
- }
164
- /**
165
- * An action from a plain_text_input element (must use dispatch_action: true)
166
- */
167
- export interface PlainTextInputAction extends BasicElementAction<'plain_text_input'> {
168
- value: string;
169
- }
170
- /**
171
- * A Slack Block Kit element action wrapped in the standard metadata.
172
- *
173
- * This describes the entire JSON-encoded body of a request from Slack's Block Kit interactive components.
174
- */
175
- export interface BlockAction<ElementAction extends BasicElementAction = BlockElementAction> {
176
- type: 'block_actions';
177
- actions: ElementAction[];
178
- team: {
179
- id: string;
180
- domain: string;
181
- enterprise_id?: string;
182
- enterprise_name?: string;
183
- } | null;
184
- user: {
185
- id: string;
186
- name: string;
187
- team_id?: string;
188
- };
189
- channel?: {
190
- id: string;
191
- name: string;
192
- };
193
- message?: {
194
- type: 'message';
195
- user?: string;
196
- ts: string;
197
- text?: string;
198
- [key: string]: any;
199
- };
200
- view?: ViewOutput;
201
- token: string;
202
- response_url: string;
203
- trigger_id: string;
204
- api_app_id: string;
205
- container: StringIndexed;
206
- app_unfurl?: any;
207
- is_enterprise_install?: boolean;
208
- enterprise?: {
209
- id: string;
210
- name: string;
211
- };
212
- }
213
- export declare type BlockButtonAction = BlockAction<ButtonAction>;
214
- export declare type BlockStaticSelectAction = BlockAction<StaticSelectAction>;
215
- export declare type BlockUsersSelectAction = BlockAction<UsersSelectAction>;
216
- export declare type BlockConversationsSelectAction = BlockAction<ConversationsSelectAction>;
217
- export declare type BlockChannelsSelectAction = BlockAction<ChannelsSelectAction>;
218
- export declare type BlockExternalSelectAction = BlockAction<ExternalSelectAction>;
219
- export declare type BlockOverflowAction = BlockAction<OverflowAction>;
220
- export declare type BlockDatepickerAction = BlockAction<DatepickerAction>;
221
- export declare type BlockRadioButtonsAction = BlockAction<RadioButtonsAction>;
222
- export declare type BlockCheckboxesAction = BlockAction<CheckboxesAction>;
223
- export declare type BlockPlainTextInputAction = BlockAction<PlainTextInputAction>;
224
- //# sourceMappingURL=block-action.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"block-action.d.ts","sourceRoot":"","sources":["../../../src/types/actions/block-action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,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,GAAG,CAAC;KACpB,CAAC;IACF,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IAGnB,SAAS,EAAE,aAAa,CAAC;IAGzB,UAAU,CAAC,EAAE,GAAG,CAAC;IAGjB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAKD,oBAAY,iBAAiB,GAAG,WAAW,CAAC,YAAY,CAAC,CAAC;AAC1D,oBAAY,uBAAuB,GAAG,WAAW,CAAC,kBAAkB,CAAC,CAAC;AACtE,oBAAY,sBAAsB,GAAG,WAAW,CAAC,iBAAiB,CAAC,CAAC;AACpE,oBAAY,8BAA8B,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAAC;AACpF,oBAAY,yBAAyB,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC;AAC1E,oBAAY,yBAAyB,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC;AAC1E,oBAAY,mBAAmB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;AAC9D,oBAAY,qBAAqB,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;AAClE,oBAAY,uBAAuB,GAAG,WAAW,CAAC,kBAAkB,CAAC,CAAC;AACtE,oBAAY,qBAAqB,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;AAClE,oBAAY,yBAAyB,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=block-action.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"block-action.js","sourceRoot":"","sources":["../../../src/types/actions/block-action.ts"],"names":[],"mappings":""}
@@ -1,47 +0,0 @@
1
- /**
2
- * A Slack dialog submit action wrapped in the standard metadata.
3
- *
4
- * This describes the entire JSON-encoded body of a request from Slack dialogs.
5
- */
6
- export interface DialogSubmitAction {
7
- type: 'dialog_submission';
8
- callback_id: string;
9
- submission: {
10
- [name: string]: string;
11
- };
12
- state: string;
13
- team: {
14
- id: string;
15
- domain: string;
16
- enterprise_id?: string;
17
- enterprise_name?: string;
18
- } | null;
19
- user: {
20
- id: string;
21
- name: string;
22
- team_id?: string;
23
- };
24
- channel: {
25
- id: string;
26
- name: string;
27
- };
28
- action_ts: string;
29
- token: string;
30
- response_url: string;
31
- is_enterprise_install?: boolean;
32
- enterprise?: {
33
- id: string;
34
- name: string;
35
- };
36
- }
37
- /**
38
- * A Slack dialog submission validation response. Use an object of this type to describe errors regarding inputs that
39
- * were part of the submission.
40
- */
41
- export interface DialogValidation {
42
- errors: {
43
- name: string;
44
- error: string;
45
- }[];
46
- }
47
- //# sourceMappingURL=dialog-action.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dialog-action.d.ts","sourceRoot":"","sources":["../../../src/types/actions/dialog-action.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE;QAAE,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,GAAG,IAAI,CAAC;IACT,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IAGrB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;CACL"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=dialog-action.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dialog-action.js","sourceRoot":"","sources":["../../../src/types/actions/dialog-action.ts"],"names":[],"mappings":""}
@@ -1,46 +0,0 @@
1
- export * from './block-action';
2
- export * from './interactive-message';
3
- export * from './dialog-action';
4
- export * from './workflow-step-edit';
5
- import { BlockAction } from './block-action';
6
- import { InteractiveMessage } from './interactive-message';
7
- import { WorkflowStepEdit } from './workflow-step-edit';
8
- import { DialogSubmitAction, DialogValidation } from './dialog-action';
9
- import { SayFn, SayArguments, RespondFn, AckFn } from '../utilities';
10
- /**
11
- * All known actions from Slack's Block Kit interactive components, message actions, dialogs, and legacy interactive
12
- * messages.
13
- *
14
- * TODO: BlockAction's default generic parameter (ElementAction) might be too specific to allow for this type to be used
15
- * as a constraint on SlackActionMiddlewareArgs' Action generic parameter.
16
- *
17
- * If someone were to instantiate SlackActionMiddlewareArgs<BlockAction<SomeNewAction>>, would it work? We need it to
18
- * work as long as SomeNewAction implements BasicElementAction.
19
- *
20
- * We don't want to substitute BlockAction with BlockAction<BasicElementAction> here because that means the completions
21
- * offered when no generic parameter is bound would be limited to BasicElementAction rather than the union of known
22
- * actions - ElementAction.
23
- */
24
- export declare type SlackAction = BlockAction | InteractiveMessage | DialogSubmitAction | WorkflowStepEdit;
25
- /**
26
- * Arguments which listeners and middleware receive to process an action from Slack's Block Kit interactive components,
27
- * message actions, dialogs, or legacy interactive messages.
28
- *
29
- * The type parameter `Action` represents the entire JSON-encoded request body from Slack. The generic type
30
- * `BlockAction<ElementAction>` can be used to create a type for this parameter based on an element's action type. In
31
- * this case `ElementAction` must extend `BasicElementAction`.
32
- */
33
- export interface SlackActionMiddlewareArgs<Action extends SlackAction = SlackAction> {
34
- payload: Action extends BlockAction<infer ElementAction> ? ElementAction : Action extends InteractiveMessage<infer InteractiveAction> ? InteractiveAction : Action;
35
- action: this['payload'];
36
- body: Action;
37
- say: Action extends Exclude<SlackAction, DialogSubmitAction | WorkflowStepEdit> ? SayFn : never;
38
- respond: RespondFn;
39
- ack: ActionAckFn<Action>;
40
- }
41
- /**
42
- * Type function which given an action `A` returns a corresponding type for the `ack()` function. The function is used
43
- * to acknowledge the receipt (and possibly signal failure) of an action from a listener or middleware.
44
- */
45
- declare type ActionAckFn<A extends SlackAction> = A extends InteractiveMessage ? AckFn<string | SayArguments> : A extends DialogSubmitAction ? AckFn<DialogValidation> : AckFn<void>;
46
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/actions/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AAErC,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAErE;;;;;;;;;;;;;GAaG;AACH,oBAAY,WAAW,GAAG,WAAW,GAAG,kBAAkB,GAAG,kBAAkB,GAAG,gBAAgB,CAAC;AAEnG;;;;;;;GAOG;AACH,MAAM,WAAW,yBAAyB,CAAC,MAAM,SAAS,WAAW,GAAG,WAAW;IACjF,OAAO,EAAE,MAAM,SAAS,WAAW,CAAC,MAAM,aAAa,CAAC,GACpD,aAAa,GACb,MAAM,SAAS,kBAAkB,CAAC,MAAM,iBAAiB,CAAC,GAC1D,iBAAiB,GACjB,MAAM,CAAC;IACX,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IAEb,GAAG,EAAE,MAAM,SAAS,OAAO,CAAC,WAAW,EAAE,kBAAkB,GAAG,gBAAgB,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC;IAChG,OAAO,EAAE,SAAS,CAAC;IACnB,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC1B;AAED;;;GAGG;AACH,aAAK,WAAW,CAAC,CAAC,SAAS,WAAW,IAAI,CAAC,SAAS,kBAAkB,GAClE,KAAK,CAAC,MAAM,GAAG,YAAY,CAAC,GAC5B,CAAC,SAAS,kBAAkB,GAC5B,KAAK,CAAC,gBAAgB,CAAC,GACvB,KAAK,CAAC,IAAI,CAAC,CAAC"}
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- __exportStar(require("./block-action"), exports);
14
- __exportStar(require("./interactive-message"), exports);
15
- __exportStar(require("./dialog-action"), exports);
16
- __exportStar(require("./workflow-step-edit"), exports);
17
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/actions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B;AAC/B,wDAAsC;AACtC,kDAAgC;AAChC,uDAAqC"}
@@ -1,66 +0,0 @@
1
- /**
2
- * All actions which Slack delivers from legacy interactive messages. The full body of these actions are represented
3
- * as [[InteractiveMessage]].
4
- */
5
- export declare type InteractiveAction = ButtonClick | MenuSelect;
6
- /**
7
- * A button click action from a legacy interactive message.
8
- */
9
- export interface ButtonClick {
10
- type: 'button';
11
- name: string;
12
- value: string;
13
- }
14
- /**
15
- * A menu selection action from a legacy interactive message.
16
- */
17
- export interface MenuSelect {
18
- type: 'select';
19
- name: string;
20
- selected_options: {
21
- value: string;
22
- }[];
23
- }
24
- /**
25
- * A Slack legacy interactive message action wrapped in the standard metadata.
26
- *
27
- * This describes the entire JSON-encoded body of a request from Slack's legacy interactive messages.
28
- */
29
- export interface InteractiveMessage<Action extends InteractiveAction = InteractiveAction> {
30
- type: 'interactive_message';
31
- callback_id: string;
32
- actions: Action[];
33
- team: {
34
- id: string;
35
- domain: string;
36
- enterprise_id?: string;
37
- enterprise_name?: string;
38
- } | null;
39
- user: {
40
- id: string;
41
- name: string;
42
- team_id?: string;
43
- };
44
- channel: {
45
- id: string;
46
- name: string;
47
- };
48
- action_ts: string;
49
- attachment_id?: string;
50
- token: string;
51
- response_url: string;
52
- trigger_id: string;
53
- is_app_unfurl?: boolean;
54
- message_ts?: string;
55
- original_message?: {
56
- [key: string]: string;
57
- };
58
- is_enterprise_install?: boolean;
59
- enterprise?: {
60
- id: string;
61
- name: string;
62
- };
63
- }
64
- export declare type InteractiveButtonClick = InteractiveMessage<ButtonClick>;
65
- export declare type InteractiveMenuSelect = InteractiveMessage<MenuSelect>;
66
- //# sourceMappingURL=interactive-message.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interactive-message.d.ts","sourceRoot":"","sources":["../../../src/types/actions/interactive-message.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,iBAAiB,GAAG,WAAW,GAAG,UAAU,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE;QAChB,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;CACL;AAED;;;;GAIG;AACH,MAAM,WAAW,kBAAkB,CAAC,MAAM,SAAS,iBAAiB,GAAG,iBAAiB;IACtF,IAAI,EAAE,qBAAqB,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,GAAG,IAAI,CAAC;IACT,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,gBAAgB,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAG7C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAKD,oBAAY,sBAAsB,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC;AACrE,oBAAY,qBAAqB,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=interactive-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"interactive-message.js","sourceRoot":"","sources":["../../../src/types/actions/interactive-message.ts"],"names":[],"mappings":""}
@@ -1,49 +0,0 @@
1
- /**
2
- * A Slack workflow step action wrapped in the standard metadata.
3
- *
4
- * This describes the entire JSON-encoded body of a request from Slack workflow step actions.
5
- */
6
- export interface WorkflowStepEdit {
7
- type: 'workflow_step_edit';
8
- callback_id: string;
9
- trigger_id: string;
10
- user: {
11
- id: string;
12
- username: string;
13
- team_id?: string;
14
- };
15
- team: {
16
- id: string;
17
- domain: string;
18
- enterprise_id?: string;
19
- enterprise_name?: string;
20
- };
21
- channel?: {
22
- id?: string;
23
- name?: string;
24
- };
25
- token: string;
26
- action_ts: string;
27
- workflow_step: {
28
- workflow_id: string;
29
- step_id: string;
30
- inputs: {
31
- [key: string]: {
32
- value: any;
33
- };
34
- };
35
- outputs: {
36
- name: string;
37
- type: string;
38
- label: string;
39
- }[];
40
- step_name?: string;
41
- step_image_url?: string;
42
- };
43
- is_enterprise_install?: boolean;
44
- enterprise?: {
45
- id: string;
46
- name: string;
47
- };
48
- }
49
- //# sourceMappingURL=workflow-step-edit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow-step-edit.d.ts","sourceRoot":"","sources":["../../../src/types/actions/workflow-step-edit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,oBAAoB,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,OAAO,CAAC,EAAE;QACR,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE;QACb,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE;YACN,CAAC,GAAG,EAAE,MAAM,GAAG;gBACb,KAAK,EAAE,GAAG,CAAC;aACZ,CAAC;SACH,CAAC;QACF,OAAO,EAAE;YACP,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,KAAK,EAAE,MAAM,CAAC;SACf,EAAE,CAAC;QACJ,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IAGF,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=workflow-step-edit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"workflow-step-edit.js","sourceRoot":"","sources":["../../../src/types/actions/workflow-step-edit.ts"],"names":[],"mappings":""}
@@ -1,36 +0,0 @@
1
- import { StringIndexed } from '../helpers';
2
- import { SayFn, RespondFn, RespondArguments, AckFn } from '../utilities';
3
- /**
4
- * Arguments which listeners and middleware receive to process a slash command from Slack.
5
- */
6
- export interface SlackCommandMiddlewareArgs {
7
- payload: SlashCommand;
8
- command: this['payload'];
9
- body: this['payload'];
10
- say: SayFn;
11
- respond: RespondFn;
12
- ack: AckFn<string | RespondArguments>;
13
- }
14
- /**
15
- * A Slack slash command
16
- *
17
- * This describes the entire URL-encoded body of a request from Slack's slash commands.
18
- */
19
- export interface SlashCommand extends StringIndexed {
20
- token: string;
21
- command: string;
22
- text: string;
23
- response_url: string;
24
- trigger_id: string;
25
- user_id: string;
26
- user_name: string;
27
- team_id: string;
28
- team_domain: string;
29
- channel_id: string;
30
- channel_name: string;
31
- api_app_id: string;
32
- enterprise_id?: string;
33
- enterprise_name?: string;
34
- is_enterprise_install?: string;
35
- }
36
- //# sourceMappingURL=index.d.ts.map