@distilled.cloud/slack 1.0.0-rc.14 → 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.
Files changed (209) hide show
  1. package/lib/credentials.d.ts +1 -1
  2. package/lib/credentials.d.ts.map +1 -1
  3. package/lib/credentials.js +39 -34
  4. package/lib/credentials.js.map +1 -1
  5. package/lib/errors.d.ts +31 -31
  6. package/lib/errors.d.ts.map +1 -1
  7. package/lib/errors.js +41 -41
  8. package/lib/errors.js.map +1 -1
  9. package/lib/index.d.ts +1 -1
  10. package/lib/index.js +9 -9
  11. package/lib/pagination.d.ts +2 -2
  12. package/lib/pagination.js +28 -28
  13. package/lib/protocol.d.ts.map +1 -1
  14. package/lib/protocol.js +61 -59
  15. package/lib/protocol.js.map +1 -1
  16. package/lib/retry.d.ts +2 -2
  17. package/lib/retry.d.ts.map +1 -1
  18. package/lib/retry.js +34 -33
  19. package/lib/retry.js.map +1 -1
  20. package/lib/services/admin.d.ts +123 -575
  21. package/lib/services/admin.d.ts.map +1 -1
  22. package/lib/services/admin.js +304 -2878
  23. package/lib/services/agents.d.ts +13 -55
  24. package/lib/services/agents.d.ts.map +1 -1
  25. package/lib/services/agents.js +48 -309
  26. package/lib/services/api.d.ts +0 -4
  27. package/lib/services/api.d.ts.map +1 -1
  28. package/lib/services/api.js +16 -18
  29. package/lib/services/apps.d.ts +25 -106
  30. package/lib/services/apps.d.ts.map +1 -1
  31. package/lib/services/apps.js +84 -509
  32. package/lib/services/assistant.d.ts +6 -40
  33. package/lib/services/assistant.d.ts.map +1 -1
  34. package/lib/services/assistant.js +33 -204
  35. package/lib/services/auth.d.ts +4 -15
  36. package/lib/services/auth.d.ts.map +1 -1
  37. package/lib/services/auth.js +22 -90
  38. package/lib/services/blocks.d.ts +1 -7
  39. package/lib/services/blocks.d.ts.map +1 -1
  40. package/lib/services/blocks.js +16 -21
  41. package/lib/services/bookmarks.d.ts +4 -15
  42. package/lib/services/bookmarks.d.ts.map +1 -1
  43. package/lib/services/bookmarks.js +27 -76
  44. package/lib/services/bots.d.ts +1 -9
  45. package/lib/services/bots.d.ts.map +1 -1
  46. package/lib/services/bots.js +17 -54
  47. package/lib/services/calls.d.ts +6 -22
  48. package/lib/services/calls.d.ts.map +1 -1
  49. package/lib/services/calls.js +35 -110
  50. package/lib/services/canvases.d.ts +7 -35
  51. package/lib/services/canvases.d.ts.map +1 -1
  52. package/lib/services/canvases.js +39 -135
  53. package/lib/services/chat.d.ts +14 -83
  54. package/lib/services/chat.d.ts.map +1 -1
  55. package/lib/services/chat.js +59 -381
  56. package/lib/services/conversations.d.ts +31 -116
  57. package/lib/services/conversations.d.ts.map +1 -1
  58. package/lib/services/conversations.js +94 -690
  59. package/lib/services/dialog.d.ts +1 -4
  60. package/lib/services/dialog.d.ts.map +1 -1
  61. package/lib/services/dialog.js +13 -17
  62. package/lib/services/dnd.d.ts +5 -17
  63. package/lib/services/dnd.d.ts.map +1 -1
  64. package/lib/services/dnd.js +26 -91
  65. package/lib/services/emoji.d.ts +1 -8
  66. package/lib/services/emoji.d.ts.map +1 -1
  67. package/lib/services/emoji.js +18 -29
  68. package/lib/services/entity.d.ts +4 -16
  69. package/lib/services/entity.d.ts.map +1 -1
  70. package/lib/services/entity.js +29 -71
  71. package/lib/services/files.d.ts +16 -80
  72. package/lib/services/files.d.ts.map +1 -1
  73. package/lib/services/files.js +75 -433
  74. package/lib/services/functions.d.ts +8 -49
  75. package/lib/services/functions.d.ts.map +1 -1
  76. package/lib/services/functions.js +45 -203
  77. package/lib/services/lists.d.ts +13 -55
  78. package/lib/services/lists.d.ts.map +1 -1
  79. package/lib/services/lists.js +53 -248
  80. package/lib/services/migration.d.ts +1 -7
  81. package/lib/services/migration.d.ts.map +1 -1
  82. package/lib/services/migration.js +18 -27
  83. package/lib/services/oauth.d.ts +7 -43
  84. package/lib/services/oauth.d.ts.map +1 -1
  85. package/lib/services/oauth.js +34 -289
  86. package/lib/services/openid.d.ts +3 -10
  87. package/lib/services/openid.d.ts.map +1 -1
  88. package/lib/services/openid.js +19 -79
  89. package/lib/services/pins.d.ts +3 -13
  90. package/lib/services/pins.d.ts.map +1 -1
  91. package/lib/services/pins.js +27 -61
  92. package/lib/services/reactions.d.ts +5 -17
  93. package/lib/services/reactions.d.ts.map +1 -1
  94. package/lib/services/reactions.js +30 -96
  95. package/lib/services/reminders.d.ts +5 -17
  96. package/lib/services/reminders.d.ts.map +1 -1
  97. package/lib/services/reminders.js +33 -83
  98. package/lib/services/rtm.d.ts +2 -11
  99. package/lib/services/rtm.d.ts.map +1 -1
  100. package/lib/services/rtm.js +22 -56
  101. package/lib/services/search.d.ts +4 -35
  102. package/lib/services/search.d.ts.map +1 -1
  103. package/lib/services/search.js +28 -167
  104. package/lib/services/stars.d.ts +4 -26
  105. package/lib/services/stars.d.ts.map +1 -1
  106. package/lib/services/stars.js +28 -128
  107. package/lib/services/team.d.ts +11 -63
  108. package/lib/services/team.d.ts.map +1 -1
  109. package/lib/services/team.js +45 -289
  110. package/lib/services/tooling.d.ts +2 -5
  111. package/lib/services/tooling.d.ts.map +1 -1
  112. package/lib/services/tooling.js +15 -28
  113. package/lib/services/usergroups.d.ts +7 -31
  114. package/lib/services/usergroups.d.ts.map +1 -1
  115. package/lib/services/usergroups.js +40 -146
  116. package/lib/services/users.d.ts +14 -48
  117. package/lib/services/users.d.ts.map +1 -1
  118. package/lib/services/users.js +54 -249
  119. package/lib/services/views.d.ts +4 -14
  120. package/lib/services/views.d.ts.map +1 -1
  121. package/lib/services/views.js +28 -73
  122. package/lib/services/workflows.d.ts +8 -51
  123. package/lib/services/workflows.d.ts.map +1 -1
  124. package/lib/services/workflows.js +37 -188
  125. package/lib/traits.d.ts +1 -1
  126. package/lib/traits.js +8 -8
  127. package/package.json +14 -10
  128. package/src/credentials.ts +20 -21
  129. package/src/errors.ts +31 -27
  130. package/src/index.ts +1 -1
  131. package/src/pagination.ts +2 -2
  132. package/src/protocol.ts +30 -29
  133. package/src/retry.ts +6 -6
  134. package/src/services/admin.ts +2717 -3451
  135. package/src/services/agents.ts +380 -370
  136. package/src/services/api.ts +31 -21
  137. package/src/services/apps.ts +569 -621
  138. package/src/services/assistant.ts +235 -270
  139. package/src/services/auth.ts +118 -100
  140. package/src/services/blocks.ts +33 -29
  141. package/src/services/bookmarks.ts +101 -83
  142. package/src/services/bots.ts +74 -67
  143. package/src/services/calls.ts +118 -124
  144. package/src/services/canvases.ts +171 -178
  145. package/src/services/chat.ts +428 -496
  146. package/src/services/conversations.ts +675 -761
  147. package/src/services/dialog.ts +30 -17
  148. package/src/services/dnd.ts +125 -99
  149. package/src/services/emoji.ts +46 -42
  150. package/src/services/entity.ts +94 -92
  151. package/src/services/files.ts +536 -531
  152. package/src/services/functions.ts +209 -274
  153. package/src/services/lists.ts +289 -304
  154. package/src/services/migration.ts +39 -37
  155. package/src/services/oauth.ts +345 -361
  156. package/src/services/openid.ts +137 -122
  157. package/src/services/pins.ts +83 -70
  158. package/src/services/reactions.ts +119 -103
  159. package/src/services/reminders.ts +112 -90
  160. package/src/services/rtm.ts +73 -65
  161. package/src/services/search.ts +193 -244
  162. package/src/services/stars.ts +101 -160
  163. package/src/services/team.ts +333 -369
  164. package/src/services/tooling.ts +43 -30
  165. package/src/services/usergroups.ts +175 -179
  166. package/src/services/users.ts +301 -268
  167. package/src/services/views.ts +85 -80
  168. package/src/services/workflows.ts +184 -269
  169. package/src/traits.ts +1 -1
  170. package/lib/protocol.test.d.ts +0 -2
  171. package/lib/protocol.test.d.ts.map +0 -1
  172. package/lib/protocol.test.js +0 -288
  173. package/lib/protocol.test.js.map +0 -1
  174. package/lib/services/admin.js.map +0 -1
  175. package/lib/services/agents.js.map +0 -1
  176. package/lib/services/api.js.map +0 -1
  177. package/lib/services/apps.js.map +0 -1
  178. package/lib/services/assistant.js.map +0 -1
  179. package/lib/services/auth.js.map +0 -1
  180. package/lib/services/blocks.js.map +0 -1
  181. package/lib/services/bookmarks.js.map +0 -1
  182. package/lib/services/bots.js.map +0 -1
  183. package/lib/services/calls.js.map +0 -1
  184. package/lib/services/canvases.js.map +0 -1
  185. package/lib/services/chat.js.map +0 -1
  186. package/lib/services/conversations.js.map +0 -1
  187. package/lib/services/dialog.js.map +0 -1
  188. package/lib/services/dnd.js.map +0 -1
  189. package/lib/services/emoji.js.map +0 -1
  190. package/lib/services/entity.js.map +0 -1
  191. package/lib/services/files.js.map +0 -1
  192. package/lib/services/functions.js.map +0 -1
  193. package/lib/services/lists.js.map +0 -1
  194. package/lib/services/migration.js.map +0 -1
  195. package/lib/services/oauth.js.map +0 -1
  196. package/lib/services/openid.js.map +0 -1
  197. package/lib/services/pins.js.map +0 -1
  198. package/lib/services/reactions.js.map +0 -1
  199. package/lib/services/reminders.js.map +0 -1
  200. package/lib/services/rtm.js.map +0 -1
  201. package/lib/services/search.js.map +0 -1
  202. package/lib/services/stars.js.map +0 -1
  203. package/lib/services/team.js.map +0 -1
  204. package/lib/services/tooling.js.map +0 -1
  205. package/lib/services/usergroups.js.map +0 -1
  206. package/lib/services/users.js.map +0 -1
  207. package/lib/services/views.js.map +0 -1
  208. package/lib/services/workflows.js.map +0 -1
  209. package/src/protocol.test.ts +0 -372
