@crvouga/mockingbird-service-slack 3.13.0 → 3.15.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.
@@ -0,0 +1,1635 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
+
19
+ // <define:__MOCKINGBIRD_ADMIN_BRAND__>
20
+ var define_MOCKINGBIRD_ADMIN_BRAND_default = { vendor: "Slack", website: "https://slack.com", docs: "https://docs.slack.dev/reference/methods", guide: "https://mockingbird.chrisvouga.dev/services/slack", logo: "data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjNEExNTRCIiByb2xlPSJpbWciIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48dGl0bGU+U2xhY2s8L3RpdGxlPjxwYXRoIGQ9Ik01LjA0MiAxNS4xNjVhMi41MjggMi41MjggMCAwIDEtMi41MiAyLjUyM0EyLjUyOCAyLjUyOCAwIDAgMSAwIDE1LjE2NWEyLjUyNyAyLjUyNyAwIDAgMSAyLjUyMi0yLjUyaDIuNTJ2Mi41MnpNNi4zMTMgMTUuMTY1YTIuNTI3IDIuNTI3IDAgMCAxIDIuNTIxLTIuNTIgMi41MjcgMi41MjcgMCAwIDEgMi41MjEgMi41MnY2LjMxM0EyLjUyOCAyLjUyOCAwIDAgMSA4LjgzNCAyNGEyLjUyOCAyLjUyOCAwIDAgMS0yLjUyMS0yLjUyMnYtNi4zMTN6TTguODM0IDUuMDQyYTIuNTI4IDIuNTI4IDAgMCAxLTIuNTIxLTIuNTJBMi41MjggMi41MjggMCAwIDEgOC44MzQgMGEyLjUyOCAyLjUyOCAwIDAgMSAyLjUyMSAyLjUyMnYyLjUySDguODM0ek04LjgzNCA2LjMxM2EyLjUyOCAyLjUyOCAwIDAgMSAyLjUyMSAyLjUyMSAyLjUyOCAyLjUyOCAwIDAgMS0yLjUyMSAyLjUyMUgyLjUyMkEyLjUyOCAyLjUyOCAwIDAgMSAwIDguODM0YTIuNTI4IDIuNTI4IDAgMCAxIDIuNTIyLTIuNTIxaDYuMzEyek0xOC45NTYgOC44MzRhMi41MjggMi41MjggMCAwIDEgMi41MjItMi41MjFBMi41MjggMi41MjggMCAwIDEgMjQgOC44MzRhMi41MjggMi41MjggMCAwIDEtMi41MjIgMi41MjFoLTIuNTIyVjguODM0ek0xNy42ODggOC44MzRhMi41MjggMi41MjggMCAwIDEtMi41MjMgMi41MjEgMi41MjcgMi41MjcgMCAwIDEtMi41Mi0yLjUyMVYyLjUyMkEyLjUyNyAyLjUyNyAwIDAgMSAxNS4xNjUgMGEyLjUyOCAyLjUyOCAwIDAgMSAyLjUyMyAyLjUyMnY2LjMxMnpNMTUuMTY1IDE4Ljk1NmEyLjUyOCAyLjUyOCAwIDAgMSAyLjUyMyAyLjUyMkEyLjUyOCAyLjUyOCAwIDAgMSAxNS4xNjUgMjRhMi41MjcgMi41MjcgMCAwIDEtMi41Mi0yLjUyMnYtMi41MjJoMi41MnpNMTUuMTY1IDE3LjY4OGEyLjUyNyAyLjUyNyAwIDAgMS0yLjUyLTIuNTIzIDIuNTI2IDIuNTI2IDAgMCAxIDIuNTItMi41Mmg2LjMxM0EyLjUyNyAyLjUyNyAwIDAgMSAyNCAxNS4xNjVhMi41MjggMi41MjggMCAwIDEtMi41MjIgMi41MjNoLTYuMzEzeiIvPjwvc3ZnPg==", color: "#4A154B", description: "Boost productivity and save time with Slack \u2014 the AI work platform for managing projects, automating workflows, and connecting teams securely. Start working smarter today." };
21
+
22
+ // src/index.ts
23
+ import {
24
+ ProviderExpansion,
25
+ seedSlack,
26
+ selectOperations,
27
+ slackPlugin
28
+ } from "@crvouga/mockingbird-runtime/http-provider";
29
+
30
+ // mockingbird-service-runtime:@crvouga/mockingbird-runtime/service
31
+ var service_exports = {};
32
+ __export(service_exports, {
33
+ PACKAGE_VERSION: () => PACKAGE_VERSION,
34
+ createRuntime: () => createRuntime
35
+ });
36
+ __reExport(service_exports, service_star);
37
+ import * as service_star from "@crvouga/mockingbird-runtime/service";
38
+ import { PACKAGE_VERSION as SHARED_VERSION, createRuntime as sharedRuntime } from "@crvouga/mockingbird-runtime/service";
39
+ var PACKAGE_VERSION = true ? "3.15.0" : SHARED_VERSION;
40
+ var ADMIN_BRAND = typeof define_MOCKINGBIRD_ADMIN_BRAND_default === "object" ? define_MOCKINGBIRD_ADMIN_BRAND_default : void 0;
41
+ var createRuntime = (options) => sharedRuntime({
42
+ ...options,
43
+ version: options.version ?? PACKAGE_VERSION,
44
+ adminBrand: options.adminBrand ?? ADMIN_BRAND
45
+ });
46
+
47
+ // src/index.ts
48
+ import { Hono } from "hono";
49
+
50
+ // src/blocks.ts
51
+ var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
52
+ var BLOCK_TYPES = /* @__PURE__ */ new Set([
53
+ "actions",
54
+ "alert",
55
+ "call",
56
+ "card",
57
+ "carousel",
58
+ "context",
59
+ "context_actions",
60
+ "divider",
61
+ "file",
62
+ "header",
63
+ "image",
64
+ "input",
65
+ "markdown",
66
+ "plan",
67
+ "rich_text",
68
+ "section",
69
+ "table",
70
+ "task_card",
71
+ "video"
72
+ ]);
73
+ var MAX_BLOCKS = 50;
74
+ var checkText = (value, path, max, issues, plainOnly = false) => {
75
+ if (!isRecord(value)) {
76
+ issues.push(`must be a text object [json-pointer:${path}]`);
77
+ return;
78
+ }
79
+ if (value.type !== "plain_text" && !(value.type === "mrkdwn" && !plainOnly)) {
80
+ issues.push(
81
+ `must be of type ${plainOnly ? "plain_text" : "plain_text or mrkdwn"} [json-pointer:${path}/type]`
82
+ );
83
+ }
84
+ if (typeof value.text !== "string" || value.text.length === 0) {
85
+ issues.push(`must be a non-empty string [json-pointer:${path}/text]`);
86
+ } else if (value.text.length > max) {
87
+ issues.push(`must be less than ${max + 1} characters [json-pointer:${path}/text]`);
88
+ }
89
+ };
90
+ var checkList = (value, path, max, issues, each) => {
91
+ if (!Array.isArray(value)) {
92
+ issues.push(`must be an array [json-pointer:${path}]`);
93
+ return;
94
+ }
95
+ if (value.length > max)
96
+ issues.push(`must have fewer than ${max + 1} items [json-pointer:${path}]`);
97
+ if (!each) return;
98
+ for (const [index, item] of value.entries()) each(item, `${path}/${index}`);
99
+ };
100
+ var checkBlock = (block, path, issues) => {
101
+ if (!isRecord(block) || typeof block.type !== "string") {
102
+ issues.push(`must be an object with a type [json-pointer:${path}]`);
103
+ return;
104
+ }
105
+ if (!BLOCK_TYPES.has(block.type)) {
106
+ issues.push(`unsupported type: ${block.type} [json-pointer:${path}/type]`);
107
+ return;
108
+ }
109
+ if (block.block_id !== void 0) {
110
+ if (typeof block.block_id !== "string" || block.block_id.length > 255) {
111
+ issues.push(`must be a string of at most 255 characters [json-pointer:${path}/block_id]`);
112
+ }
113
+ }
114
+ switch (block.type) {
115
+ case "section":
116
+ if (block.text !== void 0) checkText(block.text, `${path}/text`, 3e3, issues);
117
+ if (block.fields !== void 0) {
118
+ checkList(
119
+ block.fields,
120
+ `${path}/fields`,
121
+ 10,
122
+ issues,
123
+ (field, fieldPath) => checkText(field, fieldPath, 2e3, issues)
124
+ );
125
+ }
126
+ break;
127
+ case "header":
128
+ if (block.text !== void 0) checkText(block.text, `${path}/text`, 150, issues, true);
129
+ break;
130
+ case "context":
131
+ if (block.elements !== void 0) checkList(block.elements, `${path}/elements`, 10, issues);
132
+ break;
133
+ case "actions":
134
+ if (block.elements !== void 0) checkList(block.elements, `${path}/elements`, 25, issues);
135
+ break;
136
+ }
137
+ };
138
+ var blockIssues = (blocks, path = "/blocks") => {
139
+ const issues = [];
140
+ checkList(
141
+ blocks,
142
+ path,
143
+ MAX_BLOCKS,
144
+ issues,
145
+ (block, blockPath) => checkBlock(block, blockPath, issues)
146
+ );
147
+ return issues;
148
+ };
149
+ var attachmentBlockIssues = (attachments) => {
150
+ if (!Array.isArray(attachments)) return [];
151
+ const issues = [];
152
+ attachments.forEach((attachment, index) => {
153
+ if (isRecord(attachment) && attachment.blocks !== void 0 && attachment.blocks !== null) {
154
+ issues.push(...blockIssues(attachment.blocks, `/attachments/${index}/blocks`));
155
+ }
156
+ });
157
+ return issues;
158
+ };
159
+
160
+ // src/expanded-state.ts
161
+ import {
162
+ formatSlackView,
163
+ getSlackStore
164
+ } from "@crvouga/mockingbird-runtime/http-provider";
165
+ function syncToExpanded(state, expansion) {
166
+ const ss = getSlackStore(expansion.store);
167
+ const settings = state.current();
168
+ expansion.store.meta.insert("native-slack-actor", {
169
+ app_id: settings.appId,
170
+ bot_id: settings.botId
171
+ });
172
+ const team = ss.teams.all()[0];
173
+ if (team)
174
+ ss.teams.update(team.id, {
175
+ team_id: settings.teamId,
176
+ name: settings.teamName,
177
+ domain: settings.teamDomain
178
+ });
179
+ for (const { value: user } of state.users.list()) {
180
+ const existing = ss.users.findOneBy("user_id", user.id);
181
+ const value = {
182
+ user_id: user.id,
183
+ team_id: settings.teamId,
184
+ name: user.name,
185
+ real_name: user.real_name,
186
+ email: user.email ?? "",
187
+ is_admin: !user.is_bot,
188
+ is_bot: user.is_bot,
189
+ deleted: user.deleted,
190
+ profile: {
191
+ display_name: user.name,
192
+ real_name: user.real_name,
193
+ email: user.email ?? "",
194
+ image_48: "",
195
+ image_192: ""
196
+ }
197
+ };
198
+ if (!existing)
199
+ ss.users.insert({ ...value, last_activity: Math.floor(expansion.store.now() / 1e3) });
200
+ else if (existing.name !== user.name || existing.real_name !== user.real_name || existing.email !== user.email)
201
+ ss.users.update(existing.id, { ...value, profile: { ...existing.profile, ...value.profile } });
202
+ }
203
+ for (const { value: channel } of state.channels.list()) {
204
+ const existing = ss.channels.findOneBy("channel_id", channel.id);
205
+ const value = {
206
+ channel_id: channel.id,
207
+ team_id: settings.teamId,
208
+ name: channel.name,
209
+ is_channel: true,
210
+ is_private: channel.is_private,
211
+ is_archived: channel.is_archived,
212
+ topic: { value: "", creator: settings.botUserId, last_set: 0 },
213
+ purpose: { value: "", creator: settings.botUserId, last_set: 0 },
214
+ members: channel.is_member ? [settings.botUserId] : [],
215
+ creator: settings.botUserId,
216
+ num_members: channel.is_member ? 1 : 0
217
+ };
218
+ if (!existing) ss.channels.insert(value);
219
+ else if (existing.name !== channel.name || existing.is_archived !== channel.is_archived || existing.members.includes(settings.botUserId) !== channel.is_member)
220
+ ss.channels.update(existing.id, {
221
+ name: channel.name,
222
+ is_archived: channel.is_archived,
223
+ members: channel.is_member ? [.../* @__PURE__ */ new Set([...existing.members, settings.botUserId])] : existing.members.filter((id) => id !== settings.botUserId)
224
+ });
225
+ }
226
+ for (const { value: file } of state.files.list()) {
227
+ const existing = ss.files.findOneBy("file_id", file.id);
228
+ const value = {
229
+ file_id: file.id,
230
+ team_id: settings.teamId,
231
+ user: settings.botUserId,
232
+ name: file.name,
233
+ title: file.title,
234
+ mimetype: file.mimetype,
235
+ filetype: file.filetype,
236
+ pretty_type: file.filetype,
237
+ mode: "hosted",
238
+ size: file.size,
239
+ created: file.created,
240
+ timestamp: file.created,
241
+ url_private: "",
242
+ url_private_download: "",
243
+ permalink: "",
244
+ is_external: false,
245
+ external_type: "",
246
+ is_public: false,
247
+ public_url_shared: false,
248
+ display_as_bot: false,
249
+ editable: true,
250
+ deleted: false,
251
+ channels: [],
252
+ groups: [],
253
+ ims: [],
254
+ shares: {}
255
+ };
256
+ if (!existing) ss.files.insert(value);
257
+ else if (existing.title !== file.title) ss.files.update(existing.id, { title: file.title });
258
+ }
259
+ for (const { value: view } of state.views.list()) {
260
+ const existing = ss.views.findOneBy("view_id", view.id);
261
+ if (existing) continue;
262
+ const value = {
263
+ view_id: view.id,
264
+ team_id: settings.teamId,
265
+ user_id: settings.botUserId,
266
+ type: view.type === "home" ? "home" : "modal",
267
+ blocks: Array.isArray(view.blocks) ? view.blocks : [],
268
+ private_metadata: typeof view.private_metadata === "string" ? view.private_metadata : "",
269
+ callback_id: typeof view.callback_id === "string" ? view.callback_id : "",
270
+ external_id: typeof view.external_id === "string" ? view.external_id : "",
271
+ title: view.title ?? null,
272
+ submit: view.submit ?? null,
273
+ close: view.close ?? null,
274
+ state: view.state ?? { values: {} },
275
+ hash: String(view.hash ?? ""),
276
+ clear_on_close: view.clear_on_close === true,
277
+ notify_on_close: view.notify_on_close === true,
278
+ root_view_id: view.id,
279
+ app_id: settings.appId,
280
+ bot_id: settings.botId,
281
+ created: Math.floor(expansion.store.now() / 1e3),
282
+ updated: Math.floor(expansion.store.now() / 1e3)
283
+ };
284
+ ss.views.insert(value);
285
+ }
286
+ for (const message of state.outbox.list()) {
287
+ if (message.ephemeral) continue;
288
+ const existing = ss.messages.findBy("channel_id", message.channel).find((row) => row.ts === message.ts);
289
+ const value = {
290
+ ts: message.ts,
291
+ channel_id: message.channel,
292
+ user: message.user ?? settings.botUserId,
293
+ text: message.text ?? "",
294
+ type: "message",
295
+ ...message.blocks ? { blocks: message.blocks } : {},
296
+ ...message.attachments ? { attachments: message.attachments } : {},
297
+ ...message.thread_ts ? { thread_ts: message.thread_ts } : {},
298
+ ...message.edited ? { edited: message.edited } : {},
299
+ reply_count: 0,
300
+ reply_users: [],
301
+ reactions: message.reactions
302
+ };
303
+ if (existing) {
304
+ if (existing.text !== value.text || JSON.stringify(existing.reactions) !== JSON.stringify(value.reactions))
305
+ ss.messages.update(existing.id, value);
306
+ } else ss.messages.insert(value);
307
+ const marker = `native-message:${message.channel}:${message.ts}`;
308
+ if (!expansion.store.meta.has(marker)) expansion.store.meta.insert(marker, true);
309
+ }
310
+ for (const message of ss.messages.all()) {
311
+ if (expansion.store.meta.get(`native-message:${message.channel_id}:${message.ts}`) && !state.outbox.get(`${message.channel_id}:${message.ts}`))
312
+ ss.messages.delete(message.id);
313
+ }
314
+ }
315
+ function syncFromExpanded(state, expansion) {
316
+ const ss = getSlackStore(expansion.store);
317
+ const settings = state.current();
318
+ for (const channel of ss.channels.all()) {
319
+ if (channel.team_id !== settings.teamId) continue;
320
+ const value = {
321
+ id: channel.channel_id,
322
+ name: channel.name,
323
+ is_private: channel.is_private,
324
+ is_archived: channel.is_archived,
325
+ is_member: channel.members.includes(settings.botUserId),
326
+ created: Math.floor(Date.parse(channel.created_at) / 1e3)
327
+ };
328
+ if (state.channels.has(value.id)) state.channels.update(value.id, value);
329
+ else state.channels.insert(value.id, value);
330
+ }
331
+ for (const user of ss.users.all()) {
332
+ if (user.team_id !== settings.teamId) continue;
333
+ const value = {
334
+ id: user.user_id,
335
+ name: user.name,
336
+ real_name: user.real_name,
337
+ email: user.email,
338
+ is_bot: user.is_bot,
339
+ deleted: user.deleted,
340
+ tz: "UTC"
341
+ };
342
+ if (state.users.has(value.id)) state.users.update(value.id, value);
343
+ else state.users.insert(value.id, value);
344
+ }
345
+ for (const file of ss.files.all()) {
346
+ if (file.deleted) {
347
+ state.files.delete(file.file_id);
348
+ continue;
349
+ }
350
+ const value = {
351
+ id: file.file_id,
352
+ name: file.name,
353
+ title: file.title,
354
+ mimetype: file.mimetype,
355
+ filetype: file.filetype,
356
+ size: file.size,
357
+ created: file.created
358
+ };
359
+ if (state.files.has(file.file_id)) state.files.update(file.file_id, value);
360
+ else state.files.insert(file.file_id, value);
361
+ }
362
+ for (const view of ss.views.all()) {
363
+ const value = formatSlackView(view);
364
+ if (state.views.has(view.view_id)) state.views.update(view.view_id, value);
365
+ else state.views.insert(view.view_id, value);
366
+ }
367
+ for (const message of ss.messages.all()) {
368
+ const id = `${message.channel_id}:${message.ts}`;
369
+ const existing = state.outbox.get(id);
370
+ const value = {
371
+ ...existing,
372
+ id,
373
+ to: existing?.to ?? [message.channel_id],
374
+ createdAt: existing?.createdAt ?? message.created_at,
375
+ source: existing?.source ?? "api",
376
+ method: existing?.method ?? "chat.postMessage",
377
+ webhook: existing?.webhook ?? null,
378
+ channel: message.channel_id,
379
+ text: message.text,
380
+ blocks: message.blocks ?? null,
381
+ attachments: message.attachments ?? null,
382
+ thread_ts: message.thread_ts ?? null,
383
+ ts: message.ts,
384
+ user: message.user,
385
+ ephemeral: false,
386
+ edited: message.edited ?? null,
387
+ reactions: message.reactions,
388
+ unfurl_links: message.unfurl_links ?? null,
389
+ workspace: settings.teamId
390
+ };
391
+ if (existing) state.outbox.update(id, value);
392
+ else state.outbox.record(value);
393
+ if (!expansion.store.meta.has(`native-message:${id}`))
394
+ expansion.store.meta.insert(`native-message:${id}`, true);
395
+ }
396
+ const outbox = new service_exports.Collection(expansion.sqlite, expansion.namespace, "outbox");
397
+ for (const message of outbox.list())
398
+ if (expansion.store.meta.has(`native-message:${message.id}`) && !ss.messages.all().some((row) => `${row.channel_id}:${row.ts}` === message.id))
399
+ outbox.delete(message.id);
400
+ }
401
+
402
+ // src/generated/openapi.ts
403
+ var document = JSON.parse(`{"openapi":"3.1.0","info":{"title":"Slack incoming webhooks and Web API (Mockingbird subset)","description":"Stateful emulator subset of Slack: incoming webhooks (\`POST /services/T/B/X\`) and the Web API\\nmethods our apps call. Every message lands in an outbox a suite can assert on. Hand-authored\\nfrom Slack's documented wire shapes and the consumers (backend \`postSlackWebhook\`, EMR\\n\`slack-web-api.ts\`, request-intake \`SlackClient\`, release-conductor).\\n","version":"1","x-mockingbird-upstream":{"note":"Hand-authored from https://api.slack.com/methods and https://api.slack.com/messaging/webhooks (Slack publishes no maintained OpenAPI for these methods)."}},"servers":[{"url":"https://slack.com"},{"url":"https://hooks.slack.com"}],"security":[{"bearerAuth":[]}],"paths":{"/services/{team}/{bot}/{secret}":{"parameters":[{"name":"team","in":"path","required":true,"schema":{"type":"string","pattern":"^T[A-Z0-9]{2,12}$"}},{"name":"bot","in":"path","required":true,"schema":{"type":"string","pattern":"^B[A-Z0-9]{2,12}$"}},{"name":"secret","in":"path","required":true,"schema":{"type":"string","pattern":"^[A-Za-z0-9]{8,24}$"}}],"post":{"operationId":"PostIncomingWebhook","summary":"Incoming webhook: post a message to the hook's channel","description":"Answers \`200 ok\` (text/plain). Bad payloads get Slack's plain-text error codes (\`invalid_payload\`, \`no_text\`, \`invalid_blocks\`); an unregistered hook is \`404 no_service\` once any hook is registered. Also accepts form bodies with a \`payload=<json>\` field.","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"text":{"type":"string","maxLength":400},"blocks":{"type":"array","maxItems":3,"items":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["section","divider","header","context"]},"text":{"type":"object","properties":{"type":{"type":"string","enum":["mrkdwn","plain_text"]},"text":{"type":"string","maxLength":200}}}}}},"thread_ts":{"type":"string","maxLength":24},"username":{"type":"string","maxLength":40},"icon_emoji":{"type":"string","maxLength":40},"unfurl_links":{"type":"boolean"}}}}}},"responses":{"200":{"description":"Posted","content":{"text/plain":{"schema":{"type":"string","enum":["ok"]}}}},"400":{"description":"\`invalid_payload\`, \`no_text\`, \`invalid_blocks\`, \`too_many_attachments\`","content":{"text/plain":{"schema":{"type":"string"}}}},"403":{"description":"\`action_prohibited\`, \`posting_to_general_channel_denied\`","content":{"text/plain":{"schema":{"type":"string"}}}},"404":{"description":"\`no_service\`, \`channel_not_found\`","content":{"text/plain":{"schema":{"type":"string"}}}},"410":{"description":"\`channel_is_archived\`","content":{"text/plain":{"schema":{"type":"string"}}}},"429":{"description":"\`rate_limited\`, with \`retry-after\`","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"text/plain":{"schema":{"type":"string"}}}},"500":{"description":"\`internal_error\`","content":{"text/plain":{"schema":{"type":"string"}}}},"503":{"description":"\`service_unavailable\`","content":{"text/plain":{"schema":{"type":"string"}}}}},"security":[]}},"/api/chat.postMessage":{"post":{"operationId":"ChatPostMessage","summary":"chat.postMessage: post a message (or a thread reply) to a channel","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"},"text":{"type":"string","maxLength":400},"blocks":{"type":"string","description":"JSON-encoded blocks","maxLength":2000},"thread_ts":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}}},"required":["channel"]}},"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"},"text":{"type":"string","maxLength":400},"blocks":{"type":"array","maxItems":3,"items":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["section","divider","header","context"]},"text":{"type":"object","properties":{"type":{"type":"string","enum":["mrkdwn","plain_text"]},"text":{"type":"string","maxLength":200}}}}}},"thread_ts":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}},"mrkdwn":{"type":"boolean"},"unfurl_links":{"type":"boolean"}},"required":["channel"]}}}},"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PostMessageResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/chat.update":{"post":{"operationId":"ChatUpdate","summary":"chat.update: edit a message the bot posted","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"},"ts":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}},"text":{"type":"string","maxLength":400}},"required":["channel","ts"]}},"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"},"ts":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}},"text":{"type":"string","maxLength":400},"blocks":{"type":"array","maxItems":3,"items":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["section","divider","header","context"]},"text":{"type":"object","properties":{"type":{"type":"string","enum":["mrkdwn","plain_text"]},"text":{"type":"string","maxLength":200}}}}}}},"required":["channel","ts"]}}}},"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/chat.postEphemeral":{"post":{"operationId":"ChatPostEphemeral","summary":"chat.postEphemeral: a message only one user sees","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"},"user":{"type":"string","minLength":1,"maxLength":20,"x-mockingbird-resource-ref":{"type":"user","missing":"U00MISSING"}},"text":{"type":"string","maxLength":400}},"required":["channel","user"]}},"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"},"user":{"type":"string","minLength":1,"maxLength":20,"x-mockingbird-resource-ref":{"type":"user","missing":"U00MISSING"}},"text":{"type":"string","maxLength":400},"blocks":{"type":"array","maxItems":3,"items":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["section","divider","header","context"]},"text":{"type":"object","properties":{"type":{"type":"string","enum":["mrkdwn","plain_text"]},"text":{"type":"string","maxLength":200}}}}}},"thread_ts":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}}},"required":["channel","user"]}}}},"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EphemeralResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/chat.getPermalink":{"get":{"operationId":"ChatGetPermalinkGet","summary":"chat.getPermalink (query arguments)","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"channel","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"}},{"name":"message_ts","in":"query","required":false,"schema":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}}}],"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermalinkResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"ChatGetPermalink","summary":"chat.getPermalink: the permalink of a message","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"},"message_ts":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}}},"required":["channel","message_ts"]}},"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"},"message_ts":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}}},"required":["channel","message_ts"]}}}},"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PermalinkResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/reactions.add":{"post":{"operationId":"ReactionsAdd","summary":"reactions.add: react to a message","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"},"timestamp":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}},"name":{"type":"string","enum":["eyes","white_check_mark","x","thumbsup","rotating_light"]}},"required":["channel","timestamp","name"]}},"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"},"timestamp":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}},"name":{"type":"string","enum":["eyes","white_check_mark","x","thumbsup","rotating_light"]}},"required":["channel","timestamp","name"]}}}},"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/reactions.remove":{"post":{"operationId":"ReactionsRemove","summary":"reactions.remove: take a reaction back","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"},"timestamp":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}},"name":{"type":"string","enum":["eyes","white_check_mark","x","thumbsup","rotating_light"]}},"required":["name"]}},"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"},"timestamp":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}},"name":{"type":"string","enum":["eyes","white_check_mark","x","thumbsup","rotating_light"]}},"required":["name"]}}}},"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Envelope"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/reactions.get":{"get":{"operationId":"ReactionsGetGet","summary":"reactions.get (query arguments)","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"channel","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"}},{"name":"timestamp","in":"query","required":false,"schema":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}}},{"name":"full","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReactionsGetResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"ReactionsGet","summary":"reactions.get: a message and its reactions","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"},"timestamp":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}},"full":{"type":"string","enum":["true","false"]}},"required":["channel","timestamp"]}},"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"},"timestamp":{"type":"string","maxLength":24,"x-mockingbird-resource-ref":{"type":"message","missing":"1000000000.000000"}},"full":{"type":"boolean"}},"required":["channel","timestamp"]}}}},"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReactionsGetResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/auth.test":{"get":{"operationId":"AuthTestGet","summary":"auth.test (GET)","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[],"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthTestResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"AuthTest","summary":"auth.test: who the token belongs to","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{}}},"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthTestResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/conversations.join":{"post":{"operationId":"ConversationsJoin","summary":"conversations.join: the bot joins a public channel","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"}},"required":["channel"]}},"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","minLength":1,"maxLength":40,"description":"Channel id (\`C\u2026\`) or name (\`#alerts\`)"}},"required":["channel"]}}}},"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JoinResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/users.info":{"get":{"operationId":"UsersInfoGet","summary":"users.info (query arguments)","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"user","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":20,"x-mockingbird-resource-ref":{"type":"user","missing":"U00MISSING"}}}],"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"UsersInfo","summary":"users.info: a user's profile","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"user":{"type":"string","minLength":1,"maxLength":20,"x-mockingbird-resource-ref":{"type":"user","missing":"U00MISSING"}}},"required":["user"]}},"application/json":{"schema":{"type":"object","properties":{"user":{"type":"string","minLength":1,"maxLength":20,"x-mockingbird-resource-ref":{"type":"user","missing":"U00MISSING"}}},"required":["user"]}}}},"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/users.lookupByEmail":{"get":{"operationId":"UsersLookupByEmailGet","summary":"users.lookupByEmail (query arguments)","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"email","in":"query","required":false,"schema":{"type":"string","format":"email","maxLength":80}}],"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"UsersLookupByEmail","summary":"users.lookupByEmail: find a user by email","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","maxLength":80}},"required":["email"]}},"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email","maxLength":80}},"required":["email"]}}}},"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/files.info":{"get":{"operationId":"FilesInfoGet","summary":"files.info (query arguments)","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"parameters":[{"name":"file","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":20,"x-mockingbird-resource-ref":{"type":"file","missing":"F00MISSING"}}}],"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}},"post":{"operationId":"FilesInfo","summary":"files.info: a file's metadata and private download URL","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":true}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"file":{"type":"string","minLength":1,"maxLength":20,"x-mockingbird-resource-ref":{"type":"file","missing":"F00MISSING"}}},"required":["file"]}},"application/json":{"schema":{"type":"object","properties":{"file":{"type":"string","minLength":1,"maxLength":20,"x-mockingbird-resource-ref":{"type":"file","missing":"F00MISSING"}}},"required":["file"]}}}},"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/views.open":{"post":{"operationId":"ViewsOpen","summary":"views.open: open a modal for a trigger","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"trigger_id":{"type":"string","minLength":1,"maxLength":40},"view":{"type":"string","description":"JSON-encoded view","maxLength":2000}},"required":["trigger_id","view"]}},"application/json":{"schema":{"type":"object","properties":{"trigger_id":{"type":"string","minLength":1,"maxLength":40},"view":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["modal","home"]},"callback_id":{"type":"string","maxLength":40},"title":{"type":"object","properties":{"type":{"type":"string","enum":["plain_text"]},"text":{"type":"string","maxLength":24}}},"blocks":{"type":"array","maxItems":3,"items":{"type":"object"}},"private_metadata":{"type":"string","maxLength":200}}}},"required":["trigger_id","view"]}}}},"responses":{"200":{"description":"Slack envelope: \`ok: true\` with the method's fields, or \`ok: false\` with an \`error\` code (Slack answers logical failures with HTTP 200)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ViewResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/api/apps.connections.open":{"post":{"operationId":"AppsConnectionsOpen","summary":"apps.connections.open: mint a one-use Socket Mode WebSocket URL","description":"App-level token (\`xapp-\`) in the \`Authorization\` header. A missing token is \`not_authed\`,\\na bot or user token is \`not_allowed_token_type\`, and a malformed, unknown, or revoked\\napp token is \`invalid_auth\` or \`token_revoked\`. Logical errors are HTTP 200. The \`url\`\\nis a \`ws://\` or \`wss://\` URL on this server (\`/link/?ticket=\u2026&app_id=\u2026\`).\\n","x-mockingbird":{"supported":true,"parity":{"enabled":true,"safe":false}},"requestBody":{"required":false,"content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{}}},"application/json":{"schema":{"type":"object","properties":{}}}}},"responses":{"200":{"description":"Slack envelope: \`ok: true\` and a WebSocket \`url\`, or \`ok: false\` with an \`error\` code","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionsOpenResponse"}}}},"429":{"description":"Rate limited (\`ratelimited\`), with \`retry-after\` seconds","headers":{"retry-after":{"schema":{"type":"string"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"500":{"description":"Slack is having trouble","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}},"503":{"description":"Slack is unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"}}}}}}},"/":{"get":{"operationId":"GET /","summary":"GET /","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/files.list":{"get":{"operationId":"GET /api/files.list","summary":"GET /api/files.list","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}},"post":{"operationId":"POST /api/files.list","summary":"POST /api/files.list","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/pins.list":{"get":{"operationId":"GET /api/pins.list","summary":"GET /api/pins.list","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}},"post":{"operationId":"POST /api/pins.list","summary":"POST /api/pins.list","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/users.getPresence":{"get":{"operationId":"GET /api/users.getPresence","summary":"GET /api/users.getPresence","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}},"post":{"operationId":"POST /api/users.getPresence","summary":"POST /api/users.getPresence","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/users.profile.get":{"get":{"operationId":"GET /api/users.profile.get","summary":"GET /api/users.profile.get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}},"post":{"operationId":"POST /api/users.profile.get","summary":"POST /api/users.profile.get","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/files-pri/{fileId}/{filename}":{"get":{"operationId":"GET /files-pri/:fileId/:filename","summary":"GET /files-pri/:fileId/:filename","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[{"in":"path","name":"fileId","required":true,"schema":{"type":"string"}},{"in":"path","name":"filename","required":true,"schema":{"type":"string"}}],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/oauth/v2/authorize":{"get":{"operationId":"GET /oauth/v2/authorize","summary":"GET /oauth/v2/authorize","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/bookmarks.add":{"post":{"operationId":"POST /api/bookmarks.add","summary":"POST /api/bookmarks.add","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/bookmarks.edit":{"post":{"operationId":"POST /api/bookmarks.edit","summary":"POST /api/bookmarks.edit","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/bookmarks.list":{"post":{"operationId":"POST /api/bookmarks.list","summary":"POST /api/bookmarks.list","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/bookmarks.remove":{"post":{"operationId":"POST /api/bookmarks.remove","summary":"POST /api/bookmarks.remove","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/bots.info":{"post":{"operationId":"POST /api/bots.info","summary":"POST /api/bots.info","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/chat.delete":{"post":{"operationId":"POST /api/chat.delete","summary":"POST /api/chat.delete","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/chat.deleteScheduledMessage":{"post":{"operationId":"POST /api/chat.deleteScheduledMessage","summary":"POST /api/chat.deleteScheduledMessage","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/chat.meMessage":{"post":{"operationId":"POST /api/chat.meMessage","summary":"POST /api/chat.meMessage","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/chat.scheduleMessage":{"post":{"operationId":"POST /api/chat.scheduleMessage","summary":"POST /api/chat.scheduleMessage","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/chat.scheduledMessages.list":{"post":{"operationId":"POST /api/chat.scheduledMessages.list","summary":"POST /api/chat.scheduledMessages.list","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.archive":{"post":{"operationId":"POST /api/conversations.archive","summary":"POST /api/conversations.archive","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.close":{"post":{"operationId":"POST /api/conversations.close","summary":"POST /api/conversations.close","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.create":{"post":{"operationId":"POST /api/conversations.create","summary":"POST /api/conversations.create","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.history":{"post":{"operationId":"POST /api/conversations.history","summary":"POST /api/conversations.history","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.info":{"post":{"operationId":"POST /api/conversations.info","summary":"POST /api/conversations.info","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.invite":{"post":{"operationId":"POST /api/conversations.invite","summary":"POST /api/conversations.invite","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.kick":{"post":{"operationId":"POST /api/conversations.kick","summary":"POST /api/conversations.kick","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.leave":{"post":{"operationId":"POST /api/conversations.leave","summary":"POST /api/conversations.leave","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.list":{"post":{"operationId":"POST /api/conversations.list","summary":"POST /api/conversations.list","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.mark":{"post":{"operationId":"POST /api/conversations.mark","summary":"POST /api/conversations.mark","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.members":{"post":{"operationId":"POST /api/conversations.members","summary":"POST /api/conversations.members","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.open":{"post":{"operationId":"POST /api/conversations.open","summary":"POST /api/conversations.open","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.rename":{"post":{"operationId":"POST /api/conversations.rename","summary":"POST /api/conversations.rename","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.replies":{"post":{"operationId":"POST /api/conversations.replies","summary":"POST /api/conversations.replies","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.setPurpose":{"post":{"operationId":"POST /api/conversations.setPurpose","summary":"POST /api/conversations.setPurpose","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.setTopic":{"post":{"operationId":"POST /api/conversations.setTopic","summary":"POST /api/conversations.setTopic","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/conversations.unarchive":{"post":{"operationId":"POST /api/conversations.unarchive","summary":"POST /api/conversations.unarchive","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/files.completeUploadExternal":{"post":{"operationId":"POST /api/files.completeUploadExternal","summary":"POST /api/files.completeUploadExternal","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/files.delete":{"post":{"operationId":"POST /api/files.delete","summary":"POST /api/files.delete","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/files.getUploadURLExternal":{"post":{"operationId":"POST /api/files.getUploadURLExternal","summary":"POST /api/files.getUploadURLExternal","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/oauth.v2.access":{"post":{"operationId":"POST /api/oauth.v2.access","summary":"POST /api/oauth.v2.access","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/pins.add":{"post":{"operationId":"POST /api/pins.add","summary":"POST /api/pins.add","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/pins.remove":{"post":{"operationId":"POST /api/pins.remove","summary":"POST /api/pins.remove","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/team.info":{"post":{"operationId":"POST /api/team.info","summary":"POST /api/team.info","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/users.list":{"post":{"operationId":"POST /api/users.list","summary":"POST /api/users.list","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/users.profile.set":{"post":{"operationId":"POST /api/users.profile.set","summary":"POST /api/users.profile.set","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/users.setPresence":{"post":{"operationId":"POST /api/users.setPresence","summary":"POST /api/users.setPresence","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/views.generateTriggerId":{"post":{"operationId":"POST /api/views.generateTriggerId","summary":"POST /api/views.generateTriggerId","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/views.publish":{"post":{"operationId":"POST /api/views.publish","summary":"POST /api/views.publish","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/views.push":{"post":{"operationId":"POST /api/views.push","summary":"POST /api/views.push","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/api/views.update":{"post":{"operationId":"POST /api/views.update","summary":"POST /api/views.update","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/oauth/v2/authorize/callback":{"post":{"operationId":"POST /oauth/v2/authorize/callback","summary":"POST /oauth/v2/authorize/callback","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}},"/upload/v1/{fileId}":{"post":{"operationId":"POST /upload/v1/:fileId","summary":"POST /upload/v1/:fileId","x-mockingbird":{"supported":true,"parity":{"enabled":false,"safe":false,"reason":"Verified against a pinned package oracle; independent live vendor evidence is not available."}},"parameters":[{"in":"path","name":"fileId","required":true,"schema":{"type":"string"}}],"responses":{"default":{"description":"Provider response. Exact behavior is exercised against the pinned package oracle; not independently vendor-verified."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"Envelope":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean"},"error":{"type":"string"},"warning":{"type":"string"},"needed":{"type":"string"},"provided":{"type":"string"},"response_metadata":{"type":"object","properties":{"messages":{"type":"array","items":{"type":"string"}},"warnings":{"type":"array","items":{"type":"string"}}}}}},"ErrorEnvelope":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","enum":[false]},"error":{"type":"string"}}},"Message":{"type":"object","required":["type","ts"],"properties":{"type":{"type":"string","enum":["message"]},"subtype":{"type":"string"},"text":{"type":"string"},"user":{"type":"string"},"bot_id":{"type":"string"},"app_id":{"type":"string"},"team":{"type":"string"},"ts":{"type":"string","x-mockingbird-volatile":{"kind":"id"}},"thread_ts":{"type":"string","x-mockingbird-volatile":{"kind":"id"}},"blocks":{"type":"array","items":{"type":"object"}},"edited":{"type":"object","properties":{"user":{"type":"string"},"ts":{"type":"string","x-mockingbird-volatile":{"kind":"id"}}}},"reactions":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"count":{"type":"integer"},"users":{"type":"array","items":{"type":"string"}}}}}}},"PostMessageResponse":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","properties":{"channel":{"type":"string"},"ts":{"type":"string","x-mockingbird-resource":{"type":"message","identity":true},"x-mockingbird-volatile":{"kind":"id"}},"message":{"$ref":"#/components/schemas/Message"}}}]},"ReactionsGetResponse":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","properties":{"type":{"type":"string","enum":["message"]},"channel":{"type":"string"},"message":{"$ref":"#/components/schemas/Message"}}}]},"UpdateResponse":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","properties":{"channel":{"type":"string"},"ts":{"type":"string","x-mockingbird-volatile":{"kind":"id"}},"text":{"type":"string"},"message":{"$ref":"#/components/schemas/Message"}}}]},"EphemeralResponse":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","properties":{"message_ts":{"type":"string","x-mockingbird-volatile":{"kind":"id"}}}}]},"PermalinkResponse":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","properties":{"channel":{"type":"string"},"permalink":{"type":"string","x-mockingbird-volatile":{"kind":"url"}}}}]},"AuthTestResponse":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","properties":{"url":{"type":"string"},"team":{"type":"string"},"user":{"type":"string"},"team_id":{"type":"string"},"user_id":{"type":"string"},"bot_id":{"type":"string"},"is_enterprise_install":{"type":"boolean"}}}]},"Channel":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"is_channel":{"type":"boolean"},"is_private":{"type":"boolean"},"is_archived":{"type":"boolean"},"is_member":{"type":"boolean"},"created":{"type":"integer"}}},"JoinResponse":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","properties":{"channel":{"$ref":"#/components/schemas/Channel"}}}]},"User":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","x-mockingbird-resource":{"type":"user","identity":true}},"team_id":{"type":"string"},"name":{"type":"string"},"real_name":{"type":"string"},"deleted":{"type":"boolean"},"is_bot":{"type":"boolean"},"tz":{"type":"string"},"profile":{"type":"object","properties":{"email":{"type":"string"},"real_name":{"type":"string"},"display_name":{"type":"string"}}}}},"UserResponse":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","properties":{"user":{"$ref":"#/components/schemas/User"}}}]},"File":{"type":"object","required":["id"],"properties":{"id":{"type":"string","x-mockingbird-resource":{"type":"file","identity":true}},"name":{"type":"string"},"title":{"type":"string"},"mimetype":{"type":"string"},"filetype":{"type":"string"},"size":{"type":"integer"},"created":{"type":"integer"},"url_private":{"type":"string"},"url_private_download":{"type":"string"},"permalink":{"type":"string"}}},"FileResponse":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","properties":{"file":{"$ref":"#/components/schemas/File"}}}]},"ViewResponse":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","properties":{"view":{"type":"object","properties":{"id":{"type":"string","x-mockingbird-volatile":{"kind":"id"}},"type":{"type":"string"},"team_id":{"type":"string"},"callback_id":{"type":"string"},"hash":{"type":"string","x-mockingbird-volatile":{"kind":"opaque"}},"blocks":{"type":"array","items":{"type":"object"}},"state":{"type":"object"},"private_metadata":{"type":"string"},"title":{"type":"object"},"app_id":{"type":"string"},"bot_id":{"type":"string"}}}}}]},"ConnectionsOpenResponse":{"allOf":[{"$ref":"#/components/schemas/Envelope"},{"type":"object","properties":{"url":{"type":"string","description":"One-use Socket Mode WebSocket URL (\`ticket\` query parameter).","x-mockingbird-volatile":{"kind":"url"}}}}]}}}}`);
404
+ var operationIds = ["PostIncomingWebhook", "ChatPostMessage", "ChatUpdate", "ChatPostEphemeral", "ChatGetPermalinkGet", "ChatGetPermalink", "ReactionsAdd", "ReactionsRemove", "ReactionsGetGet", "ReactionsGet", "AuthTestGet", "AuthTest", "ConversationsJoin", "UsersInfoGet", "UsersInfo", "UsersLookupByEmailGet", "UsersLookupByEmail", "FilesInfoGet", "FilesInfo", "ViewsOpen", "AppsConnectionsOpen", "GET /", "GET /api/files.list", "POST /api/files.list", "GET /api/pins.list", "POST /api/pins.list", "GET /api/users.getPresence", "POST /api/users.getPresence", "GET /api/users.profile.get", "POST /api/users.profile.get", "GET /files-pri/:fileId/:filename", "GET /oauth/v2/authorize", "POST /api/bookmarks.add", "POST /api/bookmarks.edit", "POST /api/bookmarks.list", "POST /api/bookmarks.remove", "POST /api/bots.info", "POST /api/chat.delete", "POST /api/chat.deleteScheduledMessage", "POST /api/chat.meMessage", "POST /api/chat.scheduleMessage", "POST /api/chat.scheduledMessages.list", "POST /api/conversations.archive", "POST /api/conversations.close", "POST /api/conversations.create", "POST /api/conversations.history", "POST /api/conversations.info", "POST /api/conversations.invite", "POST /api/conversations.kick", "POST /api/conversations.leave", "POST /api/conversations.list", "POST /api/conversations.mark", "POST /api/conversations.members", "POST /api/conversations.open", "POST /api/conversations.rename", "POST /api/conversations.replies", "POST /api/conversations.setPurpose", "POST /api/conversations.setTopic", "POST /api/conversations.unarchive", "POST /api/files.completeUploadExternal", "POST /api/files.delete", "POST /api/files.getUploadURLExternal", "POST /api/oauth.v2.access", "POST /api/pins.add", "POST /api/pins.remove", "POST /api/team.info", "POST /api/users.list", "POST /api/users.profile.set", "POST /api/users.setPresence", "POST /api/views.generateTriggerId", "POST /api/views.publish", "POST /api/views.push", "POST /api/views.update", "POST /oauth/v2/authorize/callback", "POST /upload/v1/:fileId"];
405
+ var supportedOperationIds = ["PostIncomingWebhook", "ChatPostMessage", "ChatUpdate", "ChatPostEphemeral", "ChatGetPermalinkGet", "ChatGetPermalink", "ReactionsAdd", "ReactionsRemove", "ReactionsGetGet", "ReactionsGet", "AuthTestGet", "AuthTest", "ConversationsJoin", "UsersInfoGet", "UsersInfo", "UsersLookupByEmailGet", "UsersLookupByEmail", "FilesInfoGet", "FilesInfo", "ViewsOpen", "AppsConnectionsOpen", "GET /", "GET /api/files.list", "POST /api/files.list", "GET /api/pins.list", "POST /api/pins.list", "GET /api/users.getPresence", "POST /api/users.getPresence", "GET /api/users.profile.get", "POST /api/users.profile.get", "GET /files-pri/:fileId/:filename", "GET /oauth/v2/authorize", "POST /api/bookmarks.add", "POST /api/bookmarks.edit", "POST /api/bookmarks.list", "POST /api/bookmarks.remove", "POST /api/bots.info", "POST /api/chat.delete", "POST /api/chat.deleteScheduledMessage", "POST /api/chat.meMessage", "POST /api/chat.scheduleMessage", "POST /api/chat.scheduledMessages.list", "POST /api/conversations.archive", "POST /api/conversations.close", "POST /api/conversations.create", "POST /api/conversations.history", "POST /api/conversations.info", "POST /api/conversations.invite", "POST /api/conversations.kick", "POST /api/conversations.leave", "POST /api/conversations.list", "POST /api/conversations.mark", "POST /api/conversations.members", "POST /api/conversations.open", "POST /api/conversations.rename", "POST /api/conversations.replies", "POST /api/conversations.setPurpose", "POST /api/conversations.setTopic", "POST /api/conversations.unarchive", "POST /api/files.completeUploadExternal", "POST /api/files.delete", "POST /api/files.getUploadURLExternal", "POST /api/oauth.v2.access", "POST /api/pins.add", "POST /api/pins.remove", "POST /api/team.info", "POST /api/users.list", "POST /api/users.profile.set", "POST /api/users.setPresence", "POST /api/views.generateTriggerId", "POST /api/views.publish", "POST /api/views.push", "POST /api/views.update", "POST /oauth/v2/authorize/callback", "POST /upload/v1/:fileId"];
406
+
407
+ // src/native-operations.ts
408
+ var nativeOperationIds = [
409
+ "PostIncomingWebhook",
410
+ "ChatPostMessage",
411
+ "ChatUpdate",
412
+ "ChatPostEphemeral",
413
+ "ChatGetPermalinkGet",
414
+ "ChatGetPermalink",
415
+ "ReactionsAdd",
416
+ "ReactionsRemove",
417
+ "ReactionsGetGet",
418
+ "ReactionsGet",
419
+ "AuthTestGet",
420
+ "AuthTest",
421
+ "ConversationsJoin",
422
+ "UsersInfoGet",
423
+ "UsersInfo",
424
+ "UsersLookupByEmailGet",
425
+ "UsersLookupByEmail",
426
+ "FilesInfoGet",
427
+ "FilesInfo",
428
+ "ViewsOpen",
429
+ "AppsConnectionsOpen"
430
+ ];
431
+
432
+ // src/sockets.ts
433
+ var records = /* @__PURE__ */ new Map();
434
+ var transports = /* @__PURE__ */ new Map();
435
+ var issued = /* @__PURE__ */ new Map();
436
+ var publicRecord = (record) => ({
437
+ namespace: record.namespace,
438
+ appId: record.appId,
439
+ ticket: record.ticket,
440
+ connectedAt: record.connectedAt,
441
+ state: record.state,
442
+ reconnectCount: record.reconnectCount,
443
+ helloLatencyMs: record.helloLatencyMs,
444
+ closeAfterHello: record.closeAfterHello,
445
+ abnormalClose: record.abnormalClose,
446
+ lifetimeMs: record.lifetimeMs
447
+ });
448
+ var issueSocketTicket = (input) => {
449
+ const prior = issued.get(input.namespace) ?? 0;
450
+ issued.set(input.namespace, prior + 1);
451
+ const record = {
452
+ ...input,
453
+ ticket: crypto.randomUUID(),
454
+ connectedAt: null,
455
+ state: "pending",
456
+ reconnectCount: prior
457
+ };
458
+ records.set(record.ticket, record);
459
+ return publicRecord(record);
460
+ };
461
+ var claimSocketTicket = (ticket) => {
462
+ const record = records.get(ticket);
463
+ if (record?.state !== "pending") return void 0;
464
+ record.state = "open";
465
+ record.connectedAt = (/* @__PURE__ */ new Date()).toISOString();
466
+ return publicRecord(record);
467
+ };
468
+ var openSocketCount = (namespace) => {
469
+ let count = 0;
470
+ for (const record of records.values()) {
471
+ if (record.namespace === namespace && record.state === "open") count += 1;
472
+ }
473
+ return count;
474
+ };
475
+ var listSocketConnections = (namespace) => [...records.values()].filter((record) => namespace === void 0 || record.namespace === namespace).map(publicRecord);
476
+ var bindSocketTransport = (ticket, transport) => {
477
+ transports.set(ticket, transport);
478
+ };
479
+ var unbindSocketTransport = (ticket) => {
480
+ transports.delete(ticket);
481
+ };
482
+ var markSocketClosed = (ticket) => {
483
+ const record = records.get(ticket);
484
+ if (!record || record.state === "closed") return;
485
+ record.state = "closed";
486
+ transports.delete(ticket);
487
+ };
488
+ var disconnectSockets = (namespace, reason, code) => {
489
+ let closed = 0;
490
+ for (const record of records.values()) {
491
+ if (record.namespace !== namespace || record.state !== "open") continue;
492
+ record.state = "closing";
493
+ closed += 1;
494
+ const transport = transports.get(record.ticket);
495
+ if (transport) transport.disconnect(reason, code);
496
+ else record.state = "closed";
497
+ }
498
+ return closed;
499
+ };
500
+ var closeSocketNamespace = (namespace) => {
501
+ for (const record of [...records.values()]) {
502
+ if (record.namespace !== namespace) continue;
503
+ transports.get(record.ticket)?.destroy();
504
+ transports.delete(record.ticket);
505
+ records.delete(record.ticket);
506
+ }
507
+ issued.delete(namespace);
508
+ };
509
+
510
+ // src/state.ts
511
+ var DEFAULT_SETTINGS = {
512
+ teamId: "T0MOCKBIRD",
513
+ teamName: "Mockingbird",
514
+ teamDomain: "mockingbird",
515
+ botUserId: "U0MOCKBOT",
516
+ botId: "B0MOCKBOT",
517
+ appId: "A0MOCKAPP",
518
+ tokens: [],
519
+ appTokens: [],
520
+ revokedAppTokens: [],
521
+ socketLifetimeMs: null,
522
+ strictChannels: false
523
+ };
524
+ var DEFAULT_CHANNELS = [
525
+ {
526
+ id: "C0GENERAL",
527
+ name: "general",
528
+ is_private: false,
529
+ is_archived: false,
530
+ is_member: true,
531
+ created: 17e8
532
+ },
533
+ {
534
+ id: "C0ALERTS",
535
+ name: "alerts",
536
+ is_private: false,
537
+ is_archived: false,
538
+ is_member: false,
539
+ created: 17e8
540
+ }
541
+ ];
542
+ var DEFAULT_USERS = [
543
+ {
544
+ id: "U0MOCKBOT",
545
+ name: "mockingbird",
546
+ real_name: "Mockingbird Bot",
547
+ email: null,
548
+ is_bot: true,
549
+ deleted: false,
550
+ tz: "America/Los_Angeles"
551
+ },
552
+ {
553
+ id: "U0ADA",
554
+ name: "ada",
555
+ real_name: "Ada Lovelace",
556
+ email: "ada@example.com",
557
+ is_bot: false,
558
+ deleted: false,
559
+ tz: "America/Los_Angeles"
560
+ }
561
+ ];
562
+ var DEFAULT_FILES = [
563
+ {
564
+ id: "F0REPORT",
565
+ name: "lab-report.pdf",
566
+ title: "lab-report.pdf",
567
+ mimetype: "application/pdf",
568
+ filetype: "pdf",
569
+ size: 48213,
570
+ created: 17e8
571
+ }
572
+ ];
573
+ var SlackState = class {
574
+ constructor(sqlite, namespace, seed) {
575
+ this.seed = seed;
576
+ this.outbox = new service_exports.OutboxStore(sqlite, namespace);
577
+ this.channels = new service_exports.Collection(sqlite, namespace, "channels");
578
+ this.users = new service_exports.Collection(sqlite, namespace, "users");
579
+ this.files = new service_exports.Collection(sqlite, namespace, "files");
580
+ this.hooks = new service_exports.Collection(sqlite, namespace, "hooks");
581
+ this.views = new service_exports.Collection(sqlite, namespace, "views");
582
+ this.settings = new service_exports.Collection(sqlite, namespace, "settings");
583
+ this.tsCounter = new service_exports.Collection(sqlite, namespace, "ts");
584
+ this.ensureSeeded();
585
+ }
586
+ seed;
587
+ outbox;
588
+ channels;
589
+ users;
590
+ files;
591
+ hooks;
592
+ views;
593
+ settings;
594
+ /** Only its sequence is used: the microsecond part of every `ts`. */
595
+ tsCounter;
596
+ /** Re-apply the default workspace after a reset. */
597
+ ensureSeeded() {
598
+ if (!this.settings.has("settings")) {
599
+ this.settings.insert("settings", { ...DEFAULT_SETTINGS, ...this.seed.settings });
600
+ }
601
+ if (this.channels.count() === 0) {
602
+ for (const channel of DEFAULT_CHANNELS) this.channels.insert(channel.id, channel);
603
+ }
604
+ if (this.users.count() === 0) {
605
+ const bot = this.current().botUserId;
606
+ for (const user of DEFAULT_USERS) {
607
+ const id = user.is_bot ? bot : user.id;
608
+ this.users.insert(id, { ...user, id });
609
+ }
610
+ }
611
+ if (this.files.count() === 0) {
612
+ for (const file of DEFAULT_FILES) this.files.insert(file.id, file);
613
+ }
614
+ }
615
+ current() {
616
+ return this.settings.get("settings") ?? DEFAULT_SETTINGS;
617
+ }
618
+ update(patch) {
619
+ const next = { ...this.current(), ...patch };
620
+ this.settings.insert("settings", next);
621
+ return next;
622
+ }
623
+ /** `1700000000.000042`: mock-clock seconds, then a per-namespace counter as microseconds. */
624
+ nextTs(nowMs) {
625
+ const seq = this.tsCounter.nextSequence() % 1e6;
626
+ return `${Math.floor(nowMs / 1e3)}.${String(seq).padStart(6, "0")}`;
627
+ }
628
+ /** By id (`C…`), or by name with or without `#`. */
629
+ findChannel(ref) {
630
+ const byId = this.channels.get(ref);
631
+ if (byId) return byId;
632
+ const name = ref.replace(/^#/, "").toLowerCase();
633
+ return this.channels.list({ where: (c) => c.name === name }).at(0)?.value;
634
+ }
635
+ findUserByEmail(email) {
636
+ const wanted = email.toLowerCase();
637
+ return this.users.list({ where: (u) => u.email?.toLowerCase() === wanted }).at(0)?.value;
638
+ }
639
+ /** The message `ts` in `channel` (webhook posts are addressed by their hook's channel). */
640
+ findMessage(channel, ts) {
641
+ return this.outbox.list({ where: (m) => m.ts === ts && !m.ephemeral && m.channel === channel }).at(0);
642
+ }
643
+ };
644
+
645
+ // src/runtime.ts
646
+ var SLACK_PRESETS = {
647
+ rate_limited: {
648
+ description: "Webhooks answer 429 rate_limited and the Web API 429 {ok:false, error:ratelimited}, both with retry-after (params.retryAfter seconds, default 1)",
649
+ rules: [{ effect: "rate_limited", params: { retryAfter: 1 } }]
650
+ },
651
+ "5xx": {
652
+ description: "Every call answers 500 internal_error (params.status 503 gives service_unavailable); our clients retry these",
653
+ rules: [{ effect: "server_error", params: { status: 500 } }]
654
+ },
655
+ service_unavailable: {
656
+ description: "Every call answers 503 service_unavailable",
657
+ rules: [{ effect: "server_error", params: { status: 503 } }]
658
+ },
659
+ channel_not_found: {
660
+ description: "Webhooks answer 404 channel_not_found; Web API channel methods answer {ok:false, error:channel_not_found}",
661
+ rules: [{ effect: "channel_not_found" }]
662
+ },
663
+ no_service: {
664
+ description: "Webhooks answer 404 no_service (the hook was revoked): a terminal 4xx",
665
+ rules: [{ operationId: "PostIncomingWebhook", effect: "no_service" }]
666
+ },
667
+ invalid_auth: {
668
+ description: "Web API calls answer {ok:false, error:invalid_auth} (the bot token was revoked)",
669
+ rules: [{ pathPrefix: "/api/", effect: "invalid_auth" }]
670
+ },
671
+ connections_open_invalid_auth: {
672
+ description: "apps.connections.open answers {ok:false, error:invalid_auth} and does not mint a ticket",
673
+ rules: [{ operationId: "AppsConnectionsOpen", effect: "connections_open_invalid_auth" }]
674
+ },
675
+ connections_open_429: {
676
+ description: "apps.connections.open answers 429 {ok:false, error:ratelimited} with retry-after (params.retryAfter seconds, default 1)",
677
+ rules: [
678
+ {
679
+ operationId: "AppsConnectionsOpen",
680
+ effect: "connections_open_429",
681
+ params: { retryAfter: 1 }
682
+ }
683
+ ]
684
+ },
685
+ connections_open_5xx: {
686
+ description: "apps.connections.open answers 500 internal_error (params.status 503 gives service_unavailable)",
687
+ rules: [
688
+ {
689
+ operationId: "AppsConnectionsOpen",
690
+ effect: "connections_open_5xx",
691
+ params: { status: 500 }
692
+ }
693
+ ]
694
+ },
695
+ socket_close_after_hello: {
696
+ description: "The next Socket Mode WebSocket sends hello, then a normal close frame",
697
+ rules: [{ operationId: "AppsConnectionsOpen", effect: "socket_close_after_hello" }]
698
+ },
699
+ socket_abnormal_close: {
700
+ description: "The next Socket Mode WebSocket sends hello, then drops the TCP connection (close code 1006)",
701
+ rules: [{ operationId: "AppsConnectionsOpen", effect: "socket_abnormal_close" }]
702
+ },
703
+ socket_hello_latency: {
704
+ description: "Delay the Socket Mode hello frame by params.latencyMs (default 0). The HTTP response is not delayed",
705
+ rules: [
706
+ {
707
+ operationId: "AppsConnectionsOpen",
708
+ effect: "socket_hello_latency",
709
+ params: { latencyMs: 0 }
710
+ }
711
+ ]
712
+ }
713
+ };
714
+ var json = (status, body) => new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } });
715
+ var adminError = (status, message) => json(status, { error: { type: "mockingbird_admin", message } });
716
+ var isRecord2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
717
+ var list = (body, key) => Array.isArray(body) ? body : isRecord2(body) && Array.isArray(body[key]) ? body[key] : void 0;
718
+ var hookSuffix = (value) => {
719
+ let path = value;
720
+ try {
721
+ if (/^https?:\/\//.test(value)) path = new URL(value).pathname;
722
+ } catch {
723
+ }
724
+ return path.replace(/^\/?ns\/[^/]+/, "").replace(/^\/?services\//, "").replace(/^\/|\/$/g, "");
725
+ };
726
+ var outboxFilter = (params) => {
727
+ const webhook = params.get("webhook");
728
+ const channel = params.get("channel");
729
+ const thread = params.get("thread_ts");
730
+ const source = params.get("source");
731
+ if (webhook === null && channel === null && thread === null && source === null) return void 0;
732
+ return (item) => {
733
+ if (webhook !== null && item.webhook !== `/services/${hookSuffix(webhook)}`) return false;
734
+ if (channel !== null) {
735
+ const wanted = channel.toLowerCase().replace(/^#/, "");
736
+ const recipients = item.to.map((t) => t.toLowerCase().replace(/^#/, ""));
737
+ if (!recipients.includes(wanted)) return false;
738
+ }
739
+ if (thread !== null && item.thread_ts !== thread) return false;
740
+ if (source !== null && item.source !== source) return false;
741
+ return true;
742
+ };
743
+ };
744
+ var adminRoutes = (runtime) => ({
745
+ ...(0, service_exports.outboxAdminRoutes)(
746
+ runtime,
747
+ (api) => api.state.outbox,
748
+ outboxFilter
749
+ ),
750
+ "GET /hooks": ({ namespace }) => json(200, {
751
+ hooks: runtime.instance(namespace).state.hooks.list({ order: "oldest" }).map((row) => ({ ...row.value, url: `/services/${row.value.path}` }))
752
+ }),
753
+ "POST /hooks": ({ body, namespace }) => {
754
+ const entries = list(body, "hooks") ?? (isRecord2(body) ? [body] : void 0);
755
+ if (!entries || entries.some((e) => !isRecord2(e) || typeof e.path !== "string")) {
756
+ return adminError(400, 'expected {"path": "T\u2026/B\u2026/X\u2026", "channel"?: "C\u2026"} or {"hooks": [...]}');
757
+ }
758
+ const api = runtime.instance(namespace);
759
+ const created = entries.map((entry) => {
760
+ const path = hookSuffix(entry.path);
761
+ const hook = {
762
+ path,
763
+ channel: typeof entry.channel === "string" ? entry.channel : `/services/${path}`
764
+ };
765
+ api.state.hooks.insert(path, hook);
766
+ return { ...hook, url: `/services/${path}` };
767
+ });
768
+ return json(201, { hooks: created });
769
+ },
770
+ "DELETE /hooks": ({ namespace, url }) => {
771
+ const api = runtime.instance(namespace);
772
+ const only = url.searchParams.get("path");
773
+ for (const row of api.state.hooks.list()) {
774
+ if (only === null || row.id === hookSuffix(only)) api.state.hooks.delete(row.id);
775
+ }
776
+ return json(200, { status: "ok" });
777
+ },
778
+ "GET /channels": ({ namespace }) => json(200, {
779
+ channels: runtime.instance(namespace).state.channels.list({ order: "oldest" }).map((r) => r.value)
780
+ }),
781
+ "POST /channels": ({ body, namespace }) => {
782
+ const entries = list(body, "channels") ?? (isRecord2(body) ? [body] : void 0);
783
+ if (!entries || entries.some((e) => !isRecord2(e) || typeof e.name !== "string")) {
784
+ return adminError(
785
+ 400,
786
+ 'expected {"id"?, "name", "is_private"?, "is_archived"?, "is_member"?}'
787
+ );
788
+ }
789
+ const api = runtime.instance(namespace);
790
+ const saved = entries.map((entry) => {
791
+ const name = entry.name.replace(/^#/, "").toLowerCase();
792
+ const channel = {
793
+ id: typeof entry.id === "string" ? entry.id : `C${name.toUpperCase().replace(/[^A-Z0-9]/g, "")}`.slice(0, 11),
794
+ name,
795
+ is_private: entry.is_private === true,
796
+ is_archived: entry.is_archived === true,
797
+ is_member: entry.is_member !== false,
798
+ created: Math.floor(runtime.namespaceClock(namespace).now() / 1e3)
799
+ };
800
+ api.state.channels.insert(channel.id, channel);
801
+ return channel;
802
+ });
803
+ return json(201, { channels: saved });
804
+ },
805
+ "GET /users": ({ namespace }) => json(200, {
806
+ users: runtime.instance(namespace).state.users.list({ order: "oldest" }).map((r) => r.value)
807
+ }),
808
+ "POST /users": ({ body, namespace }) => {
809
+ const entries = list(body, "users") ?? (isRecord2(body) ? [body] : void 0);
810
+ if (!entries || entries.some((e) => !isRecord2(e) || typeof e.id !== "string")) {
811
+ return adminError(400, 'expected {"id": "U\u2026", "name"?, "real_name"?, "email"?}');
812
+ }
813
+ const api = runtime.instance(namespace);
814
+ const saved = entries.map((entry) => {
815
+ const id = entry.id;
816
+ const user = {
817
+ id,
818
+ name: typeof entry.name === "string" ? entry.name : id.toLowerCase(),
819
+ real_name: typeof entry.real_name === "string" ? entry.real_name : id,
820
+ email: typeof entry.email === "string" ? entry.email : null,
821
+ is_bot: entry.is_bot === true,
822
+ deleted: entry.deleted === true,
823
+ tz: typeof entry.tz === "string" ? entry.tz : "America/Los_Angeles"
824
+ };
825
+ api.state.users.insert(id, user);
826
+ return user;
827
+ });
828
+ return json(201, { users: saved });
829
+ },
830
+ "POST /files": ({ body, namespace }) => {
831
+ const entries = list(body, "files") ?? (isRecord2(body) ? [body] : void 0);
832
+ if (!entries || entries.some((e) => !isRecord2(e) || typeof e.id !== "string")) {
833
+ return adminError(400, 'expected {"id": "F\u2026", "name"?, "mimetype"?, "size"?}');
834
+ }
835
+ const api = runtime.instance(namespace);
836
+ const saved = entries.map((entry) => {
837
+ const id = entry.id;
838
+ const name = typeof entry.name === "string" ? entry.name : `${id}.bin`;
839
+ const file = {
840
+ id,
841
+ name,
842
+ title: typeof entry.title === "string" ? entry.title : name,
843
+ mimetype: typeof entry.mimetype === "string" ? entry.mimetype : "application/octet-stream",
844
+ filetype: typeof entry.filetype === "string" ? entry.filetype : "binary",
845
+ size: typeof entry.size === "number" ? entry.size : 0,
846
+ created: Math.floor(runtime.namespaceClock(namespace).now() / 1e3)
847
+ };
848
+ api.state.files.insert(id, file);
849
+ return file;
850
+ });
851
+ return json(201, { files: saved });
852
+ },
853
+ "GET /views": ({ namespace }) => json(200, {
854
+ views: runtime.instance(namespace).state.views.list({ order: "oldest" }).map((r) => r.value)
855
+ }),
856
+ "GET /settings": ({ namespace }) => json(200, runtime.instance(namespace).state.current()),
857
+ "PUT /settings": ({ body, namespace }) => {
858
+ if (!isRecord2(body)) return adminError(400, "expected a JSON object");
859
+ const patch = {};
860
+ for (const key of [
861
+ "teamId",
862
+ "teamName",
863
+ "teamDomain",
864
+ "botUserId",
865
+ "botId",
866
+ "appId"
867
+ ]) {
868
+ if (body[key] === void 0) continue;
869
+ if (typeof body[key] !== "string") return adminError(400, `${key}: string`);
870
+ patch[key] = body[key];
871
+ }
872
+ if (body.tokens !== void 0) {
873
+ if (!Array.isArray(body.tokens)) return adminError(400, "tokens: string[]");
874
+ patch.tokens = body.tokens.map(String);
875
+ }
876
+ if (body.strictChannels !== void 0) {
877
+ if (typeof body.strictChannels !== "boolean")
878
+ return adminError(400, "strictChannels: boolean");
879
+ patch.strictChannels = body.strictChannels;
880
+ }
881
+ for (const key of ["appTokens", "revokedAppTokens"]) {
882
+ if (body[key] === void 0) continue;
883
+ const entries = body[key];
884
+ if (!Array.isArray(entries) || entries.some((entry) => typeof entry !== "string")) {
885
+ return adminError(400, `${key}: string[]`);
886
+ }
887
+ patch[key] = entries.map(String);
888
+ }
889
+ if (body.socketLifetimeMs !== void 0) {
890
+ if (body.socketLifetimeMs !== null && (typeof body.socketLifetimeMs !== "number" || body.socketLifetimeMs < 0)) {
891
+ return adminError(400, "socketLifetimeMs: number | null");
892
+ }
893
+ patch.socketLifetimeMs = body.socketLifetimeMs;
894
+ }
895
+ return json(200, runtime.instance(namespace).state.update(patch));
896
+ },
897
+ "GET /socket/connections": ({ namespace }) => json(200, {
898
+ connections: listSocketConnections(namespace).map((row) => ({
899
+ namespace: row.namespace,
900
+ appId: row.appId,
901
+ ticket: row.ticket,
902
+ connectedAt: row.connectedAt,
903
+ state: row.state,
904
+ reconnectCount: row.reconnectCount
905
+ }))
906
+ }),
907
+ "POST /socket/disconnect": ({ body, namespace }) => {
908
+ const reason = isRecord2(body) && typeof body.reason === "string" ? body.reason : "warning";
909
+ if (reason !== "warning" && reason !== "refresh_requested" && reason !== "link_disabled") {
910
+ return adminError(400, "reason must be warning, refresh_requested, or link_disabled");
911
+ }
912
+ const code = isRecord2(body) && typeof body.code === "number" ? body.code : 1e3;
913
+ return json(200, { closed: disconnectSockets(namespace, reason, code) });
914
+ }
915
+ });
916
+ var createRuntime2 = (options = {}) => createRuntime({
917
+ name: SLACK_NAMESPACE,
918
+ document,
919
+ ...options.sqlite ? { sqlite: options.sqlite } : {},
920
+ ...options.clock ? { clock: options.clock } : {},
921
+ ...options.seed !== void 0 ? { seed: options.seed } : {},
922
+ ...options.adminPrefix !== void 0 ? { adminPrefix: options.adminPrefix } : {},
923
+ ...options.adminKey !== void 0 ? { adminKey: options.adminKey } : {},
924
+ ...options.adminControls !== void 0 ? { adminControls: options.adminControls } : {},
925
+ ...options.onLog ? { onLog: options.onLog } : {},
926
+ credential: (request) => slackCredential(request, options.adminPrefix),
927
+ presets: SLACK_PRESETS,
928
+ create: ({ sqlite, namespace, publicNamespace, adminPrefix, clock, rng }) => new SlackAPI({
929
+ ...options.fixtures ? { fixtures: options.fixtures } : {},
930
+ ...options.baseUrl ? { baseUrl: options.baseUrl } : {},
931
+ ...options.tokens ? { tokens: options.tokens } : {},
932
+ sqlite,
933
+ namespace,
934
+ publicNamespace,
935
+ adminPrefix,
936
+ now: clock.now,
937
+ random: rng.next,
938
+ ...options.settings ? { settings: options.settings } : {}
939
+ }),
940
+ admin: adminRoutes
941
+ });
942
+
943
+ // src/index.ts
944
+ var SLACK_NAMESPACE = "slack";
945
+ var WEBHOOK_PATH = /^\/services\/([^/]+\/[^/]+\/[^/]+)\/?$/;
946
+ var slackCredential = (request, adminPrefix = service_exports.ADMIN_PREFIX) => {
947
+ const token = (0, service_exports.bearerToken)(request);
948
+ if (token) return token;
949
+ const path = new URL(request.url).pathname;
950
+ return WEBHOOK_PATH.exec((0, service_exports.matchNamespacePath)(path, adminPrefix)?.[2] ?? path)?.[1];
951
+ };
952
+ var isRecord3 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
953
+ var text = (status, body, headers = {}) => new Response(body, {
954
+ status,
955
+ headers: { "content-type": "text/plain; charset=utf-8", ...headers }
956
+ });
957
+ var fail = (error, extra = {}) => (0, service_exports.jsonRes)(200, { ok: false, error, ...extra });
958
+ var SlackError = class extends Error {
959
+ constructor(code, extra = {}) {
960
+ super(code);
961
+ this.code = code;
962
+ this.extra = extra;
963
+ }
964
+ code;
965
+ extra;
966
+ };
967
+ var reply = (body, ids) => ids ? { body, ids: ids.ids } : { body };
968
+ var readArgs = (context) => {
969
+ const args = {};
970
+ for (const [key, value] of context.url.searchParams) args[key] = value;
971
+ const body = context.body;
972
+ const contentType = context.request.headers.get("content-type") ?? "";
973
+ let json2 = false;
974
+ if (body.kind === "json") {
975
+ if (!isRecord3(body.value)) throw new SlackError("invalid_json");
976
+ Object.assign(args, body.value);
977
+ json2 = true;
978
+ } else if (body.kind === "form") {
979
+ Object.assign(args, body.value);
980
+ for (const key of ["blocks", "attachments", "view"]) {
981
+ const raw = args[key];
982
+ if (typeof raw !== "string") continue;
983
+ try {
984
+ args[key] = JSON.parse(raw);
985
+ } catch {
986
+ throw new SlackError(key === "blocks" ? "invalid_blocks_format" : "invalid_arguments", {
987
+ response_metadata: { messages: [`[ERROR] ${key} must be valid JSON`] }
988
+ });
989
+ }
990
+ }
991
+ } else if (body.kind === "invalid") {
992
+ throw new SlackError("invalid_json");
993
+ }
994
+ return Object.assign(args, { __json: json2, __charset: /charset=/i.test(contentType) });
995
+ };
996
+ var str = (value) => typeof value === "string" && value.length > 0 ? value : typeof value === "number" ? String(value) : void 0;
997
+ var APP_TOKEN = /^xapp-[A-Za-z0-9][A-Za-z0-9_-]{8,}$/;
998
+ var flag = (value) => {
999
+ if (typeof value === "boolean") return value;
1000
+ if (value === "true") return true;
1001
+ if (value === "false") return false;
1002
+ return null;
1003
+ };
1004
+ var invalidBlocks = (issues) => new SlackError("invalid_blocks", {
1005
+ response_metadata: { messages: issues.map((issue) => `[ERROR] ${issue}`) }
1006
+ });
1007
+ var checkBlocks = (blocks) => {
1008
+ if (blocks === void 0 || blocks === null || blocks === "") return null;
1009
+ const issues = blockIssues(blocks);
1010
+ if (issues.length > 0) throw invalidBlocks(issues);
1011
+ return blocks;
1012
+ };
1013
+ var checkAttachments = (attachments) => {
1014
+ if (!Array.isArray(attachments)) return null;
1015
+ const issues = attachmentBlockIssues(attachments);
1016
+ if (issues.length > 0) throw invalidBlocks(issues);
1017
+ return attachments;
1018
+ };
1019
+ var SlackAPI = class {
1020
+ app;
1021
+ sqlite;
1022
+ state;
1023
+ tail = Promise.resolve();
1024
+ expansion;
1025
+ service;
1026
+ now;
1027
+ namespaceName;
1028
+ constructor(options = {}) {
1029
+ const sqlite = (0, service_exports.bootSqlite)(options.sqlite);
1030
+ const namespace = options.namespace ?? SLACK_NAMESPACE;
1031
+ this.namespaceName = options.publicNamespace ?? "default";
1032
+ this.now = options.now ?? (() => Date.now());
1033
+ this.state = new SlackState(sqlite, namespace, { settings: options.settings ?? {} });
1034
+ const api = (fn) => (context) => {
1035
+ try {
1036
+ const args = readArgs(context);
1037
+ const { body, ids } = fn(args, context);
1038
+ const warn = args.__json && !args.__charset;
1039
+ const response = (0, service_exports.jsonRes)(
1040
+ 200,
1041
+ warn ? {
1042
+ ...body,
1043
+ warning: "missing_charset",
1044
+ response_metadata: { warnings: ["missing_charset"] }
1045
+ } : body
1046
+ );
1047
+ return ids ? (0, service_exports.annotateResponse)(response, { ids }) : response;
1048
+ } catch (error) {
1049
+ if (error instanceof SlackError) return fail(error.code, error.extra);
1050
+ throw error;
1051
+ }
1052
+ };
1053
+ const handlers = (0, service_exports.defineOperations)({
1054
+ PostIncomingWebhook: (context) => this.incomingWebhook(context),
1055
+ ChatPostMessage: api((args, context) => this.postMessage(args, context)),
1056
+ ChatUpdate: api((args, context) => this.update(args, context)),
1057
+ ChatPostEphemeral: api((args, context) => this.postEphemeral(args, context)),
1058
+ ChatGetPermalink: api((args, context) => this.permalink(args, context)),
1059
+ ChatGetPermalinkGet: api((args, context) => this.permalink(args, context)),
1060
+ ReactionsAdd: api((args, context) => this.react(args, context, "add")),
1061
+ ReactionsRemove: api((args, context) => this.react(args, context, "remove")),
1062
+ ReactionsGet: api((args, context) => this.reactions(args, context)),
1063
+ ReactionsGetGet: api((args, context) => this.reactions(args, context)),
1064
+ AuthTest: api(() => this.authTest()),
1065
+ AuthTestGet: api(() => this.authTest()),
1066
+ ConversationsJoin: api((args, context) => this.join(args, context)),
1067
+ UsersInfo: api((args) => this.userInfo(args)),
1068
+ UsersInfoGet: api((args) => this.userInfo(args)),
1069
+ UsersLookupByEmail: api((args) => this.lookupByEmail(args)),
1070
+ UsersLookupByEmailGet: api((args) => this.lookupByEmail(args)),
1071
+ FilesInfo: api((args) => this.fileInfo(args)),
1072
+ FilesInfoGet: api((args) => this.fileInfo(args)),
1073
+ ViewsOpen: api((args) => this.openView(args)),
1074
+ AppsConnectionsOpen: (context) => this.connectionsOpen(context)
1075
+ });
1076
+ this.service = (0, service_exports.createService)({
1077
+ document: selectOperations(document, nativeOperationIds),
1078
+ handlers,
1079
+ sqlite,
1080
+ namespace,
1081
+ now: this.now,
1082
+ notFound: (request) => new URL(request.url).pathname.startsWith("/api/") ? fail("unknown_method") : text(404, "no_service"),
1083
+ onError: (error) => {
1084
+ if (error instanceof service_exports.HttpError) return error.toResponse();
1085
+ throw error;
1086
+ },
1087
+ before: (context) => this.gate(context)
1088
+ });
1089
+ this.app = new Hono().all("*", (c) => this.fetch(c.req.raw));
1090
+ this.sqlite = this.service.sqlite;
1091
+ this.expansion = new ProviderExpansion(
1092
+ slackPlugin,
1093
+ selectOperations(document, nativeOperationIds),
1094
+ {
1095
+ ...options.baseUrl ? { baseUrl: options.baseUrl } : {},
1096
+ ...options.tokens ? { tokens: options.tokens } : {},
1097
+ ...options.random ? { random: options.random } : {},
1098
+ ...options.publicNamespace !== void 0 ? { publicNamespace: options.publicNamespace } : {},
1099
+ ...options.adminPrefix !== void 0 ? { adminPrefix: options.adminPrefix } : {},
1100
+ sqlite,
1101
+ namespace,
1102
+ now: this.now,
1103
+ fallbackUser: { login: this.state.current().botUserId, id: 1, scopes: [] }
1104
+ }
1105
+ );
1106
+ if (options.fixtures) {
1107
+ this.expansion.configureFixtures(options.fixtures, seedSlack);
1108
+ syncFromExpanded(this.state, this.expansion);
1109
+ }
1110
+ }
1111
+ fetch(request) {
1112
+ const result = this.tail.then(
1113
+ () => this.handleFetch(request),
1114
+ () => this.handleFetch(request)
1115
+ );
1116
+ this.tail = result.then(
1117
+ () => void 0,
1118
+ () => void 0
1119
+ );
1120
+ return result;
1121
+ }
1122
+ async handleFetch(request) {
1123
+ if (this.expansion.handles(request)) {
1124
+ syncToExpanded(this.state, this.expansion);
1125
+ const path = new URL(request.url).pathname;
1126
+ if (path.startsWith("/api/") && !path.includes("oauth")) {
1127
+ let token = (0, service_exports.bearerToken)(request) ?? new URL(request.url).searchParams.get("token");
1128
+ if (!token && request.headers.get("content-type")?.includes("application/x-www-form-urlencoded"))
1129
+ token = String((await request.clone().formData()).get("token") ?? "");
1130
+ if (!token) return fail("not_authed");
1131
+ const accepted = this.settings().tokens;
1132
+ if (!(accepted.length ? accepted.includes(token) : /^xox[abp]-/.test(token)))
1133
+ return fail("invalid_auth");
1134
+ if (!(0, service_exports.bearerToken)(request)) {
1135
+ const headers = new Headers(request.headers);
1136
+ headers.set("authorization", `Bearer ${token}`);
1137
+ request = new Request(request, { headers });
1138
+ }
1139
+ }
1140
+ const response2 = await this.expansion.fetch(request);
1141
+ syncFromExpanded(this.state, this.expansion);
1142
+ return response2;
1143
+ }
1144
+ const response = await this.service.fetch(request);
1145
+ return response;
1146
+ }
1147
+ async reset() {
1148
+ await this.tail;
1149
+ closeSocketNamespace(this.namespaceName);
1150
+ await this.service.reset();
1151
+ await this.expansion.reset();
1152
+ syncFromExpanded(this.state, this.expansion);
1153
+ this.state.ensureSeeded();
1154
+ }
1155
+ /** Every message in the outbox, oldest first. */
1156
+ messages() {
1157
+ return this.state.outbox.list();
1158
+ }
1159
+ settings() {
1160
+ return this.state.current();
1161
+ }
1162
+ /** Fault effects every surface shares, then Web API authentication. */
1163
+ gate(context) {
1164
+ const webhook = context.operation.operationId === "PostIncomingWebhook";
1165
+ const limited = (0, service_exports.faultEffect)(context.request, "rate_limited");
1166
+ if (limited !== void 0) {
1167
+ const retryAfter = String(limited.retryAfter ?? 1);
1168
+ return webhook ? text(429, "rate_limited", { "retry-after": retryAfter }) : (0, service_exports.jsonRes)(429, { ok: false, error: "ratelimited" }, { "retry-after": retryAfter });
1169
+ }
1170
+ const broken = (0, service_exports.faultEffect)(context.request, "server_error");
1171
+ if (broken !== void 0) {
1172
+ const status = typeof broken.status === "number" ? broken.status : 500;
1173
+ const code = status === 503 ? "service_unavailable" : "internal_error";
1174
+ return webhook ? text(status, code) : (0, service_exports.jsonRes)(status, { ok: false, error: code });
1175
+ }
1176
+ if (webhook || context.operation.operationId === "AppsConnectionsOpen") return void 0;
1177
+ if ((0, service_exports.faultEffect)(context.request, "invalid_auth") !== void 0) return fail("invalid_auth");
1178
+ const token = (0, service_exports.bearerToken)(context.request) ?? this.bodyToken(context);
1179
+ if (!token) return fail("not_authed");
1180
+ const accepted = this.settings().tokens;
1181
+ const ok = accepted.length > 0 ? accepted.includes(token) : /^xox[abp]-/.test(token);
1182
+ return ok ? void 0 : fail("invalid_auth");
1183
+ }
1184
+ /** Form posts may carry `token=` instead of the header (Slack's legacy style). */
1185
+ bodyToken(context) {
1186
+ const fromQuery = context.url.searchParams.get("token");
1187
+ if (fromQuery) return fromQuery;
1188
+ return context.body.kind === "form" ? str(context.body.value.token) : void 0;
1189
+ }
1190
+ iso() {
1191
+ return new Date(this.now()).toISOString();
1192
+ }
1193
+ /**
1194
+ * Resolve a channel id or name. Unknown channels are created on first use unless
1195
+ * `strictChannels` is set; the `channel_not_found` preset forces the error.
1196
+ */
1197
+ channel(ref, context) {
1198
+ const wanted = str(ref);
1199
+ if (!wanted || (0, service_exports.faultEffect)(context.request, "channel_not_found") !== void 0) {
1200
+ throw new SlackError("channel_not_found");
1201
+ }
1202
+ const found = this.state.findChannel(wanted);
1203
+ if (found) return found;
1204
+ if (this.settings().strictChannels) throw new SlackError("channel_not_found");
1205
+ const isId = /^[CGD][A-Z0-9]{2,}$/.test(wanted);
1206
+ const name = isId ? wanted.toLowerCase() : wanted.replace(/^#/, "").toLowerCase();
1207
+ const created = {
1208
+ id: isId ? wanted : `C${(0, service_exports.opaqueToken)(`channel:${name}`, 10).toUpperCase()}`,
1209
+ name,
1210
+ is_private: wanted.startsWith("G"),
1211
+ is_archived: false,
1212
+ is_member: true,
1213
+ created: Math.floor(this.now() / 1e3)
1214
+ };
1215
+ this.state.channels.insert(created.id, created);
1216
+ return created;
1217
+ }
1218
+ messageBody(message) {
1219
+ const settings = this.settings();
1220
+ return {
1221
+ type: "message",
1222
+ ...message.text !== null ? { text: message.text } : { text: "" },
1223
+ user: settings.botUserId,
1224
+ bot_id: settings.botId,
1225
+ app_id: settings.appId,
1226
+ team: settings.teamId,
1227
+ ts: message.ts,
1228
+ ...message.thread_ts !== null ? { thread_ts: message.thread_ts } : {},
1229
+ ...message.blocks !== null ? { blocks: message.blocks } : {},
1230
+ ...message.edited !== null ? { edited: message.edited } : {},
1231
+ ...message.reactions.length > 0 ? { reactions: message.reactions } : {}
1232
+ };
1233
+ }
1234
+ record(message) {
1235
+ const stored = {
1236
+ ...message,
1237
+ id: `${message.channel}:${message.ts}`,
1238
+ createdAt: this.iso(),
1239
+ reactions: [],
1240
+ workspace: this.settings().teamId
1241
+ };
1242
+ return this.state.outbox.record(stored);
1243
+ }
1244
+ incomingWebhook(context) {
1245
+ const path = `${context.params.team}/${context.params.bot}/${context.params.secret}`;
1246
+ const webhook = `/services/${path}`;
1247
+ const hooks = this.state.hooks.list();
1248
+ const hook = this.state.hooks.get(path);
1249
+ if (hooks.length > 0 && !hook) return text(404, "no_service");
1250
+ if ((0, service_exports.faultEffect)(context.request, "no_service") !== void 0) return text(404, "no_service");
1251
+ if ((0, service_exports.faultEffect)(context.request, "channel_not_found") !== void 0) {
1252
+ return text(404, "channel_not_found");
1253
+ }
1254
+ let payload;
1255
+ const body = context.body;
1256
+ if (body.kind === "json") payload = body.value;
1257
+ else if (body.kind === "form" && typeof body.value.payload === "string") {
1258
+ try {
1259
+ payload = JSON.parse(body.value.payload);
1260
+ } catch {
1261
+ return text(400, "invalid_payload");
1262
+ }
1263
+ } else return text(400, "invalid_payload");
1264
+ if (!isRecord3(payload)) return text(400, "invalid_payload");
1265
+ let blocks;
1266
+ let attachments;
1267
+ try {
1268
+ blocks = checkBlocks(payload.blocks);
1269
+ attachments = checkAttachments(payload.attachments);
1270
+ } catch {
1271
+ return text(400, "invalid_blocks");
1272
+ }
1273
+ if (attachments && attachments.length > 100) return text(400, "too_many_attachments");
1274
+ const messageText = typeof payload.text === "string" ? payload.text : null;
1275
+ if (!messageText && !blocks && !attachments) return text(400, "no_text");
1276
+ const channel = hook ? this.state.findChannel(hook.channel) : void 0;
1277
+ if (channel?.is_archived) return text(410, "channel_is_archived");
1278
+ const ts = this.state.nextTs(this.now());
1279
+ const target = channel?.id ?? hook?.channel ?? webhook;
1280
+ const message = this.record({
1281
+ to: [webhook, ...channel ? [channel.id, `#${channel.name}`] : hook ? [hook.channel] : []],
1282
+ source: "webhook",
1283
+ method: "incoming-webhook",
1284
+ webhook,
1285
+ channel: target,
1286
+ text: messageText,
1287
+ blocks,
1288
+ attachments,
1289
+ thread_ts: str(payload.thread_ts) ?? null,
1290
+ ts,
1291
+ user: null,
1292
+ ephemeral: false,
1293
+ edited: null,
1294
+ unfurl_links: flag(payload.unfurl_links)
1295
+ });
1296
+ return (0, service_exports.annotateResponse)(text(200, "ok"), { ids: { ts: message.ts, webhook: path } });
1297
+ }
1298
+ postMessage(args, context) {
1299
+ const channel = this.channel(args.channel, context);
1300
+ if (channel.is_archived) throw new SlackError("is_archived");
1301
+ const blocks = checkBlocks(args.blocks);
1302
+ const attachments = checkAttachments(args.attachments);
1303
+ const messageText = typeof args.text === "string" ? args.text : null;
1304
+ if (!messageText && !blocks && !attachments) throw new SlackError("no_text");
1305
+ if (messageText && messageText.length > 4e4) throw new SlackError("msg_too_long");
1306
+ const message = this.record({
1307
+ to: [channel.id, `#${channel.name}`],
1308
+ source: "api",
1309
+ method: "chat.postMessage",
1310
+ webhook: null,
1311
+ channel: channel.id,
1312
+ text: messageText,
1313
+ blocks,
1314
+ attachments,
1315
+ thread_ts: str(args.thread_ts) ?? null,
1316
+ ts: this.state.nextTs(this.now()),
1317
+ user: this.settings().botUserId,
1318
+ ephemeral: false,
1319
+ edited: null,
1320
+ unfurl_links: flag(args.unfurl_links)
1321
+ });
1322
+ return reply(
1323
+ {
1324
+ ok: true,
1325
+ channel: channel.id,
1326
+ ts: message.ts,
1327
+ message: this.messageBody(message)
1328
+ },
1329
+ { ids: { channel: channel.id, ts: message.ts } }
1330
+ );
1331
+ }
1332
+ update(args, context) {
1333
+ const channel = this.channel(args.channel, context);
1334
+ const ts = str(args.ts);
1335
+ const message = ts ? this.state.findMessage(channel.id, ts) : void 0;
1336
+ if (!message) throw new SlackError("message_not_found");
1337
+ if (message.source !== "api") throw new SlackError("cant_update_message");
1338
+ const blocks = checkBlocks(args.blocks);
1339
+ checkAttachments(args.attachments);
1340
+ const messageText = typeof args.text === "string" ? args.text : null;
1341
+ if (!messageText && !blocks && args.blocks === void 0) throw new SlackError("no_text");
1342
+ const next = {
1343
+ ...message,
1344
+ text: messageText ?? message.text,
1345
+ // Omitted blocks are retained, as Slack documents; `[]` clears them.
1346
+ blocks: Array.isArray(args.blocks) && args.blocks.length === 0 ? null : blocks ?? message.blocks,
1347
+ edited: { user: this.settings().botUserId, ts: this.state.nextTs(this.now()) }
1348
+ };
1349
+ this.state.outbox.update(message.id, next);
1350
+ return reply(
1351
+ {
1352
+ ok: true,
1353
+ channel: channel.id,
1354
+ ts: message.ts,
1355
+ text: next.text ?? "",
1356
+ message: this.messageBody(next)
1357
+ },
1358
+ { ids: { channel: channel.id, ts: message.ts } }
1359
+ );
1360
+ }
1361
+ postEphemeral(args, context) {
1362
+ const channel = this.channel(args.channel, context);
1363
+ const userId = str(args.user);
1364
+ const user = userId ? this.state.users.get(userId) : void 0;
1365
+ if (!user) throw new SlackError("user_not_found");
1366
+ const blocks = checkBlocks(args.blocks);
1367
+ checkAttachments(args.attachments);
1368
+ const messageText = typeof args.text === "string" ? args.text : null;
1369
+ if (!messageText && !blocks) throw new SlackError("no_text");
1370
+ const message = this.record({
1371
+ to: [channel.id, `#${channel.name}`, user.id],
1372
+ source: "api",
1373
+ method: "chat.postEphemeral",
1374
+ webhook: null,
1375
+ channel: channel.id,
1376
+ text: messageText,
1377
+ blocks,
1378
+ attachments: null,
1379
+ thread_ts: str(args.thread_ts) ?? null,
1380
+ ts: this.state.nextTs(this.now()),
1381
+ user: user.id,
1382
+ ephemeral: true,
1383
+ edited: null,
1384
+ unfurl_links: flag(args.unfurl_links)
1385
+ });
1386
+ return reply(
1387
+ { ok: true, message_ts: message.ts },
1388
+ {
1389
+ ids: { channel: channel.id, ts: message.ts }
1390
+ }
1391
+ );
1392
+ }
1393
+ permalink(args, context) {
1394
+ const channel = this.channel(args.channel, context);
1395
+ const ts = str(args.message_ts);
1396
+ const message = ts ? this.state.findMessage(channel.id, ts) : void 0;
1397
+ if (!message) throw new SlackError("message_not_found");
1398
+ const base = `https://${this.settings().teamDomain}.slack.com/archives/${channel.id}/p${message.ts.replace(".", "")}`;
1399
+ const permalink = message.thread_ts ? `${base}?thread_ts=${message.thread_ts}&cid=${channel.id}` : base;
1400
+ return reply({ ok: true, channel: channel.id, permalink });
1401
+ }
1402
+ react(args, context, mode) {
1403
+ const name = str(args.name)?.replace(/:/g, "");
1404
+ if (!name) throw new SlackError("invalid_name");
1405
+ if (args.channel === void 0 && args.timestamp === void 0) {
1406
+ throw new SlackError("no_item_specified");
1407
+ }
1408
+ const channel = this.channel(args.channel, context);
1409
+ const ts = str(args.timestamp);
1410
+ const message = ts ? this.state.findMessage(channel.id, ts) : void 0;
1411
+ if (!message) throw new SlackError("message_not_found");
1412
+ const bot = this.settings().botUserId;
1413
+ const reactions = message.reactions.map((r) => ({ ...r, users: [...r.users] }));
1414
+ const existing = reactions.find((r) => r.name === name);
1415
+ if (mode === "add") {
1416
+ if (existing?.users.includes(bot)) throw new SlackError("already_reacted");
1417
+ if (existing) {
1418
+ existing.users.push(bot);
1419
+ existing.count = existing.users.length;
1420
+ } else reactions.push({ name, users: [bot], count: 1 });
1421
+ } else {
1422
+ if (!existing?.users.includes(bot)) throw new SlackError("no_reaction");
1423
+ existing.users = existing.users.filter((u) => u !== bot);
1424
+ existing.count = existing.users.length;
1425
+ }
1426
+ this.state.outbox.update(message.id, {
1427
+ ...message,
1428
+ reactions: reactions.filter((r) => r.count > 0)
1429
+ });
1430
+ return reply({ ok: true });
1431
+ }
1432
+ reactions(args, context) {
1433
+ if (args.channel === void 0 && args.timestamp === void 0) {
1434
+ throw new SlackError("no_item_specified");
1435
+ }
1436
+ const channel = this.channel(args.channel, context);
1437
+ const ts = str(args.timestamp);
1438
+ const message = ts ? this.state.findMessage(channel.id, ts) : void 0;
1439
+ if (!message) throw new SlackError("message_not_found");
1440
+ return reply({
1441
+ ok: true,
1442
+ type: "message",
1443
+ channel: channel.id,
1444
+ message: this.messageBody(message)
1445
+ });
1446
+ }
1447
+ authTest() {
1448
+ const settings = this.settings();
1449
+ const bot = this.state.users.get(settings.botUserId);
1450
+ return reply({
1451
+ ok: true,
1452
+ url: `https://${settings.teamDomain}.slack.com/`,
1453
+ team: settings.teamName,
1454
+ user: bot?.name ?? "mockingbird",
1455
+ team_id: settings.teamId,
1456
+ user_id: settings.botUserId,
1457
+ bot_id: settings.botId,
1458
+ is_enterprise_install: false
1459
+ });
1460
+ }
1461
+ channelBody(channel) {
1462
+ return {
1463
+ id: channel.id,
1464
+ name: channel.name,
1465
+ is_channel: !channel.is_private,
1466
+ is_private: channel.is_private,
1467
+ is_archived: channel.is_archived,
1468
+ is_member: channel.is_member,
1469
+ created: channel.created
1470
+ };
1471
+ }
1472
+ join(args, context) {
1473
+ const channel = this.channel(args.channel, context);
1474
+ if (channel.is_archived) throw new SlackError("is_archived");
1475
+ if (channel.is_private) throw new SlackError("method_not_supported_for_channel_type");
1476
+ if (channel.is_member) {
1477
+ return reply({
1478
+ ok: true,
1479
+ channel: this.channelBody(channel),
1480
+ warning: "already_in_channel",
1481
+ response_metadata: { warnings: ["already_in_channel"] }
1482
+ });
1483
+ }
1484
+ const joined = { ...channel, is_member: true };
1485
+ this.state.channels.update(channel.id, joined);
1486
+ return reply({ ok: true, channel: this.channelBody(joined) });
1487
+ }
1488
+ userBody(user) {
1489
+ return {
1490
+ id: user.id,
1491
+ team_id: this.settings().teamId,
1492
+ name: user.name,
1493
+ real_name: user.real_name,
1494
+ deleted: user.deleted,
1495
+ is_bot: user.is_bot,
1496
+ tz: user.tz,
1497
+ profile: {
1498
+ real_name: user.real_name,
1499
+ display_name: user.name,
1500
+ ...user.email !== null ? { email: user.email } : {}
1501
+ }
1502
+ };
1503
+ }
1504
+ userInfo(args) {
1505
+ const id = str(args.user);
1506
+ const user = id ? this.state.users.get(id) : void 0;
1507
+ if (!user) throw new SlackError("user_not_found");
1508
+ return reply({ ok: true, user: this.userBody(user) });
1509
+ }
1510
+ lookupByEmail(args) {
1511
+ const email = str(args.email);
1512
+ if (!email) throw new SlackError("invalid_arguments");
1513
+ const user = this.state.findUserByEmail(email);
1514
+ if (!user) throw new SlackError("users_not_found");
1515
+ return reply({ ok: true, user: this.userBody(user) });
1516
+ }
1517
+ fileBody(file) {
1518
+ const settings = this.settings();
1519
+ const base = `https://files.slack.com/files-pri/${settings.teamId}-${file.id}`;
1520
+ return {
1521
+ ...file,
1522
+ url_private: `${base}/${encodeURIComponent(file.name)}`,
1523
+ url_private_download: `${base}/download/${encodeURIComponent(file.name)}`,
1524
+ permalink: `https://${settings.teamDomain}.slack.com/files/${settings.botUserId}/${file.id}/${encodeURIComponent(file.name)}`
1525
+ };
1526
+ }
1527
+ fileInfo(args) {
1528
+ const id = str(args.file);
1529
+ const file = id ? this.state.files.get(id) : void 0;
1530
+ if (!file) throw new SlackError("file_not_found");
1531
+ return reply({ ok: true, file: this.fileBody(file) });
1532
+ }
1533
+ /**
1534
+ * `apps.connections.open`. The app token must be an `Authorization: Bearer xapp-…` header
1535
+ * (Slack rejects a body token). The WebSocket URL is on this same host; the Node server
1536
+ * accepts it. `@slack/socket-mode@2.0.4` reconnects by calling this method again — it does
1537
+ * not read a URL out of a `disconnect` envelope, and Slack's documented envelope has none.
1538
+ */
1539
+ connectionsOpen(context) {
1540
+ const limited = (0, service_exports.faultEffect)(context.request, "connections_open_429");
1541
+ if (limited) {
1542
+ const retryAfter = String(typeof limited.retryAfter === "number" ? limited.retryAfter : 1);
1543
+ return (0, service_exports.jsonRes)(429, { ok: false, error: "ratelimited" }, { "retry-after": retryAfter });
1544
+ }
1545
+ const broken = (0, service_exports.faultEffect)(context.request, "connections_open_5xx");
1546
+ if (broken) {
1547
+ const status = typeof broken.status === "number" ? broken.status : 500;
1548
+ const code = status === 503 ? "service_unavailable" : "internal_error";
1549
+ return (0, service_exports.jsonRes)(status, { ok: false, error: code });
1550
+ }
1551
+ if ((0, service_exports.faultEffect)(context.request, "connections_open_invalid_auth") !== void 0) {
1552
+ return fail("invalid_auth");
1553
+ }
1554
+ const token = (0, service_exports.bearerToken)(context.request);
1555
+ if (!token) return fail("not_authed");
1556
+ if (/^xox[abp]-/.test(token)) return fail("not_allowed_token_type");
1557
+ if (!APP_TOKEN.test(token)) return fail("invalid_auth");
1558
+ const settings = this.settings();
1559
+ if (settings.revokedAppTokens.includes(token)) return fail("token_revoked");
1560
+ if (settings.appTokens.length > 0 && !settings.appTokens.includes(token)) {
1561
+ return fail("invalid_auth");
1562
+ }
1563
+ const latency = (0, service_exports.faultEffect)(context.request, "socket_hello_latency");
1564
+ const helloLatencyMs = latency === void 0 ? 0 : typeof latency.latencyMs === "number" ? latency.latencyMs : typeof latency.delayMs === "number" ? latency.delayMs : 0;
1565
+ const issued2 = issueSocketTicket({
1566
+ namespace: this.namespaceName,
1567
+ appId: settings.appId,
1568
+ helloLatencyMs,
1569
+ closeAfterHello: (0, service_exports.faultEffect)(context.request, "socket_close_after_hello") !== void 0,
1570
+ abnormalClose: (0, service_exports.faultEffect)(context.request, "socket_abnormal_close") !== void 0,
1571
+ lifetimeMs: settings.socketLifetimeMs
1572
+ });
1573
+ const host = context.request.headers.get("host") ?? context.url.host;
1574
+ const forwarded = context.request.headers.get("x-forwarded-proto");
1575
+ const scheme = forwarded === "https" || context.url.protocol === "https:" ? "wss" : "ws";
1576
+ const url = `${scheme}://${host}/link/?ticket=${encodeURIComponent(issued2.ticket)}&app_id=${encodeURIComponent(settings.appId)}`;
1577
+ const contentType = context.request.headers.get("content-type") ?? "";
1578
+ const json2 = contentType.includes("application/json");
1579
+ const response = (0, service_exports.jsonRes)(
1580
+ 200,
1581
+ json2 && !/charset=/i.test(contentType) ? {
1582
+ ok: true,
1583
+ url,
1584
+ warning: "missing_charset",
1585
+ response_metadata: { warnings: ["missing_charset"] }
1586
+ } : { ok: true, url }
1587
+ );
1588
+ return (0, service_exports.annotateResponse)(response, { ids: { app_id: settings.appId } });
1589
+ }
1590
+ openView(args) {
1591
+ if (!str(args.trigger_id)) throw new SlackError("invalid_arguments");
1592
+ const view = args.view;
1593
+ if (!isRecord3(view) || view.type !== "modal" && view.type !== "home") {
1594
+ throw new SlackError("invalid_arguments", {
1595
+ response_metadata: { messages: ["[ERROR] view.type must be modal"] }
1596
+ });
1597
+ }
1598
+ const settings = this.settings();
1599
+ const seq = this.state.views.nextSequence();
1600
+ const id = `V${(0, service_exports.opaqueToken)(`view:${seq}`, 10).toUpperCase()}`;
1601
+ const stored = {
1602
+ ...view,
1603
+ id,
1604
+ team_id: settings.teamId,
1605
+ state: { values: {} },
1606
+ hash: `${Math.floor(this.now() / 1e3)}.${(0, service_exports.opaqueToken)(`hash:${seq}`, 8)}`,
1607
+ app_id: settings.appId,
1608
+ bot_id: settings.botId,
1609
+ blocks: Array.isArray(view.blocks) ? view.blocks : []
1610
+ };
1611
+ this.state.views.insert(id, stored);
1612
+ return reply({ ok: true, view: stored }, { ids: { view: id } });
1613
+ }
1614
+ };
1615
+
1616
+ export {
1617
+ document,
1618
+ operationIds,
1619
+ supportedOperationIds,
1620
+ claimSocketTicket,
1621
+ openSocketCount,
1622
+ bindSocketTransport,
1623
+ unbindSocketTransport,
1624
+ markSocketClosed,
1625
+ DEFAULT_SETTINGS,
1626
+ DEFAULT_CHANNELS,
1627
+ DEFAULT_USERS,
1628
+ DEFAULT_FILES,
1629
+ SLACK_PRESETS,
1630
+ createRuntime2 as createRuntime,
1631
+ SLACK_NAMESPACE,
1632
+ slackCredential,
1633
+ SlackAPI
1634
+ };
1635
+ //# sourceMappingURL=chunk-JBHAW5J2.js.map