@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";
4
- import * as Redacted from "effect/Redacted";
3
+ import * as S from "@distilled.cloud/core/schema-lite";
4
+ import * as __L from "@distilled.cloud/core/schema-lite";
5
+ import type * as Redacted from "effect/Redacted";
5
6
  import { SlackError, SlackRateLimited } from "../errors.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
 
@@ -13,19 +16,6 @@ export interface RotateTokenRequest {
13
16
  /** The `xoxe` refresh token that was issued along with the old app configuration token. */
14
17
  refresh_token: string | Redacted.Redacted<string>;
15
18
  }
16
- export const RotateTokenRequest = /*@__PURE__*/ S.suspend(() =>
17
- S.Struct({
18
- refresh_token: S.String.pipe(T.SensitiveValue({})),
19
- }).pipe(
20
- T.Http({
21
- method: "POST",
22
- uri: "/tooling.tokens.rotate",
23
- code: 200,
24
- contentType: "form-urlencoded",
25
- }),
26
- ),
27
- ).annotate({ identifier: "RotateTokenRequest" }) as any as S.Schema<RotateTokenRequest>;
28
-
29
19
  export interface RotateTokenResponse {
30
20
  /** Always `true` (a failed call raises a typed error instead). */
31
21
  ok: boolean;
@@ -42,29 +32,52 @@ export interface RotateTokenResponse {
42
32
  /** Issued at (iat) identifies the time at which the token was issued. */
43
33
  iat: number;
44
34
  }
45
- export const RotateTokenResponse = /*@__PURE__*/ S.suspend(() =>
46
- S.Struct({
47
- ok: S.Boolean,
48
- token: S.String,
49
- refresh_token: S.String.pipe(T.SensitiveValue({})),
50
- team_id: S.String,
51
- user_id: S.String,
52
- exp: S.Number,
53
- iat: S.Number,
54
- }),
55
- ).annotate({ identifier: "RotateTokenResponse" }) as any as S.Schema<RotateTokenResponse>;
56
-
57
35
  export type RotateTokenError = SlackOpError;
58
- /** Exchanges a refresh token for a new app configuration token. Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `internal_error` — Internal error - `invalid_refresh_token` — The given refresh token is invalid. - `unknown_error` — Temporary error for dev only restriction See https://docs.slack.dev/reference/methods/tooling.tokens.rotate */
36
+ /** Exchanges a refresh token for a new app configuration token. Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- Internal error - `invalid_refresh_token` -- The given refresh token is invalid. - `unknown_error` -- Temporary error for dev only restriction See https://docs.slack.dev/reference/methods/tooling.tokens.rotate */
59
37
  export const rotateToken: API.OperationMethod<
60
38
  RotateTokenRequest,
61
39
  RotateTokenResponse,
62
40
  RotateTokenError,
63
41
  SlackOpContext
64
42
  > = /*@__PURE__*/ API.make(() => ({
65
- input: RotateTokenRequest,
66
- output: RotateTokenResponse,
43
+ input: __S(0, __c0, 0) as any as S.Schema<RotateTokenRequest>,
44
+ output: __S(1, __c0, 1) as any as S.Schema<RotateTokenResponse>,
67
45
  errors: [SlackError, SlackRateLimited],
68
46
  protocol: SlackProtocol,
69
47
  retry: Retry.Retry,
70
48
  }));
49
+
50
+ // Schema builders: each runs one schema initializer, on that schema's first use.
51
+ function __c0(j: number): any {
52
+ switch (j) {
53
+ case 0:
54
+ return S.suspend(() =>
55
+ S.Struct({
56
+ refresh_token: S.String.pipe(T.SensitiveValue({})),
57
+ }).pipe(
58
+ T.Http({
59
+ method: "POST",
60
+ uri: "/tooling.tokens.rotate",
61
+ code: 200,
62
+ contentType: "form-urlencoded",
63
+ }),
64
+ ),
65
+ ).annotate({ identifier: "RotateTokenRequest" });
66
+ case 1:
67
+ return S.suspend(() =>
68
+ S.Struct({
69
+ ok: S.Boolean,
70
+ token: S.String,
71
+ refresh_token: S.String.pipe(T.SensitiveValue({})),
72
+ team_id: S.String,
73
+ user_id: S.String,
74
+ exp: S.Number,
75
+ iat: S.Number,
76
+ }),
77
+ ).annotate({ identifier: "RotateTokenResponse" });
78
+ }
79
+ }
80
+ // Schema table: entry i is schema j of builder f, made on first reach.
81
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
82
+ return (__s[i] ??= __L.at(f, j));
83
+ }
@@ -1,25 +1,20 @@
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
  /** A comma separated string of encoded channel IDs for which the User Group uses as a default. */
12
15
  export type CreateUsergroupRequestChannelsList = Array<string>;
