@slack/bolt 3.8.0 → 3.8.1
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.
- package/dist/App.d.ts +212 -0
- package/dist/App.d.ts.map +1 -0
- package/dist/App.js +796 -0
- package/dist/App.js.map +1 -0
- package/dist/WorkflowStep.d.ts +106 -0
- package/dist/WorkflowStep.d.ts.map +1 -0
- package/dist/WorkflowStep.js +196 -0
- package/dist/WorkflowStep.js.map +1 -0
- package/dist/conversation-store.d.ts +31 -0
- package/dist/conversation-store.d.ts.map +1 -0
- package/dist/conversation-store.js +72 -0
- package/dist/conversation-store.js.map +1 -0
- package/dist/errors.d.ts +79 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +120 -0
- package/dist/errors.js.map +1 -0
- package/dist/helpers.d.ts +24 -0
- package/dist/helpers.d.ts.map +1 -0
- package/dist/helpers.js +100 -0
- package/dist/helpers.js.map +1 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/middleware/builtin.d.ts +52 -0
- package/dist/middleware/builtin.d.ts.map +1 -0
- package/dist/middleware/builtin.js +311 -0
- package/dist/middleware/builtin.js.map +1 -0
- package/dist/middleware/process.d.ts +5 -0
- package/dist/middleware/process.d.ts.map +1 -0
- package/dist/middleware/process.js +25 -0
- package/dist/middleware/process.js.map +1 -0
- package/dist/receivers/AwsLambdaReceiver.d.ts +53 -0
- package/dist/receivers/AwsLambdaReceiver.d.ts.map +1 -0
- package/dist/receivers/AwsLambdaReceiver.js +188 -0
- package/dist/receivers/AwsLambdaReceiver.js.map +1 -0
- package/dist/receivers/ExpressReceiver.d.ts +77 -0
- package/dist/receivers/ExpressReceiver.d.ts.map +1 -0
- package/dist/receivers/ExpressReceiver.js +445 -0
- package/dist/receivers/ExpressReceiver.js.map +1 -0
- package/dist/receivers/HTTPReceiver.d.ts +109 -0
- package/dist/receivers/HTTPReceiver.d.ts.map +1 -0
- package/dist/receivers/HTTPReceiver.js +501 -0
- package/dist/receivers/HTTPReceiver.js.map +1 -0
- package/dist/receivers/SocketModeReceiver.d.ts +61 -0
- package/dist/receivers/SocketModeReceiver.d.ts.map +1 -0
- package/dist/receivers/SocketModeReceiver.js +175 -0
- package/dist/receivers/SocketModeReceiver.js.map +1 -0
- package/dist/receivers/custom-routes.d.ts +14 -0
- package/dist/receivers/custom-routes.d.ts.map +1 -0
- package/dist/receivers/custom-routes.js +33 -0
- package/dist/receivers/custom-routes.js.map +1 -0
- package/dist/receivers/http-utils.d.ts +5 -0
- package/dist/receivers/http-utils.d.ts.map +1 -0
- package/dist/receivers/http-utils.js +35 -0
- package/dist/receivers/http-utils.js.map +1 -0
- package/dist/receivers/render-html-for-install-path.d.ts +3 -0
- package/dist/receivers/render-html-for-install-path.d.ts.map +1 -0
- package/dist/receivers/render-html-for-install-path.js +25 -0
- package/dist/receivers/render-html-for-install-path.js.map +1 -0
- package/dist/receivers/verify-redirect-opts.d.ts +7 -0
- package/dist/receivers/verify-redirect-opts.d.ts.map +1 -0
- package/dist/receivers/verify-redirect-opts.js +23 -0
- package/dist/receivers/verify-redirect-opts.js.map +1 -0
- package/dist/receivers/verify-request.d.ts +41 -0
- package/dist/receivers/verify-request.d.ts.map +1 -0
- package/dist/receivers/verify-request.js +98 -0
- package/dist/receivers/verify-request.js.map +1 -0
- package/dist/types/actions/block-action.d.ts +231 -0
- package/dist/types/actions/block-action.d.ts.map +1 -0
- package/dist/types/actions/block-action.js +3 -0
- package/dist/types/actions/block-action.js.map +1 -0
- package/dist/types/actions/dialog-action.d.ts +47 -0
- package/dist/types/actions/dialog-action.d.ts.map +1 -0
- package/dist/types/actions/dialog-action.js +3 -0
- package/dist/types/actions/dialog-action.js.map +1 -0
- package/dist/types/actions/index.d.ts +46 -0
- package/dist/types/actions/index.d.ts.map +1 -0
- package/dist/types/actions/index.js +17 -0
- package/dist/types/actions/index.js.map +1 -0
- package/dist/types/actions/interactive-message.d.ts +66 -0
- package/dist/types/actions/interactive-message.d.ts.map +1 -0
- package/dist/types/actions/interactive-message.js +3 -0
- package/dist/types/actions/interactive-message.js.map +1 -0
- package/dist/types/actions/workflow-step-edit.d.ts +49 -0
- package/dist/types/actions/workflow-step-edit.d.ts.map +1 -0
- package/dist/types/actions/workflow-step-edit.js +3 -0
- package/dist/types/actions/workflow-step-edit.js.map +1 -0
- package/dist/types/command/index.d.ts +36 -0
- package/dist/types/command/index.d.ts.map +1 -0
- package/dist/types/command/index.js +3 -0
- package/dist/types/command/index.js.map +1 -0
- package/dist/types/events/base-events.d.ts +699 -0
- package/dist/types/events/base-events.d.ts.map +1 -0
- package/dist/types/events/base-events.js +5 -0
- package/dist/types/events/base-events.js.map +1 -0
- package/dist/types/events/index.d.ts +63 -0
- package/dist/types/events/index.d.ts.map +1 -0
- package/dist/types/events/index.js +14 -0
- package/dist/types/events/index.js.map +1 -0
- package/dist/types/events/message-events.d.ts +312 -0
- package/dist/types/events/message-events.d.ts.map +1 -0
- package/dist/types/events/message-events.js +3 -0
- package/dist/types/events/message-events.js.map +1 -0
- package/dist/types/helpers.d.ts +17 -0
- package/dist/types/helpers.d.ts.map +1 -0
- package/dist/types/helpers.js +3 -0
- package/dist/types/helpers.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +22 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/middleware.d.ts +65 -0
- package/dist/types/middleware.d.ts.map +1 -0
- package/dist/types/middleware.js +14 -0
- package/dist/types/middleware.js.map +1 -0
- package/dist/types/options/index.d.ts +192 -0
- package/dist/types/options/index.d.ts.map +1 -0
- package/dist/types/options/index.js +3 -0
- package/dist/types/options/index.js.map +1 -0
- package/dist/types/receiver.d.ts +16 -0
- package/dist/types/receiver.d.ts.map +1 -0
- package/dist/types/receiver.js +3 -0
- package/dist/types/receiver.js.map +1 -0
- package/dist/types/shortcuts/global-shortcut.d.ts +29 -0
- package/dist/types/shortcuts/global-shortcut.d.ts.map +1 -0
- package/dist/types/shortcuts/global-shortcut.js +3 -0
- package/dist/types/shortcuts/global-shortcut.js.map +1 -0
- package/dist/types/shortcuts/index.d.ts +23 -0
- package/dist/types/shortcuts/index.d.ts.map +1 -0
- package/dist/types/shortcuts/index.js +16 -0
- package/dist/types/shortcuts/index.js.map +1 -0
- package/dist/types/shortcuts/message-shortcut.d.ts +43 -0
- package/dist/types/shortcuts/message-shortcut.d.ts.map +1 -0
- package/dist/types/shortcuts/message-shortcut.js +3 -0
- package/dist/types/shortcuts/message-shortcut.js.map +1 -0
- package/dist/types/utilities.d.ts +23 -0
- package/dist/types/utilities.d.ts.map +1 -0
- package/dist/types/utilities.js +3 -0
- package/dist/types/utilities.js.map +1 -0
- package/dist/types/view/index.d.ts +175 -0
- package/dist/types/view/index.d.ts.map +1 -0
- package/dist/types/view/index.js +3 -0
- package/dist/types/view/index.js.map +1 -0
- package/package.json +1 -1
- package/dist/package.json +0 -88
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { Option } from '@slack/types';
|
|
2
|
+
import { StringIndexed, XOR } from '../helpers';
|
|
3
|
+
import { AckFn } from '../utilities';
|
|
4
|
+
import { ViewOutput } from '../view/index';
|
|
5
|
+
/**
|
|
6
|
+
* Arguments which listeners and middleware receive to process an options request from Slack
|
|
7
|
+
*/
|
|
8
|
+
export interface SlackOptionsMiddlewareArgs<Source extends OptionsSource = OptionsSource> {
|
|
9
|
+
payload: OptionsPayloadFromType<Source>;
|
|
10
|
+
body: this['payload'];
|
|
11
|
+
options: this['payload'];
|
|
12
|
+
ack: OptionsAckFn<Source>;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* All sources from which Slack sends options requests.
|
|
16
|
+
*/
|
|
17
|
+
export declare type OptionsSource = 'interactive_message' | 'dialog_suggestion' | 'block_suggestion';
|
|
18
|
+
export declare type SlackOptions = BlockSuggestion | InteractiveMessageSuggestion | DialogSuggestion;
|
|
19
|
+
export interface BasicOptionsPayload<Type extends string = string> {
|
|
20
|
+
type: Type;
|
|
21
|
+
value: string;
|
|
22
|
+
}
|
|
23
|
+
export declare type OptionsPayloadFromType<T extends string> = KnownOptionsPayloadFromType<T> extends never ? BasicOptionsPayload<T> : KnownOptionsPayloadFromType<T>;
|
|
24
|
+
export declare type KnownOptionsPayloadFromType<T extends string> = Extract<SlackOptions, {
|
|
25
|
+
type: T;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* external data source in blocks
|
|
29
|
+
*/
|
|
30
|
+
export interface BlockSuggestion extends StringIndexed {
|
|
31
|
+
type: 'block_suggestion';
|
|
32
|
+
block_id: string;
|
|
33
|
+
action_id: string;
|
|
34
|
+
value: string;
|
|
35
|
+
api_app_id: string;
|
|
36
|
+
team: {
|
|
37
|
+
id: string;
|
|
38
|
+
domain: string;
|
|
39
|
+
enterprise_id?: string;
|
|
40
|
+
enterprise_name?: string;
|
|
41
|
+
} | null;
|
|
42
|
+
channel?: {
|
|
43
|
+
id: string;
|
|
44
|
+
name: string;
|
|
45
|
+
};
|
|
46
|
+
user: {
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
team_id?: string;
|
|
50
|
+
};
|
|
51
|
+
token: string;
|
|
52
|
+
container: StringIndexed;
|
|
53
|
+
view?: ViewOutput;
|
|
54
|
+
is_enterprise_install?: boolean;
|
|
55
|
+
enterprise?: {
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* external data source in attachments
|
|
62
|
+
*/
|
|
63
|
+
export interface InteractiveMessageSuggestion extends StringIndexed {
|
|
64
|
+
type: 'interactive_message';
|
|
65
|
+
name: string;
|
|
66
|
+
value: string;
|
|
67
|
+
callback_id: string;
|
|
68
|
+
action_ts: string;
|
|
69
|
+
message_ts: string;
|
|
70
|
+
attachment_id: string;
|
|
71
|
+
team: {
|
|
72
|
+
id: string;
|
|
73
|
+
domain: string;
|
|
74
|
+
enterprise_id?: string;
|
|
75
|
+
enterprise_name?: string;
|
|
76
|
+
} | null;
|
|
77
|
+
channel?: {
|
|
78
|
+
id: string;
|
|
79
|
+
name: string;
|
|
80
|
+
};
|
|
81
|
+
user: {
|
|
82
|
+
id: string;
|
|
83
|
+
name: string;
|
|
84
|
+
team_id?: string;
|
|
85
|
+
};
|
|
86
|
+
token: string;
|
|
87
|
+
is_enterprise_install?: boolean;
|
|
88
|
+
enterprise?: {
|
|
89
|
+
id: string;
|
|
90
|
+
name: string;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* external data source in dialogs
|
|
95
|
+
*/
|
|
96
|
+
export interface DialogSuggestion extends StringIndexed {
|
|
97
|
+
type: 'dialog_suggestion';
|
|
98
|
+
name: string;
|
|
99
|
+
value: string;
|
|
100
|
+
callback_id: string;
|
|
101
|
+
action_ts: string;
|
|
102
|
+
team: {
|
|
103
|
+
id: string;
|
|
104
|
+
domain: string;
|
|
105
|
+
enterprise_id?: string;
|
|
106
|
+
enterprise_name?: string;
|
|
107
|
+
} | null;
|
|
108
|
+
channel?: {
|
|
109
|
+
id: string;
|
|
110
|
+
name: string;
|
|
111
|
+
};
|
|
112
|
+
user: {
|
|
113
|
+
id: string;
|
|
114
|
+
name: string;
|
|
115
|
+
team_id?: string;
|
|
116
|
+
};
|
|
117
|
+
token: string;
|
|
118
|
+
is_enterprise_install?: boolean;
|
|
119
|
+
enterprise?: {
|
|
120
|
+
id: string;
|
|
121
|
+
name: string;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Type function which given an options source `Source` returns a corresponding type for the `ack()` function. The
|
|
126
|
+
* function is used to fulfill the options request from a listener or middleware.
|
|
127
|
+
*/
|
|
128
|
+
declare type OptionsAckFn<Source extends OptionsSource> = Source extends 'block_suggestion' ? AckFn<XOR<BlockOptions, OptionGroups<BlockOptions>>> : Source extends 'interactive_message' ? AckFn<XOR<MessageOptions, OptionGroups<MessageOptions>>> : AckFn<XOR<DialogOptions, OptionGroups<DialogOptions>>>;
|
|
129
|
+
export interface BlockOptions {
|
|
130
|
+
options: Option[];
|
|
131
|
+
}
|
|
132
|
+
export interface MessageOptions {
|
|
133
|
+
options: {
|
|
134
|
+
text: string;
|
|
135
|
+
value: string;
|
|
136
|
+
}[];
|
|
137
|
+
}
|
|
138
|
+
export interface DialogOptions {
|
|
139
|
+
options: {
|
|
140
|
+
label: string;
|
|
141
|
+
value: string;
|
|
142
|
+
}[];
|
|
143
|
+
}
|
|
144
|
+
export interface OptionGroups<Options> {
|
|
145
|
+
option_groups: ({
|
|
146
|
+
label: string;
|
|
147
|
+
} & Options)[];
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* A request for options for a select menu with an external data source, wrapped in the standard metadata. The menu
|
|
151
|
+
* can have a source of Slack's Block Kit external select elements, dialogs, or legacy interactive components.
|
|
152
|
+
*
|
|
153
|
+
* This describes the entire JSON-encoded body of a request.
|
|
154
|
+
* @deprecated You can use more specific types such as BlockSuggestionPayload
|
|
155
|
+
*/
|
|
156
|
+
export interface OptionsRequest<Source extends OptionsSource = OptionsSource> extends StringIndexed {
|
|
157
|
+
value: string;
|
|
158
|
+
type: Source;
|
|
159
|
+
team: {
|
|
160
|
+
id: string;
|
|
161
|
+
domain: string;
|
|
162
|
+
enterprise_id?: string;
|
|
163
|
+
enterprise_name?: string;
|
|
164
|
+
} | null;
|
|
165
|
+
channel?: {
|
|
166
|
+
id: string;
|
|
167
|
+
name: string;
|
|
168
|
+
};
|
|
169
|
+
user: {
|
|
170
|
+
id: string;
|
|
171
|
+
name: string;
|
|
172
|
+
team_id?: string;
|
|
173
|
+
};
|
|
174
|
+
token: string;
|
|
175
|
+
name: Source extends 'interactive_message' | 'dialog_suggestion' ? string : never;
|
|
176
|
+
callback_id: Source extends 'interactive_message' | 'dialog_suggestion' ? string : never;
|
|
177
|
+
action_ts: Source extends 'interactive_message' | 'dialog_suggestion' ? string : never;
|
|
178
|
+
message_ts: Source extends 'interactive_message' ? string : never;
|
|
179
|
+
attachment_id: Source extends 'interactive_message' ? string : never;
|
|
180
|
+
api_app_id: Source extends 'block_suggestion' ? string : never;
|
|
181
|
+
action_id: Source extends 'block_suggestion' ? string : never;
|
|
182
|
+
block_id: Source extends 'block_suggestion' ? string : never;
|
|
183
|
+
container: Source extends 'block_suggestion' ? StringIndexed : never;
|
|
184
|
+
app_unfurl?: any;
|
|
185
|
+
is_enterprise_install?: boolean;
|
|
186
|
+
enterprise?: {
|
|
187
|
+
id: string;
|
|
188
|
+
name: string;
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
export {};
|
|
192
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/options/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;GAEG;AACH,MAAM,WAAW,0BAA0B,CAAC,MAAM,SAAS,aAAa,GAAG,aAAa;IACtF,OAAO,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACxC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACtB,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACzB,GAAG,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;CAC3B;AAED;;GAEG;AACH,oBAAY,aAAa,GAAG,qBAAqB,GAAG,mBAAmB,GAAG,kBAAkB,CAAC;AAE7F,oBAAY,YAAY,GAAG,eAAe,GAAG,4BAA4B,GAAG,gBAAgB,CAAC;AAE7F,MAAM,WAAW,m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AAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/options/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import App from '../App';
|
|
2
|
+
import { AckFn } from './index';
|
|
3
|
+
import { StringIndexed } from './helpers';
|
|
4
|
+
export interface ReceiverEvent {
|
|
5
|
+
body: StringIndexed;
|
|
6
|
+
retryNum?: number;
|
|
7
|
+
retryReason?: string;
|
|
8
|
+
customProperties?: StringIndexed;
|
|
9
|
+
ack: AckFn<any>;
|
|
10
|
+
}
|
|
11
|
+
export interface Receiver {
|
|
12
|
+
init(app: App): void;
|
|
13
|
+
start(...args: any[]): Promise<unknown>;
|
|
14
|
+
stop(...args: any[]): Promise<unknown>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=receiver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receiver.d.ts","sourceRoot":"","sources":["../../src/types/receiver.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,QAAQ,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,WAAW,aAAa;IAE5B,IAAI,EAAE,aAAa,CAAC;IAIpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAIlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,gBAAgB,CAAC,EAAE,aAAa,CAAC;IAKjC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;CACjB;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC;IACrB,KAAK,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACxC,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"receiver.js","sourceRoot":"","sources":["../../src/types/receiver.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Slack global shortcut wrapped in the standard metadata.
|
|
3
|
+
*
|
|
4
|
+
* This describes the entire JSON-encoded body of a request from Slack global shortcuts.
|
|
5
|
+
*/
|
|
6
|
+
export interface GlobalShortcut {
|
|
7
|
+
type: 'shortcut';
|
|
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
|
+
} | null;
|
|
21
|
+
token: string;
|
|
22
|
+
action_ts: string;
|
|
23
|
+
is_enterprise_install?: boolean;
|
|
24
|
+
enterprise?: {
|
|
25
|
+
id: string;
|
|
26
|
+
name: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=global-shortcut.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-shortcut.d.ts","sourceRoot":"","sources":["../../../src/types/shortcuts/global-shortcut.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IAEF,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,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAGlB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-shortcut.js","sourceRoot":"","sources":["../../../src/types/shortcuts/global-shortcut.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MessageShortcut } from './message-shortcut';
|
|
2
|
+
import { GlobalShortcut } from './global-shortcut';
|
|
3
|
+
import { SayFn, RespondFn, AckFn } from '../utilities';
|
|
4
|
+
export * from './global-shortcut';
|
|
5
|
+
export * from './message-shortcut';
|
|
6
|
+
/**
|
|
7
|
+
* All known shortcuts from Slack.
|
|
8
|
+
*/
|
|
9
|
+
export declare type SlackShortcut = GlobalShortcut | MessageShortcut;
|
|
10
|
+
/**
|
|
11
|
+
* Arguments which listeners and middleware receive to process a shortcut from Slack.
|
|
12
|
+
*
|
|
13
|
+
* The type parameter `Shortcut` represents the entire JSON-encoded request body from Slack.
|
|
14
|
+
*/
|
|
15
|
+
export interface SlackShortcutMiddlewareArgs<Shortcut extends SlackShortcut = SlackShortcut> {
|
|
16
|
+
payload: Shortcut;
|
|
17
|
+
shortcut: this['payload'];
|
|
18
|
+
body: this['payload'];
|
|
19
|
+
say: SayFn;
|
|
20
|
+
respond: RespondFn;
|
|
21
|
+
ack: AckFn<void>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/shortcuts/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAGvD,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AAEnC;;GAEG;AACH,oBAAY,aAAa,GAAG,cAAc,GAAG,eAAe,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,2BAA2B,CAAC,QAAQ,SAAS,aAAa,GAAG,aAAa;IACzF,OAAO,EAAE,QAAQ,CAAC;IAClB,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IAC1B,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACtB,GAAG,EAAE,KAAK,CAAC;IACX,OAAO,EAAE,SAAS,CAAC;IACnB,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;CAClB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
// export * from './message-action';
|
|
14
|
+
__exportStar(require("./global-shortcut"), exports);
|
|
15
|
+
__exportStar(require("./message-shortcut"), exports);
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/shortcuts/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAIA,oCAAoC;AACpC,oDAAkC;AAClC,qDAAmC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Slack message action wrapped in the standard metadata.
|
|
3
|
+
*
|
|
4
|
+
* This describes the entire JSON-encoded body of a request from Slack message actions.
|
|
5
|
+
*/
|
|
6
|
+
export interface MessageShortcut {
|
|
7
|
+
type: 'message_action';
|
|
8
|
+
callback_id: string;
|
|
9
|
+
trigger_id: string;
|
|
10
|
+
message_ts: string;
|
|
11
|
+
response_url: string;
|
|
12
|
+
message: {
|
|
13
|
+
type: 'message';
|
|
14
|
+
user?: string;
|
|
15
|
+
ts: string;
|
|
16
|
+
text?: string;
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
};
|
|
19
|
+
user: {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
team_id?: string;
|
|
23
|
+
username?: string;
|
|
24
|
+
};
|
|
25
|
+
channel: {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
};
|
|
29
|
+
team: {
|
|
30
|
+
id: string;
|
|
31
|
+
domain: string;
|
|
32
|
+
enterprise_id?: string;
|
|
33
|
+
enterprise_name?: string;
|
|
34
|
+
} | null;
|
|
35
|
+
token: string;
|
|
36
|
+
action_ts: string;
|
|
37
|
+
is_enterprise_install?: boolean;
|
|
38
|
+
enterprise?: {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=message-shortcut.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-shortcut.d.ts","sourceRoot":"","sources":["../../../src/types/shortcuts/message-shortcut.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,gBAAgB,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IAErB,OAAO,EAAE;QACP,IAAI,EAAE,SAAS,CAAC;QAChB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QAEd,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;IACF,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,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,GAAG,IAAI,CAAC;IACT,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAGlB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,UAAU,CAAC,EAAE;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-shortcut.js","sourceRoot":"","sources":["../../../src/types/shortcuts/message-shortcut.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ChatPostMessageArguments, ChatPostMessageResponse } from '@slack/web-api';
|
|
2
|
+
declare type ChatPostMessageArgumentsKnownKeys = 'token' | 'channel' | 'text' | 'as_user' | 'attachments' | 'blocks' | 'icon_emoji' | 'icon_url' | 'link_names' | 'mrkdwn' | 'parse' | 'reply_broadcast' | 'thread_ts' | 'unfurl_links' | 'unfurl_media' | 'username';
|
|
3
|
+
export declare type SayArguments = Pick<ChatPostMessageArguments, Exclude<ChatPostMessageArgumentsKnownKeys, 'channel'>> & {
|
|
4
|
+
channel?: string;
|
|
5
|
+
};
|
|
6
|
+
export interface SayFn {
|
|
7
|
+
(message: string | SayArguments): Promise<ChatPostMessageResponse>;
|
|
8
|
+
}
|
|
9
|
+
export declare type RespondArguments = Pick<ChatPostMessageArguments, Exclude<ChatPostMessageArgumentsKnownKeys, 'channel' | 'text'>> & {
|
|
10
|
+
/** Response URLs can be used to send ephemeral messages or in-channel messages using this argument */
|
|
11
|
+
response_type?: 'in_channel' | 'ephemeral';
|
|
12
|
+
replace_original?: boolean;
|
|
13
|
+
delete_original?: boolean;
|
|
14
|
+
text?: string;
|
|
15
|
+
};
|
|
16
|
+
export interface RespondFn {
|
|
17
|
+
(message: string | RespondArguments): Promise<any>;
|
|
18
|
+
}
|
|
19
|
+
export interface AckFn<Response> {
|
|
20
|
+
(response?: Response): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=utilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.d.ts","sourceRoot":"","sources":["../../src/types/utilities.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAGnF,aAAK,iCAAiC,GAClC,OAAO,GACP,SAAS,GACT,MAAM,GACN,SAAS,GACT,aAAa,GACb,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,YAAY,GACZ,QAAQ,GACR,OAAO,GACP,iBAAiB,GACjB,WAAW,GACX,cAAc,GACd,cAAc,GACd,UAAU,CAAC;AAIf,oBAAY,YAAY,GAAG,IAAI,CAAC,wBAAwB,EAAE,OAAO,CAAC,iCAAiC,EAAE,SAAS,CAAC,CAAC,GAAG;IACjH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,WAAW,KAAK;IACpB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACpE;AAED,oBAAY,gBAAgB,GAAG,IAAI,CAAC,wBAAwB,EAAE,OAAO,CAAC,iCAAiC,EAAE,SAAS,GAAG,MAAM,CAAC,CAC3H,GAAG;IACF,sGAAsG;IACtG,aAAa,CAAC,EAAE,YAAY,GAAG,WAAW,CAAC;IAC3C,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,KAAK,CAAC,QAAQ;IAC7B,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utilities.js","sourceRoot":"","sources":["../../src/types/utilities.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { View, PlainTextElement } from '@slack/types';
|
|
2
|
+
import { StringIndexed } from '../helpers';
|
|
3
|
+
import { AckFn, RespondFn } from '../utilities';
|
|
4
|
+
/**
|
|
5
|
+
* Known view action types
|
|
6
|
+
*/
|
|
7
|
+
export declare type SlackViewAction = ViewSubmitAction | ViewClosedAction | ViewWorkflowStepSubmitAction | ViewWorkflowStepClosedAction;
|
|
8
|
+
/**
|
|
9
|
+
* Arguments which listeners and middleware receive to process a view submission event from Slack.
|
|
10
|
+
*/
|
|
11
|
+
export interface SlackViewMiddlewareArgs<ViewActionType extends SlackViewAction = SlackViewAction> {
|
|
12
|
+
payload: ViewOutput;
|
|
13
|
+
view: this['payload'];
|
|
14
|
+
body: ViewActionType;
|
|
15
|
+
ack: ViewAckFn<ViewActionType>;
|
|
16
|
+
respond: RespondFn;
|
|
17
|
+
}
|
|
18
|
+
interface PlainTextElementOutput {
|
|
19
|
+
type: 'plain_text';
|
|
20
|
+
text: string;
|
|
21
|
+
emoji?: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A Slack view_submission event wrapped in the standard metadata.
|
|
25
|
+
*
|
|
26
|
+
* This describes the entire JSON-encoded body of a view_submission event.
|
|
27
|
+
*/
|
|
28
|
+
export interface ViewSubmitAction {
|
|
29
|
+
type: 'view_submission';
|
|
30
|
+
team: {
|
|
31
|
+
id: string;
|
|
32
|
+
domain: string;
|
|
33
|
+
enterprise_id?: string;
|
|
34
|
+
enterprise_name?: string;
|
|
35
|
+
} | null;
|
|
36
|
+
user: {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
team_id?: string;
|
|
40
|
+
};
|
|
41
|
+
view: ViewOutput;
|
|
42
|
+
api_app_id: string;
|
|
43
|
+
token: string;
|
|
44
|
+
trigger_id: string;
|
|
45
|
+
is_enterprise_install?: boolean;
|
|
46
|
+
enterprise?: {
|
|
47
|
+
id: string;
|
|
48
|
+
name: string;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A Slack view_closed event wrapped in the standard metadata.
|
|
53
|
+
*
|
|
54
|
+
* This describes the entire JSON-encoded body of a view_closed event.
|
|
55
|
+
*/
|
|
56
|
+
export interface ViewClosedAction {
|
|
57
|
+
type: 'view_closed';
|
|
58
|
+
team: {
|
|
59
|
+
id: string;
|
|
60
|
+
domain: string;
|
|
61
|
+
enterprise_id?: string;
|
|
62
|
+
enterprise_name?: string;
|
|
63
|
+
} | null;
|
|
64
|
+
user: {
|
|
65
|
+
id: string;
|
|
66
|
+
name: string;
|
|
67
|
+
team_id?: string;
|
|
68
|
+
};
|
|
69
|
+
view: ViewOutput;
|
|
70
|
+
api_app_id: string;
|
|
71
|
+
token: string;
|
|
72
|
+
is_cleared: boolean;
|
|
73
|
+
is_enterprise_install?: boolean;
|
|
74
|
+
enterprise?: {
|
|
75
|
+
id: string;
|
|
76
|
+
name: string;
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A Slack view_submission Workflow Step event
|
|
81
|
+
*
|
|
82
|
+
* This describes the additional JSON-encoded body details for a step's view_submission event
|
|
83
|
+
*/
|
|
84
|
+
export interface ViewWorkflowStepSubmitAction extends ViewSubmitAction {
|
|
85
|
+
trigger_id: string;
|
|
86
|
+
response_urls: [];
|
|
87
|
+
workflow_step: {
|
|
88
|
+
workflow_step_edit_id: string;
|
|
89
|
+
workflow_id: string;
|
|
90
|
+
step_id: string;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* A Slack view_closed Workflow Step event
|
|
95
|
+
*
|
|
96
|
+
* This describes the additional JSON-encoded body details for a step's view_closed event
|
|
97
|
+
*/
|
|
98
|
+
export interface ViewWorkflowStepClosedAction extends ViewClosedAction {
|
|
99
|
+
workflow_step: {
|
|
100
|
+
workflow_step_edit_id: string;
|
|
101
|
+
workflow_id: string;
|
|
102
|
+
step_id: string;
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
export interface ViewStateSelectedOption {
|
|
106
|
+
text: PlainTextElement;
|
|
107
|
+
value: string;
|
|
108
|
+
}
|
|
109
|
+
export interface ViewStateValue {
|
|
110
|
+
type: string;
|
|
111
|
+
value?: string | null;
|
|
112
|
+
selected_date?: string | null;
|
|
113
|
+
selected_time?: string | null;
|
|
114
|
+
selected_conversation?: string | null;
|
|
115
|
+
selected_channel?: string | null;
|
|
116
|
+
selected_user?: string | null;
|
|
117
|
+
selected_option?: ViewStateSelectedOption | null;
|
|
118
|
+
selected_conversations?: string[];
|
|
119
|
+
selected_channels?: string[];
|
|
120
|
+
selected_users?: string[];
|
|
121
|
+
selected_options?: ViewStateSelectedOption[];
|
|
122
|
+
}
|
|
123
|
+
export interface ViewOutput {
|
|
124
|
+
id: string;
|
|
125
|
+
callback_id: string;
|
|
126
|
+
team_id: string;
|
|
127
|
+
app_installed_team_id?: string;
|
|
128
|
+
app_id: string | null;
|
|
129
|
+
bot_id: string;
|
|
130
|
+
title: PlainTextElementOutput;
|
|
131
|
+
type: string;
|
|
132
|
+
blocks: StringIndexed;
|
|
133
|
+
close: PlainTextElementOutput | null;
|
|
134
|
+
submit: PlainTextElementOutput | null;
|
|
135
|
+
state: {
|
|
136
|
+
values: {
|
|
137
|
+
[blockId: string]: {
|
|
138
|
+
[actionId: string]: ViewStateValue;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
hash: string;
|
|
143
|
+
private_metadata: string;
|
|
144
|
+
root_view_id: string | null;
|
|
145
|
+
previous_view_id: string | null;
|
|
146
|
+
clear_on_close: boolean;
|
|
147
|
+
notify_on_close: boolean;
|
|
148
|
+
external_id?: string;
|
|
149
|
+
}
|
|
150
|
+
export interface ViewUpdateResponseAction {
|
|
151
|
+
response_action: 'update';
|
|
152
|
+
view: View;
|
|
153
|
+
}
|
|
154
|
+
export interface ViewPushResponseAction {
|
|
155
|
+
response_action: 'push';
|
|
156
|
+
view: View;
|
|
157
|
+
}
|
|
158
|
+
export interface ViewClearResponseAction {
|
|
159
|
+
response_action: 'clear';
|
|
160
|
+
}
|
|
161
|
+
export interface ViewErrorsResponseAction {
|
|
162
|
+
response_action: 'errors';
|
|
163
|
+
errors: {
|
|
164
|
+
[blockId: string]: string;
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
export declare type ViewResponseAction = ViewUpdateResponseAction | ViewPushResponseAction | ViewClearResponseAction | ViewErrorsResponseAction;
|
|
168
|
+
/**
|
|
169
|
+
* Type function which given a view action `VA` returns a corresponding type for the `ack()` function. The function is
|
|
170
|
+
* used to acknowledge the receipt (and possibly signal failure) of an view submission or closure from a listener or
|
|
171
|
+
* middleware.
|
|
172
|
+
*/
|
|
173
|
+
declare type ViewAckFn<VA extends SlackViewAction = SlackViewAction> = VA extends ViewSubmitAction ? AckFn<ViewResponseAction> : AckFn<void>;
|
|
174
|
+
export {};
|
|
175
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEhD;;GAEG;AACH,oBAAY,eAAe,GACvB,gBAAgB,GAChB,gBAAgB,GAChB,4BAA4B,GAC5B,4BAA4B,CAAC;AAEjC;;GAEG;AACH,MAAM,WAAW,uBAAuB,CAAC,cAAc,SAAS,eAAe,GAAG,eAAe;IAC/F,OAAO,EAAE,UAAU,CAAC;IACpB,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACtB,IAAI,EAAE,cAAc,CAAC;IACrB,GAAG,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAC/B,OAAO,EAAE,SAAS,CAAC;CACpB;AAED,UAAU,sBAAsB;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EA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