@crvouga/mockingbird-service-slack 3.1.0 → 3.2.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.
package/dist/index.d.ts CHANGED
@@ -11,9 +11,9 @@ interface FetchAPI$1 {
11
11
  }
12
12
 
13
13
  /** Bind values accepted by Mockingbird's SQLite port (matches sqlite-mem / better-sqlite3). */
14
- type SqliteValue$1 = null | number | bigint | string | Uint8Array | boolean;
14
+ type SqliteValue$2 = null | number | bigint | string | Uint8Array | boolean;
15
15
  /** Mutation counters returned by {@link SqliteStatement.run}. */
16
- type SqliteRunResult$1 = {
16
+ type SqliteRunResult$2 = {
17
17
  changes: number;
18
18
  lastInsertRowid: number | bigint;
19
19
  };
@@ -22,10 +22,10 @@ type SqliteRunResult$1 = {
22
22
  *
23
23
  * Pass bind values as rest arguments on each call (no sticky `bind()`).
24
24
  */
25
- interface SqliteStatement$1 {
26
- run(...params: SqliteValue$1[]): SqliteRunResult$1;
27
- all<T = Record<string, unknown>>(...params: SqliteValue$1[]): T[];
28
- get<T = Record<string, unknown>>(...params: SqliteValue$1[]): T | undefined;
25
+ interface SqliteStatement$2 {
26
+ run(...params: SqliteValue$2[]): SqliteRunResult$2;
27
+ all<T = Record<string, unknown>>(...params: SqliteValue$2[]): T[];
28
+ get<T = Record<string, unknown>>(...params: SqliteValue$2[]): T | undefined;
29
29
  }
30
30
  /**
31
31
  * Sync SQLite client port owned by Mockingbird.
@@ -33,54 +33,158 @@ interface SqliteStatement$1 {
33
33
  * Duck-typed so `@crvouga/mockingbird-service-sqlite` `Database`, better-sqlite3, and wrapped
34
34
  * `bun:sqlite` instances all work when they expose this surface.
35
35
  */
36
- interface SqliteClient$1 {
36
+ interface SqliteClient$2 {
37
37
  exec(sql: string): void;
38
- prepare(sql: string): SqliteStatement$1;
38
+ prepare(sql: string): SqliteStatement$2;
39
39
  transaction<T>(fn: () => T): T;
40
40
  }
41
41
 
42
- /** Every stored record carries a monotonically increasing sequence for stable ordering. */
43
- type Stored<T> = {
44
- seq: number;
45
- value: T;
46
- };
47
- type ListRecordsOptions<T> = {
48
- /** Keep only records passing the predicate. */
49
- where?: (value: T, seq: number) => boolean;
50
- /** Sort order; default newest first. */
51
- order?: "newest" | "oldest";
42
+ /** Options every provider constructor accepts. */
43
+ type APIOptions$1 = {
44
+ /** Sync SQLite client. Defaults to `@crvouga/mockingbird-service-sqlite`. */
45
+ sqlite?: SqliteClient$2;
46
+ /** Clock used for `created`-style fields. Default `Date.now`. */
47
+ now?: () => number;
48
+ /**
49
+ * Storage namespace for this instance's records. Instances sharing one SQLite
50
+ * client stay isolated when their namespaces differ. Defaults to the service name.
51
+ */
52
+ namespace?: string;
52
53
  };
53
- /**
54
- * A SQLite-backed table of JSON records addressed by id. Ordering is by insertion
55
- * sequence, never by id lexicographic order, so list semantics stay stable.
56
- */
57
- declare class Collection<T> {
58
- private readonly sqlite;
59
- /** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
60
- readonly namespace: string;
61
- /** Table name inside the namespace. Stable across resets of the rows themselves. */
62
- readonly collectionName: string;
63
- constructor(sqlite: SqliteClient$1,
64
- /** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
65
- namespace: string,
66
- /** Table name inside the namespace. Stable across resets of the rows themselves. */
67
- collectionName: string);
68
- private bumpCollectionSeq;
69
- nextSequence(): number;
70
- get(id: string): T | undefined;
71
- has(id: string): boolean;
72
- /** Insert a new record, assigning it the next sequence number. */
73
- insert(id: string, value: T): Stored<T>;
74
- /** Replace an existing record's value, keeping its position. */
75
- update(id: string, value: T): Stored<T> | undefined;
76
- delete(id: string): boolean;
77
- /** How many records the collection holds, without reading them. */
78
- count(): number;
79
- list(options?: ListRecordsOptions<T>): Array<Stored<T> & {
80
- id: string;
54
+
55
+ interface AuthUser {
56
+ login: string;
57
+ id: number;
58
+ scopes: string[];
59
+ installation?: AuthInstallation;
60
+ }
61
+ interface AuthInstallation {
62
+ installationId: number;
63
+ appId: number;
64
+ accountId: number;
65
+ accountType: "User" | "Organization";
66
+ permissions: Record<string, string>;
67
+ repositoryIds: number[];
68
+ repositorySelection: "all" | "selected";
69
+ }
70
+ interface AuthFallback {
71
+ login: string;
72
+ id: number;
73
+ scopes: string[];
74
+ }
75
+
76
+ /*! Adapted from vercel-labs/emulate (Apache-2.0), modified for Mockingbird. See port.json, LICENSE_EMULATE and THIRD_PARTY_NOTICES.md. */
77
+
78
+ interface SlackUserProfile {
79
+ display_name: string;
80
+ real_name: string;
81
+ email: string;
82
+ image_48: string;
83
+ image_192: string;
84
+ title?: string;
85
+ phone?: string;
86
+ skype?: string;
87
+ real_name_normalized?: string;
88
+ display_name_normalized?: string;
89
+ fields?: Record<string, {
90
+ value: string;
91
+ alt?: string;
92
+ label?: string;
93
+ }>;
94
+ status_text?: string;
95
+ status_emoji?: string;
96
+ status_emoji_display_info?: Record<string, unknown>[];
97
+ status_expiration?: number;
98
+ avatar_hash?: string;
99
+ start_date?: string;
100
+ pronouns?: string;
101
+ huddle_state?: string;
102
+ huddle_state_expiration_ts?: number;
103
+ first_name?: string;
104
+ last_name?: string;
105
+ image_24?: string;
106
+ image_32?: string;
107
+ image_72?: string;
108
+ image_512?: string;
109
+ }
110
+ type SlackPresence = "active" | "away";
111
+ type SlackTokenType = "bot" | "user" | "test";
112
+
113
+ interface SlackSeedConfig {
114
+ port?: number;
115
+ team?: {
116
+ name?: string;
117
+ domain?: string;
118
+ };
119
+ users?: Array<{
120
+ name: string;
121
+ real_name?: string;
122
+ email?: string;
123
+ is_admin?: boolean;
124
+ profile?: Partial<SlackUserProfile>;
125
+ presence?: SlackPresence;
126
+ }>;
127
+ channels?: Array<{
128
+ name: string;
129
+ topic?: string;
130
+ purpose?: string;
131
+ is_private?: boolean;
132
+ }>;
133
+ bots?: Array<{
134
+ name: string;
135
+ }>;
136
+ oauth_apps?: Array<{
137
+ app_id?: string;
138
+ client_id: string;
139
+ client_secret: string;
140
+ name: string;
141
+ redirect_uris: string[];
142
+ scopes?: string[] | string;
143
+ user_scopes?: string[] | string;
144
+ bot_id?: string;
145
+ bot_user_id?: string;
146
+ bot_name?: string;
147
+ }>;
148
+ tokens?: Array<{
149
+ token: string;
150
+ type?: SlackTokenType;
151
+ user?: string;
152
+ user_id?: string;
153
+ scopes?: string[] | string;
154
+ app_id?: string;
155
+ client_id?: string;
156
+ team_id?: string;
157
+ bot_id?: string;
158
+ bot_user_id?: string;
159
+ authed_user_id?: string;
160
+ }>;
161
+ incoming_webhooks?: Array<{
162
+ channel: string;
163
+ label?: string;
81
164
  }>;
165
+ strict_scopes?: boolean;
166
+ signing_secret?: string;
82
167
  }
83
168
 
169
+ type ProviderOptions = APIOptions$1 & {
170
+ baseUrl?: string;
171
+ tokens?: Record<string, AuthUser>;
172
+ fallbackUser?: AuthFallback;
173
+ publicNamespace?: string;
174
+ adminPrefix?: string;
175
+ };
176
+
177
+ type MountedAPI = FetchAPI & {
178
+ readonly prefix: string;
179
+ GET: FetchHandler;
180
+ POST: FetchHandler;
181
+ PUT: FetchHandler;
182
+ PATCH: FetchHandler;
183
+ DELETE: FetchHandler;
184
+ HEAD: FetchHandler;
185
+ OPTIONS: FetchHandler;
186
+ };
187
+
84
188
  /** A stable identifier for a point in a {@link Timeline}. */
85
189
  type CheckpointId = string;
86
190
  /** An immutable node in a timeline's checkpoint DAG. */
@@ -170,6 +274,79 @@ declare class Timeline<T> {
170
274
  interface FetchAPI {
171
275
  fetch(request: Request): Promise<Response>;
172
276
  }
277
+ /** A bare function form of {@link FetchAPI}, compatible with `Bun.serve`, workerd, and Deno. */
278
+ type FetchHandler = (request: Request) => Promise<Response>;
279
+
280
+ /** Bind values accepted by Mockingbird's SQLite port (matches sqlite-mem / better-sqlite3). */
281
+ type SqliteValue$1 = null | number | bigint | string | Uint8Array | boolean;
282
+ /** Mutation counters returned by {@link SqliteStatement.run}. */
283
+ type SqliteRunResult$1 = {
284
+ changes: number;
285
+ lastInsertRowid: number | bigint;
286
+ };
287
+ /**
288
+ * Prepared statement bound to a {@link SqliteClient}.
289
+ *
290
+ * Pass bind values as rest arguments on each call (no sticky `bind()`).
291
+ */
292
+ interface SqliteStatement$1 {
293
+ run(...params: SqliteValue$1[]): SqliteRunResult$1;
294
+ all<T = Record<string, unknown>>(...params: SqliteValue$1[]): T[];
295
+ get<T = Record<string, unknown>>(...params: SqliteValue$1[]): T | undefined;
296
+ }
297
+ /**
298
+ * Sync SQLite client port owned by Mockingbird.
299
+ *
300
+ * Duck-typed so `@crvouga/mockingbird-service-sqlite` `Database`, better-sqlite3, and wrapped
301
+ * `bun:sqlite` instances all work when they expose this surface.
302
+ */
303
+ interface SqliteClient$1 {
304
+ exec(sql: string): void;
305
+ prepare(sql: string): SqliteStatement$1;
306
+ transaction<T>(fn: () => T): T;
307
+ }
308
+
309
+ /** Every stored record carries a monotonically increasing sequence for stable ordering. */
310
+ type Stored<T> = {
311
+ seq: number;
312
+ value: T;
313
+ };
314
+ type ListRecordsOptions<T> = {
315
+ /** Keep only records passing the predicate. */
316
+ where?: (value: T, seq: number) => boolean;
317
+ /** Sort order; default newest first. */
318
+ order?: "newest" | "oldest";
319
+ };
320
+ /**
321
+ * A SQLite-backed table of JSON records addressed by id. Ordering is by insertion
322
+ * sequence, never by id lexicographic order, so list semantics stay stable.
323
+ */
324
+ declare class Collection<T> {
325
+ private readonly sqlite;
326
+ /** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
327
+ readonly namespace: string;
328
+ /** Table name inside the namespace. Stable across resets of the rows themselves. */
329
+ readonly collectionName: string;
330
+ constructor(sqlite: SqliteClient$1,
331
+ /** Storage namespace. Admin introspection uses this to ignore another namespace's tables. */
332
+ namespace: string,
333
+ /** Table name inside the namespace. Stable across resets of the rows themselves. */
334
+ collectionName: string);
335
+ private bumpCollectionSeq;
336
+ nextSequence(): number;
337
+ get(id: string): T | undefined;
338
+ has(id: string): boolean;
339
+ /** Insert a new record, assigning it the next sequence number. */
340
+ insert(id: string, value: T): Stored<T>;
341
+ /** Replace an existing record's value, keeping its position. */
342
+ update(id: string, value: T): Stored<T> | undefined;
343
+ delete(id: string): boolean;
344
+ /** How many records the collection holds, without reading them. */
345
+ count(): number;
346
+ list(options?: ListRecordsOptions<T>): Array<Stored<T> & {
347
+ id: string;
348
+ }>;
349
+ }
173
350
 
174
351
  /** Options every provider constructor accepts. */
175
352
  type APIOptions = {
@@ -612,6 +789,8 @@ type ServiceRuntime<T extends ServiceInstance> = FetchAPI & {
612
789
  /** Stop package-owned lifecycle timers when a supervisor closes the runtime. */
613
790
  stop?(): void;
614
791
  readonly name: string;
792
+ /** Same-origin Fetch handler and App Router method exports, sharing this runtime. */
793
+ mount(prefix: string): MountedAPI;
615
794
  readonly sqlite: SqliteClient$1;
616
795
  readonly clock: Clock;
617
796
  readonly faults: FaultRegistry;
@@ -1019,17 +1198,17 @@ type OpenAPIDocument = {
1019
1198
  };
1020
1199
 
1021
1200
  declare const document: OpenAPIDocument;
1022
- type OperationId = "PostIncomingWebhook" | "ChatPostMessage" | "ChatUpdate" | "ChatPostEphemeral" | "ChatGetPermalinkGet" | "ChatGetPermalink" | "ReactionsAdd" | "ReactionsRemove" | "ReactionsGetGet" | "ReactionsGet" | "AuthTestGet" | "AuthTest" | "ConversationsJoin" | "UsersInfoGet" | "UsersInfo" | "UsersLookupByEmailGet" | "UsersLookupByEmail" | "FilesInfoGet" | "FilesInfo" | "ViewsOpen" | "AppsConnectionsOpen";
1023
- type SupportedOperationId = "PostIncomingWebhook" | "ChatPostMessage" | "ChatUpdate" | "ChatPostEphemeral" | "ChatGetPermalinkGet" | "ChatGetPermalink" | "ReactionsAdd" | "ReactionsRemove" | "ReactionsGetGet" | "ReactionsGet" | "AuthTestGet" | "AuthTest" | "ConversationsJoin" | "UsersInfoGet" | "UsersInfo" | "UsersLookupByEmailGet" | "UsersLookupByEmail" | "FilesInfoGet" | "FilesInfo" | "ViewsOpen" | "AppsConnectionsOpen";
1024
- declare const operationIds: readonly ["PostIncomingWebhook", "ChatPostMessage", "ChatUpdate", "ChatPostEphemeral", "ChatGetPermalinkGet", "ChatGetPermalink", "ReactionsAdd", "ReactionsRemove", "ReactionsGetGet", "ReactionsGet", "AuthTestGet", "AuthTest", "ConversationsJoin", "UsersInfoGet", "UsersInfo", "UsersLookupByEmailGet", "UsersLookupByEmail", "FilesInfoGet", "FilesInfo", "ViewsOpen", "AppsConnectionsOpen"];
1025
- declare const supportedOperationIds: readonly ["PostIncomingWebhook", "ChatPostMessage", "ChatUpdate", "ChatPostEphemeral", "ChatGetPermalinkGet", "ChatGetPermalink", "ReactionsAdd", "ReactionsRemove", "ReactionsGetGet", "ReactionsGet", "AuthTestGet", "AuthTest", "ConversationsJoin", "UsersInfoGet", "UsersInfo", "UsersLookupByEmailGet", "UsersLookupByEmail", "FilesInfoGet", "FilesInfo", "ViewsOpen", "AppsConnectionsOpen"];
1201
+ type OperationId = "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";
1202
+ type SupportedOperationId = "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";
1203
+ declare const operationIds: readonly ["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"];
1204
+ declare const supportedOperationIds: readonly ["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"];
1026
1205
 
1027
1206
  /**
1028
1207
  * Every named Slack misbehaviour our consumers branch on, switched on with
1029
1208
  * `POST /__admin/faults {"preset": "<name>"}` (add `count` to limit it, `params` to tune it).
1030
1209
  */
1031
1210
  declare const SLACK_PRESETS: Record<string, FaultPreset>;
1032
- type SlackRuntimeOptions = {
1211
+ type SlackRuntimeOptions = Pick<SlackAPIOptions, "fixtures" | "baseUrl" | "tokens"> & {
1033
1212
  sqlite?: SqliteClient;
1034
1213
  clock?: Clock;
1035
1214
  seed?: number | string;
@@ -1047,7 +1226,8 @@ type SlackRuntime = ServiceRuntime<SlackAPI>;
1047
1226
  declare const createRuntime: (options?: SlackRuntimeOptions) => SlackRuntime;
1048
1227
 
1049
1228
  declare const SLACK_NAMESPACE = "slack";
1050
- type SlackAPIOptions = APIOptions & {
1229
+ type SlackAPIOptions = APIOptions & Pick<ProviderOptions, "tokens" | "baseUrl" | "publicNamespace" | "adminPrefix"> & {
1230
+ fixtures?: SlackSeedConfig;
1051
1231
  /** Initial per-namespace settings (workspace identity, accepted tokens, strict channels). */
1052
1232
  settings?: Partial<Settings>;
1053
1233
  /**
@@ -1071,11 +1251,14 @@ declare class SlackAPI implements FetchAPI$1 {
1071
1251
  readonly app: Hono;
1072
1252
  readonly sqlite: SqliteClient;
1073
1253
  readonly state: SlackState;
1254
+ private tail;
1255
+ private readonly expansion;
1074
1256
  private readonly service;
1075
1257
  private readonly now;
1076
1258
  private readonly namespaceName;
1077
1259
  constructor(options?: SlackAPIOptions);
1078
1260
  fetch(request: Request): Promise<Response>;
1261
+ private handleFetch;
1079
1262
  reset(): Promise<void>;
1080
1263
  /** Every message in the outbox, oldest first. */
1081
1264
  messages(): SlackMessage[];
package/dist/index.js CHANGED
@@ -11,7 +11,8 @@ import {
11
11
  operationIds,
12
12
  slackCredential,
13
13
  supportedOperationIds
14
- } from "./chunk-A2QC6SAR.js";
14
+ } from "./chunk-B4MV67Z4.js";
15
+ import "./chunk-M73LWCCP.js";
15
16
  export {
16
17
  DEFAULT_CHANNELS,
17
18
  DEFAULT_FILES,