13
- export const CreateUsergroupRequestChannelsList = /*@__PURE__*/ S.Array(
14
- S.String,
15
- ) as any as S.Schema<CreateUsergroupRequestChannelsList>;
16
-
17
16
  /** A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too. */
18
17
  export type CreateUsergroupRequestAdditionalChannelsList = Array<string>;
19
- export const CreateUsergroupRequestAdditionalChannelsList = /*@__PURE__*/ S.Array(
20
- S.String,
21
- ) as any as S.Schema<CreateUsergroupRequestAdditionalChannelsList>;
22
-
23
18
  export interface CreateUsergroupRequest {
24
19
  /** A comma separated string of encoded channel IDs for which the User Group uses as a default. */
25
20
  channels?: CreateUsergroupRequestChannelsList;
@@ -38,31 +33,11 @@ export interface CreateUsergroupRequest {
38
33
  /** Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added. */
39
34
  enable_section?: boolean;
40
35
  }
41
- export const CreateUsergroupRequest = /*@__PURE__*/ S.suspend(() =>
42
- S.Struct({
43
- channels: S.optional(CreateUsergroupRequestChannelsList),
44
- additional_channels: S.optional(CreateUsergroupRequestAdditionalChannelsList),
45
- description: S.optional(S.String),
46
- handle: S.optional(S.String),
47
- include_count: S.optional(S.Boolean),
48
- name: S.String,
49
- team_id: S.optional(S.String),
50
- enable_section: S.optional(S.Boolean),
51
- }).pipe(T.Http({ method: "POST", uri: "/usergroups.create", code: 200 })),
52
- ).annotate({ identifier: "CreateUsergroupRequest" }) as any as S.Schema<CreateUsergroupRequest>;
53
-
54
36
  export interface CreateUsergroupResponse {
55
37
  /** Always `true` (a failed call raises a typed error instead). */
56
38
  ok: boolean;
57
39
  usergroup: unknown;
58
40
  }
59
- export const CreateUsergroupResponse = /*@__PURE__*/ S.suspend(() =>
60
- S.Struct({
61
- ok: S.Boolean,
62
- usergroup: S.Unknown,
63
- }),
64
- ).annotate({ identifier: "CreateUsergroupResponse" }) as any as S.Schema<CreateUsergroupResponse>;
65
-
66
41
  export interface DisableUsergroupRequest {
67
42
  /** Include the number of users in the User Group. */
68
43
  include_count?: boolean;
@@ -71,26 +46,11 @@ export interface DisableUsergroupRequest {
71
46
  /** The encoded ID of the User Group to disable. */
72
47
  usergroup: string;
73
48
  }
74
- export const DisableUsergroupRequest = /*@__PURE__*/ S.suspend(() =>
75
- S.Struct({
76
- include_count: S.optional(S.Boolean),
77
- team_id: S.optional(S.String),
78
- usergroup: S.String,
79
- }).pipe(T.Http({ method: "POST", uri: "/usergroups.disable", code: 200 })),
80
- ).annotate({ identifier: "DisableUsergroupRequest" }) as any as S.Schema<DisableUsergroupRequest>;
81
-
82
49
  export interface DisableUsergroupResponse {
83
50
  /** Always `true` (a failed call raises a typed error instead). */
84
51
  ok: boolean;
85
52
  usergroup: unknown;
86
53
  }
87
- export const DisableUsergroupResponse = /*@__PURE__*/ S.suspend(() =>
88
- S.Struct({
89
- ok: S.Boolean,
90
- usergroup: S.Unknown,
91
- }),
92
- ).annotate({ identifier: "DisableUsergroupResponse" }) as any as S.Schema<DisableUsergroupResponse>;
93
-
94
54
  export interface EnableUsergroupRequest {
95
55
  /** Include the number of users in the User Group. */
96
56
  include_count?: boolean;
@@ -99,26 +59,11 @@ export interface EnableUsergroupRequest {
99
59
  /** The encoded ID of the User Group to enable. */
100
60
  usergroup: string;
101
61
  }
102
- export const EnableUsergroupRequest = /*@__PURE__*/ S.suspend(() =>
103
- S.Struct({
104
- include_count: S.optional(S.Boolean),
105
- team_id: S.optional(S.String),
106
- usergroup: S.String,
107
- }).pipe(T.Http({ method: "POST", uri: "/usergroups.enable", code: 200 })),
108
- ).annotate({ identifier: "EnableUsergroupRequest" }) as any as S.Schema<EnableUsergroupRequest>;
109
-
110
62
  export interface EnableUsergroupResponse {
111
63
  /** Always `true` (a failed call raises a typed error instead). */
112
64
  ok: boolean;
113
65
  usergroup: unknown;
114
66
  }
115
- export const EnableUsergroupResponse = /*@__PURE__*/ S.suspend(() =>
116
- S.Struct({
117
- ok: S.Boolean,
118
- usergroup: S.Unknown,
119
- }),
120
- ).annotate({ identifier: "EnableUsergroupResponse" }) as any as S.Schema<EnableUsergroupResponse>;
121
-
122
67
  export interface ListUsergroupsRequest {
123
68
  /** Include the number of users in each User Group. */
124
69
  include_count?: boolean;
@@ -129,32 +74,12 @@ export interface ListUsergroupsRequest {
129
74
  /** The user group's encoded team ID. Required if org token is used. */
130
75
  team_id?: string;
131
76
  }
132
- export const ListUsergroupsRequest = /*@__PURE__*/ S.suspend(() =>
133
- S.Struct({
134
- include_count: S.optional(S.Boolean.pipe(T.Query())),
135
- include_disabled: S.optional(S.Boolean.pipe(T.Query())),
136
- include_users: S.optional(S.Boolean.pipe(T.Query())),
137
- team_id: S.optional(S.String.pipe(T.Query())),
138
- }).pipe(T.Http({ method: "GET", uri: "/usergroups.list", code: 200 })),
139
- ).annotate({ identifier: "ListUsergroupsRequest" }) as any as S.Schema<ListUsergroupsRequest>;
140
-
141
77
  export type ListUsergroupsResponseUsergroupsList = Array<unknown>;
142
- export const ListUsergroupsResponseUsergroupsList = /*@__PURE__*/ S.Array(
143
- S.Unknown,
144
- ) as any as S.Schema<ListUsergroupsResponseUsergroupsList>;
145
-
146
78
  export interface ListUsergroupsResponse {
147
79
  /** Always `true` (a failed call raises a typed error instead). */
148
80
  ok: boolean;
149
81
  usergroups: ListUsergroupsResponseUsergroupsList;
150
82
  }
151
- export const ListUsergroupsResponse = /*@__PURE__*/ S.suspend(() =>
152
- S.Struct({
153
- ok: S.Boolean,
154
- usergroups: ListUsergroupsResponseUsergroupsList,
155
- }),
156
- ).annotate({ identifier: "ListUsergroupsResponse" }) as any as S.Schema<ListUsergroupsResponse>;
157
-
158
83
  export interface ListUsersRequest {
159
84
  /** Include results for disabled User Groups. */
160
85
  include_disabled?: boolean;
@@ -163,43 +88,16 @@ export interface ListUsersRequest {
163
88
  /** The user group's encoded team ID. Required if org token is used. */
164
89
  team_id?: string;
165
90
  }
166
- export const ListUsersRequest = /*@__PURE__*/ S.suspend(() =>
167
- S.Struct({
168
- include_disabled: S.optional(S.Boolean.pipe(T.Query())),
169
- usergroup: S.String.pipe(T.Query()),
170
- team_id: S.optional(S.String.pipe(T.Query())),
171
- }).pipe(T.Http({ method: "GET", uri: "/usergroups.users.list", code: 200 })),
172
- ).annotate({ identifier: "ListUsersRequest" }) as any as S.Schema<ListUsersRequest>;
173
-
174
91
  export type ListUsersResponseUsersList = Array<unknown>;
175
- export const ListUsersResponseUsersList = /*@__PURE__*/ S.Array(
176
- S.Unknown,
177
- ) as any as S.Schema<ListUsersResponseUsersList>;
178
-
179
92
  export interface ListUsersResponse {
180
93
  /** Always `true` (a failed call raises a typed error instead). */
181
94
  ok: boolean;
182
95
  users: ListUsersResponseUsersList;
183
96
  }
184
- export const ListUsersResponse = /*@__PURE__*/ S.suspend(() =>
185
- S.Struct({
186
- ok: S.Boolean,
187
- users: ListUsersResponseUsersList,
188
- }),
189
- ).annotate({ identifier: "ListUsersResponse" }) as any as S.Schema<ListUsersResponse>;
190
-
191
97
  /** A comma separated string of encoded user IDs that represent the entire list of users for the user group. */
192
98
  export type UpdateUserRequestUsersList = Array<string>;
193
- export const UpdateUserRequestUsersList = /*@__PURE__*/ S.Array(
194
- S.String,
195
- ) as any as S.Schema<UpdateUserRequestUsersList>;
196
-
197
99
  /** A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too. */
198
100
  export type UpdateUserRequestAdditionalChannelsList = Array<string>;
199
- export const UpdateUserRequestAdditionalChannelsList = /*@__PURE__*/ S.Array(
200
- S.String,
201
- ) as any as S.Schema<UpdateUserRequestAdditionalChannelsList>;
202
-
203
101
  export interface UpdateUserRequest {
204
102
  /** Include the number of users in the user group. */
205
103
  include_count?: boolean;
@@ -214,41 +112,15 @@ export interface UpdateUserRequest {
214
112
  /** Boolean to identify if the API is getting called when a shared section is getting shared */
215
113
  is_shared?: boolean;
216
114
  }
217
- export const UpdateUserRequest = /*@__PURE__*/ S.suspend(() =>
218
- S.Struct({
219
- include_count: S.optional(S.Boolean),
220
- team_id: S.optional(S.String),
221
- usergroup: S.String,
222
- users: UpdateUserRequestUsersList,
223
- additional_channels: S.optional(UpdateUserRequestAdditionalChannelsList),
224
- is_shared: S.optional(S.Boolean),
225
- }).pipe(T.Http({ method: "POST", uri: "/usergroups.users.update", code: 200 })),
226
- ).annotate({ identifier: "UpdateUserRequest" }) as any as S.Schema<UpdateUserRequest>;
227
-
228
115
  export interface UpdateUserResponse {
229
116
  /** Always `true` (a failed call raises a typed error instead). */
230
117
  ok: boolean;
231
118
  usergroup: unknown;
232
119
  }
233
- export const UpdateUserResponse = /*@__PURE__*/ S.suspend(() =>
234
- S.Struct({
235
- ok: S.Boolean,
236
- usergroup: S.Unknown,
237
- }),
238
- ).annotate({ identifier: "UpdateUserResponse" }) as any as S.Schema<UpdateUserResponse>;
239
-
240
120
  /** A comma separated string of encoded channel IDs for which the User Group uses as a default. */
241
121
  export type UpdateUsergroupRequestChannelsList = Array<string>;
242
- export const UpdateUsergroupRequestChannelsList = /*@__PURE__*/ S.Array(
243
- S.String,
244
- ) as any as S.Schema<UpdateUsergroupRequestChannelsList>;
245
-
246
122
  /** A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too. */
247
123
  export type UpdateUsergroupRequestAdditionalChannelsList = Array<string>;
248
- export const UpdateUsergroupRequestAdditionalChannelsList = /*@__PURE__*/ S.Array(
249
- S.String,
250
- ) as any as S.Schema<UpdateUsergroupRequestAdditionalChannelsList>;
251
-
252
124
  export interface UpdateUsergroupRequest {
253
125
  /** A comma separated string of encoded channel IDs for which the User Group uses as a default. */
254
126
  channels?: UpdateUsergroupRequestChannelsList;
@@ -269,26 +141,8 @@ export interface UpdateUsergroupRequest {
269
141
  /** Configure this user group to show as a sidebar section for all group members. Note: Only relevant if group has 1 or more default channels added. */
270
142
  enable_section?: boolean;
271
143
  }
272
- export const UpdateUsergroupRequest = /*@__PURE__*/ S.suspend(() =>
273
- S.Struct({
274
- channels: S.optional(UpdateUsergroupRequestChannelsList),
275
- additional_channels: S.optional(UpdateUsergroupRequestAdditionalChannelsList),
276
- description: S.optional(S.String),
277
- handle: S.optional(S.String),
278
- include_count: S.optional(S.Boolean),
279
- name: S.optional(S.String),
280
- team_id: S.optional(S.String),
281
- usergroup: S.String,
282
- enable_section: S.optional(S.Boolean),
283
- }).pipe(T.Http({ method: "POST", uri: "/usergroups.update", code: 200 })),
284
- ).annotate({ identifier: "UpdateUsergroupRequest" }) as any as S.Schema<UpdateUsergroupRequest>;
285
-
286
144
  /** List of user IDs who would exceed their channel limit */
287
145
  export type UpdateUsergroupResponseChannelLimitUserIdsList = Array<string>;
288
- export const UpdateUsergroupResponseChannelLimitUserIdsList = /*@__PURE__*/ S.Array(
289
- S.String,
290
- ) as any as S.Schema<UpdateUsergroupResponseChannelLimitUserIdsList>;
291
-
292
146
  export interface UpdateUsergroupResponse {
293
147
  /** Always `true` (a failed call raises a typed error instead). */
294
148
  ok: boolean;
@@ -296,115 +150,257 @@ export interface UpdateUsergroupResponse {
296
150
  /** List of user IDs who would exceed their channel limit */
297
151
  channel_limit_user_ids?: UpdateUsergroupResponseChannelLimitUserIdsList;
298
152
  }
299
- export const UpdateUsergroupResponse = /*@__PURE__*/ S.suspend(() =>
300
- S.Struct({
301
- ok: S.Boolean,
302
- usergroup: S.Unknown,
303
- channel_limit_user_ids: S.optional(UpdateUsergroupResponseChannelLimitUserIdsList),
304
- }),
305
- ).annotate({ identifier: "UpdateUsergroupResponse" }) as any as S.Schema<UpdateUsergroupResponse>;
306
-
307
153
  export type CreateUsergroupError = SlackOpError;
308
- /** Create a User Group. Required scopes — bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_handle` — Handle is invalid - `description_too_long` — Given usergroup description is too long - `forbidden_handle` — Handle is invalid - `handle_already_exists` — Handle is already in use on this workspace - `invalid_channel_provided` — An invalid channel ID was provided - `invalid_group_provided` — An invalid group ID was provided - `missing_argument` — A required argument is missing. - `missing_subteam_name` — Subteam name is required - `name_already_exists` — Name is already in use on this workspace - `name_too_long` — Name too long. - `paid_teams_only` — Usergroups can only be used on paid Slack teams - `permission_denied` — The user does not have permission to create a User Group. - `plan_upgrade_required` — This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `target_team_not_on_org` — Target team specified is not on the org in context - `target_team_must_be_specified_in_org_context` — No target team was specified but the team in context is an org See https://docs.slack.dev/reference/methods/usergroups.create */
154
+ /** Create a User Group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_handle` -- Handle is invalid - `description_too_long` -- Given usergroup description is too long - `forbidden_handle` -- Handle is invalid - `handle_already_exists` -- Handle is already in use on this workspace - `invalid_channel_provided` -- An invalid channel ID was provided - `invalid_group_provided` -- An invalid group ID was provided - `missing_argument` -- A required argument is missing. - `missing_subteam_name` -- Subteam name is required - `name_already_exists` -- Name is already in use on this workspace - `name_too_long` -- Name too long. - `paid_teams_only` -- Usergroups can only be used on paid Slack teams - `permission_denied` -- The user does not have permission to create a User Group. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `target_team_not_on_org` -- Target team specified is not on the org in context - `target_team_must_be_specified_in_org_context` -- No target team was specified but the team in context is an org See https://docs.slack.dev/reference/methods/usergroups.create */
309
155
  export const createUsergroup: API.OperationMethod<
310
156
  CreateUsergroupRequest,
311
157
  CreateUsergroupResponse,
312
158
  CreateUsergroupError,
313
159
  SlackOpContext
314
160
  > = /*@__PURE__*/ API.make(() => ({
315
- input: CreateUsergroupRequest,
316
- output: CreateUsergroupResponse,
161
+ input: __S(0, __c0, 0) as any as S.Schema<CreateUsergroupRequest>,
162
+ output: __S(2, __c1, 0) as any as S.Schema<CreateUsergroupResponse>,
317
163
  errors: [SlackError, SlackRateLimited],
318
164
  protocol: SlackProtocol,
319
165
  retry: Retry.Retry,
320
166
  }));
321
167
 
322
168
  export type DisableUsergroupError = SlackOpError;
323
- /** Disable an existing User Group. Required scopes — bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` — A required argument is missing. - `permission_denied` — The user does not have permission to disable the User Group. - `plan_upgrade_required` — This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `target_team_not_on_org` — Target team specified is not on the org in context - `target_team_must_be_specified_in_org_context` — No target team was specified but the team in context is an org See https://docs.slack.dev/reference/methods/usergroups.disable */
169
+ /** Disable an existing User Group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- A required argument is missing. - `permission_denied` -- The user does not have permission to disable the User Group. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `target_team_not_on_org` -- Target team specified is not on the org in context - `target_team_must_be_specified_in_org_context` -- No target team was specified but the team in context is an org See https://docs.slack.dev/reference/methods/usergroups.disable */
324
170
  export const disableUsergroup: API.OperationMethod<
325
171
  DisableUsergroupRequest,
326
172
  DisableUsergroupResponse,
327
173
  DisableUsergroupError,
328
174
  SlackOpContext
329
175
  > = /*@__PURE__*/ API.make(() => ({
330
- input: DisableUsergroupRequest,
331
- output: DisableUsergroupResponse,
176
+ input: __S(6, __c3, 0) as any as S.Schema<DisableUsergroupRequest>,
177
+ output: __S(2, __c1, 0) as any as S.Schema<DisableUsergroupResponse>,
332
178
  errors: [SlackError, SlackRateLimited],
333
179
  protocol: SlackProtocol,
334
180
  retry: Retry.Retry,
335
181
  }));
336
182
 
337
183
  export type EnableUsergroupError = SlackOpError;
338
- /** Enable a User Group. Required scopes — bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` — A required argument is missing. - `permission_denied` — The user does not have permission to enables the User Group. - `plan_upgrade_required` — This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. See https://docs.slack.dev/reference/methods/usergroups.enable */
184
+ /** Enable a User Group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- A required argument is missing. - `permission_denied` -- The user does not have permission to enables the User Group. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. See https://docs.slack.dev/reference/methods/usergroups.enable */
339
185
  export const enableUsergroup: API.OperationMethod<
340
186
  EnableUsergroupRequest,
341
187
  EnableUsergroupResponse,
342
188
  EnableUsergroupError,
343
189
  SlackOpContext
344
190
  > = /*@__PURE__*/ API.make(() => ({
345
- input: EnableUsergroupRequest,
346
- output: EnableUsergroupResponse,
191
+ input: __S(8, __c4, 0) as any as S.Schema<EnableUsergroupRequest>,
192
+ output: __S(2, __c1, 0) as any as S.Schema<EnableUsergroupResponse>,
347
193
  errors: [SlackError, SlackRateLimited],
348
194
  protocol: SlackProtocol,
349
195
  retry: Retry.Retry,
350
196
  }));
351
197
 
352
198
  export type ListUsergroupsError = SlackOpError;
353
- /** List all User Groups for a team. Required scopes — bot: `usergroups:read`; user: `usergroups:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` — A required argument is missing. - `plan_upgrade_required` — This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `invalid_cursor` — Value passed for `cursor` was not valid or is no longer valid. - `users_not_found` — Cannot find users on subteam. - `invalid_team` — Cannot find subteam team. See https://docs.slack.dev/reference/methods/usergroups.list */
199
+ /** List all User Groups for a team. Required scopes -- bot: `usergroups:read`; user: `usergroups:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- A required argument is missing. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `users_not_found` -- Cannot find users on subteam. - `invalid_team` -- Cannot find subteam team. See https://docs.slack.dev/reference/methods/usergroups.list */
354
200
  export const listUsergroups: API.OperationMethod<
355
201
  ListUsergroupsRequest,
356
202
  ListUsergroupsResponse,
357
203
  ListUsergroupsError,
358
204
  SlackOpContext
359
205
  > = /*@__PURE__*/ API.make(() => ({
360
- input: ListUsergroupsRequest,
361
- output: ListUsergroupsResponse,
206
+ input: __S(10, __c5, 0) as any as S.Schema<ListUsergroupsRequest>,
207
+ output: __S(11, __c5, 1) as any as S.Schema<ListUsergroupsResponse>,
362
208
  errors: [SlackError, SlackRateLimited],
363
209
  protocol: SlackProtocol,
364
210
  retry: Retry.Retry,
365
211
  }));
366
212
 
367
213
  export type ListUsersError = SlackOpError;
368
- /** List all users in a User Group. Required scopes — bot: `usergroups:read`; user: `usergroups:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `no_such_subteam` — No usergroup found with the given ID. - `plan_upgrade_required` — This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `invalid_cursor` — Value passed for `cursor` was not valid or is no longer valid. See https://docs.slack.dev/reference/methods/usergroups.users.list */
214
+ /** List all users in a User Group. Required scopes -- bot: `usergroups:read`; user: `usergroups:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `no_such_subteam` -- No usergroup found with the given ID. - `plan_upgrade_required` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. See https://docs.slack.dev/reference/methods/usergroups.users.list */
369
215
  export const listUsers: API.OperationMethod<
370
216
  ListUsersRequest,
371
217
  ListUsersResponse,
372
218
  ListUsersError,
373
219
  SlackOpContext
374
220
  > = /*@__PURE__*/ API.make(() => ({
375
- input: ListUsersRequest,
376
- output: ListUsersResponse,
221
+ input: __S(14, __c7, 0) as any as S.Schema<ListUsersRequest>,
222
+ output: __S(15, __c7, 1) as any as S.Schema<ListUsersResponse>,
377
223
  errors: [SlackError, SlackRateLimited],
378
224
  protocol: SlackProtocol,
379
225
  retry: Retry.Retry,
380
226
  }));
381
227
 
382
228
  export type UpdateUserError = SlackOpError;
383
- /** Update the list of users for a user group. Required scopes — bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_users` — Value passed for `users` was empty or invalid. - `failed_for_some_users` — User(s) are not in the workspace where this usergroup exists - `missing_argument` — A required argument is missing. - `no_users_provided` — Either the `users` field wasn't provided or an empty value was passed. - `permission_denied` — The user does not have permission to update the list of users for a user group. Check workspace settings to confirm whether the calling user has permission. - `plan_upgrade_required` — This workspace does not have access to user groups, as that feature is only available on Standard and above plans. - `subteam_max_users_exceeded` — Exceeds maximum supported number of users per subteam. - `cannot_modify_role_admin` — The user does not have permission to modify the roles admin role. See https://docs.slack.dev/reference/methods/usergroups.users.update */
229
+ /** Update the list of users for a user group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_users` -- Value passed for `users` was empty or invalid. - `failed_for_some_users` -- User(s) are not in the workspace where this usergroup exists - `missing_argument` -- A required argument is missing. - `no_users_provided` -- Either the `users` field wasn't provided or an empty value was passed. - `permission_denied` -- The user does not have permission to update the list of users for a user group. Check workspace settings to confirm whether the calling user has permission. - `plan_upgrade_required` -- This workspace does not have access to user groups, as that feature is only available on Standard and above plans. - `subteam_max_users_exceeded` -- Exceeds maximum supported number of users per subteam. - `cannot_modify_role_admin` -- The user does not have permission to modify the roles admin role. See https://docs.slack.dev/reference/methods/usergroups.users.update */
384
230
  export const updateUser: API.OperationMethod<
385
231
  UpdateUserRequest,
386
232
  UpdateUserResponse,
387
233
  UpdateUserError,
388
234
  SlackOpContext
389
235
  > = /*@__PURE__*/ API.make(() => ({
390
- input: UpdateUserRequest,
391
- output: UpdateUserResponse,
236
+ input: __S(16, __c8, 0) as any as S.Schema<UpdateUserRequest>,
237
+ output: __S(2, __c1, 0) as any as S.Schema<UpdateUserResponse>,
392
238
  errors: [SlackError, SlackRateLimited],
393
239
  protocol: SlackProtocol,
394
240
  retry: Retry.Retry,
395
241
  }));
396
242
 
397
243
  export type UpdateUsergroupError = SlackOpError;
398
- /** Update an existing User Group. Required scopes — bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` — A required argument is missing. - `paid_teams_only` — This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `permission_denied` — The user does not have permission to update the User Group. - `too_many_linked_channels` — This request exceeds the number of channels we supporting linking to a single usergroup. - `user_channel_limit_exceeded` — Adding these channels would cause one or more members to exceed their channel limit. See https://docs.slack.dev/reference/methods/usergroups.update */
244
+ /** Update an existing User Group. Required scopes -- bot: `usergroups:write`; user: `usergroups:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- A required argument is missing. - `paid_teams_only` -- This workspace does not have access to User Groups, as that feature is only available on Standard and above plans. - `permission_denied` -- The user does not have permission to update the User Group. - `too_many_linked_channels` -- This request exceeds the number of channels we supporting linking to a single usergroup. - `user_channel_limit_exceeded` -- Adding these channels would cause one or more members to exceed their channel limit. See https://docs.slack.dev/reference/methods/usergroups.update */
399
245
  export const updateUsergroup: API.OperationMethod<
400
246
  UpdateUsergroupRequest,
401
247
  UpdateUsergroupResponse,
402
248
  UpdateUsergroupError,
403
249
  SlackOpContext
404
250
  > = /*@__PURE__*/ API.make(() => ({
405
- input: UpdateUsergroupRequest,
406
- output: UpdateUsergroupResponse,
251
+ input: __S(18, __c9, 0) as any as S.Schema<UpdateUsergroupRequest>,
252
+ output: __S(19, __c9, 1) as any as S.Schema<UpdateUsergroupResponse>,
407
253
  errors: [SlackError, SlackRateLimited],
408
254
  protocol: SlackProtocol,
409
255
  retry: Retry.Retry,
410
256
  }));
257
+
258
+ // Schema builders: each runs one schema initializer, on that schema's first use.
259
+ function __c0(j: number): any {
260
+ switch (j) {
261
+ case 0:
262
+ return S.suspend(() =>
263
+ S.Struct({
264
+ channels: S.optional(__S(4, __c2, 0)),
265
+ additional_channels: S.optional(__S(4, __c2, 0)),
266
+ description: S.optional(S.String),
267
+ handle: S.optional(S.String),
268
+ include_count: S.optional(S.Boolean),
269
+ name: S.String,
270
+ team_id: S.optional(S.String),
271
+ enable_section: S.optional(S.Boolean),
272
+ }).pipe(T.Http({ method: "POST", uri: "/usergroups.create", code: 200 })),
273
+ ).annotate({ identifier: "CreateUsergroupRequest" });
274
+ }
275
+ }
276
+ function __c1(j: number): any {
277
+ switch (j) {
278
+ case 0:
279
+ return S.suspend(() =>
280
+ S.Struct({
281
+ ok: S.Boolean,
282
+ usergroup: S.Unknown,
283
+ }),
284
+ ).annotate({ identifier: "CreateUsergroupResponse" });
285
+ }
286
+ }
287
+ function __c2(j: number): any {
288
+ switch (j) {
289
+ case 0:
290
+ return S.Array(S.String);
291
+ }
292
+ }
293
+ function __c3(j: number): any {
294
+ switch (j) {
295
+ case 0:
296
+ return S.suspend(() =>
297
+ S.Struct({
298
+ include_count: S.optional(S.Boolean),
299
+ team_id: S.optional(S.String),
300
+ usergroup: S.String,
301
+ }).pipe(T.Http({ method: "POST", uri: "/usergroups.disable", code: 200 })),
302
+ ).annotate({ identifier: "DisableUsergroupRequest" });
303
+ }
304
+ }
305
+ function __c4(j: number): any {
306
+ switch (j) {
307
+ case 0:
308
+ return S.suspend(() =>
309
+ S.Struct({
310
+ include_count: S.optional(S.Boolean),
311
+ team_id: S.optional(S.String),
312
+ usergroup: S.String,
313
+ }).pipe(T.Http({ method: "POST", uri: "/usergroups.enable", code: 200 })),
314
+ ).annotate({ identifier: "EnableUsergroupRequest" });
315
+ }
316
+ }
317
+ function __c5(j: number): any {
318
+ switch (j) {
319
+ case 0:
320
+ return S.suspend(() =>
321
+ S.Struct({
322
+ include_count: S.optional(S.Boolean.pipe(T.Query())),
323
+ include_disabled: S.optional(S.Boolean.pipe(T.Query())),
324
+ include_users: S.optional(S.Boolean.pipe(T.Query())),
325
+ team_id: S.optional(S.String.pipe(T.Query())),
326
+ }).pipe(T.Http({ method: "GET", uri: "/usergroups.list", code: 200 })),
327
+ ).annotate({ identifier: "ListUsergroupsRequest" });
328
+ case 1:
329
+ return S.suspend(() =>
330
+ S.Struct({
331
+ ok: S.Boolean,
332
+ usergroups: __S(12, __c6, 0),
333
+ }),
334
+ ).annotate({ identifier: "ListUsergroupsResponse" });
335
+ }
336
+ }
337
+ function __c6(j: number): any {
338
+ switch (j) {
339
+ case 0:
340
+ return S.Array(S.Unknown);
341
+ }
342
+ }
343
+ function __c7(j: number): any {
344
+ switch (j) {
345
+ case 0:
346
+ return S.suspend(() =>
347
+ S.Struct({
348
+ include_disabled: S.optional(S.Boolean.pipe(T.Query())),
349
+ usergroup: S.String.pipe(T.Query()),
350
+ team_id: S.optional(S.String.pipe(T.Query())),
351
+ }).pipe(T.Http({ method: "GET", uri: "/usergroups.users.list", code: 200 })),
352
+ ).annotate({ identifier: "ListUsersRequest" });
353
+ case 1:
354
+ return S.suspend(() =>
355
+ S.Struct({
356
+ ok: S.Boolean,
357
+ users: __S(12, __c6, 0),
358
+ }),
359
+ ).annotate({ identifier: "ListUsersResponse" });
360
+ }
361
+ }
362
+ function __c8(j: number): any {
363
+ switch (j) {
364
+ case 0:
365
+ return S.suspend(() =>
366
+ S.Struct({
367
+ include_count: S.optional(S.Boolean),
368
+ team_id: S.optional(S.String),
369
+ usergroup: S.String,
370
+ users: __S(4, __c2, 0),
371
+ additional_channels: S.optional(__S(4, __c2, 0)),
372
+ is_shared: S.optional(S.Boolean),
373
+ }).pipe(T.Http({ method: "POST", uri: "/usergroups.users.update", code: 200 })),
374
+ ).annotate({ identifier: "UpdateUserRequest" });
375
+ }
376
+ }
377
+ function __c9(j: number): any {
378
+ switch (j) {
379
+ case 0:
380
+ return S.suspend(() =>
381
+ S.Struct({
382
+ channels: S.optional(__S(4, __c2, 0)),
383
+ additional_channels: S.optional(__S(4, __c2, 0)),
384
+ description: S.optional(S.String),
385
+ handle: S.optional(S.String),
386
+ include_count: S.optional(S.Boolean),
387
+ name: S.optional(S.String),
388
+ team_id: S.optional(S.String),
389
+ usergroup: S.String,
390
+ enable_section: S.optional(S.Boolean),
391
+ }).pipe(T.Http({ method: "POST", uri: "/usergroups.update", code: 200 })),
392
+ ).annotate({ identifier: "UpdateUsergroupRequest" });
393
+ case 1:
394
+ return S.suspend(() =>
395
+ S.Struct({
396
+ ok: S.Boolean,
397
+ usergroup: S.Unknown,
398
+ channel_limit_user_ids: S.optional(__S(4, __c2, 0)),
399
+ }),
400
+ ).annotate({ identifier: "UpdateUsergroupResponse" });
401
+ }
402
+ }
403
+ // Schema table: entry i is schema j of builder f, made on first reach.
404
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
405
+ return (__s[i] ??= __L.at(f, j));
406
+ }