@distilled.cloud/slack 0.0.0 → 1.0.0-rc.10

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 (212) hide show
  1. package/LICENSE +201 -0
  2. package/lib/credentials.d.ts +27 -0
  3. package/lib/credentials.d.ts.map +1 -0
  4. package/lib/credentials.js +53 -0
  5. package/lib/credentials.js.map +1 -0
  6. package/lib/errors.d.ts +83 -0
  7. package/lib/errors.d.ts.map +1 -0
  8. package/lib/errors.js +59 -0
  9. package/lib/errors.js.map +1 -0
  10. package/lib/index.d.ts +17 -0
  11. package/lib/index.d.ts.map +1 -0
  12. package/lib/index.js +17 -0
  13. package/lib/index.js.map +1 -0
  14. package/lib/pagination.d.ts +31 -0
  15. package/lib/pagination.d.ts.map +1 -0
  16. package/lib/pagination.js +31 -0
  17. package/lib/pagination.js.map +1 -0
  18. package/lib/protocol.d.ts +18 -0
  19. package/lib/protocol.d.ts.map +1 -0
  20. package/lib/protocol.js +230 -0
  21. package/lib/protocol.js.map +1 -0
  22. package/lib/retry.d.ts +52 -0
  23. package/lib/retry.d.ts.map +1 -0
  24. package/lib/retry.js +45 -0
  25. package/lib/retry.js.map +1 -0
  26. package/lib/services/admin.d.ts +2796 -0
  27. package/lib/services/admin.d.ts.map +1 -0
  28. package/lib/services/admin.js +3217 -0
  29. package/lib/services/admin.js.map +1 -0
  30. package/lib/services/api.d.ts +23 -0
  31. package/lib/services/api.d.ts.map +1 -0
  32. package/lib/services/api.js +26 -0
  33. package/lib/services/api.js.map +1 -0
  34. package/lib/services/apps.d.ts +568 -0
  35. package/lib/services/apps.d.ts.map +1 -0
  36. package/lib/services/apps.js +584 -0
  37. package/lib/services/apps.js.map +1 -0
  38. package/lib/services/assistant.d.ts +290 -0
  39. package/lib/services/assistant.d.ts.map +1 -0
  40. package/lib/services/assistant.js +232 -0
  41. package/lib/services/assistant.js.map +1 -0
  42. package/lib/services/auth.d.ts +90 -0
  43. package/lib/services/auth.d.ts.map +1 -0
  44. package/lib/services/auth.js +114 -0
  45. package/lib/services/auth.js.map +1 -0
  46. package/lib/services/blocks.d.ts +31 -0
  47. package/lib/services/blocks.d.ts.map +1 -0
  48. package/lib/services/blocks.js +31 -0
  49. package/lib/services/blocks.js.map +1 -0
  50. package/lib/services/bookmarks.d.ts +91 -0
  51. package/lib/services/bookmarks.d.ts.map +1 -0
  52. package/lib/services/bookmarks.js +98 -0
  53. package/lib/services/bookmarks.js.map +1 -0
  54. package/lib/services/bots.d.ts +60 -0
  55. package/lib/services/bots.d.ts.map +1 -0
  56. package/lib/services/bots.js +68 -0
  57. package/lib/services/bots.js.map +1 -0
  58. package/lib/services/calls.d.ts +124 -0
  59. package/lib/services/calls.d.ts.map +1 -0
  60. package/lib/services/calls.js +136 -0
  61. package/lib/services/calls.js.map +1 -0
  62. package/lib/services/canvases.d.ts +152 -0
  63. package/lib/services/canvases.d.ts.map +1 -0
  64. package/lib/services/canvases.js +152 -0
  65. package/lib/services/canvases.js.map +1 -0
  66. package/lib/services/chat.d.ts +525 -0
  67. package/lib/services/chat.d.ts.map +1 -0
  68. package/lib/services/chat.js +436 -0
  69. package/lib/services/chat.js.map +1 -0
  70. package/lib/services/conversations.d.ts +642 -0
  71. package/lib/services/conversations.d.ts.map +1 -0
  72. package/lib/services/conversations.js +769 -0
  73. package/lib/services/conversations.js.map +1 -0
  74. package/lib/services/dialog.d.ts +20 -0
  75. package/lib/services/dialog.d.ts.map +1 -0
  76. package/lib/services/dialog.js +27 -0
  77. package/lib/services/dialog.js.map +1 -0
  78. package/lib/services/dnd.d.ts +94 -0
  79. package/lib/services/dnd.d.ts.map +1 -0
  80. package/lib/services/dnd.js +111 -0
  81. package/lib/services/dnd.js.map +1 -0
  82. package/lib/services/emoji.d.ts +35 -0
  83. package/lib/services/emoji.d.ts.map +1 -0
  84. package/lib/services/emoji.js +40 -0
  85. package/lib/services/emoji.js.map +1 -0
  86. package/lib/services/entity.d.ts +93 -0
  87. package/lib/services/entity.d.ts.map +1 -0
  88. package/lib/services/entity.js +89 -0
  89. package/lib/services/entity.js.map +1 -0
  90. package/lib/services/files.d.ts +473 -0
  91. package/lib/services/files.d.ts.map +1 -0
  92. package/lib/services/files.js +510 -0
  93. package/lib/services/files.js.map +1 -0
  94. package/lib/services/functions.d.ts +235 -0
  95. package/lib/services/functions.d.ts.map +1 -0
  96. package/lib/services/functions.js +256 -0
  97. package/lib/services/functions.js.map +1 -0
  98. package/lib/services/index.d.ts +35 -0
  99. package/lib/services/index.d.ts.map +1 -0
  100. package/lib/services/index.js +36 -0
  101. package/lib/services/index.js.map +1 -0
  102. package/lib/services/lists.d.ts +300 -0
  103. package/lib/services/lists.d.ts.map +1 -0
  104. package/lib/services/lists.js +366 -0
  105. package/lib/services/lists.js.map +1 -0
  106. package/lib/services/migration.d.ts +34 -0
  107. package/lib/services/migration.d.ts.map +1 -0
  108. package/lib/services/migration.js +36 -0
  109. package/lib/services/migration.js.map +1 -0
  110. package/lib/services/oauth.d.ts +307 -0
  111. package/lib/services/oauth.d.ts.map +1 -0
  112. package/lib/services/oauth.js +278 -0
  113. package/lib/services/oauth.js.map +1 -0
  114. package/lib/services/openid.d.ts +86 -0
  115. package/lib/services/openid.d.ts.map +1 -0
  116. package/lib/services/openid.js +93 -0
  117. package/lib/services/openid.js.map +1 -0
  118. package/lib/services/pins.d.ts +64 -0
  119. package/lib/services/pins.d.ts.map +1 -0
  120. package/lib/services/pins.js +75 -0
  121. package/lib/services/pins.js.map +1 -0
  122. package/lib/services/reactions.d.ts +108 -0
  123. package/lib/services/reactions.d.ts.map +1 -0
  124. package/lib/services/reactions.js +119 -0
  125. package/lib/services/reactions.js.map +1 -0
  126. package/lib/services/reminders.d.ts +89 -0
  127. package/lib/services/reminders.d.ts.map +1 -0
  128. package/lib/services/reminders.js +109 -0
  129. package/lib/services/reminders.js.map +1 -0
  130. package/lib/services/rtm.d.ts +68 -0
  131. package/lib/services/rtm.d.ts.map +1 -0
  132. package/lib/services/rtm.js +74 -0
  133. package/lib/services/rtm.js.map +1 -0
  134. package/lib/services/search.d.ts +239 -0
  135. package/lib/services/search.d.ts.map +1 -0
  136. package/lib/services/search.js +190 -0
  137. package/lib/services/search.js.map +1 -0
  138. package/lib/services/stars.d.ts +126 -0
  139. package/lib/services/stars.d.ts.map +1 -0
  140. package/lib/services/stars.js +145 -0
  141. package/lib/services/stars.js.map +1 -0
  142. package/lib/services/team.d.ts +309 -0
  143. package/lib/services/team.d.ts.map +1 -0
  144. package/lib/services/team.js +333 -0
  145. package/lib/services/team.js.map +1 -0
  146. package/lib/services/tooling.d.ts +31 -0
  147. package/lib/services/tooling.d.ts.map +1 -0
  148. package/lib/services/tooling.js +38 -0
  149. package/lib/services/tooling.js.map +1 -0
  150. package/lib/services/usergroups.d.ts +183 -0
  151. package/lib/services/usergroups.d.ts.map +1 -0
  152. package/lib/services/usergroups.js +180 -0
  153. package/lib/services/usergroups.js.map +1 -0
  154. package/lib/services/users.d.ts +246 -0
  155. package/lib/services/users.d.ts.map +1 -0
  156. package/lib/services/users.js +309 -0
  157. package/lib/services/users.js.map +1 -0
  158. package/lib/services/views.d.ts +84 -0
  159. package/lib/services/views.d.ts.map +1 -0
  160. package/lib/services/views.js +95 -0
  161. package/lib/services/views.js.map +1 -0
  162. package/lib/services/workflows.d.ts +231 -0
  163. package/lib/services/workflows.d.ts.map +1 -0
  164. package/lib/services/workflows.js +238 -0
  165. package/lib/services/workflows.js.map +1 -0
  166. package/lib/traits.d.ts +11 -0
  167. package/lib/traits.d.ts.map +1 -0
  168. package/lib/traits.js +12 -0
  169. package/lib/traits.js.map +1 -0
  170. package/package.json +82 -4
  171. package/src/credentials.ts +86 -0
  172. package/src/errors.ts +101 -0
  173. package/src/index.ts +20 -0
  174. package/src/pagination.ts +35 -0
  175. package/src/protocol.ts +326 -0
  176. package/src/retry.ts +76 -0
  177. package/src/services/admin.ts +7722 -0
  178. package/src/services/api.ts +58 -0
  179. package/src/services/apps.ts +1441 -0
  180. package/src/services/assistant.ts +639 -0
  181. package/src/services/auth.ts +241 -0
  182. package/src/services/blocks.ts +80 -0
  183. package/src/services/bookmarks.ts +223 -0
  184. package/src/services/bots.ts +144 -0
  185. package/src/services/calls.ts +318 -0
  186. package/src/services/canvases.ts +392 -0
  187. package/src/services/chat.ts +1191 -0
  188. package/src/services/conversations.ts +1754 -0
  189. package/src/services/dialog.ts +55 -0
  190. package/src/services/dnd.ts +246 -0
  191. package/src/services/emoji.ts +91 -0
  192. package/src/services/entity.ts +225 -0
  193. package/src/services/files.ts +1192 -0
  194. package/src/services/functions.ts +642 -0
  195. package/src/services/index.ts +35 -0
  196. package/src/services/lists.ts +832 -0
  197. package/src/services/migration.ts +85 -0
  198. package/src/services/oauth.ts +658 -0
  199. package/src/services/openid.ts +243 -0
  200. package/src/services/pins.ts +167 -0
  201. package/src/services/reactions.ts +272 -0
  202. package/src/services/reminders.ts +240 -0
  203. package/src/services/rtm.ts +162 -0
  204. package/src/services/search.ts +507 -0
  205. package/src/services/stars.ts +323 -0
  206. package/src/services/team.ts +834 -0
  207. package/src/services/tooling.ts +78 -0
  208. package/src/services/usergroups.ts +441 -0
  209. package/src/services/users.ts +685 -0
  210. package/src/services/views.ts +212 -0
  211. package/src/services/workflows.ts +605 -0
  212. package/src/traits.ts +45 -0
