@distilled.cloud/slack 1.0.0-rc.17 → 1.0.0-rc.19
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/lib/_bundle/sdk.js +1 -1
- package/lib/_bundle/sdk.js.map +1 -1
- package/lib/credentials.d.ts +2 -1
- package/lib/credentials.d.ts.map +1 -1
- package/lib/index.d.ts +3 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.lazy.js.map +1 -1
- package/lib/protocol.d.ts +3 -2
- package/lib/protocol.d.ts.map +1 -1
- package/lib/services/admin.d.ts +594 -356
- package/lib/services/admin.d.ts.map +1 -1
- package/lib/services/admin.js +149 -139
- package/lib/services/admin.js.map +1 -1
- package/lib/services/agents.d.ts +89 -97
- package/lib/services/agents.d.ts.map +1 -1
- package/lib/services/agents.js +1 -1
- package/lib/services/agents.js.map +1 -1
- package/lib/services/api.d.ts +2 -2
- package/lib/services/api.d.ts.map +1 -1
- package/lib/services/api.js +1 -1
- package/lib/services/api.js.map +1 -1
- package/lib/services/apps.d.ts +74 -74
- package/lib/services/apps.d.ts.map +1 -1
- package/lib/services/apps.js +34 -33
- package/lib/services/apps.js.map +1 -1
- package/lib/services/assistant.d.ts +55 -46
- package/lib/services/assistant.d.ts.map +1 -1
- package/lib/services/assistant.js +1 -1
- package/lib/services/assistant.js.map +1 -1
- package/lib/services/auth.d.ts +27 -27
- package/lib/services/auth.d.ts.map +1 -1
- package/lib/services/auth.js +1 -1
- package/lib/services/auth.js.map +1 -1
- package/lib/services/blocks.d.ts +3 -3
- package/lib/services/blocks.d.ts.map +1 -1
- package/lib/services/blocks.js +1 -1
- package/lib/services/blocks.js.map +1 -1
- package/lib/services/bookmarks.d.ts +19 -19
- package/lib/services/bookmarks.d.ts.map +1 -1
- package/lib/services/bookmarks.js +1 -1
- package/lib/services/bookmarks.js.map +1 -1
- package/lib/services/bots.d.ts +23 -23
- package/lib/services/bots.d.ts.map +1 -1
- package/lib/services/bots.js +1 -1
- package/lib/services/bots.js.map +1 -1
- package/lib/services/calls.d.ts +10 -10
- package/lib/services/calls.d.ts.map +1 -1
- package/lib/services/calls.js +1 -1
- package/lib/services/calls.js.map +1 -1
- package/lib/services/canvases.d.ts +18 -18
- package/lib/services/canvases.d.ts.map +1 -1
- package/lib/services/canvases.js +1 -1
- package/lib/services/canvases.js.map +1 -1
- package/lib/services/chat.d.ts +103 -103
- package/lib/services/chat.d.ts.map +1 -1
- package/lib/services/chat.js +1 -1
- package/lib/services/chat.js.map +1 -1
- package/lib/services/conversations.d.ts +109 -103
- package/lib/services/conversations.d.ts.map +1 -1
- package/lib/services/conversations.js +39 -38
- package/lib/services/conversations.js.map +1 -1
- package/lib/services/dialog.d.ts.map +1 -1
- package/lib/services/dialog.js +1 -1
- package/lib/services/dialog.js.map +1 -1
- package/lib/services/dnd.d.ts +14 -14
- package/lib/services/dnd.d.ts.map +1 -1
- package/lib/services/dnd.js +1 -1
- package/lib/services/dnd.js.map +1 -1
- package/lib/services/emoji.d.ts +6 -6
- package/lib/services/emoji.d.ts.map +1 -1
- package/lib/services/emoji.js +1 -1
- package/lib/services/emoji.js.map +1 -1
- package/lib/services/entity.d.ts +14 -14
- package/lib/services/entity.d.ts.map +1 -1
- package/lib/services/entity.js +1 -1
- package/lib/services/entity.js.map +1 -1
- package/lib/services/files.d.ts +106 -106
- package/lib/services/files.d.ts.map +1 -1
- package/lib/services/files.js +30 -1
- package/lib/services/files.js.map +1 -1
- package/lib/services/functions.d.ts +37 -37
- package/lib/services/functions.d.ts.map +1 -1
- package/lib/services/functions.js +1 -1
- package/lib/services/functions.js.map +1 -1
- package/lib/services/index.d.ts +1 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/index.js +1 -0
- package/lib/services/lists.d.ts +47 -45
- package/lib/services/lists.d.ts.map +1 -1
- package/lib/services/lists.js +1 -1
- package/lib/services/lists.js.map +1 -1
- package/lib/services/migration.d.ts +3 -3
- package/lib/services/migration.d.ts.map +1 -1
- package/lib/services/migration.js +1 -1
- package/lib/services/migration.js.map +1 -1
- package/lib/services/oauth.d.ts +102 -102
- package/lib/services/oauth.d.ts.map +1 -1
- package/lib/services/oauth.js +1 -1
- package/lib/services/oauth.js.map +1 -1
- package/lib/services/openid.d.ts +40 -40
- package/lib/services/openid.d.ts.map +1 -1
- package/lib/services/openid.js +1 -1
- package/lib/services/openid.js.map +1 -1
- package/lib/services/pins.d.ts +9 -9
- package/lib/services/pins.d.ts.map +1 -1
- package/lib/services/pins.js +1 -1
- package/lib/services/pins.js.map +1 -1
- package/lib/services/reactions.d.ts +23 -23
- package/lib/services/reactions.d.ts.map +1 -1
- package/lib/services/reactions.js +1 -1
- package/lib/services/reactions.js.map +1 -1
- package/lib/services/reminders.d.ts +8 -8
- package/lib/services/reminders.d.ts.map +1 -1
- package/lib/services/reminders.js +1 -1
- package/lib/services/reminders.js.map +1 -1
- package/lib/services/rtm.d.ts +11 -11
- package/lib/services/rtm.d.ts.map +1 -1
- package/lib/services/rtm.js +1 -1
- package/lib/services/rtm.js.map +1 -1
- package/lib/services/search.d.ts +84 -80
- package/lib/services/search.d.ts.map +1 -1
- package/lib/services/search.js +1 -1
- package/lib/services/search.js.map +1 -1
- package/lib/services/slackbot.d.ts +366 -0
- package/lib/services/slackbot.d.ts.map +1 -0
- package/lib/services/slackbot.js +2 -0
- package/lib/services/slackbot.js.map +1 -0
- package/lib/services/stars.d.ts +16 -16
- package/lib/services/stars.d.ts.map +1 -1
- package/lib/services/stars.js +1 -1
- package/lib/services/stars.js.map +1 -1
- package/lib/services/team.d.ts +39 -37
- package/lib/services/team.d.ts.map +1 -1
- package/lib/services/team.js +1 -1
- package/lib/services/team.js.map +1 -1
- package/lib/services/tooling.d.ts.map +1 -1
- package/lib/services/tooling.js +1 -1
- package/lib/services/tooling.js.map +1 -1
- package/lib/services/usergroups.d.ts +30 -30
- package/lib/services/usergroups.d.ts.map +1 -1
- package/lib/services/usergroups.js +1 -1
- package/lib/services/usergroups.js.map +1 -1
- package/lib/services/users.d.ts +37 -37
- package/lib/services/users.d.ts.map +1 -1
- package/lib/services/users.js +1 -1
- package/lib/services/users.js.map +1 -1
- package/lib/services/views.d.ts +9 -9
- package/lib/services/views.d.ts.map +1 -1
- package/lib/services/views.js +1 -1
- package/lib/services/views.js.map +1 -1
- package/lib/services/workflows.d.ts +16 -16
- package/lib/services/workflows.d.ts.map +1 -1
- package/lib/services/workflows.js +1 -1
- package/lib/services/workflows.js.map +1 -1
- package/lib/services.lazy/admin.js +2 -2
- package/lib/services.lazy/apps.js +1 -1
- package/lib/services.lazy/conversations.js +1 -1
- package/lib/services.lazy/files.js +3 -1
- package/lib/services.lazy/index.js +2 -2
- package/lib/services.lazy/slackbot.js +1 -0
- package/package.json +8 -7
- package/src/credentials.ts +3 -2
- package/src/index.ts +3 -4
- package/src/protocol.ts +23 -21
- package/src/services/admin.ts +1882 -1034
- package/src/services/agents.ts +128 -103
- package/src/services/api.ts +17 -2
- package/src/services/apps.ts +133 -74
- package/src/services/assistant.ts +109 -54
- package/src/services/auth.ts +46 -27
- package/src/services/blocks.ts +18 -3
- package/src/services/bookmarks.ts +40 -19
- package/src/services/bots.ts +38 -23
- package/src/services/calls.ts +35 -10
- package/src/services/canvases.ts +77 -46
- package/src/services/chat.ts +142 -103
- package/src/services/conversations.ts +195 -115
- package/src/services/dialog.ts +15 -0
- package/src/services/dnd.ts +37 -14
- package/src/services/emoji.ts +21 -6
- package/src/services/entity.ts +33 -14
- package/src/services/files.ts +149 -106
- package/src/services/functions.ts +66 -37
- package/src/services/index.ts +1 -0
- package/src/services/lists.ts +86 -46
- package/src/services/migration.ts +18 -3
- package/src/services/oauth.ts +127 -102
- package/src/services/openid.ts +57 -40
- package/src/services/pins.ts +28 -9
- package/src/services/reactions.ts +44 -23
- package/src/services/reminders.ts +31 -8
- package/src/services/rtm.ts +28 -11
- package/src/services/search.ts +142 -130
- package/src/services/slackbot.ts +766 -0
- package/src/services/stars.ts +35 -16
- package/src/services/team.ts +73 -37
- package/src/services/tooling.ts +15 -0
- package/src/services/usergroups.ts +57 -30
- package/src/services/users.ts +76 -37
- package/src/services/views.ts +30 -9
- package/src/services/workflows.ts +45 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@distilled.cloud/slack",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.19",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -66,25 +66,26 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@distilled.cloud/core": "1.0.0-rc.
|
|
69
|
+
"@distilled.cloud/core": "1.0.0-rc.19"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@
|
|
72
|
+
"@distilled.cloud/dev": "0.0.0",
|
|
73
|
+
"@effect/platform-node": "^4.1.2",
|
|
73
74
|
"@types/node": "26.6.5"
|
|
74
75
|
},
|
|
75
76
|
"peerDependencies": {
|
|
76
|
-
"effect": "^4.
|
|
77
|
+
"effect": "^4.1.2"
|
|
77
78
|
},
|
|
78
79
|
"distilled": {
|
|
79
|
-
"generatedAt": "2026-10
|
|
80
|
-
"specUpdatedAt": "2026-
|
|
80
|
+
"generatedAt": "2026-11-10",
|
|
81
|
+
"specUpdatedAt": "2026-11-07"
|
|
81
82
|
},
|
|
82
83
|
"scripts": {
|
|
83
84
|
"build": "tsrs -b",
|
|
84
85
|
"specs:fetch": "git submodule update --force --init --depth=1 specs/spec-mirror-slack",
|
|
85
86
|
"specs:update": "git submodule update --remote --force --depth=1 specs/spec-mirror-slack",
|
|
86
87
|
"convert": "node --conditions=bun scripts/convert.ts",
|
|
87
|
-
"generate": "node --conditions=bun scripts/
|
|
88
|
+
"generate": "node --conditions=bun scripts/generate.ts",
|
|
88
89
|
"typecheck": "tsrs -p tsconfig.json"
|
|
89
90
|
}
|
|
90
91
|
}
|
package/src/credentials.ts
CHANGED
|
@@ -36,7 +36,9 @@ export interface Config {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
export class Credentials
|
|
39
|
-
extends /*@__PURE__*/ Context.Service<Credentials, Effect.Effect<Config>>()(
|
|
39
|
+
extends /*@__PURE__*/ Context.Service<Credentials, Effect.Effect<Config, ConfigError>>()(
|
|
40
|
+
"SlackCredentials",
|
|
41
|
+
) {}
|
|
40
42
|
|
|
41
43
|
const envConfig = /*@__PURE__*/ EffectConfig.all({
|
|
42
44
|
// SLACK_BOT_TOKEN is the spelling Bolt and most hosting platforms use;
|
|
@@ -62,7 +64,6 @@ export const CredentialsFromEnv = /*@__PURE__*/ Layer.succeed(
|
|
|
62
64
|
token: Redacted.make(token),
|
|
63
65
|
apiBaseUrl,
|
|
64
66
|
})),
|
|
65
|
-
Effect.orDie,
|
|
66
67
|
),
|
|
67
68
|
);
|
|
68
69
|
|
package/src/index.ts
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
* @distilled.cloud/slack -- Slack Web API SDK for Effect.
|
|
3
3
|
*
|
|
4
4
|
* `./services` is generated by `scripts/generate.ts` from the Smithy models
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* hand-written.
|
|
5
|
+
* that `scripts/convert.ts` converts from the JSON twins of the docs.slack.dev
|
|
6
|
+
* method reference, which the spec mirror `specs/spec-mirror-slack` snapshots.
|
|
7
|
+
* Everything else in this folder is hand-written.
|
|
9
8
|
*/
|
|
10
9
|
export * from "./credentials.ts";
|
|
11
10
|
export * from "./errors.ts";
|
package/src/protocol.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as API from "@distilled.cloud/core/api";
|
|
2
|
-
import { debugHttp } from "@distilled.cloud/core/debug";
|
|
3
2
|
import {
|
|
4
3
|
ConfigError,
|
|
5
4
|
GatewayTimeout,
|
|
@@ -7,6 +6,7 @@ import {
|
|
|
7
6
|
InternalServerError,
|
|
8
7
|
ServiceUnavailable,
|
|
9
8
|
Unauthorized,
|
|
9
|
+
type InvalidInput,
|
|
10
10
|
} from "@distilled.cloud/core/errors";
|
|
11
11
|
import {
|
|
12
12
|
buildRequest,
|
|
@@ -16,9 +16,9 @@ import {
|
|
|
16
16
|
mapKeys,
|
|
17
17
|
matchTypedError,
|
|
18
18
|
} from "@distilled.cloud/core/protocol-http";
|
|
19
|
-
import { unwrapRedactedDeep,
|
|
20
|
-
import { validateResponse } from "@distilled.cloud/core/response-validation";
|
|
19
|
+
import { unwrapRedactedDeep, validateSuccess } from "@distilled.cloud/core/protocol-rest";
|
|
21
20
|
import { parseRetryAfterForStatus, parseServerRetryHint } from "@distilled.cloud/core/retry-after";
|
|
21
|
+
import type { SdkError } from "@distilled.cloud/core/sdk-error";
|
|
22
22
|
import { httpSymbol, querySymbol, type HttpTrait } from "@distilled.cloud/core/trait";
|
|
23
23
|
/**
|
|
24
24
|
* SlackProtocol -- hand-written.
|
|
@@ -69,7 +69,12 @@ import {
|
|
|
69
69
|
* SlackOpContext>` explicitly so the compiler never infers these back out of
|
|
70
70
|
* the schema generics.
|
|
71
71
|
*/
|
|
72
|
-
export type SlackOpError =
|
|
72
|
+
export type SlackOpError =
|
|
73
|
+
| DefaultErrors
|
|
74
|
+
| ConfigError
|
|
75
|
+
| HttpClientError.HttpClientError
|
|
76
|
+
| InvalidInput
|
|
77
|
+
| SdkError;
|
|
73
78
|
|
|
74
79
|
/** Context (requirements) shared by every generated Slack operation. */
|
|
75
80
|
export type SlackOpContext = Credentials | HttpClient.HttpClient;
|
|
@@ -153,7 +158,7 @@ const encode = ({ input, inputAst }: { readonly input: unknown; readonly inputAs
|
|
|
153
158
|
const resolveCredentials = yield* Credentials;
|
|
154
159
|
const creds = yield* resolveCredentials as Effect.Effect<Config>;
|
|
155
160
|
const token = Redacted.value(creds.token);
|
|
156
|
-
return buildRequest({
|
|
161
|
+
return yield* buildRequest({
|
|
157
162
|
input: serializeForWire(unwrapRedactedDeep(input), inputAst),
|
|
158
163
|
inputAst,
|
|
159
164
|
baseUrl: creds.apiBaseUrl,
|
|
@@ -176,13 +181,11 @@ const decode = ({
|
|
|
176
181
|
// Read as BYTES first: the analytics export answers a successful call
|
|
177
182
|
// with a gzipped file, which a text read would corrupt. Everything else
|
|
178
183
|
// decodes from the same buffer.
|
|
179
|
-
const bytes = new Uint8Array(yield* response.arrayBuffer.pipe(Effect.
|
|
184
|
+
const bytes = new Uint8Array(yield* response.arrayBuffer.pipe(Effect.catch(fail)));
|
|
180
185
|
const text = new TextDecoder().decode(bytes);
|
|
181
|
-
if (debugHttp()) {
|
|
182
|
-
console.error(`[distilled] <- ${response.status} ${text.slice(0, 400)}`);
|
|
183
|
-
}
|
|
184
186
|
|
|
185
187
|
let json: Record<string, unknown> | undefined;
|
|
188
|
+
let nonJson = false;
|
|
186
189
|
if (text.trim().length > 0) {
|
|
187
190
|
try {
|
|
188
191
|
const parsed = JSON.parse(text);
|
|
@@ -191,6 +194,7 @@ const decode = ({
|
|
|
191
194
|
}
|
|
192
195
|
} catch {
|
|
193
196
|
// non-JSON -- a binary success payload or an HTML error page
|
|
197
|
+
nonJson = true;
|
|
194
198
|
}
|
|
195
199
|
}
|
|
196
200
|
const status = response.status;
|
|
@@ -281,24 +285,22 @@ const decode = ({
|
|
|
281
285
|
// Successful non-JSON body: raw bytes (the analytics file download --
|
|
282
286
|
// modeled as a Document output, so the bytes pass through verbatim).
|
|
283
287
|
// Strict mode fails them for every other (struct) output.
|
|
284
|
-
|
|
285
|
-
return yield* validateResponse(
|
|
286
|
-
outputAst,
|
|
287
|
-
bytes,
|
|
288
|
-
(cause) => new SlackParseError({ body: text, cause }),
|
|
289
|
-
).pipe(Effect.catch(fail));
|
|
290
|
-
}
|
|
291
|
-
|
|
288
|
+
//
|
|
292
289
|
// 2xx envelope: the body IS the payload (`ok` rides along as a modeled
|
|
293
290
|
// member). Wire->TS key mapping is schema-driven; sensitive members
|
|
294
291
|
// (OAuth access/refresh tokens) wrap in Redacted. Strict mode checks the
|
|
295
292
|
// mapped payload against the output schema first.
|
|
296
|
-
|
|
293
|
+
//
|
|
294
|
+
// Either way, parse errors withhold a body that can hold a secret, and a
|
|
295
|
+
// body that is not JSON at all fails for such an output in every mode
|
|
296
|
+
// (core `validateSuccess`).
|
|
297
|
+
return yield* validateSuccess(
|
|
297
298
|
outputAst,
|
|
298
|
-
|
|
299
|
-
|
|
299
|
+
json === undefined
|
|
300
|
+
? { value: bytes, body: text, nonJson }
|
|
301
|
+
: { value: mapKeys(outputAst, json, "decode"), body: json, nonJson },
|
|
302
|
+
(info) => new SlackParseError(info),
|
|
300
303
|
).pipe(Effect.catch(fail));
|
|
301
|
-
return wrapSensitive(outputAst, mapped);
|
|
302
304
|
});
|
|
303
305
|
|
|
304
306
|
export const SlackProtocol: Layer.Layer<API.Protocol> = /*@__PURE__*/ Layer.succeed(
|