@distilled.cloud/slack 1.0.0-rc.15 → 1.0.0-rc.16
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/credentials.d.ts +1 -1
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +39 -34
- package/lib/credentials.js.map +1 -1
- package/lib/errors.d.ts +31 -31
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +41 -41
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +9 -9
- package/lib/pagination.d.ts +2 -2
- package/lib/pagination.js +28 -28
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +61 -59
- package/lib/protocol.js.map +1 -1
- package/lib/retry.d.ts +2 -2
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +34 -33
- package/lib/retry.js.map +1 -1
- package/lib/services/admin.d.ts +123 -575
- package/lib/services/admin.d.ts.map +1 -1
- package/lib/services/admin.js +304 -2878
- package/lib/services/agents.d.ts +13 -55
- package/lib/services/agents.d.ts.map +1 -1
- package/lib/services/agents.js +48 -309
- package/lib/services/api.d.ts +0 -4
- package/lib/services/api.d.ts.map +1 -1
- package/lib/services/api.js +16 -18
- package/lib/services/apps.d.ts +25 -106
- package/lib/services/apps.d.ts.map +1 -1
- package/lib/services/apps.js +84 -509
- package/lib/services/assistant.d.ts +6 -40
- package/lib/services/assistant.d.ts.map +1 -1
- package/lib/services/assistant.js +33 -204
- package/lib/services/auth.d.ts +4 -15
- package/lib/services/auth.d.ts.map +1 -1
- package/lib/services/auth.js +22 -90
- package/lib/services/blocks.d.ts +1 -7
- package/lib/services/blocks.d.ts.map +1 -1
- package/lib/services/blocks.js +16 -21
- package/lib/services/bookmarks.d.ts +4 -15
- package/lib/services/bookmarks.d.ts.map +1 -1
- package/lib/services/bookmarks.js +27 -76
- package/lib/services/bots.d.ts +1 -9
- package/lib/services/bots.d.ts.map +1 -1
- package/lib/services/bots.js +17 -54
- package/lib/services/calls.d.ts +6 -22
- package/lib/services/calls.d.ts.map +1 -1
- package/lib/services/calls.js +35 -110
- package/lib/services/canvases.d.ts +7 -35
- package/lib/services/canvases.d.ts.map +1 -1
- package/lib/services/canvases.js +39 -135
- package/lib/services/chat.d.ts +14 -83
- package/lib/services/chat.d.ts.map +1 -1
- package/lib/services/chat.js +59 -381
- package/lib/services/conversations.d.ts +31 -116
- package/lib/services/conversations.d.ts.map +1 -1
- package/lib/services/conversations.js +94 -690
- package/lib/services/dialog.d.ts +1 -4
- package/lib/services/dialog.d.ts.map +1 -1
- package/lib/services/dialog.js +13 -17
- package/lib/services/dnd.d.ts +5 -17
- package/lib/services/dnd.d.ts.map +1 -1
- package/lib/services/dnd.js +26 -91
- package/lib/services/emoji.d.ts +1 -8
- package/lib/services/emoji.d.ts.map +1 -1
- package/lib/services/emoji.js +18 -29
- package/lib/services/entity.d.ts +4 -16
- package/lib/services/entity.d.ts.map +1 -1
- package/lib/services/entity.js +29 -71
- package/lib/services/files.d.ts +16 -80
- package/lib/services/files.d.ts.map +1 -1
- package/lib/services/files.js +75 -433
- package/lib/services/functions.d.ts +8 -49
- package/lib/services/functions.d.ts.map +1 -1
- package/lib/services/functions.js +45 -203
- package/lib/services/lists.d.ts +13 -55
- package/lib/services/lists.d.ts.map +1 -1
- package/lib/services/lists.js +53 -248
- package/lib/services/migration.d.ts +1 -7
- package/lib/services/migration.d.ts.map +1 -1
- package/lib/services/migration.js +18 -27
- package/lib/services/oauth.d.ts +7 -43
- package/lib/services/oauth.d.ts.map +1 -1
- package/lib/services/oauth.js +34 -289
- package/lib/services/openid.d.ts +3 -10
- package/lib/services/openid.d.ts.map +1 -1
- package/lib/services/openid.js +19 -79
- package/lib/services/pins.d.ts +3 -13
- package/lib/services/pins.d.ts.map +1 -1
- package/lib/services/pins.js +27 -61
- package/lib/services/reactions.d.ts +5 -17
- package/lib/services/reactions.d.ts.map +1 -1
- package/lib/services/reactions.js +30 -96
- package/lib/services/reminders.d.ts +5 -17
- package/lib/services/reminders.d.ts.map +1 -1
- package/lib/services/reminders.js +33 -83
- package/lib/services/rtm.d.ts +2 -11
- package/lib/services/rtm.d.ts.map +1 -1
- package/lib/services/rtm.js +22 -56
- package/lib/services/search.d.ts +4 -35
- package/lib/services/search.d.ts.map +1 -1
- package/lib/services/search.js +28 -167
- package/lib/services/stars.d.ts +4 -26
- package/lib/services/stars.d.ts.map +1 -1
- package/lib/services/stars.js +28 -128
- package/lib/services/team.d.ts +11 -63
- package/lib/services/team.d.ts.map +1 -1
- package/lib/services/team.js +45 -289
- package/lib/services/tooling.d.ts +2 -5
- package/lib/services/tooling.d.ts.map +1 -1
- package/lib/services/tooling.js +15 -28
- package/lib/services/usergroups.d.ts +7 -31
- package/lib/services/usergroups.d.ts.map +1 -1
- package/lib/services/usergroups.js +40 -146
- package/lib/services/users.d.ts +14 -48
- package/lib/services/users.d.ts.map +1 -1
- package/lib/services/users.js +54 -249
- package/lib/services/views.d.ts +4 -14
- package/lib/services/views.d.ts.map +1 -1
- package/lib/services/views.js +28 -73
- package/lib/services/workflows.d.ts +8 -51
- package/lib/services/workflows.d.ts.map +1 -1
- package/lib/services/workflows.js +37 -188
- package/lib/traits.d.ts +1 -1
- package/lib/traits.js +8 -8
- package/package.json +14 -10
- package/src/credentials.ts +20 -21
- package/src/errors.ts +31 -27
- package/src/index.ts +1 -1
- package/src/pagination.ts +2 -2
- package/src/protocol.ts +30 -29
- package/src/retry.ts +6 -6
- package/src/services/admin.ts +2717 -3451
- package/src/services/agents.ts +380 -370
- package/src/services/api.ts +31 -21
- package/src/services/apps.ts +569 -621
- package/src/services/assistant.ts +235 -270
- package/src/services/auth.ts +118 -100
- package/src/services/blocks.ts +33 -29
- package/src/services/bookmarks.ts +101 -83
- package/src/services/bots.ts +74 -67
- package/src/services/calls.ts +118 -124
- package/src/services/canvases.ts +171 -178
- package/src/services/chat.ts +428 -496
- package/src/services/conversations.ts +675 -761
- package/src/services/dialog.ts +30 -17
- package/src/services/dnd.ts +125 -99
- package/src/services/emoji.ts +46 -42
- package/src/services/entity.ts +94 -92
- package/src/services/files.ts +536 -531
- package/src/services/functions.ts +209 -274
- package/src/services/lists.ts +289 -304
- package/src/services/migration.ts +39 -37
- package/src/services/oauth.ts +345 -361
- package/src/services/openid.ts +137 -122
- package/src/services/pins.ts +83 -70
- package/src/services/reactions.ts +119 -103
- package/src/services/reminders.ts +112 -90
- package/src/services/rtm.ts +73 -65
- package/src/services/search.ts +193 -244
- package/src/services/stars.ts +101 -160
- package/src/services/team.ts +333 -369
- package/src/services/tooling.ts +43 -30
- package/src/services/usergroups.ts +175 -179
- package/src/services/users.ts +301 -268
- package/src/services/views.ts +85 -80
- package/src/services/workflows.ts +184 -269
- package/src/traits.ts +1 -1
- package/lib/protocol.test.d.ts +0 -2
- package/lib/protocol.test.d.ts.map +0 -1
- package/lib/protocol.test.js +0 -288
- package/lib/protocol.test.js.map +0 -1
- package/lib/services/admin.js.map +0 -1
- package/lib/services/agents.js.map +0 -1
- package/lib/services/api.js.map +0 -1
- package/lib/services/apps.js.map +0 -1
- package/lib/services/assistant.js.map +0 -1
- package/lib/services/auth.js.map +0 -1
- package/lib/services/blocks.js.map +0 -1
- package/lib/services/bookmarks.js.map +0 -1
- package/lib/services/bots.js.map +0 -1
- package/lib/services/calls.js.map +0 -1
- package/lib/services/canvases.js.map +0 -1
- package/lib/services/chat.js.map +0 -1
- package/lib/services/conversations.js.map +0 -1
- package/lib/services/dialog.js.map +0 -1
- package/lib/services/dnd.js.map +0 -1
- package/lib/services/emoji.js.map +0 -1
- package/lib/services/entity.js.map +0 -1
- package/lib/services/files.js.map +0 -1
- package/lib/services/functions.js.map +0 -1
- package/lib/services/lists.js.map +0 -1
- package/lib/services/migration.js.map +0 -1
- package/lib/services/oauth.js.map +0 -1
- package/lib/services/openid.js.map +0 -1
- package/lib/services/pins.js.map +0 -1
- package/lib/services/reactions.js.map +0 -1
- package/lib/services/reminders.js.map +0 -1
- package/lib/services/rtm.js.map +0 -1
- package/lib/services/search.js.map +0 -1
- package/lib/services/stars.js.map +0 -1
- package/lib/services/team.js.map +0 -1
- package/lib/services/tooling.js.map +0 -1
- package/lib/services/usergroups.js.map +0 -1
- package/lib/services/users.js.map +0 -1
- package/lib/services/views.js.map +0 -1
- package/lib/services/workflows.js.map +0 -1
- package/src/protocol.test.ts +0 -372
package/lib/credentials.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface Config {
|
|
|
12
12
|
readonly apiBaseUrl: string;
|
|
13
13
|
}
|
|
14
14
|
declare const Credentials_base: Context.ServiceClass<Credentials, "SlackCredentials", Effect.Effect<Config, never, never>>;
|
|
15
|
-
export declare class Credentials extends Credentials_base {
|
|
15
|
+
export declare class Credentials extends /*@__PURE__*/ Credentials_base {
|
|
16
16
|
}
|
|
17
17
|
export declare const CredentialsFromEnv: Layer.Layer<Credentials, never, never>;
|
|
18
18
|
/**
|
package/lib/credentials.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,
|
|
1
|
+
{"version":3,"file":"credentials.d.ts","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAE5D,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;;AAED,qBAAa,WACX,SAAQ,aAAa,CAAC,gBAAyE;CAAG;AAapG,eAAO,MAAM,kBAAkB,wCAe9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,WAAW,WAAY;IAClC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAOxB,CAAC"}
|
package/lib/credentials.js
CHANGED
|
@@ -1,51 +1,56 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
import * as EffectConfig from "@distilled.cloud/core/config";
|
|
1
21
|
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
2
|
-
/**
|
|
3
|
-
* Slack credentials — hand-written.
|
|
4
|
-
*
|
|
5
|
-
* The `Credentials` service resolves `{ token, apiBaseUrl }` per request; the
|
|
6
|
-
* protocol layer formats the `Authorization: Bearer <token>` header from it.
|
|
7
|
-
*
|
|
8
|
-
* Slack authorizes Web API calls with one bearer token, and the token's
|
|
9
|
-
* PREFIX carries its kind (https://docs.slack.dev/authentication/tokens):
|
|
10
|
-
* • `xoxb-…` — a bot token (what almost every integration uses)
|
|
11
|
-
* • `xoxp-…` — a user token, for calls made on behalf of a user
|
|
12
|
-
* • `xoxe.xoxb-…` / `xoxe.xoxp-…` — rotating (expiring) variants
|
|
13
|
-
* • `xapp-…` — an app-level token (Socket Mode / `apps.connections.open`)
|
|
14
|
-
* The header is the same for all of them, so there is no token-type knob.
|
|
15
|
-
*
|
|
16
|
-
* The OAuth exchange methods (`oauth.v2.access`, `openid.connect.token`, …)
|
|
17
|
-
* authenticate with `client_id`/`client_secret` args instead of a token — for
|
|
18
|
-
* those, an empty-string token is allowed and the protocol simply omits the
|
|
19
|
-
* Authorization header.
|
|
20
|
-
*/
|
|
21
|
-
import * as EffectConfig from "effect/Config";
|
|
22
22
|
import * as Context from "effect/Context";
|
|
23
23
|
import * as Effect from "effect/Effect";
|
|
24
24
|
import * as Layer from "effect/Layer";
|
|
25
25
|
import * as Redacted from "effect/Redacted";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
30
|
export const DEFAULT_API_BASE_URL = "https://slack.com/api";
|
|
31
|
-
export class Credentials extends Context.Service()("SlackCredentials") {
|
|
31
|
+
export class Credentials extends /*@__PURE__*/ /*@__PURE__*/ Context.Service()("SlackCredentials") {
|
|
32
32
|
}
|
|
33
|
-
const envConfig = EffectConfig.all({
|
|
33
|
+
const envConfig = /*@__PURE__*/ EffectConfig.all({
|
|
34
34
|
// SLACK_BOT_TOKEN is the spelling Bolt and most hosting platforms use;
|
|
35
35
|
// SLACK_TOKEN is the fallback (the node SDK's CLI convention).
|
|
36
|
-
token: EffectConfig.String("SLACK_BOT_TOKEN").pipe(
|
|
37
|
-
|
|
36
|
+
token: /*@__PURE__*/ EffectConfig.String("SLACK_BOT_TOKEN").pipe(
|
|
37
|
+
/*@__PURE__*/ EffectConfig.orElse(() => EffectConfig.String("SLACK_TOKEN"))),
|
|
38
|
+
apiBaseUrl: /*@__PURE__*/ EffectConfig.String("SLACK_API_URL").pipe(
|
|
39
|
+
/*@__PURE__*/ EffectConfig.withDefault(DEFAULT_API_BASE_URL)),
|
|
38
40
|
});
|
|
39
|
-
export const CredentialsFromEnv = Layer.succeed(Credentials,
|
|
41
|
+
export const CredentialsFromEnv = /*@__PURE__*/ Layer.succeed(Credentials,
|
|
42
|
+
/*@__PURE__*/ envConfig.pipe(
|
|
43
|
+
/*@__PURE__*/ Effect.mapError(() => new ConfigError({
|
|
40
44
|
message: "SLACK_BOT_TOKEN (or SLACK_TOKEN) environment variable is required",
|
|
41
|
-
})),
|
|
45
|
+
})),
|
|
46
|
+
/*@__PURE__*/ Effect.map(({ token, apiBaseUrl }) => ({
|
|
42
47
|
token: Redacted.make(token),
|
|
43
48
|
apiBaseUrl,
|
|
44
49
|
})), Effect.orDie));
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
49
54
|
export const credentials = (config) => Layer.succeed(Credentials, Effect.succeed({
|
|
50
55
|
token: config.token,
|
|
51
56
|
apiBaseUrl: config.apiBaseUrl ?? DEFAULT_API_BASE_URL,
|
package/lib/credentials.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,YAAY,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAC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A4B,EAAE,CAC7B,KAAK,CAAC,OAAO,CACX,WAAW,EACX,MAAM,CAAC,OAAO,CAAC;IACb,KAAK,EAAE,MAAM,CAAC,KAAK;IACnB,UAAU,EAAE,MAAM,CAAC,UAAU,IAAI,oBAAoB;CACtD,CAAC,CACH,CAAC"}
|
package/lib/errors.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Slack-specific error types.
|
|
3
3
|
*
|
|
4
|
-
* Slack reports failures as `{ "ok": false, "error": "<slug>" }`
|
|
5
|
-
* with HTTP 200
|
|
4
|
+
* Slack reports failures as `{ "ok": false, "error": "<slug>" }` -- usually
|
|
5
|
+
* with HTTP 200 -- so the interesting field is the machine-readable `error`
|
|
6
6
|
* slug, not the status. The protocol maps the well-known infrastructure
|
|
7
7
|
* slugs (auth, throttling, server hiccups) onto core's shared HTTP error
|
|
8
8
|
* classes and surfaces everything else as {@link SlackError} with the slug
|
|
@@ -11,29 +11,29 @@
|
|
|
11
11
|
*/
|
|
12
12
|
export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
|
|
13
13
|
import type { DefaultErrors as CoreDefaultErrors } from "@distilled.cloud/core/errors";
|
|
14
|
-
import * as Schema from "
|
|
15
|
-
declare const SlackError_base: Schema.
|
|
16
|
-
readonly code: Schema.String;
|
|
17
|
-
readonly message: Schema.optional<Schema.String>;
|
|
18
|
-
readonly needed: Schema.optional<Schema.String>;
|
|
19
|
-
readonly provided: Schema.optional<Schema.String>;
|
|
20
|
-
readonly messages: Schema.optional<Schema.$Array<Schema.String>>;
|
|
21
|
-
}
|
|
14
|
+
import * as Schema from "@distilled.cloud/core/schema-lite-typed";
|
|
15
|
+
declare const SlackError_base: Schema.TaggedErrorClass<"SlackError", {
|
|
16
|
+
readonly code: import("effect/Schema").String;
|
|
17
|
+
readonly message: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
18
|
+
readonly needed: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
19
|
+
readonly provided: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
20
|
+
readonly messages: import("effect/Schema").optional<Schema.$Array<import("effect/Schema").String>>;
|
|
21
|
+
}>;
|
|
22
22
|
/**
|
|
23
23
|
* A Slack API error envelope: `ok: false` with a machine-readable slug.
|
|
24
|
-
* `code` is the slug (`channel_not_found`, `invalid_blocks`,
|
|
24
|
+
* `code` is the slug (`channel_not_found`, `invalid_blocks`, ...) -- the field
|
|
25
25
|
* to branch on; the per-method slugs are listed in each operation's doc
|
|
26
26
|
* comment. `needed`/`provided` carry scope detail on `missing_scope`;
|
|
27
27
|
* `messages` carries the envelope's `response_metadata.messages` (per-field
|
|
28
28
|
* validation detail on `invalid_arguments`).
|
|
29
29
|
*/
|
|
30
|
-
export declare class SlackError extends SlackError_base {
|
|
30
|
+
export declare class SlackError extends /*@__PURE__*/ SlackError_base {
|
|
31
31
|
}
|
|
32
|
-
declare const SlackRateLimited_base: Schema.
|
|
33
|
-
readonly code: Schema.String;
|
|
34
|
-
readonly message: Schema.optional<Schema.String>;
|
|
35
|
-
readonly retryAfter: Schema.optional<Schema.declare<import("effect/Duration").Duration, import("effect/Duration").Duration>>;
|
|
36
|
-
}
|
|
32
|
+
declare const SlackRateLimited_base: Schema.TaggedErrorClass<"SlackRateLimited", {
|
|
33
|
+
readonly code: import("effect/Schema").String;
|
|
34
|
+
readonly message: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
35
|
+
readonly retryAfter: import("effect/Schema").optional<import("effect/Schema").declare<import("effect/Duration").Duration, import("effect/Duration").Duration>>;
|
|
36
|
+
}> & (new (...args: any[]) => {
|
|
37
37
|
"@distilled/meta/error-categories": {
|
|
38
38
|
"@distilled/errors/retryable": true;
|
|
39
39
|
};
|
|
@@ -43,32 +43,32 @@ declare const SlackRateLimited_base: Schema.Class<SlackRateLimited, Schema.Tagge
|
|
|
43
43
|
};
|
|
44
44
|
});
|
|
45
45
|
/**
|
|
46
|
-
* Slack rate limit
|
|
46
|
+
* Slack rate limit -- a 429 or the `rate_limited`/`ratelimited` slug. Slack
|
|
47
47
|
* answers with a `Retry-After` header the default retry policy honors.
|
|
48
48
|
*/
|
|
49
|
-
export declare class SlackRateLimited extends SlackRateLimited_base {
|
|
49
|
+
export declare class SlackRateLimited extends /*@__PURE__*/ SlackRateLimited_base {
|
|
50
50
|
}
|
|
51
|
-
declare const SlackHttpError_base: Schema.
|
|
52
|
-
readonly status: Schema.Number;
|
|
53
|
-
readonly message: Schema.String;
|
|
54
|
-
readonly body: Schema.optional<Schema.String>;
|
|
55
|
-
}
|
|
51
|
+
declare const SlackHttpError_base: Schema.TaggedErrorClass<"SlackHttpError", {
|
|
52
|
+
readonly status: import("effect/Schema").Number;
|
|
53
|
+
readonly message: import("effect/Schema").String;
|
|
54
|
+
readonly body: import("effect/Schema").optional<import("effect/Schema").String>;
|
|
55
|
+
}>;
|
|
56
56
|
/**
|
|
57
|
-
* HTTP error
|
|
57
|
+
* HTTP error -- a non-2xx response without a parseable Slack error envelope
|
|
58
58
|
* (proxy pages, HTML 5xx bodies).
|
|
59
59
|
*/
|
|
60
|
-
export declare class SlackHttpError extends SlackHttpError_base {
|
|
60
|
+
export declare class SlackHttpError extends /*@__PURE__*/ SlackHttpError_base {
|
|
61
61
|
}
|
|
62
|
-
declare const SlackParseError_base: Schema.
|
|
63
|
-
readonly body: Schema.Unknown;
|
|
64
|
-
readonly cause: Schema.Unknown;
|
|
65
|
-
}
|
|
62
|
+
declare const SlackParseError_base: Schema.TaggedErrorClass<"SlackParseError", {
|
|
63
|
+
readonly body: import("effect/Schema").Unknown;
|
|
64
|
+
readonly cause: import("effect/Schema").Unknown;
|
|
65
|
+
}> & (new (...args: any[]) => {
|
|
66
66
|
"@distilled.cloud/error/categories": {
|
|
67
67
|
ParseError: true;
|
|
68
68
|
};
|
|
69
69
|
});
|
|
70
70
|
/** Schema parse error wrapper. */
|
|
71
|
-
export declare class SlackParseError extends SlackParseError_base {
|
|
71
|
+
export declare class SlackParseError extends /*@__PURE__*/ SlackParseError_base {
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Errors any Slack operation may surface in addition to the shared HTTP
|
package/lib/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEvF,OAAO,KAAK,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEvF,OAAO,KAAK,MAAM,MAAM,yCAAyC,CAAC;;;;;;;;AAElE;;;;;;;GAOG;AACH,qBAAa,UACX,SAAQ,aAAa,CAAC,eAMpB;CAAG;;;;;;;;;;;;;;AAEP;;;GAGG;AACH,qBAAa,gBACX,SAAQ,aAAa,CAAC,qBAIsD;CAAG;;;;;;AAEjF;;;GAGG;AACH,qBAAa,cACX,SAAQ,aAAa,CAAC,mBAIpB;CAAG;;;;;;;;;AAEP,kCAAkC;AAClC,qBAAa,eACX,SAAQ,aAAa,CAAC,oBAGU;CAAG;AAErC;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,gBAAgB,GAAG,cAAc,GAAG,eAAe,CAAC;AAE5F;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,YAAY,CAAC"}
|
package/lib/errors.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
12
|
export { BadGateway, BadRequest, Conflict, ConfigError, Forbidden, GatewayTimeout, InternalServerError, NotFound, ServiceUnavailable, TooManyRequests, Unauthorized, UnprocessableEntity, HTTP_STATUS_MAP, DEFAULT_ERRORS, API_ERRORS, } from "@distilled.cloud/core/errors";
|
|
13
13
|
import * as Category from "@distilled.cloud/core/category";
|
|
14
14
|
import { withCategory } from "@distilled.cloud/core/error-category";
|
|
15
15
|
import { DurationSchema, RETRYABLE } from "@distilled.cloud/core/errors";
|
|
16
|
-
import * as Schema from "
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export class SlackError extends Schema.TaggedError()("SlackError", {
|
|
16
|
+
import * as Schema from "@distilled.cloud/core/schema-lite-typed";
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
export class SlackError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("SlackError", {
|
|
26
26
|
code: Schema.String,
|
|
27
|
-
message: Schema.optional(Schema.String),
|
|
28
|
-
needed: Schema.optional(Schema.String),
|
|
29
|
-
provided: Schema.optional(Schema.String),
|
|
30
|
-
messages: Schema.optional(Schema.Array(Schema.String)),
|
|
27
|
+
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
28
|
+
needed: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
29
|
+
provided: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
30
|
+
messages: /*@__PURE__*/ Schema.optional(/*@__PURE__*/ Schema.Array(Schema.String)),
|
|
31
31
|
}) {
|
|
32
32
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
export class SlackRateLimited extends Schema.TaggedError()("SlackRateLimited", {
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
export class SlackRateLimited extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("SlackRateLimited", {
|
|
38
38
|
code: Schema.String,
|
|
39
|
-
message: Schema.optional(Schema.String),
|
|
40
|
-
retryAfter: Schema.optional(DurationSchema),
|
|
41
|
-
}).pipe(withCategory(RETRYABLE), Category.withThrottlingError) {
|
|
39
|
+
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
40
|
+
retryAfter: /*@__PURE__*/ Schema.optional(DurationSchema),
|
|
41
|
+
}).pipe(/*@__PURE__*/ withCategory(RETRYABLE), Category.withThrottlingError) {
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
export class SlackHttpError extends Schema.TaggedError()("SlackHttpError", {
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
export class SlackHttpError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("SlackHttpError", {
|
|
48
48
|
status: Schema.Number,
|
|
49
49
|
message: Schema.String,
|
|
50
|
-
body: Schema.optional(Schema.String),
|
|
50
|
+
body: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
51
51
|
}) {
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
export class SlackParseError extends Schema.TaggedError()("SlackParseError", {
|
|
53
|
+
|
|
54
|
+
export class SlackParseError extends /*@__PURE__*/ /*@__PURE__*/ Schema.TaggedError()("SlackParseError", {
|
|
55
55
|
body: Schema.Unknown,
|
|
56
56
|
cause: Schema.Unknown,
|
|
57
57
|
}).pipe(Category.withParseError) {
|
package/lib/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,UAAU,GACX,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,QAAQ,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,KAAK,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,UAAU,EACV,UAAU,EACV,QAAQ,EACR,WAAW,EACX,SAAS,EACT,cAAc,EACd,mBAAmB,EACnB,QAAQ,EACR,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAm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AO,cACX,SAAQ,aAAa,CAAb,aAAa,CAAC,MAAM,CAAC,WAAW,EAAkB,CAAC,gBAAgB,EAAE;IAC3E,MAAM,EAAE,MAAM,CAAC,MAAM;IACrB,OAAO,EAAE,MAAM,CAAC,MAAM;IACtB,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;CACnD,CAAC;CAAG;AAEP,kCAAkC;AAClC,MAAM,OAAO,eACX,SAAQ,aAAa,CAAb,aAAa,CAAC,MAAM,CAAC,WAAW,EAAmB,CAAC,iBAAiB,EAAE;IAC7E,IAAI,EAAE,MAAM,CAAC,OAAO;IACpB,KAAK,EAAE,MAAM,CAAC,OAAO;CACtB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC;CAAG"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @distilled.cloud/slack
|
|
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
5
|
* in `.generated-specs` (written by `scripts/convert.ts` from the JSON twins
|
package/lib/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
10
|
export * from "./credentials.js";
|
|
11
11
|
export * from "./errors.js";
|
|
12
12
|
export * as T from "./traits.js";
|
package/lib/pagination.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Slack pagination
|
|
2
|
+
* Slack pagination -- hand-written.
|
|
3
3
|
*
|
|
4
4
|
* Slack's cursor convention: pass `cursor` (from the previous response's
|
|
5
5
|
* `response_metadata.next_cursor`), and an EMPTY `next_cursor` means the
|
|
6
|
-
* last page
|
|
6
|
+
* last page -- which is exactly core's cursor traversal (`isTerminalToken`
|
|
7
7
|
* treats `""` as terminal). Paginated operations are compiled with this
|
|
8
8
|
* strategy by scripts/generate.ts from the `smithy.api#paginated` traits the
|
|
9
9
|
* converter stamps.
|
package/lib/pagination.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
25
|
import * as Pagination from "@distilled.cloud/core/pagination";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
30
|
export const slackPaginate = (operation, input, pagination) => Pagination.paginateCursor(operation, input, pagination);
|
|
31
31
|
//# sourceMappingURL=pagination.js.map
|
package/lib/protocol.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AAEjD,OAAO,EACL,WAAW,EAMZ,MAAM,8BAA8B,CAAC;AAwCtC,OAAO,KAAK,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,KAAK,eAAe,MAAM,6BAA6B,CAAC;AAGpE,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC,OAAO,EAAE,WAAW,EAAe,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EACL,KAAK,aAAa,EAKnB,MAAM,aAAa,CAAC;AAErB;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,WAAW,GAAG,eAAe,CAAC,eAAe,CAAC;AAEzF,wEAAwE;AACxE,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,UAAU,CAAC,UAAU,CAAC;AAqOjE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAOnD,CAAC"}
|