@@ -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
  /**
@@ -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,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,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,KAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAOxB,CAAC"}
@@ -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
- * Slack Web API base URL. Every method is `POST/GET <base>/<method>`.
28
- * Override via `SLACK_API_URL` only to point at a proxy or a mock.
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(EffectConfig.orElse(() => EffectConfig.String("SLACK_TOKEN"))),
37
- apiBaseUrl: EffectConfig.String("SLACK_API_URL").pipe(EffectConfig.withDefault(DEFAULT_API_BASE_URL)),
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, envConfig.pipe(Effect.mapError(() => new ConfigError({
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
- })), Effect.map(({ token, apiBaseUrl }) => ({
45
+ })),
46
+ /*@__PURE__*/ Effect.map(({ token, apiBaseUrl }) => ({
42
47
  token: Redacted.make(token),
43
48
  apiBaseUrl,
44
49
  })), Effect.orDie));
45
- /**
46
- * Convenience layer from a redacted token + optional base URL. Pass an empty
47
- * token (`""`) for the credential-less OAuth exchange methods.
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,
@@ -1 +1 @@
1
- {"version":3,"file":"credentials.js","sourceRoot":"","sources":["../src/credentials.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,8BA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,MAAM,kBAAkB,GAAG,aAAa,CAAC,KAAK,CAAC,OAAO,CAC3D,WAAW;AACX,aAAa,CAAC,SAAS,CAAC,IAAI;AAC1B,aAAa,CAAC,MAAM,CAAC,QAAQ,CAC3B,GAAG,EAAE,CACH,IAAI,WAAW,CAAC;IACd,OAAO,EAAE,mEAAmE;CAC7E,CAAC,CACL;AACD,aAAa,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC;IACnD,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC;IAC3B,UAAU;CACX,CAAC,CAAC,EACH,MAAM,CAAC,KAAK,CACb,CACF,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,MAG3B,EAA4B,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>" }` — usually
5
- * with HTTP 200 — so the interesting field is the machine-readable `error`
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 "effect/Schema";
15
- declare const SlackError_base: Schema.Class<SlackError, Schema.TaggedStruct<"SlackError", {
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
- }>, import("effect/Cause").YieldableError>;
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`, …) — the field
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.Class<SlackRateLimited, Schema.TaggedStruct<"SlackRateLimited", {
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
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
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 — a 429 or the `rate_limited`/`ratelimited` slug. Slack
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.Class<SlackHttpError, Schema.TaggedStruct<"SlackHttpError", {
52
- readonly status: Schema.Number;
53
- readonly message: Schema.String;
54
- readonly body: Schema.optional<Schema.String>;
55
- }>, import("effect/Cause").YieldableError>;
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 — a non-2xx response without a parseable Slack error envelope
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.Class<SlackParseError, Schema.TaggedStruct<"SlackParseError", {
63
- readonly body: Schema.Unknown;
64
- readonly cause: Schema.Unknown;
65
- }>, import("effect/Cause").YieldableError> & (new (...args: any[]) => {
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
@@ -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,eAAe,CAAC;;;;;;;;AAExC;;;;;;;GAOG;AACH,qBAAa,UAAW,SAAQ,eAM9B;CAAG;;;;;;;;;;;;;;AAEL;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,qBAIwB;CAAG;;;;;;AAEjE;;;GAGG;AACH,qBAAa,cAAe,SAAQ,mBAIlC;CAAG;;;;;;;;;AAEL,kCAAkC;AAClC,qBAAa,eAAgB,SAAQ,oBAGL;CAAG;AAEnC;;;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"}
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
- * Slack-specific error types.
3
- *
4
- * Slack reports failures as `{ "ok": false, "error": "<slug>" }` — usually
5
- * with HTTP 200 — so the interesting field is the machine-readable `error`
6
- * slug, not the status. The protocol maps the well-known infrastructure
7
- * slugs (auth, throttling, server hiccups) onto core's shared HTTP error
8
- * classes and surfaces everything else as {@link SlackError} with the slug
9
- * preserved for branching. Each generated operation's doc comment lists the
10
- * slugs that method can produce.
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 "effect/Schema";
17
- /**
18
- * A Slack API error envelope: `ok: false` with a machine-readable slug.
19
- * `code` is the slug (`channel_not_found`, `invalid_blocks`, …) — the field
20
- * to branch on; the per-method slugs are listed in each operation's doc
21
- * comment. `needed`/`provided` carry scope detail on `missing_scope`;
22
- * `messages` carries the envelope's `response_metadata.messages` (per-field
23
- * validation detail on `invalid_arguments`).
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
- * Slack rate limit — a 429 or the `rate_limited`/`ratelimited` slug. Slack
35
- * answers with a `Retry-After` header the default retry policy honors.
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
- * HTTP error — a non-2xx response without a parseable Slack error envelope
45
- * (proxy pages, HTML 5xx bodies).
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
- /** Schema parse error wrapper. */
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,EA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M,OAAO,gBACX,SAAQ,aAAa,CAAb,aAAa,CAAC,MAAM,CAAC,WAAW,EAAoB,CAAC,kBAAkB,EAAE;IAC/E,IAAI,EAAE,MAAM,CAAC,MAAM;IACnB,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;IACrD,UAAU,EAAE,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC;CAC1D,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC,mBAAmB,CAAC;CAAG;AAEjF;;;GAGG;AACH,MAAM,OAAO,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 — Slack Web API SDK for Effect.
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
- * @distilled.cloud/slack — Slack Web API SDK for Effect.
3
- *
4
- * `./services` is generated by `scripts/generate.ts` from the Smithy models
5
- * in `.generated-specs` (written by `scripts/convert.ts` from the JSON twins
6
- * of the docs.slack.dev method reference, which the spec mirror
7
- * `specs/spec-mirror-slack` snapshots). Everything else in this folder is
8
- * hand-written.
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";
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Slack pagination — hand-written.
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 — which is exactly core's cursor traversal (`isTerminalToken`
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
- * Slack pagination — hand-written.
3
- *
4
- * Slack's cursor convention: pass `cursor` (from the previous response's
5
- * `response_metadata.next_cursor`), and an EMPTY `next_cursor` means the
6
- * last page — which is exactly core's cursor traversal (`isTerminalToken`
7
- * treats `""` as terminal). Paginated operations are compiled with this
8
- * strategy by scripts/generate.ts from the `smithy.api#paginated` traits the
9
- * converter stamps.
10
- *
11
- * @example
12
- * ```ts
13
- * import * as Effect from "effect/Effect";
14
- * import * as Stream from "effect/Stream";
15
- * import * as Users from "@distilled.cloud/slack/users";
16
- *
17
- * // Every member, cursors followed automatically:
18
- * const members = Users.list.items({ limit: 200 }).pipe(
19
- * Stream.runCollect,
20
- * );
21
- * // Or page by page:
22
- * const pages = Users.list.pages({ limit: 200 });
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
- * Cursor traversal for Slack: follow `response_metadata.next_cursor` until
28
- * it comes back empty/absent.
29
- */
26
+
27
+
28
+
29
+
30
30
  export const slackPaginate = (operation, input, pagination) => Pagination.paginateCursor(operation, input, pagination);
31
31
  //# sourceMappingURL=pagination.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACjD,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"}
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;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