@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
@@ -1,11 +1,14 @@
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 { slackPaginate } from "../pagination.ts";
6
7
  import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
7
8
  import * as Retry from "../retry.ts";
8
9
  import * as T from "../traits.ts";
10
+ // Schema table, filled on first reach (see __S at the end).
11
+ const __s: any[] = [];
9
12
 
10
13
  export type { SlackOpError, SlackOpContext };
11
14
 
@@ -17,24 +20,10 @@ export interface AddReactionRequest {
17
20
  /** Timestamp of the message to add reaction to. */
18
21
  timestamp: string;
19
22
  }
20
- export const AddReactionRequest = /*@__PURE__*/ S.suspend(() =>
21
- S.Struct({
22
- channel: S.String,
23
- name: S.String,
24
- timestamp: S.String,
25
- }).pipe(T.Http({ method: "POST", uri: "/reactions.add", code: 200 })),
26
- ).annotate({ identifier: "AddReactionRequest" }) as any as S.Schema<AddReactionRequest>;
27
-
28
23
  export interface AddReactionResponse {
29
24
  /** Always `true` (a failed call raises a typed error instead). */
30
25
  ok: boolean;
31
26
  }
32
- export const AddReactionResponse = /*@__PURE__*/ S.suspend(() =>
33
- S.Struct({
34
- ok: S.Boolean,
35
- }),
36
- ).annotate({ identifier: "AddReactionResponse" }) as any as S.Schema<AddReactionResponse>;
37
-
38
27
  export interface GetReactionRequest {
39
28
  /** Channel where the message to get reactions for was posted. */
40
29
  channel?: string;
@@ -47,16 +36,6 @@ export interface GetReactionRequest {
47
36
  /** Timestamp of the message to get reactions for. */
48
37
  timestamp?: string;
49
38
  }
50
- export const GetReactionRequest = /*@__PURE__*/ S.suspend(() =>
51
- S.Struct({
52
- channel: S.optional(S.String.pipe(T.Query())),
53
- file: S.optional(S.String.pipe(T.Query())),
54
- file_comment: S.optional(S.String.pipe(T.Query())),
55
- full: S.optional(S.Boolean.pipe(T.Query())),
56
- timestamp: S.optional(S.String.pipe(T.Query())),
57
- }).pipe(T.Http({ method: "GET", uri: "/reactions.get", code: 200 })),
58
- ).annotate({ identifier: "GetReactionRequest" }) as any as S.Schema<GetReactionRequest>;
59
-
60
39
  export interface GetReactionResponse {
61
40
  /** Always `true` (a failed call raises a typed error instead). */
62
41
  ok: boolean;
@@ -66,17 +45,6 @@ export interface GetReactionResponse {
66
45
  channel?: string;
67
46
  file?: unknown;
68
47
  }
69
- export const GetReactionResponse = /*@__PURE__*/ S.suspend(() =>
70
- S.Struct({
71
- ok: S.Boolean,
72
- comment: S.optional(S.Unknown),
73
- message: S.optional(S.Unknown),
74
- type: S.String,
75
- channel: S.optional(S.String),
76
- file: S.optional(S.Unknown),
77
- }),
78
- ).annotate({ identifier: "GetReactionResponse" }) as any as S.Schema<GetReactionResponse>;
79
-
80
48
  export interface ListReactionsRequest {
81
49
  /** Show reactions made by this user. Defaults to the authed user. */
82
50
  user?: string;
@@ -91,42 +59,13 @@ export interface ListReactionsRequest {
91
59
  /** encoded team id to list reactions in, required if org token is used */
92
60
  team_id?: string;
93
61
  }
94
- export const ListReactionsRequest = /*@__PURE__*/ S.suspend(() =>
95
- S.Struct({
96
- user: S.optional(S.String.pipe(T.Query())),
97
- full: S.optional(S.Boolean.pipe(T.Query())),
98
- count: S.optional(S.Number.pipe(T.Query())),
99
- page: S.optional(S.Number.pipe(T.Query())),
100
- cursor: S.optional(S.String.pipe(T.Query())),
101
- limit: S.optional(S.Number.pipe(T.Query())),
102
- team_id: S.optional(S.String.pipe(T.Query())),
103
- }).pipe(T.Http({ method: "GET", uri: "/reactions.list", code: 200 })),
104
- ).annotate({ identifier: "ListReactionsRequest" }) as any as S.Schema<ListReactionsRequest>;
105
-
106
62
  export type ListReactionsResponseItemsItemMap = { [key: string]: unknown | undefined };
107
- export const ListReactionsResponseItemsItemMap = /*@__PURE__*/ S.Record(
108
- S.String,
109
- S.Unknown,
110
- ) as any as S.Schema<ListReactionsResponseItemsItemMap>;
111
-
112
63
  export type ListReactionsResponseItemsList = Array<ListReactionsResponseItemsItemMap>;
113
- export const ListReactionsResponseItemsList = /*@__PURE__*/ S.Array(
114
- ListReactionsResponseItemsItemMap,
115
- ) as any as S.Schema<ListReactionsResponseItemsList>;
116
-
117
64
  /** Pagination metadata. An empty `next_cursor` means the last page. */
118
65
  export interface ListReactionsResponseResponseMetadata {
119
- /** Cursor for the next page — pass as `cursor` on the next call. */
66
+ /** Cursor for the next page -- pass as `cursor` on the next call. */
120
67
  next_cursor?: string;
121
68
  }
122
- export const ListReactionsResponseResponseMetadata = /*@__PURE__*/ S.suspend(() =>
123
- S.Struct({
124
- next_cursor: S.optional(S.String),
125
- }),
126
- ).annotate({
127
- identifier: "ListReactionsResponseResponseMetadata",
128
- }) as any as S.Schema<ListReactionsResponseResponseMetadata>;
129
-
130
69
  export interface ListReactionsResponse {
131
70
  /** Always `true` (a failed call raises a typed error instead). */
132
71
  ok: boolean;
@@ -135,15 +74,6 @@ export interface ListReactionsResponse {
135
74
  /** Pagination metadata. An empty `next_cursor` means the last page. */
136
75
  response_metadata?: ListReactionsResponseResponseMetadata;
137
76
  }
138
- export const ListReactionsResponse = /*@__PURE__*/ S.suspend(() =>
139
- S.Struct({
140
- ok: S.Boolean,
141
- items: ListReactionsResponseItemsList,
142
- paging: S.optional(S.Unknown),
143
- response_metadata: S.optional(ListReactionsResponseResponseMetadata),
144
- }),
145
- ).annotate({ identifier: "ListReactionsResponse" }) as any as S.Schema<ListReactionsResponse>;
146
-
147
77
  export interface RemoveReactionRequest {
148
78
  /** Reaction (emoji) name. */
149
79
  name: string;
@@ -156,58 +86,42 @@ export interface RemoveReactionRequest {
156
86
  /** Timestamp of the message to remove reaction from. */
157
87
  timestamp?: string;
158
88
  }
159
- export const RemoveReactionRequest = /*@__PURE__*/ S.suspend(() =>
160
- S.Struct({
161
- name: S.String,
162
- file: S.optional(S.String),
163
- file_comment: S.optional(S.String),
164
- channel: S.optional(S.String),
165
- timestamp: S.optional(S.String),
166
- }).pipe(T.Http({ method: "POST", uri: "/reactions.remove", code: 200 })),
167
- ).annotate({ identifier: "RemoveReactionRequest" }) as any as S.Schema<RemoveReactionRequest>;
168
-
169
89
  export interface RemoveReactionResponse {
170
90
  /** Always `true` (a failed call raises a typed error instead). */
171
91
  ok: boolean;
172
92
  }
173
- export const RemoveReactionResponse = /*@__PURE__*/ S.suspend(() =>
174
- S.Struct({
175
- ok: S.Boolean,
176
- }),
177
- ).annotate({ identifier: "RemoveReactionResponse" }) as any as S.Schema<RemoveReactionResponse>;
178
-
179
93
  export type AddReactionError = SlackOpError;
180
- /** Adds a reaction to an item. Required scopes — bot: `reactions:write`; user: `reactions:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `already_reacted` — The specified item already has the user/reaction combination. - `bad_timestamp` — Value passed for `timestamp` was invalid. - `channel_not_found` — Value passed for `channel` is invalid. - `external_channel_migrating` — The channel is in the process of being migrated. - `invalid_name` — Value passed for `name` was invalid. - `is_archived` — Channel specified has been archived. - `message_not_found` — Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` — combination of `channel` and `timestamp` was not specified. - `not_reactable` — Whatever you passed in, like a `file` or `file_comment`, can't be reacted to anymore. Your app can react to messages though. - `thread_locked` — Reactions are disabled as the specified message is part of a locked thread. - `too_many_emoji` — The limit for distinct reactions (i.e emoji) on the item has been reached. - `too_many_reactions` — The limit for reactions a person may add to the item has been reached. - `no_access` — User does not have access to react to this canvas. See https://docs.slack.dev/reference/methods/reactions.add */
94
+ /** Adds a reaction to an item. Required scopes -- bot: `reactions:write`; user: `reactions:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `already_reacted` -- The specified item already has the user/reaction combination. - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- Value passed for `channel` is invalid. - `external_channel_migrating` -- The channel is in the process of being migrated. - `invalid_name` -- Value passed for `name` was invalid. - `is_archived` -- Channel specified has been archived. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- combination of `channel` and `timestamp` was not specified. - `not_reactable` -- Whatever you passed in, like a `file` or `file_comment`, can't be reacted to anymore. Your app can react to messages though. - `thread_locked` -- Reactions are disabled as the specified message is part of a locked thread. - `too_many_emoji` -- The limit for distinct reactions (i.e emoji) on the item has been reached. - `too_many_reactions` -- The limit for reactions a person may add to the item has been reached. - `no_access` -- User does not have access to react to this canvas. See https://docs.slack.dev/reference/methods/reactions.add */
181
95
  export const addReaction: API.OperationMethod<
182
96
  AddReactionRequest,
183
97
  AddReactionResponse,
184
98
  AddReactionError,
185
99
  SlackOpContext
186
100
  > = /*@__PURE__*/ API.make(() => ({
187
- input: AddReactionRequest,
188
- output: AddReactionResponse,
101
+ input: __S(0, __c0, 0) as any as S.Schema<AddReactionRequest>,
102
+ output: __S(8, __c1, 0) as any as S.Schema<AddReactionResponse>,
189
103
  errors: [SlackError, SlackRateLimited],
190
104
  protocol: SlackProtocol,
191
105
  retry: Retry.Retry,
192
106
  }));
193
107
 
194
108
  export type GetReactionError = SlackOpError;
195
- /** Gets reactions for an item. Required scopes — bot: `reactions:read`; user: `reactions:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `bad_timestamp` — Value passed for `timestamp` was invalid. - `channel_not_found` — Value passed for `channel` was invalid. - `file_comment_not_found` — File comment specified by `file_comment` does not exist. - `file_not_found` — File specified by `file` does not exist. - `message_not_found` — Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` — `file`, `file_comment`, or combination of `channel` and `timestamp` was not specified. See https://docs.slack.dev/reference/methods/reactions.get */
109
+ /** Gets reactions for an item. Required scopes -- bot: `reactions:read`; user: `reactions:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- Value passed for `channel` was invalid. - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `file_not_found` -- File specified by `file` does not exist. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- `file`, `file_comment`, or combination of `channel` and `timestamp` was not specified. See https://docs.slack.dev/reference/methods/reactions.get */
196
110
  export const getReaction: API.OperationMethod<
197
111
  GetReactionRequest,
198
112
  GetReactionResponse,
199
113
  GetReactionError,
200
114
  SlackOpContext
201
115
  > = /*@__PURE__*/ API.make(() => ({
202
- input: GetReactionRequest,
203
- output: GetReactionResponse,
116
+ input: __S(16, __c2, 0) as any as S.Schema<GetReactionRequest>,
117
+ output: __S(17, __c2, 1) as any as S.Schema<GetReactionResponse>,
204
118
  errors: [SlackError, SlackRateLimited],
205
119
  protocol: SlackProtocol,
206
120
  retry: Retry.Retry,
207
121
  }));
208
122
 
209
123
  export type ListReactionsError = SlackOpError;
210
- /** Lists reactions made by a user. Required scopes — bot: `reactions:read`; user: `reactions:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` — Value passed for `cursor` was not valid or is no longer valid. - `user_not_found` — Value passed for `user` was invalid. See https://docs.slack.dev/reference/methods/reactions.list */
124
+ /** Lists reactions made by a user. Required scopes -- bot: `reactions:read`; user: `reactions:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `user_not_found` -- Value passed for `user` was invalid. See https://docs.slack.dev/reference/methods/reactions.list */
211
125
  export const listReactions: API.PaginatedOperationMethod<
212
126
  ListReactionsRequest,
213
127
  ListReactionsResponse,
@@ -216,8 +130,8 @@ export const listReactions: API.PaginatedOperationMethod<
216
130
  ListReactionsResponseItemsItemMap
217
131
  > = /*@__PURE__*/ API.makePaginated(
218
132
  () => ({
219
- input: ListReactionsRequest,
220
- output: ListReactionsResponse,
133
+ input: __S(24, __c3, 0) as any as S.Schema<ListReactionsRequest>,
134
+ output: __S(28, __c3, 4) as any as S.Schema<ListReactionsResponse>,
221
135
  errors: [SlackError, SlackRateLimited],
222
136
  protocol: SlackProtocol,
223
137
  retry: Retry.Retry,
@@ -233,16 +147,118 @@ export const listReactions: API.PaginatedOperationMethod<
233
147
  ) as any;
234
148
 
235
149
  export type RemoveReactionError = SlackOpError;
236
- /** Removes a reaction from an item. Required scopes — bot: `reactions:write`; user: `reactions:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_timestamp` — Value passed for `timestamp` was invalid. - `channel_not_found` — The specified channel was not found. - `external_channel_migrating` — The reaction is in a channel that is being migrated - `file_not_found` — File specified by `file` does not exist. - `file_comment_not_found` — File comment specified by `file_comment` does not exist. - `invalid_name` — Value passed for `name` was invalid. - `message_not_found` — Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` — `file`, `file_comment`, or combination of `channel` and `timestamp` was not specified. - `no_access` — The requestor does not have permission to perform this action on the specified item. - `no_reaction` — The specified reaction does not exist, or the requestor is not the original reaction author. - `thread_locked` — Reactions are disabled as the specified message is part of a locked thread. See https://docs.slack.dev/reference/methods/reactions.remove */
150
+ /** Removes a reaction from an item. Required scopes -- bot: `reactions:write`; user: `reactions:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- The specified channel was not found. - `external_channel_migrating` -- The reaction is in a channel that is being migrated - `file_not_found` -- File specified by `file` does not exist. - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `invalid_name` -- Value passed for `name` was invalid. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- `file`, `file_comment`, or combination of `channel` and `timestamp` was not specified. - `no_access` -- The requestor does not have permission to perform this action on the specified item. - `no_reaction` -- The specified reaction does not exist, or the requestor is not the original reaction author. - `thread_locked` -- Reactions are disabled as the specified message is part of a locked thread. See https://docs.slack.dev/reference/methods/reactions.remove */
237
151
  export const removeReaction: API.OperationMethod<
238
152
  RemoveReactionRequest,
239
153
  RemoveReactionResponse,
240
154
  RemoveReactionError,
241
155
  SlackOpContext
242
156
  > = /*@__PURE__*/ API.make(() => ({
243
- input: RemoveReactionRequest,
244
- output: RemoveReactionResponse,
157
+ input: __S(32, __c4, 0) as any as S.Schema<RemoveReactionRequest>,
158
+ output: __S(8, __c1, 0) as any as S.Schema<RemoveReactionResponse>,
245
159
  errors: [SlackError, SlackRateLimited],
246
160
  protocol: SlackProtocol,
247
161
  retry: Retry.Retry,
248
162
  }));
163
+
164
+ // Schema builders: each runs one schema initializer, on that schema's first use.
165
+ function __c0(j: number): any {
166
+ switch (j) {
167
+ case 0:
168
+ return S.suspend(() =>
169
+ S.Struct({
170
+ channel: S.String,
171
+ name: S.String,
172
+ timestamp: S.String,
173
+ }).pipe(T.Http({ method: "POST", uri: "/reactions.add", code: 200 })),
174
+ ).annotate({ identifier: "AddReactionRequest" });
175
+ }
176
+ }
177
+ function __c1(j: number): any {
178
+ switch (j) {
179
+ case 0:
180
+ return S.suspend(() =>
181
+ S.Struct({
182
+ ok: S.Boolean,
183
+ }),
184
+ ).annotate({ identifier: "AddReactionResponse" });
185
+ }
186
+ }
187
+ function __c2(j: number): any {
188
+ switch (j) {
189
+ case 0:
190
+ return S.suspend(() =>
191
+ S.Struct({
192
+ channel: S.optional(S.String.pipe(T.Query())),
193
+ file: S.optional(S.String.pipe(T.Query())),
194
+ file_comment: S.optional(S.String.pipe(T.Query())),
195
+ full: S.optional(S.Boolean.pipe(T.Query())),
196
+ timestamp: S.optional(S.String.pipe(T.Query())),
197
+ }).pipe(T.Http({ method: "GET", uri: "/reactions.get", code: 200 })),
198
+ ).annotate({ identifier: "GetReactionRequest" });
199
+ case 1:
200
+ return S.suspend(() =>
201
+ S.Struct({
202
+ ok: S.Boolean,
203
+ comment: S.optional(S.Unknown),
204
+ message: S.optional(S.Unknown),
205
+ type: S.String,
206
+ channel: S.optional(S.String),
207
+ file: S.optional(S.Unknown),
208
+ }),
209
+ ).annotate({ identifier: "GetReactionResponse" });
210
+ }
211
+ }
212
+ function __c3(j: number): any {
213
+ switch (j) {
214
+ case 0:
215
+ return S.suspend(() =>
216
+ S.Struct({
217
+ user: S.optional(S.String.pipe(T.Query())),
218
+ full: S.optional(S.Boolean.pipe(T.Query())),
219
+ count: S.optional(S.Number.pipe(T.Query())),
220
+ page: S.optional(S.Number.pipe(T.Query())),
221
+ cursor: S.optional(S.String.pipe(T.Query())),
222
+ limit: S.optional(S.Number.pipe(T.Query())),
223
+ team_id: S.optional(S.String.pipe(T.Query())),
224
+ }).pipe(T.Http({ method: "GET", uri: "/reactions.list", code: 200 })),
225
+ ).annotate({ identifier: "ListReactionsRequest" });
226
+ case 1:
227
+ return S.Record(S.String, S.Unknown);
228
+ case 2:
229
+ return S.Array(__S(25, __c3, 1));
230
+ case 3:
231
+ return S.suspend(() =>
232
+ S.Struct({
233
+ next_cursor: S.optional(S.String),
234
+ }),
235
+ ).annotate({ identifier: "ListReactionsResponseResponseMetadata" });
236
+ case 4:
237
+ return S.suspend(() =>
238
+ S.Struct({
239
+ ok: S.Boolean,
240
+ items: __S(26, __c3, 2),
241
+ paging: S.optional(S.Unknown),
242
+ response_metadata: S.optional(__S(27, __c3, 3)),
243
+ }),
244
+ ).annotate({ identifier: "ListReactionsResponse" });
245
+ }
246
+ }
247
+ function __c4(j: number): any {
248
+ switch (j) {
249
+ case 0:
250
+ return S.suspend(() =>
251
+ S.Struct({
252
+ name: S.String,
253
+ file: S.optional(S.String),
254
+ file_comment: S.optional(S.String),
255
+ channel: S.optional(S.String),
256
+ timestamp: S.optional(S.String),
257
+ }).pipe(T.Http({ method: "POST", uri: "/reactions.remove", code: 200 })),
258
+ ).annotate({ identifier: "RemoveReactionRequest" });
259
+ }
260
+ }
261
+ // Schema table: entry i is schema j of builder f, made on first reach.
262
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
263
+ return (__s[i] ??= __L.at(f, j));
264
+ }
@@ -1,10 +1,13 @@
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
 
@@ -20,197 +23,216 @@ export interface AddReminderRequest {
20
23
  /** Specify the repeating behavior of a reminder. Available options: `daily`, `weekly`, `monthly`, or `yearly`. If `weekly`, may further specify the days of the week. */
21
24
  recurrence?: unknown;
22
25
  }
23
- export const AddReminderRequest = /*@__PURE__*/ S.suspend(() =>
24
- S.Struct({
25
- text: S.String,
26
- time: S.String,
27
- user: S.optional(S.String),
28
- team_id: S.optional(S.String),
29
- recurrence: S.optional(S.Unknown),
30
- }).pipe(T.Http({ method: "POST", uri: "/reminders.add", code: 200 })),
31
- ).annotate({ identifier: "AddReminderRequest" }) as any as S.Schema<AddReminderRequest>;
32
-
33
26
  export interface AddReminderResponse {
34
27
  /** Always `true` (a failed call raises a typed error instead). */
35
28
  ok: boolean;
36
29
  reminder: unknown;
37
30
  }
38
- export const AddReminderResponse = /*@__PURE__*/ S.suspend(() =>
39
- S.Struct({
40
- ok: S.Boolean,
41
- reminder: S.Unknown,
42
- }),
43
- ).annotate({ identifier: "AddReminderResponse" }) as any as S.Schema<AddReminderResponse>;
44
-
45
31
  export interface CompleteReminderRequest {
46
32
  /** The ID of the reminder to be marked as complete */
47
33
  reminder: string;
48
34
  /** Encoded team id, required if org token is used */
49
35
  team_id?: string;
50
36
  }
51
- export const CompleteReminderRequest = /*@__PURE__*/ S.suspend(() =>
52
- S.Struct({
53
- reminder: S.String,
54
- team_id: S.optional(S.String),
55
- }).pipe(T.Http({ method: "POST", uri: "/reminders.complete", code: 200 })),
56
- ).annotate({ identifier: "CompleteReminderRequest" }) as any as S.Schema<CompleteReminderRequest>;
57
-
58
37
  export interface CompleteReminderResponse {
59
38
  /** Always `true` (a failed call raises a typed error instead). */
60
39
  ok: boolean;
61
40
  }
62
- export const CompleteReminderResponse = /*@__PURE__*/ S.suspend(() =>
63
- S.Struct({
64
- ok: S.Boolean,
65
- }),
66
- ).annotate({ identifier: "CompleteReminderResponse" }) as any as S.Schema<CompleteReminderResponse>;
67
-
68
41
  export interface DeleteReminderRequest {
69
42
  /** The ID of the reminder */
70
43
  reminder: string;
71
44
  /** Encoded team id, required if org token is used */
72
45
  team_id?: string;
73
46
  }
74
- export const DeleteReminderRequest = /*@__PURE__*/ S.suspend(() =>
75
- S.Struct({
76
- reminder: S.String,
77
- team_id: S.optional(S.String),
78
- }).pipe(T.Http({ method: "POST", uri: "/reminders.delete", code: 200 })),
79
- ).annotate({ identifier: "DeleteReminderRequest" }) as any as S.Schema<DeleteReminderRequest>;
80
-
81
47
  export interface DeleteReminderResponse {
82
48
  /** Always `true` (a failed call raises a typed error instead). */
83
49
  ok: boolean;
84
50
  }
85
- export const DeleteReminderResponse = /*@__PURE__*/ S.suspend(() =>
86
- S.Struct({
87
- ok: S.Boolean,
88
- }),
89
- ).annotate({ identifier: "DeleteReminderResponse" }) as any as S.Schema<DeleteReminderResponse>;
90
-
91
51
  export interface ListRemindersRequest {
92
52
  /** Encoded team id, required if org token is passed */
93
53
  team_id?: string;
94
54
  }
95
- export const ListRemindersRequest = /*@__PURE__*/ S.suspend(() =>
96
- S.Struct({
97
- team_id: S.optional(S.String.pipe(T.Query())),
98
- }).pipe(T.Http({ method: "GET", uri: "/reminders.list", code: 200 })),
99
- ).annotate({ identifier: "ListRemindersRequest" }) as any as S.Schema<ListRemindersRequest>;
100
-
101
55
  export type ListRemindersResponseRemindersList = Array<unknown>;
102
- export const ListRemindersResponseRemindersList = /*@__PURE__*/ S.Array(
103
- S.Unknown,
104
- ) as any as S.Schema<ListRemindersResponseRemindersList>;
105
-
106
56
  export interface ListRemindersResponse {
107
57
  /** Always `true` (a failed call raises a typed error instead). */
108
58
  ok: boolean;
109
59
  reminders?: ListRemindersResponseRemindersList;
110
60
  }
111
- export const ListRemindersResponse = /*@__PURE__*/ S.suspend(() =>
112
- S.Struct({
113
- ok: S.Boolean,
114
- reminders: S.optional(ListRemindersResponseRemindersList),
115
- }),
116
- ).annotate({ identifier: "ListRemindersResponse" }) as any as S.Schema<ListRemindersResponse>;
117
-
118
61
  export interface RemindersInfoRequest {
119
62
  /** The ID of the reminder */
120
63
  reminder: string;
121
64
  /** Encoded team id, required if org token is passed */
122
65
  team_id?: string;
123
66
  }
124
- export const RemindersInfoRequest = /*@__PURE__*/ S.suspend(() =>
125
- S.Struct({
126
- reminder: S.String.pipe(T.Query()),
127
- team_id: S.optional(S.String.pipe(T.Query())),
128
- }).pipe(T.Http({ method: "GET", uri: "/reminders.info", code: 200 })),
129
- ).annotate({ identifier: "RemindersInfoRequest" }) as any as S.Schema<RemindersInfoRequest>;
130
-
131
67
  export interface RemindersInfoResponse {
132
68
  /** Always `true` (a failed call raises a typed error instead). */
133
69
  ok: boolean;
134
70
  reminder: unknown;
135
71
  }
136
- export const RemindersInfoResponse = /*@__PURE__*/ S.suspend(() =>
137
- S.Struct({
138
- ok: S.Boolean,
139
- reminder: S.Unknown,
140
- }),
141
- ).annotate({ identifier: "RemindersInfoResponse" }) as any as S.Schema<RemindersInfoResponse>;
142
-
143
72
  export type AddReminderError = SlackOpError;
144
- /** Creates a reminder. Required scopes — user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_add_bot` — Reminders can't be sent to bots. - `cannot_add_others` — Guests can't set reminders for other team members. - `cannot_add_others_recurring` — Recurring reminders can't be set for other team members. - `cannot_add_profile_only_user` — Reminders can't be sent to profile only users. - `cannot_add_slackbot` — Reminders can't be sent to Slackbot. - `cannot_parse` — The phrasing of the timing for this reminder is unclear. You must include a complete time description. Some examples that work: `1458678068`, `20`, `in 5 minutes`, `tomorrow`, `at 3:30pm`, `on Tuesday`, or `next week`. - `missing_argument` — An argument is missing. - `user_not_found` — That user can't be found. See https://docs.slack.dev/reference/methods/reminders.add */
73
+ /** Creates a reminder. Required scopes -- user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_add_bot` -- Reminders can't be sent to bots. - `cannot_add_others` -- Guests can't set reminders for other team members. - `cannot_add_others_recurring` -- Recurring reminders can't be set for other team members. - `cannot_add_profile_only_user` -- Reminders can't be sent to profile only users. - `cannot_add_slackbot` -- Reminders can't be sent to Slackbot. - `cannot_parse` -- The phrasing of the timing for this reminder is unclear. You must include a complete time description. Some examples that work: `1458678068`, `20`, `in 5 minutes`, `tomorrow`, `at 3:30pm`, `on Tuesday`, or `next week`. - `missing_argument` -- An argument is missing. - `user_not_found` -- That user can't be found. See https://docs.slack.dev/reference/methods/reminders.add */
145
74
  export const addReminder: API.OperationMethod<
146
75
  AddReminderRequest,
147
76
  AddReminderResponse,
148
77
  AddReminderError,
149
78
  SlackOpContext
150
79
  > = /*@__PURE__*/ API.make(() => ({
151
- input: AddReminderRequest,
152
- output: AddReminderResponse,
80
+ input: __S(0, __c0, 0) as any as S.Schema<AddReminderRequest>,
81
+ output: __S(4, __c1, 0) as any as S.Schema<AddReminderResponse>,
153
82
  errors: [SlackError, SlackRateLimited],
154
83
  protocol: SlackProtocol,
155
84
  retry: Retry.Retry,
156
85
  }));
157
86
 
158
87
  export type CompleteReminderError = SlackOpError;
159
- /** Marks a reminder as complete. Required scopes — user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_complete_others` — Reminders for other team members can't be marked complete. - `cannot_complete_recurring` — Recurring reminders can't be marked complete. - `missing_argument` — An argument is missing. - `not_found` — That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.complete */
88
+ /** Marks a reminder as complete. Required scopes -- user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_complete_others` -- Reminders for other team members can't be marked complete. - `cannot_complete_recurring` -- Recurring reminders can't be marked complete. - `missing_argument` -- An argument is missing. - `not_found` -- That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.complete */
160
89
  export const completeReminder: API.OperationMethod<
161
90
  CompleteReminderRequest,
162
91
  CompleteReminderResponse,
163
92
  CompleteReminderError,
164
93
  SlackOpContext
165
94
  > = /*@__PURE__*/ API.make(() => ({
166
- input: CompleteReminderRequest,
167
- output: CompleteReminderResponse,
95
+ input: __S(8, __c2, 0) as any as S.Schema<CompleteReminderRequest>,
96
+ output: __S(12, __c3, 0) as any as S.Schema<CompleteReminderResponse>,
168
97
  errors: [SlackError, SlackRateLimited],
169
98
  protocol: SlackProtocol,
170
99
  retry: Retry.Retry,
171
100
  }));
172
101
 
173
102
  export type DeleteReminderError = SlackOpError;
174
- /** Deletes a reminder. Required scopes — user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` — An argument is missing. - `not_found` — That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.delete */
103
+ /** Deletes a reminder. Required scopes -- user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- An argument is missing. - `not_found` -- That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.delete */
175
104
  export const deleteReminder: API.OperationMethod<
176
105
  DeleteReminderRequest,
177
106
  DeleteReminderResponse,
178
107
  DeleteReminderError,
179
108
  SlackOpContext
180
109
  > = /*@__PURE__*/ API.make(() => ({
181
- input: DeleteReminderRequest,
182
- output: DeleteReminderResponse,
110
+ input: __S(16, __c4, 0) as any as S.Schema<DeleteReminderRequest>,
111
+ output: __S(12, __c3, 0) as any as S.Schema<DeleteReminderResponse>,
183
112
  errors: [SlackError, SlackRateLimited],
184
113
  protocol: SlackProtocol,
185
114
  retry: Retry.Retry,
186
115
  }));
187
116
 
188
117
  export type ListRemindersError = SlackOpError;
189
- /** Lists all reminders created by or for a given user. Required scopes — user: `reminders:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` — An argument is missing. See https://docs.slack.dev/reference/methods/reminders.list */
118
+ /** Lists all reminders created by or for a given user. Required scopes -- user: `reminders:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- An argument is missing. See https://docs.slack.dev/reference/methods/reminders.list */
190
119
  export const listReminders: API.OperationMethod<
191
120
  ListRemindersRequest,
192
121
  ListRemindersResponse,
193
122
  ListRemindersError,
194
123
  SlackOpContext
195
124
  > = /*@__PURE__*/ API.make(() => ({
196
- input: ListRemindersRequest,
197
- output: ListRemindersResponse,
125
+ input: __S(20, __c5, 0) as any as S.Schema<ListRemindersRequest>,
126
+ output: __S(22, __c5, 2) as any as S.Schema<ListRemindersResponse>,
198
127
  errors: [SlackError, SlackRateLimited],
199
128
  protocol: SlackProtocol,
200
129
  retry: Retry.Retry,
201
130
  }));
202
131
 
203
132
  export type RemindersInfoError = SlackOpError;
204
- /** Gets information about a reminder. Required scopes — user: `reminders:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` — An argument is missing. - `not_found` — That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.info */
133
+ /** Gets information about a reminder. Required scopes -- user: `reminders:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- An argument is missing. - `not_found` -- That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.info */
205
134
  export const remindersInfo: API.OperationMethod<
206
135
  RemindersInfoRequest,
207
136
  RemindersInfoResponse,
208
137
  RemindersInfoError,
209
138
  SlackOpContext
210
139
  > = /*@__PURE__*/ API.make(() => ({
211
- input: RemindersInfoRequest,
212
- output: RemindersInfoResponse,
140
+ input: __S(24, __c6, 0) as any as S.Schema<RemindersInfoRequest>,
141
+ output: __S(4, __c1, 0) as any as S.Schema<RemindersInfoResponse>,
213
142
  errors: [SlackError, SlackRateLimited],
214
143
  protocol: SlackProtocol,
215
144
  retry: Retry.Retry,
216
145
  }));
146
+
147
+ // Schema builders: each runs one schema initializer, on that schema's first use.
148
+ function __c0(j: number): any {
149
+ switch (j) {
150
+ case 0:
151
+ return S.suspend(() =>
152
+ S.Struct({
153
+ text: S.String,
154
+ time: S.String,
155
+ user: S.optional(S.String),
156
+ team_id: S.optional(S.String),
157
+ recurrence: S.optional(S.Unknown),
158
+ }).pipe(T.Http({ method: "POST", uri: "/reminders.add", code: 200 })),
159
+ ).annotate({ identifier: "AddReminderRequest" });
160
+ }
161
+ }
162
+ function __c1(j: number): any {
163
+ switch (j) {
164
+ case 0:
165
+ return S.suspend(() =>
166
+ S.Struct({
167
+ ok: S.Boolean,
168
+ reminder: S.Unknown,
169
+ }),
170
+ ).annotate({ identifier: "AddReminderResponse" });
171
+ }
172
+ }
173
+ function __c2(j: number): any {
174
+ switch (j) {
175
+ case 0:
176
+ return S.suspend(() =>
177
+ S.Struct({
178
+ reminder: S.String,
179
+ team_id: S.optional(S.String),
180
+ }).pipe(T.Http({ method: "POST", uri: "/reminders.complete", code: 200 })),
181
+ ).annotate({ identifier: "CompleteReminderRequest" });
182
+ }
183
+ }
184
+ function __c3(j: number): any {
185
+ switch (j) {
186
+ case 0:
187
+ return S.suspend(() =>
188
+ S.Struct({
189
+ ok: S.Boolean,
190
+ }),
191
+ ).annotate({ identifier: "CompleteReminderResponse" });
192
+ }
193
+ }
194
+ function __c4(j: number): any {
195
+ switch (j) {
196
+ case 0:
197
+ return S.suspend(() =>
198
+ S.Struct({
199
+ reminder: S.String,
200
+ team_id: S.optional(S.String),
201
+ }).pipe(T.Http({ method: "POST", uri: "/reminders.delete", code: 200 })),
202
+ ).annotate({ identifier: "DeleteReminderRequest" });
203
+ }
204
+ }
205
+ function __c5(j: number): any {
206
+ switch (j) {
207
+ case 0:
208
+ return S.suspend(() =>
209
+ S.Struct({
210
+ team_id: S.optional(S.String.pipe(T.Query())),
211
+ }).pipe(T.Http({ method: "GET", uri: "/reminders.list", code: 200 })),
212
+ ).annotate({ identifier: "ListRemindersRequest" });
213
+ case 1:
214
+ return S.Array(S.Unknown);
215
+ case 2:
216
+ return S.suspend(() =>
217
+ S.Struct({
218
+ ok: S.Boolean,
219
+ reminders: S.optional(__S(21, __c5, 1)),
220
+ }),
221
+ ).annotate({ identifier: "ListRemindersResponse" });
222
+ }
223
+ }
224
+ function __c6(j: number): any {
225
+ switch (j) {
226
+ case 0:
227
+ return S.suspend(() =>
228
+ S.Struct({
229
+ reminder: S.String.pipe(T.Query()),
230
+ team_id: S.optional(S.String.pipe(T.Query())),
231
+ }).pipe(T.Http({ method: "GET", uri: "/reminders.info", code: 200 })),
232
+ ).annotate({ identifier: "RemindersInfoRequest" });
233
+ }
234
+ }
235
+ // Schema table: entry i is schema j of builder f, made on first reach.
236
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
237
+ return (__s[i] ??= __L.at(f, j));
238
+ }