@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.
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
@@ -1,18 +1,17 @@
1
1
  import * as API from "@distilled.cloud/core/api";
2
2
  // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
3
- import * as S from "@distilled.cloud/core/schema";
3
+ import * as S from "@distilled.cloud/core/schema-lite";
4
+ import * as __L from "@distilled.cloud/core/schema-lite";
4
5
  import { SlackError, SlackRateLimited } from "../errors.ts";
5
6
  import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
6
7
  import * as Retry from "../retry.ts";
7
8
  import * as T from "../traits.ts";
9
+ // Schema table, filled on first reach (see __S at the end).
10
+ const __s: any[] = [];
8
11
 
9
12
  export type { SlackOpError, SlackOpContext };
10
13
 
11
14
  export type MigrationExchangeRequestUsersList = Array<string>;
12
- export const MigrationExchangeRequestUsersList = /*@__PURE__*/ S.Array(
13
- S.String,
14
- ) as any as S.Schema<MigrationExchangeRequestUsersList>;
15
-
16
15
  export interface MigrationExchangeRequest {
17
16
  /** A comma-separated list of user ids, up to 400 per request */
18
17
  users: MigrationExchangeRequestUsersList;
@@ -21,25 +20,8 @@ export interface MigrationExchangeRequest {
21
20
  /** Specify `true` to convert `W` global user IDs to workspace-specific `U` IDs. Defaults to `false`. */
22
21
  to_old?: boolean;
23
22
  }
24
- export const MigrationExchangeRequest = /*@__PURE__*/ S.suspend(() =>
25
- S.Struct({
26
- users: MigrationExchangeRequestUsersList.pipe(T.Query()),
27
- team_id: S.optional(S.String.pipe(T.Query())),
28
- to_old: S.optional(S.Boolean.pipe(T.Query())),
29
- }).pipe(T.Http({ method: "GET", uri: "/migration.exchange", code: 200 })),
30
- ).annotate({ identifier: "MigrationExchangeRequest" }) as any as S.Schema<MigrationExchangeRequest>;
31
-
32
23
  export type MigrationExchangeResponseUserIdMapMap = { [key: string]: unknown | undefined };
33
- export const MigrationExchangeResponseUserIdMapMap = /*@__PURE__*/ S.Record(
34
- S.String,
35
- S.Unknown,
36
- ) as any as S.Schema<MigrationExchangeResponseUserIdMapMap>;
37
-
38
24
  export type MigrationExchangeResponseInvalidUserIdsList = Array<string>;
39
- export const MigrationExchangeResponseInvalidUserIdsList = /*@__PURE__*/ S.Array(
40
- S.String,
41
- ) as any as S.Schema<MigrationExchangeResponseInvalidUserIdsList>;
42
-
43
25
  export interface MigrationExchangeResponse {
44
26
  /** Always `true` (a failed call raises a typed error instead). */
45
27
  ok: boolean;
@@ -48,29 +30,49 @@ export interface MigrationExchangeResponse {
48
30
  user_id_map: MigrationExchangeResponseUserIdMapMap;
49
31
  invalid_user_ids?: MigrationExchangeResponseInvalidUserIdsList;
50
32
  }
51
- export const MigrationExchangeResponse = /*@__PURE__*/ S.suspend(() =>
52
- S.Struct({
53
- ok: S.Boolean,
54
- team_id: S.String,
55
- enterprise_id: S.String,
56
- user_id_map: MigrationExchangeResponseUserIdMapMap,
57
- invalid_user_ids: S.optional(MigrationExchangeResponseInvalidUserIdsList),
58
- }),
59
- ).annotate({
60
- identifier: "MigrationExchangeResponse",
61
- }) as any as S.Schema<MigrationExchangeResponse>;
62
-
63
33
  export type MigrationExchangeError = SlackOpError;
64
- /** For Enterprise organization workspaces, map local user IDs to global user IDs Required scopes — bot: `tokens.basic`; user: `tokens.basic` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `not_enterprise_team` — The workspace associated with the token is not part of an Enterprise organization. User IDs have not changed and there is nothing to map. - `too_many_users` — Too many user IDs provided in `users`. Up to 400 user IDs are allowed per request. See https://docs.slack.dev/reference/methods/migration.exchange */
34
+ /** For Enterprise organization workspaces, map local user IDs to global user IDs Required scopes -- bot: `tokens.basic`; user: `tokens.basic` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `not_enterprise_team` -- The workspace associated with the token is not part of an Enterprise organization. User IDs have not changed and there is nothing to map. - `too_many_users` -- Too many user IDs provided in `users`. Up to 400 user IDs are allowed per request. See https://docs.slack.dev/reference/methods/migration.exchange */
65
35
  export const migrationExchange: API.OperationMethod<
66
36
  MigrationExchangeRequest,
67
37
  MigrationExchangeResponse,
68
38
  MigrationExchangeError,
69
39
  SlackOpContext
70
40
  > = /*@__PURE__*/ API.make(() => ({
71
- input: MigrationExchangeRequest,
72
- output: MigrationExchangeResponse,
41
+ input: __S(1, __c0, 1) as any as S.Schema<MigrationExchangeRequest>,
42
+ output: __S(3, __c0, 3) as any as S.Schema<MigrationExchangeResponse>,
73
43
  errors: [SlackError, SlackRateLimited],
74
44
  protocol: SlackProtocol,
75
45
  retry: Retry.Retry,
76
46
  }));
47
+
48
+ // Schema builders: each runs one schema initializer, on that schema's first use.
49
+ function __c0(j: number): any {
50
+ switch (j) {
51
+ case 0:
52
+ return S.Array(S.String);
53
+ case 1:
54
+ return S.suspend(() =>
55
+ S.Struct({
56
+ users: __S(0, __c0, 0).pipe(T.Query()),
57
+ team_id: S.optional(S.String.pipe(T.Query())),
58
+ to_old: S.optional(S.Boolean.pipe(T.Query())),
59
+ }).pipe(T.Http({ method: "GET", uri: "/migration.exchange", code: 200 })),
60
+ ).annotate({ identifier: "MigrationExchangeRequest" });
61
+ case 2:
62
+ return S.Record(S.String, S.Unknown);
63
+ case 3:
64
+ return S.suspend(() =>
65
+ S.Struct({
66
+ ok: S.Boolean,
67
+ team_id: S.String,
68
+ enterprise_id: S.String,
69
+ user_id_map: __S(2, __c0, 2),
70
+ invalid_user_ids: S.optional(__S(0, __c0, 0)),
71
+ }),
72
+ ).annotate({ identifier: "MigrationExchangeResponse" });
73
+ }
74
+ }
75
+ // Schema table: entry i is schema j of builder f, made on first reach.
76
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
77
+ return (__s[i] ??= __L.at(f, j));
78
+ }