@@ -0,0 +1,78 @@
1
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
2
+ import * as S from "@distilled.cloud/core/schema";
3
+ import * as Redacted from "effect/Redacted";
4
+ import * as API from "@distilled.cloud/core/api";
5
+ import * as T from "../traits.ts";
6
+ import {
7
+ SlackProtocol,
8
+ type SlackOpError,
9
+ type SlackOpContext,
10
+ } from "../protocol.ts";
11
+ import { SlackError, SlackRateLimited } from "../errors.ts";
12
+ import * as Retry from "../retry.ts";
13
+
14
+ export type { SlackOpError, SlackOpContext };
15
+
16
+ export interface RotateTokenRequest {
17
+ /** The `xoxe` refresh token that was issued along with the old app configuration token. */
18
+ refresh_token: string | Redacted.Redacted<string>;
19
+ }
20
+ export const RotateTokenRequest = /*@__PURE__*/ S.suspend(() =>
21
+ S.Struct({
22
+ refresh_token: S.String.pipe(T.SensitiveValue({})),
23
+ }).pipe(
24
+ T.Http({
25
+ method: "POST",
26
+ uri: "/tooling.tokens.rotate",
27
+ code: 200,
28
+ contentType: "form-urlencoded",
29
+ }),
30
+ ),
31
+ ).annotate({
32
+ identifier: "RotateTokenRequest",
33
+ }) as any as S.Schema<RotateTokenRequest>;
34
+
35
+ export interface RotateTokenResponse {
36
+ /** Always `true` (a failed call raises a typed error instead). */
37
+ ok: boolean;
38
+ /** The app configuration token used to access App Manifest APIs */
39
+ token: string;
40
+ /** Refresh token for this credential */
41
+ refresh_token: string | Redacted.Redacted<string>;
42
+ /** ID of the team associated with the access token. */
43
+ team_id: string;
44
+ /** The ID of the user associated with the token. */
45
+ user_id: string;
46
+ /** Expiration time (exp) identifies the expiration time on or after which the token must not be accepted for processing. */
47
+ exp: number;
48
+ /** Issued at (iat) identifies the time at which the token was issued. */
49
+ iat: number;
50
+ }
51
+ export const RotateTokenResponse = /*@__PURE__*/ S.suspend(() =>
52
+ S.Struct({
53
+ ok: S.Boolean,
54
+ token: S.String,
55
+ refresh_token: S.String.pipe(T.SensitiveValue({})),
56
+ team_id: S.String,
57
+ user_id: S.String,
58
+ exp: S.Number,
59
+ iat: S.Number,
60
+ }),
61
+ ).annotate({
62
+ identifier: "RotateTokenResponse",
63
+ }) as any as S.Schema<RotateTokenResponse>;
64
+
65
+ export type RotateTokenError = SlackOpError;
66
+ /** 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 */
67
+ export const rotateToken: API.OperationMethod<
68
+ RotateTokenRequest,
69
+ RotateTokenResponse,
70
+ RotateTokenError,
71
+ SlackOpContext
72
+ > = /*@__PURE__*/ API.make(() => ({
73
+ input: RotateTokenRequest,
74
+ output: RotateTokenResponse,
75
+ errors: [SlackError, SlackRateLimited],
76
+ protocol: SlackProtocol,
77
+ retry: Retry.Retry,
78
+ }));
@@ -0,0 +1,441 @@
1
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
2
+ import * as S from "@distilled.cloud/core/schema";
3
+ import * as API from "@distilled.cloud/core/api";
4
+ import * as T from "../traits.ts";
5
+ import {
6
+ SlackProtocol,
7
+ type SlackOpError,
8
+ type SlackOpContext,
9
+ } from "../protocol.ts";
10
+ import { SlackError, SlackRateLimited } from "../errors.ts";
11
+ import * as Retry from "../retry.ts";
12
+
13
+ export type { SlackOpError, SlackOpContext };
14
+
15
+ /** A comma separated string of encoded channel IDs for which the User Group uses as a default. */
16
+ export type CreateUsergroupRequestChannelsList = Array<string>;
17
+ export const CreateUsergroupRequestChannelsList = /*@__PURE__*/ S.Array(
18
+ S.String,
19
+ ) as any as S.Schema<CreateUsergroupRequestChannelsList>;
20
+
21
+ /** A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too. */
22
+ export type CreateUsergroupRequestAdditionalChannelsList = Array<string>;
23
+ export const CreateUsergroupRequestAdditionalChannelsList =
24
+ /*@__PURE__*/ S.Array(
25
+ S.String,
26
+ ) as any as S.Schema<CreateUsergroupRequestAdditionalChannelsList>;
27
+
28
+ export interface CreateUsergroupRequest {
29
+ /** A comma separated string of encoded channel IDs for which the User Group uses as a default. */
30
+ channels?: CreateUsergroupRequestChannelsList;
31
+ /** A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too. */
32
+ additional_channels?: CreateUsergroupRequestAdditionalChannelsList;
33
+ /** A short description of the User Group. */
34
+ description?: string;
35
+ /** A mention handle. Must be unique among channels, users and User Groups. */
36
+ handle?: string;
37
+ /** Include the number of users in each User Group. */
38
+ include_count?: boolean;
39
+ /** A name for the User Group. Must be unique among User Groups. */
40
+ name: string;
41
+ /** Encoded team id where the user group has to be created, required if org token is used. */
42
+ team_id?: string;
43
+ /** 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. */
44
+ enable_section?: boolean;
45
+ }
46
+ export const CreateUsergroupRequest = /*@__PURE__*/ S.suspend(() =>
47
+ S.Struct({
48
+ channels: S.optional(CreateUsergroupRequestChannelsList),
49
+ additional_channels: S.optional(
50
+ CreateUsergroupRequestAdditionalChannelsList,
51
+ ),
52
+ description: S.optional(S.String),
53
+ handle: S.optional(S.String),
54
+ include_count: S.optional(S.Boolean),
55
+ name: S.String,
56
+ team_id: S.optional(S.String),
57
+ enable_section: S.optional(S.Boolean),
58
+ }).pipe(T.Http({ method: "POST", uri: "/usergroups.create", code: 200 })),
59
+ ).annotate({
60
+ identifier: "CreateUsergroupRequest",
61
+ }) as any as S.Schema<CreateUsergroupRequest>;
62
+
63
+ export interface CreateUsergroupResponse {
64
+ /** Always `true` (a failed call raises a typed error instead). */
65
+ ok: boolean;
66
+ usergroup: unknown;
67
+ }
68
+ export const CreateUsergroupResponse = /*@__PURE__*/ S.suspend(() =>
69
+ S.Struct({
70
+ ok: S.Boolean,
71
+ usergroup: S.Unknown,
72
+ }),
73
+ ).annotate({
74
+ identifier: "CreateUsergroupResponse",
75
+ }) as any as S.Schema<CreateUsergroupResponse>;
76
+
77
+ export interface DisableUsergroupRequest {
78
+ /** Include the number of users in the User Group. */
79
+ include_count?: boolean;
80
+ /** Encoded target team id where the user group is, required if org token is used. */
81
+ team_id?: string;
82
+ /** The encoded ID of the User Group to disable. */
83
+ usergroup: string;
84
+ }
85
+ export const DisableUsergroupRequest = /*@__PURE__*/ S.suspend(() =>
86
+ S.Struct({
87
+ include_count: S.optional(S.Boolean),
88
+ team_id: S.optional(S.String),
89
+ usergroup: S.String,
90
+ }).pipe(T.Http({ method: "POST", uri: "/usergroups.disable", code: 200 })),
91
+ ).annotate({
92
+ identifier: "DisableUsergroupRequest",
93
+ }) as any as S.Schema<DisableUsergroupRequest>;
94
+
95
+ export interface DisableUsergroupResponse {
96
+ /** Always `true` (a failed call raises a typed error instead). */
97
+ ok: boolean;
98
+ usergroup: unknown;
99
+ }
100
+ export const DisableUsergroupResponse = /*@__PURE__*/ S.suspend(() =>
101
+ S.Struct({
102
+ ok: S.Boolean,
103
+ usergroup: S.Unknown,
104
+ }),
105
+ ).annotate({
106
+ identifier: "DisableUsergroupResponse",
107
+ }) as any as S.Schema<DisableUsergroupResponse>;
108
+
109
+ export interface EnableUsergroupRequest {
110
+ /** Include the number of users in the User Group. */
111
+ include_count?: boolean;
112
+ /** Encoded team id where the user group is, required if org token is used. */
113
+ team_id?: string;
114
+ /** The encoded ID of the User Group to enable. */
115
+ usergroup: string;
116
+ }
117
+ export const EnableUsergroupRequest = /*@__PURE__*/ S.suspend(() =>
118
+ S.Struct({
119
+ include_count: S.optional(S.Boolean),
120
+ team_id: S.optional(S.String),
121
+ usergroup: S.String,
122
+ }).pipe(T.Http({ method: "POST", uri: "/usergroups.enable", code: 200 })),
123
+ ).annotate({
124
+ identifier: "EnableUsergroupRequest",
125
+ }) as any as S.Schema<EnableUsergroupRequest>;
126
+
127
+ export interface EnableUsergroupResponse {
128
+ /** Always `true` (a failed call raises a typed error instead). */
129
+ ok: boolean;
130
+ usergroup: unknown;
131
+ }
132
+ export const EnableUsergroupResponse = /*@__PURE__*/ S.suspend(() =>
133
+ S.Struct({
134
+ ok: S.Boolean,
135
+ usergroup: S.Unknown,
136
+ }),
137
+ ).annotate({
138
+ identifier: "EnableUsergroupResponse",
139
+ }) as any as S.Schema<EnableUsergroupResponse>;
140
+
141
+ export interface ListUsergroupsRequest {
142
+ /** Include the number of users in each User Group. */
143
+ include_count?: boolean;
144
+ /** Include results for disabled User Groups. */
145
+ include_disabled?: boolean;
146
+ /** Include the list of users for each User Group. */
147
+ include_users?: boolean;
148
+ /** The user group's encoded team ID. Required if org token is used. */
149
+ team_id?: string;
150
+ }
151
+ export const ListUsergroupsRequest = /*@__PURE__*/ S.suspend(() =>
152
+ S.Struct({
153
+ include_count: S.optional(S.Boolean.pipe(T.Query())),
154
+ include_disabled: S.optional(S.Boolean.pipe(T.Query())),
155
+ include_users: S.optional(S.Boolean.pipe(T.Query())),
156
+ team_id: S.optional(S.String.pipe(T.Query())),
157
+ }).pipe(T.Http({ method: "GET", uri: "/usergroups.list", code: 200 })),
158
+ ).annotate({
159
+ identifier: "ListUsergroupsRequest",
160
+ }) as any as S.Schema<ListUsergroupsRequest>;
161
+
162
+ export type ListUsergroupsResponseUsergroupsList = Array<unknown>;
163
+ export const ListUsergroupsResponseUsergroupsList = /*@__PURE__*/ S.Array(
164
+ S.Unknown,
165
+ ) as any as S.Schema<ListUsergroupsResponseUsergroupsList>;
166
+
167
+ export interface ListUsergroupsResponse {
168
+ /** Always `true` (a failed call raises a typed error instead). */
169
+ ok: boolean;
170
+ usergroups: ListUsergroupsResponseUsergroupsList;
171
+ }
172
+ export const ListUsergroupsResponse = /*@__PURE__*/ S.suspend(() =>
173
+ S.Struct({
174
+ ok: S.Boolean,
175
+ usergroups: ListUsergroupsResponseUsergroupsList,
176
+ }),
177
+ ).annotate({
178
+ identifier: "ListUsergroupsResponse",
179
+ }) as any as S.Schema<ListUsergroupsResponse>;
180
+
181
+ export interface ListUsersRequest {
182
+ /** Include results for disabled User Groups. */
183
+ include_disabled?: boolean;
184
+ /** The encoded ID of the User Group. */
185
+ usergroup: string;
186
+ /** The user group's encoded team ID. Required if org token is used. */
187
+ team_id?: string;
188
+ }
189
+ export const ListUsersRequest = /*@__PURE__*/ S.suspend(() =>
190
+ S.Struct({
191
+ include_disabled: S.optional(S.Boolean.pipe(T.Query())),
192
+ usergroup: S.String.pipe(T.Query()),
193
+ team_id: S.optional(S.String.pipe(T.Query())),
194
+ }).pipe(T.Http({ method: "GET", uri: "/usergroups.users.list", code: 200 })),
195
+ ).annotate({
196
+ identifier: "ListUsersRequest",
197
+ }) as any as S.Schema<ListUsersRequest>;
198
+
199
+ export type ListUsersResponseUsersList = Array<unknown>;
200
+ export const ListUsersResponseUsersList = /*@__PURE__*/ S.Array(
201
+ S.Unknown,
202
+ ) as any as S.Schema<ListUsersResponseUsersList>;
203
+
204
+ export interface ListUsersResponse {
205
+ /** Always `true` (a failed call raises a typed error instead). */
206
+ ok: boolean;
207
+ users: ListUsersResponseUsersList;
208
+ }
209
+ export const ListUsersResponse = /*@__PURE__*/ S.suspend(() =>
210
+ S.Struct({
211
+ ok: S.Boolean,
212
+ users: ListUsersResponseUsersList,
213
+ }),
214
+ ).annotate({
215
+ identifier: "ListUsersResponse",
216
+ }) as any as S.Schema<ListUsersResponse>;
217
+
218
+ /** A comma separated string of encoded user IDs that represent the entire list of users for the user group. */
219
+ export type UpdateUserRequestUsersList = Array<string>;
220
+ export const UpdateUserRequestUsersList = /*@__PURE__*/ S.Array(
221
+ S.String,
222
+ ) as any as S.Schema<UpdateUserRequestUsersList>;
223
+
224
+ /** A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too. */
225
+ export type UpdateUserRequestAdditionalChannelsList = Array<string>;
226
+ export const UpdateUserRequestAdditionalChannelsList = /*@__PURE__*/ S.Array(
227
+ S.String,
228
+ ) as any as S.Schema<UpdateUserRequestAdditionalChannelsList>;
229
+
230
+ export interface UpdateUserRequest {
231
+ /** Include the number of users in the user group. */
232
+ include_count?: boolean;
233
+ /** encoded team id where the user group exists, required if org token is used */
234
+ team_id?: string;
235
+ /** The encoded ID of the user group to update. */
236
+ usergroup: string;
237
+ /** A comma separated string of encoded user IDs that represent the entire list of users for the user group. */
238
+ users: UpdateUserRequestUsersList;
239
+ /** A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too. */
240
+ additional_channels?: UpdateUserRequestAdditionalChannelsList;
241
+ /** Boolean to identify if the API is getting called when a shared section is getting shared */
242
+ is_shared?: boolean;
243
+ }
244
+ export const UpdateUserRequest = /*@__PURE__*/ S.suspend(() =>
245
+ S.Struct({
246
+ include_count: S.optional(S.Boolean),
247
+ team_id: S.optional(S.String),
248
+ usergroup: S.String,
249
+ users: UpdateUserRequestUsersList,
250
+ additional_channels: S.optional(UpdateUserRequestAdditionalChannelsList),
251
+ is_shared: S.optional(S.Boolean),
252
+ }).pipe(
253
+ T.Http({ method: "POST", uri: "/usergroups.users.update", code: 200 }),
254
+ ),
255
+ ).annotate({
256
+ identifier: "UpdateUserRequest",
257
+ }) as any as S.Schema<UpdateUserRequest>;
258
+
259
+ export interface UpdateUserResponse {
260
+ /** Always `true` (a failed call raises a typed error instead). */
261
+ ok: boolean;
262
+ usergroup: unknown;
263
+ }
264
+ export const UpdateUserResponse = /*@__PURE__*/ S.suspend(() =>
265
+ S.Struct({
266
+ ok: S.Boolean,
267
+ usergroup: S.Unknown,
268
+ }),
269
+ ).annotate({
270
+ identifier: "UpdateUserResponse",
271
+ }) as any as S.Schema<UpdateUserResponse>;
272
+
273
+ /** A comma separated string of encoded channel IDs for which the User Group uses as a default. */
274
+ export type UpdateUsergroupRequestChannelsList = Array<string>;
275
+ export const UpdateUsergroupRequestChannelsList = /*@__PURE__*/ S.Array(
276
+ S.String,
277
+ ) as any as S.Schema<UpdateUsergroupRequestChannelsList>;
278
+
279
+ /** A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too. */
280
+ export type UpdateUsergroupRequestAdditionalChannelsList = Array<string>;
281
+ export const UpdateUsergroupRequestAdditionalChannelsList =
282
+ /*@__PURE__*/ S.Array(
283
+ S.String,
284
+ ) as any as S.Schema<UpdateUsergroupRequestAdditionalChannelsList>;
285
+
286
+ export interface UpdateUsergroupRequest {
287
+ /** A comma separated string of encoded channel IDs for which the User Group uses as a default. */
288
+ channels?: UpdateUsergroupRequestChannelsList;
289
+ /** A comma separated string of encoded channel IDs for which the User Group can custom add usergroup members too. */
290
+ additional_channels?: UpdateUsergroupRequestAdditionalChannelsList;
291
+ /** A short description of the User Group. */
292
+ description?: string;
293
+ /** A mention handle. Must be unique among channels, users and User Groups. */
294
+ handle?: string;
295
+ /** Include the number of users in the User Group. */
296
+ include_count?: boolean;
297
+ /** A name for the User Group. Must be unique among User Groups. */
298
+ name?: string;
299
+ /** encoded team id where the user group exists, required if org token is used */
300
+ team_id?: string;
301
+ /** The encoded ID of the User Group to update. */
302
+ usergroup: string;
303
+ /** 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. */
304
+ enable_section?: boolean;
305
+ }
306
+ export const UpdateUsergroupRequest = /*@__PURE__*/ S.suspend(() =>
307
+ S.Struct({
308
+ channels: S.optional(UpdateUsergroupRequestChannelsList),
309
+ additional_channels: S.optional(
310
+ UpdateUsergroupRequestAdditionalChannelsList,
311
+ ),
312
+ description: S.optional(S.String),
313
+ handle: S.optional(S.String),
314
+ include_count: S.optional(S.Boolean),
315
+ name: S.optional(S.String),
316
+ team_id: S.optional(S.String),
317
+ usergroup: S.String,
318
+ enable_section: S.optional(S.Boolean),
319
+ }).pipe(T.Http({ method: "POST", uri: "/usergroups.update", code: 200 })),
320
+ ).annotate({
321
+ identifier: "UpdateUsergroupRequest",
322
+ }) as any as S.Schema<UpdateUsergroupRequest>;
323
+
324
+ export interface UpdateUsergroupResponse {
325
+ /** Always `true` (a failed call raises a typed error instead). */
326
+ ok: boolean;
327
+ usergroup: unknown;
328
+ }
329
+ export const UpdateUsergroupResponse = /*@__PURE__*/ S.suspend(() =>
330
+ S.Struct({
331
+ ok: S.Boolean,
332
+ usergroup: S.Unknown,
333
+ }),
334
+ ).annotate({
335
+ identifier: "UpdateUsergroupResponse",
336
+ }) as any as S.Schema<UpdateUsergroupResponse>;
337
+
338
+ export type CreateUsergroupError = SlackOpError;
339
+ /** 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 */
340
+ export const createUsergroup: API.OperationMethod<
341
+ CreateUsergroupRequest,
342
+ CreateUsergroupResponse,
343
+ CreateUsergroupError,
344
+ SlackOpContext
345
+ > = /*@__PURE__*/ API.make(() => ({
346
+ input: CreateUsergroupRequest,
347
+ output: CreateUsergroupResponse,
348
+ errors: [SlackError, SlackRateLimited],
349
+ protocol: SlackProtocol,
350
+ retry: Retry.Retry,
351
+ }));
352
+
353
+ export type DisableUsergroupError = SlackOpError;
354
+ /** 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 */
355
+ export const disableUsergroup: API.OperationMethod<
356
+ DisableUsergroupRequest,
357
+ DisableUsergroupResponse,
358
+ DisableUsergroupError,
359
+ SlackOpContext
360
+ > = /*@__PURE__*/ API.make(() => ({
361
+ input: DisableUsergroupRequest,
362
+ output: DisableUsergroupResponse,
363
+ errors: [SlackError, SlackRateLimited],
364
+ protocol: SlackProtocol,
365
+ retry: Retry.Retry,
366
+ }));
367
+
368
+ export type EnableUsergroupError = SlackOpError;
369
+ /** 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 */
370
+ export const enableUsergroup: API.OperationMethod<
371
+ EnableUsergroupRequest,
372
+ EnableUsergroupResponse,
373
+ EnableUsergroupError,
374
+ SlackOpContext
375
+ > = /*@__PURE__*/ API.make(() => ({
376
+ input: EnableUsergroupRequest,
377
+ output: EnableUsergroupResponse,
378
+ errors: [SlackError, SlackRateLimited],
379
+ protocol: SlackProtocol,
380
+ retry: Retry.Retry,
381
+ }));
382
+
383
+ export type ListUsergroupsError = SlackOpError;
384
+ /** 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 */
385
+ export const listUsergroups: API.OperationMethod<
386
+ ListUsergroupsRequest,
387
+ ListUsergroupsResponse,
388
+ ListUsergroupsError,
389
+ SlackOpContext
390
+ > = /*@__PURE__*/ API.make(() => ({
391
+ input: ListUsergroupsRequest,
392
+ output: ListUsergroupsResponse,
393
+ errors: [SlackError, SlackRateLimited],
394
+ protocol: SlackProtocol,
395
+ retry: Retry.Retry,
396
+ }));
397
+
398
+ export type ListUsersError = SlackOpError;
399
+ /** 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 */
400
+ export const listUsers: API.OperationMethod<
401
+ ListUsersRequest,
402
+ ListUsersResponse,
403
+ ListUsersError,
404
+ SlackOpContext
405
+ > = /*@__PURE__*/ API.make(() => ({
406
+ input: ListUsersRequest,
407
+ output: ListUsersResponse,
408
+ errors: [SlackError, SlackRateLimited],
409
+ protocol: SlackProtocol,
410
+ retry: Retry.Retry,
411
+ }));
412
+
413
+ export type UpdateUserError = SlackOpError;
414
+ /** 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. See https://docs.slack.dev/reference/methods/usergroups.users.update */
415
+ export const updateUser: API.OperationMethod<
416
+ UpdateUserRequest,
417
+ UpdateUserResponse,
418
+ UpdateUserError,
419
+ SlackOpContext
420
+ > = /*@__PURE__*/ API.make(() => ({
421
+ input: UpdateUserRequest,
422
+ output: UpdateUserResponse,
423
+ errors: [SlackError, SlackRateLimited],
424
+ protocol: SlackProtocol,
425
+ retry: Retry.Retry,
426
+ }));
427
+
428
+ export type UpdateUsergroupError = SlackOpError;
429
+ /** 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. See https://docs.slack.dev/reference/methods/usergroups.update */
430
+ export const updateUsergroup: API.OperationMethod<
431
+ UpdateUsergroupRequest,
432
+ UpdateUsergroupResponse,
433
+ UpdateUsergroupError,
434
+ SlackOpContext
435
+ > = /*@__PURE__*/ API.make(() => ({
436
+ input: UpdateUsergroupRequest,
437
+ output: UpdateUsergroupResponse,
438
+ errors: [SlackError, SlackRateLimited],
439
+ protocol: SlackProtocol,
440
+ retry: Retry.Retry,
441
+ }));