@distilled.cloud/slack 1.0.0-rc.15 → 1.0.0-rc.17

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 (255) hide show
  1. package/lib/.lazy.json +1 -0
  2. package/lib/_bundle/lazy.js +4 -0
  3. package/lib/_bundle/sdk.js +2 -0
  4. package/lib/_bundle/sdk.js.map +1 -0
  5. package/lib/credentials.d.ts +1 -1
  6. package/lib/credentials.d.ts.map +1 -1
  7. package/lib/credentials.js +1 -53
  8. package/lib/errors.d.ts +31 -31
  9. package/lib/errors.d.ts.map +1 -1
  10. package/lib/errors.js +1 -59
  11. package/lib/index.d.ts +1 -1
  12. package/lib/index.js +0 -10
  13. package/lib/index.lazy.js +7 -0
  14. package/lib/pagination.d.ts +2 -2
  15. package/lib/pagination.js +1 -31
  16. package/lib/protocol.d.ts.map +1 -1
  17. package/lib/protocol.js +1 -231
  18. package/lib/retry.d.ts +2 -2
  19. package/lib/retry.d.ts.map +1 -1
  20. package/lib/retry.js +1 -45
  21. package/lib/services/admin.d.ts +123 -575
  22. package/lib/services/admin.d.ts.map +1 -1
  23. package/lib/services/admin.js +141 -2884
  24. package/lib/services/admin.js.map +1 -1
  25. package/lib/services/agents.d.ts +13 -55
  26. package/lib/services/agents.d.ts.map +1 -1
  27. package/lib/services/agents.js +1 -314
  28. package/lib/services/agents.js.map +1 -1
  29. package/lib/services/api.d.ts +0 -4
  30. package/lib/services/api.d.ts.map +1 -1
  31. package/lib/services/api.js +1 -23
  32. package/lib/services/api.js.map +1 -1
  33. package/lib/services/apps.d.ts +25 -106
  34. package/lib/services/apps.d.ts.map +1 -1
  35. package/lib/services/apps.js +35 -515
  36. package/lib/services/apps.js.map +1 -1
  37. package/lib/services/assistant.d.ts +6 -40
  38. package/lib/services/assistant.d.ts.map +1 -1
  39. package/lib/services/assistant.js +1 -209
  40. package/lib/services/assistant.js.map +1 -1
  41. package/lib/services/auth.d.ts +4 -15
  42. package/lib/services/auth.d.ts.map +1 -1
  43. package/lib/services/auth.js +1 -96
  44. package/lib/services/auth.js.map +1 -1
  45. package/lib/services/blocks.d.ts +1 -7
  46. package/lib/services/blocks.d.ts.map +1 -1
  47. package/lib/services/blocks.js +1 -26
  48. package/lib/services/blocks.js.map +1 -1
  49. package/lib/services/bookmarks.d.ts +4 -15
  50. package/lib/services/bookmarks.d.ts.map +1 -1
  51. package/lib/services/bookmarks.js +1 -81
  52. package/lib/services/bookmarks.js.map +1 -1
  53. package/lib/services/bots.d.ts +1 -9
  54. package/lib/services/bots.d.ts.map +1 -1
  55. package/lib/services/bots.js +1 -59
  56. package/lib/services/bots.js.map +1 -1
  57. package/lib/services/calls.d.ts +6 -22
  58. package/lib/services/calls.d.ts.map +1 -1
  59. package/lib/services/calls.js +1 -115
  60. package/lib/services/calls.js.map +1 -1
  61. package/lib/services/canvases.d.ts +7 -35
  62. package/lib/services/canvases.d.ts.map +1 -1
  63. package/lib/services/canvases.js +1 -140
  64. package/lib/services/canvases.js.map +1 -1
  65. package/lib/services/chat.d.ts +14 -83
  66. package/lib/services/chat.d.ts.map +1 -1
  67. package/lib/services/chat.js +1 -387
  68. package/lib/services/chat.js.map +1 -1
  69. package/lib/services/conversations.d.ts +31 -116
  70. package/lib/services/conversations.d.ts.map +1 -1
  71. package/lib/services/conversations.js +40 -696
  72. package/lib/services/conversations.js.map +1 -1
  73. package/lib/services/dialog.d.ts +1 -4
  74. package/lib/services/dialog.d.ts.map +1 -1
  75. package/lib/services/dialog.js +1 -22
  76. package/lib/services/dialog.js.map +1 -1
  77. package/lib/services/dnd.d.ts +5 -17
  78. package/lib/services/dnd.d.ts.map +1 -1
  79. package/lib/services/dnd.js +1 -96
  80. package/lib/services/dnd.js.map +1 -1
  81. package/lib/services/emoji.d.ts +1 -8
  82. package/lib/services/emoji.d.ts.map +1 -1
  83. package/lib/services/emoji.js +1 -34
  84. package/lib/services/emoji.js.map +1 -1
  85. package/lib/services/entity.d.ts +4 -16
  86. package/lib/services/entity.d.ts.map +1 -1
  87. package/lib/services/entity.js +1 -76
  88. package/lib/services/entity.js.map +1 -1
  89. package/lib/services/files.d.ts +16 -80
  90. package/lib/services/files.d.ts.map +1 -1
  91. package/lib/services/files.js +1 -439
  92. package/lib/services/files.js.map +1 -1
  93. package/lib/services/functions.d.ts +8 -49
  94. package/lib/services/functions.d.ts.map +1 -1
  95. package/lib/services/functions.js +1 -208
  96. package/lib/services/functions.js.map +1 -1
  97. package/lib/services/index.js +0 -2
  98. package/lib/services/lists.d.ts +13 -55
  99. package/lib/services/lists.d.ts.map +1 -1
  100. package/lib/services/lists.js +1 -254
  101. package/lib/services/lists.js.map +1 -1
  102. package/lib/services/migration.d.ts +1 -7
  103. package/lib/services/migration.d.ts.map +1 -1
  104. package/lib/services/migration.js +1 -32
  105. package/lib/services/migration.js.map +1 -1
  106. package/lib/services/oauth.d.ts +7 -43
  107. package/lib/services/oauth.d.ts.map +1 -1
  108. package/lib/services/oauth.js +1 -294
  109. package/lib/services/oauth.js.map +1 -1
  110. package/lib/services/openid.d.ts +3 -10
  111. package/lib/services/openid.d.ts.map +1 -1
  112. package/lib/services/openid.js +1 -84
  113. package/lib/services/openid.js.map +1 -1
  114. package/lib/services/pins.d.ts +3 -13
  115. package/lib/services/pins.d.ts.map +1 -1
  116. package/lib/services/pins.js +1 -66
  117. package/lib/services/pins.js.map +1 -1
  118. package/lib/services/reactions.d.ts +5 -17
  119. package/lib/services/reactions.d.ts.map +1 -1
  120. package/lib/services/reactions.js +1 -102
  121. package/lib/services/reactions.js.map +1 -1
  122. package/lib/services/reminders.d.ts +5 -17
  123. package/lib/services/reminders.d.ts.map +1 -1
  124. package/lib/services/reminders.js +1 -88
  125. package/lib/services/reminders.js.map +1 -1
  126. package/lib/services/rtm.d.ts +2 -11
  127. package/lib/services/rtm.d.ts.map +1 -1
  128. package/lib/services/rtm.js +1 -61
  129. package/lib/services/rtm.js.map +1 -1
  130. package/lib/services/search.d.ts +4 -35
  131. package/lib/services/search.d.ts.map +1 -1
  132. package/lib/services/search.js +1 -172
  133. package/lib/services/search.js.map +1 -1
  134. package/lib/services/stars.d.ts +4 -26
  135. package/lib/services/stars.d.ts.map +1 -1
  136. package/lib/services/stars.js +1 -134
  137. package/lib/services/stars.js.map +1 -1
  138. package/lib/services/team.d.ts +11 -63
  139. package/lib/services/team.d.ts.map +1 -1
  140. package/lib/services/team.js +1 -295
  141. package/lib/services/team.js.map +1 -1
  142. package/lib/services/tooling.d.ts +2 -5
  143. package/lib/services/tooling.d.ts.map +1 -1
  144. package/lib/services/tooling.js +1 -33
  145. package/lib/services/tooling.js.map +1 -1
  146. package/lib/services/usergroups.d.ts +7 -31
  147. package/lib/services/usergroups.d.ts.map +1 -1
  148. package/lib/services/usergroups.js +1 -151
  149. package/lib/services/usergroups.js.map +1 -1
  150. package/lib/services/users.d.ts +14 -48
  151. package/lib/services/users.d.ts.map +1 -1
  152. package/lib/services/users.js +1 -255
  153. package/lib/services/users.js.map +1 -1
  154. package/lib/services/views.d.ts +4 -14
  155. package/lib/services/views.d.ts.map +1 -1
  156. package/lib/services/views.js +1 -78
  157. package/lib/services/views.js.map +1 -1
  158. package/lib/services/workflows.d.ts +8 -51
  159. package/lib/services/workflows.d.ts.map +1 -1
  160. package/lib/services/workflows.js +1 -193
  161. package/lib/services/workflows.js.map +1 -1
  162. package/lib/services.lazy/admin.js +3 -0
  163. package/lib/services.lazy/agents.js +1 -0
  164. package/lib/services.lazy/api.js +1 -0
  165. package/lib/services.lazy/apps.js +3 -0
  166. package/lib/services.lazy/assistant.js +1 -0
  167. package/lib/services.lazy/auth.js +1 -0
  168. package/lib/services.lazy/blocks.js +1 -0
  169. package/lib/services.lazy/bookmarks.js +1 -0
  170. package/lib/services.lazy/bots.js +1 -0
  171. package/lib/services.lazy/calls.js +1 -0
  172. package/lib/services.lazy/canvases.js +1 -0
  173. package/lib/services.lazy/chat.js +1 -0
  174. package/lib/services.lazy/conversations.js +3 -0
  175. package/lib/services.lazy/dialog.js +1 -0
  176. package/lib/services.lazy/dnd.js +1 -0
  177. package/lib/services.lazy/emoji.js +1 -0
  178. package/lib/services.lazy/entity.js +1 -0
  179. package/lib/services.lazy/files.js +1 -0
  180. package/lib/services.lazy/functions.js +1 -0
  181. package/lib/services.lazy/index.js +3 -0
  182. package/lib/services.lazy/lists.js +1 -0
  183. package/lib/services.lazy/migration.js +1 -0
  184. package/lib/services.lazy/oauth.js +1 -0
  185. package/lib/services.lazy/openid.js +1 -0
  186. package/lib/services.lazy/pins.js +1 -0
  187. package/lib/services.lazy/reactions.js +1 -0
  188. package/lib/services.lazy/reminders.js +1 -0
  189. package/lib/services.lazy/rtm.js +1 -0
  190. package/lib/services.lazy/search.js +1 -0
  191. package/lib/services.lazy/stars.js +1 -0
  192. package/lib/services.lazy/team.js +1 -0
  193. package/lib/services.lazy/tooling.js +1 -0
  194. package/lib/services.lazy/usergroups.js +1 -0
  195. package/lib/services.lazy/users.js +1 -0
  196. package/lib/services.lazy/views.js +1 -0
  197. package/lib/services.lazy/workflows.js +1 -0
  198. package/lib/traits.d.ts +1 -1
  199. package/lib/traits.js +1 -12
  200. package/package.json +10 -8
  201. package/src/credentials.ts +20 -21
  202. package/src/errors.ts +31 -27
  203. package/src/index.ts +1 -1
  204. package/src/pagination.ts +2 -2
  205. package/src/protocol.ts +30 -29
  206. package/src/retry.ts +6 -6
  207. package/src/services/admin.ts +2717 -3451
  208. package/src/services/agents.ts +380 -370
  209. package/src/services/api.ts +31 -21
  210. package/src/services/apps.ts +569 -621
  211. package/src/services/assistant.ts +235 -270
  212. package/src/services/auth.ts +118 -100
  213. package/src/services/blocks.ts +33 -29
  214. package/src/services/bookmarks.ts +101 -83
  215. package/src/services/bots.ts +74 -67
  216. package/src/services/calls.ts +118 -124
  217. package/src/services/canvases.ts +171 -178
  218. package/src/services/chat.ts +428 -496
  219. package/src/services/conversations.ts +675 -761
  220. package/src/services/dialog.ts +30 -17
  221. package/src/services/dnd.ts +125 -99
  222. package/src/services/emoji.ts +46 -42
  223. package/src/services/entity.ts +94 -92
  224. package/src/services/files.ts +536 -531
  225. package/src/services/functions.ts +209 -274
  226. package/src/services/lists.ts +289 -304
  227. package/src/services/migration.ts +39 -37
  228. package/src/services/oauth.ts +345 -361
  229. package/src/services/openid.ts +137 -122
  230. package/src/services/pins.ts +83 -70
  231. package/src/services/reactions.ts +119 -103
  232. package/src/services/reminders.ts +112 -90
  233. package/src/services/rtm.ts +73 -65
  234. package/src/services/search.ts +193 -244
  235. package/src/services/stars.ts +101 -160
  236. package/src/services/team.ts +333 -369
  237. package/src/services/tooling.ts +43 -30
  238. package/src/services/usergroups.ts +175 -179
  239. package/src/services/users.ts +301 -268
  240. package/src/services/views.ts +85 -80
  241. package/src/services/workflows.ts +184 -269
  242. package/src/traits.ts +1 -1
  243. package/lib/credentials.js.map +0 -1
  244. package/lib/errors.js.map +0 -1
  245. package/lib/pagination.js.map +0 -1
  246. package/lib/protocol.js.map +0 -1
  247. package/lib/protocol.test.d.ts +0 -2
  248. package/lib/protocol.test.d.ts.map +0 -1
  249. package/lib/protocol.test.js +0 -288
  250. package/lib/protocol.test.js.map +0 -1
  251. package/lib/retry.js.map +0 -1
  252. package/lib/services/index.js.map +0 -1
  253. package/lib/traits.js.map +0 -1
  254. package/src/protocol.test.ts +0 -372
  255. /package/lib/{index.js.map → index.lazy.js.map} +0 -0
@@ -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
 
@@ -15,37 +18,12 @@ export interface BeginShortTokenRotationRequest {
15
18
  /** Issued when you created your application. */
16
19
  client_secret: string | Redacted.Redacted<string>;
17
20
  }
18
- export const BeginShortTokenRotationRequest = /*@__PURE__*/ S.suspend(() =>
19
- S.Struct({
20
- client_id: S.String,
21
- client_secret: S.String.pipe(T.SensitiveValue({})),
22
- }).pipe(
23
- T.Http({
24
- method: "POST",
25
- uri: "/oauth.v2.beginShortTokenRotation",
26
- code: 200,
27
- contentType: "form-urlencoded",
28
- }),
29
- ),
30
- ).annotate({
31
- identifier: "BeginShortTokenRotationRequest",
32
- }) as any as S.Schema<BeginShortTokenRotationRequest>;
33
-
34
21
  export interface BeginShortTokenRotationResponse {
35
22
  /** Always `true` (a failed call raises a typed error instead). */
36
23
  ok: boolean;
37
24
  /** A new xoxp access token to replace the token with a shorter secret. Not yet active until completeShortTokenRotation is called. */
38
25
  new_token: string;
39
26
  }
40
- export const BeginShortTokenRotationResponse = /*@__PURE__*/ S.suspend(() =>
41
- S.Struct({
42
- ok: S.Boolean,
43
- new_token: S.String,
44
- }),
45
- ).annotate({
46
- identifier: "BeginShortTokenRotationResponse",
47
- }) as any as S.Schema<BeginShortTokenRotationResponse>;
48
-
49
27
  export interface CompleteShortTokenRotationRequest {
50
28
  /** Issued when you created your application. Must be the app the token being rotated was issued to. */
51
29
  client_id: string;
@@ -54,38 +32,12 @@ export interface CompleteShortTokenRotationRequest {
54
32
  /** The new xoxp token returned by oauth.v2.beginShortTokenRotation. */
55
33
  new_token: string;
56
34
  }
57
- export const CompleteShortTokenRotationRequest = /*@__PURE__*/ S.suspend(() =>
58
- S.Struct({
59
- client_id: S.String,
60
- client_secret: S.String.pipe(T.SensitiveValue({})),
61
- new_token: S.String,
62
- }).pipe(
63
- T.Http({
64
- method: "POST",
65
- uri: "/oauth.v2.completeShortTokenRotation",
66
- code: 200,
67
- contentType: "form-urlencoded",
68
- }),
69
- ),
70
- ).annotate({
71
- identifier: "CompleteShortTokenRotationRequest",
72
- }) as any as S.Schema<CompleteShortTokenRotationRequest>;
73
-
74
35
  export interface CompleteShortTokenRotationResponse {
75
36
  /** Always `true` (a failed call raises a typed error instead). */
76
37
  ok: boolean;
77
38
  /** The new xoxp access token, now active. The previous token is no longer valid. */
78
39
  token: string;
79
40
  }
80
- export const CompleteShortTokenRotationResponse = /*@__PURE__*/ S.suspend(() =>
81
- S.Struct({
82
- ok: S.Boolean,
83
- token: S.String,
84
- }),
85
- ).annotate({
86
- identifier: "CompleteShortTokenRotationResponse",
87
- }) as any as S.Schema<CompleteShortTokenRotationResponse>;
88
-
89
41
  export interface OauthAccessRequest {
90
42
  /** Issued when you created your application. If possible, avoid sending `client_id` and `client_secret` as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme. */
91
43
  client_id?: string;
@@ -98,64 +50,17 @@ export interface OauthAccessRequest {
98
50
  /** Request the user to add your app only to a single channel. Only valid with a [legacy workspace app](https://docs.slack.dev/changelog/2021-03-workspace-apps-to-retire-in-august-2021). */
99
51
  single_channel?: boolean;
100
52
  }
101
- export const OauthAccessRequest = /*@__PURE__*/ S.suspend(() =>
102
- S.Struct({
103
- client_id: S.optional(S.String),
104
- client_secret: S.optional(S.String.pipe(T.SensitiveValue({}))),
105
- code: S.optional(S.String),
106
- redirect_uri: S.optional(S.String),
107
- single_channel: S.optional(S.Boolean),
108
- }).pipe(
109
- T.Http({ method: "POST", uri: "/oauth.access", code: 200, contentType: "form-urlencoded" }),
110
- ),
111
- ).annotate({ identifier: "OauthAccessRequest" }) as any as S.Schema<OauthAccessRequest>;
112
-
113
53
  export interface OauthAccessResponseAuthorizingUser {
114
54
  user_id?: string;
115
55
  app_home?: string | null;
116
56
  }
117
- export const OauthAccessResponseAuthorizingUser = /*@__PURE__*/ S.suspend(() =>
118
- S.Struct({
119
- user_id: S.optional(S.String),
120
- app_home: S.optional(S.NullOr(S.String)),
121
- }),
122
- ).annotate({
123
- identifier: "OauthAccessResponseAuthorizingUser",
124
- }) as any as S.Schema<OauthAccessResponseAuthorizingUser>;
125
-
126
57
  export type OauthAccessResponseInstallerUser = OauthAccessResponseAuthorizingUser;
127
- export const OauthAccessResponseInstallerUser = OauthAccessResponseAuthorizingUser;
128
-
129
58
  export type OauthAccessResponseScopesAppHomeList = Array<string>;
130
- export const OauthAccessResponseScopesAppHomeList = /*@__PURE__*/ S.Array(
131
- S.String,
132
- ) as any as S.Schema<OauthAccessResponseScopesAppHomeList>;
133
-
134
59
  export type OauthAccessResponseScopesTeamList = Array<string>;
135
- export const OauthAccessResponseScopesTeamList = /*@__PURE__*/ S.Array(
136
- S.String,
137
- ) as any as S.Schema<OauthAccessResponseScopesTeamList>;
138
-
139
60
  export type OauthAccessResponseScopesChannelList = Array<string>;
140
- export const OauthAccessResponseScopesChannelList = /*@__PURE__*/ S.Array(
141
- S.String,
142
- ) as any as S.Schema<OauthAccessResponseScopesChannelList>;
143
-
144
61
  export type OauthAccessResponseScopesGroupList = Array<string>;
145
- export const OauthAccessResponseScopesGroupList = /*@__PURE__*/ S.Array(
146
- S.String,
147
- ) as any as S.Schema<OauthAccessResponseScopesGroupList>;
148
-
149
62
  export type OauthAccessResponseScopesMpimList = Array<string>;
150
- export const OauthAccessResponseScopesMpimList = /*@__PURE__*/ S.Array(
151
- S.String,
152
- ) as any as S.Schema<OauthAccessResponseScopesMpimList>;
153
-
154
63
  export type OauthAccessResponseScopesImList = Array<string>;
155
- export const OauthAccessResponseScopesImList = /*@__PURE__*/ S.Array(
156
- S.String,
157
- ) as any as S.Schema<OauthAccessResponseScopesImList>;
158
-
159
64
  export interface OauthAccessResponseScopes {
160
65
  app_home?: OauthAccessResponseScopesAppHomeList;
161
66
  team?: OauthAccessResponseScopesTeamList;
@@ -164,32 +69,11 @@ export interface OauthAccessResponseScopes {
164
69
  mpim?: OauthAccessResponseScopesMpimList;
165
70
  im?: OauthAccessResponseScopesImList;
166
71
  }
167
- export const OauthAccessResponseScopes = /*@__PURE__*/ S.suspend(() =>
168
- S.Struct({
169
- app_home: S.optional(OauthAccessResponseScopesAppHomeList),
170
- team: S.optional(OauthAccessResponseScopesTeamList),
171
- channel: S.optional(OauthAccessResponseScopesChannelList),
172
- group: S.optional(OauthAccessResponseScopesGroupList),
173
- mpim: S.optional(OauthAccessResponseScopesMpimList),
174
- im: S.optional(OauthAccessResponseScopesImList),
175
- }),
176
- ).annotate({
177
- identifier: "OauthAccessResponseScopes",
178
- }) as any as S.Schema<OauthAccessResponseScopes>;
179
-
180
72
  export interface OauthAccessResponseBot {
181
73
  bot_user_id?: string;
182
74
  bot_access_token?: string;
183
75
  scope?: string;
184
76
  }
185
- export const OauthAccessResponseBot = /*@__PURE__*/ S.suspend(() =>
186
- S.Struct({
187
- bot_user_id: S.optional(S.String),
188
- bot_access_token: S.optional(S.String),
189
- scope: S.optional(S.String),
190
- }),
191
- ).annotate({ identifier: "OauthAccessResponseBot" }) as any as S.Schema<OauthAccessResponseBot>;
192
-
193
77
  export interface OauthAccessResponseUser {
194
78
  name?: string;
195
79
  id?: string;
@@ -204,23 +88,6 @@ export interface OauthAccessResponseUser {
204
88
  access_token?: string | Redacted.Redacted<string>;
205
89
  token_type?: string;
206
90
  }
207
- export const OauthAccessResponseUser = /*@__PURE__*/ S.suspend(() =>
208
- S.Struct({
209
- name: S.optional(S.String),
210
- id: S.optional(S.String),
211
- email: S.optional(S.String),
212
- image_24: S.optional(S.String),
213
- image_32: S.optional(S.String),
214
- image_48: S.optional(S.String),
215
- image_72: S.optional(S.String),
216
- image_192: S.optional(S.String),
217
- image_512: S.optional(S.String),
218
- scope: S.optional(S.String),
219
- access_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
220
- token_type: S.optional(S.String),
221
- }),
222
- ).annotate({ identifier: "OauthAccessResponseUser" }) as any as S.Schema<OauthAccessResponseUser>;
223
-
224
91
  export interface OauthAccessResponseTeam {
225
92
  id?: string;
226
93
  name?: string;
@@ -235,40 +102,12 @@ export interface OauthAccessResponseTeam {
235
102
  image_default?: boolean;
236
103
  image_original?: string;
237
104
  }
238
- export const OauthAccessResponseTeam = /*@__PURE__*/ S.suspend(() =>
239
- S.Struct({
240
- id: S.optional(S.String),
241
- name: S.optional(S.String),
242
- domain: S.optional(S.String),
243
- image_34: S.optional(S.String),
244
- image_44: S.optional(S.String),
245
- image_68: S.optional(S.String),
246
- image_88: S.optional(S.String),
247
- image_102: S.optional(S.String),
248
- image_132: S.optional(S.String),
249
- image_230: S.optional(S.String),
250
- image_default: S.optional(S.Boolean),
251
- image_original: S.optional(S.String),
252
- }),
253
- ).annotate({ identifier: "OauthAccessResponseTeam" }) as any as S.Schema<OauthAccessResponseTeam>;
254
-
255
105
  export interface OauthAccessResponseIncomingWebhook {
256
106
  channel?: string;
257
107
  channel_id?: string;
258
108
  configuration_url?: string;
259
109
  url?: string;
260
110
  }
261
- export const OauthAccessResponseIncomingWebhook = /*@__PURE__*/ S.suspend(() =>
262
- S.Struct({
263
- channel: S.optional(S.String),
264
- channel_id: S.optional(S.String),
265
- configuration_url: S.optional(S.String),
266
- url: S.optional(S.String),
267
- }),
268
- ).annotate({
269
- identifier: "OauthAccessResponseIncomingWebhook",
270
- }) as any as S.Schema<OauthAccessResponseIncomingWebhook>;
271
-
272
111
  export interface OauthAccessResponse {
273
112
  /** Always `true` (a failed call raises a typed error instead). */
274
113
  ok: boolean;
@@ -292,31 +131,6 @@ export interface OauthAccessResponse {
292
131
  incoming_webhook?: OauthAccessResponseIncomingWebhook;
293
132
  single_channel_id?: string;
294
133
  }
295
- export const OauthAccessResponse = /*@__PURE__*/ S.suspend(() =>
296
- S.Struct({
297
- ok: S.Boolean,
298
- token_type: S.optional(S.String),
299
- app_id: S.optional(S.String),
300
- app_user_id: S.optional(S.String),
301
- team_name: S.optional(S.String),
302
- team_id: S.String,
303
- access_token: S.String.pipe(T.SensitiveValue({})),
304
- authorizing_user: S.optional(OauthAccessResponseAuthorizingUser),
305
- installer_user: S.optional(OauthAccessResponseAuthorizingUser),
306
- scopes: S.optional(OauthAccessResponseScopes),
307
- scope: S.optional(S.String),
308
- user_id: S.optional(S.String),
309
- bot: S.optional(OauthAccessResponseBot),
310
- refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
311
- expires_in: S.optional(S.Number),
312
- user: S.optional(OauthAccessResponseUser),
313
- team: S.optional(OauthAccessResponseTeam),
314
- enterprise_id: S.optional(S.NullOr(S.String)),
315
- incoming_webhook: S.optional(OauthAccessResponseIncomingWebhook),
316
- single_channel_id: S.optional(S.String),
317
- }),
318
- ).annotate({ identifier: "OauthAccessResponse" }) as any as S.Schema<OauthAccessResponse>;
319
-
320
134
  export interface V2AccessRequest {
321
135
  /** Issued when you created your application. If possible, avoid sending `client_id` and `client_secret` as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme. */
322
136
  client_id?: string;
@@ -335,25 +149,8 @@ export interface V2AccessRequest {
335
149
  /** Identity assertion JWT authorization grant */
336
150
  assertion?: string;
337
151
  }
338
- export const V2AccessRequest = /*@__PURE__*/ S.suspend(() =>
339
- S.Struct({
340
- client_id: S.optional(S.String),
341
- client_secret: S.optional(S.String.pipe(T.SensitiveValue({}))),
342
- code: S.optional(S.String),
343
- code_verifier: S.optional(S.String),
344
- redirect_uri: S.optional(S.String),
345
- grant_type: S.optional(S.String),
346
- refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
347
- assertion: S.optional(S.String),
348
- }).pipe(
349
- T.Http({ method: "POST", uri: "/oauth.v2.access", code: 200, contentType: "form-urlencoded" }),
350
- ),
351
- ).annotate({ identifier: "V2AccessRequest" }) as any as S.Schema<V2AccessRequest>;
352
-
353
152
  /** The type of access token. Only present if a bot token was requested at the start of the auth flow. */
354
153
  export type V2AccessResponseTokenType = "granular_bot";
355
- export const V2AccessResponseTokenType = S.String;
356
-
357
154
  /** Details about the installing user, and the user token if one was requested at the start of the auth flow. */
358
155
  export interface V2AccessResponseTeam {
359
156
  /** ID of the team into which the app is being installed or re-installed. */
@@ -361,13 +158,6 @@ export interface V2AccessResponseTeam {
361
158
  /** Name of the team into which the app is being installed or re-installed. */
362
159
  name?: string;
363
160
  }
364
- export const V2AccessResponseTeam = /*@__PURE__*/ S.suspend(() =>
365
- S.Struct({
366
- id: S.String,
367
- name: S.optional(S.String),
368
- }),
369
- ).annotate({ identifier: "V2AccessResponseTeam" }) as any as S.Schema<V2AccessResponseTeam>;
370
-
371
161
  /** Details about the installing team, and the user token if one was requested at the start of the auth flow. */
372
162
  export interface V2AccessResponseEnterprise {
373
163
  /** ID of the enterprise into which the app is being installed or re-installed. */
@@ -375,19 +165,8 @@ export interface V2AccessResponseEnterprise {
375
165
  /** Name of the enterprise into which the app is being installed or re-installed. */
376
166
  name?: string;
377
167
  }
378
- export const V2AccessResponseEnterprise = /*@__PURE__*/ S.suspend(() =>
379
- S.Struct({
380
- id: S.String,
381
- name: S.optional(S.String),
382
- }),
383
- ).annotate({
384
- identifier: "V2AccessResponseEnterprise",
385
- }) as any as S.Schema<V2AccessResponseEnterprise>;
386
-
387
168
  /** The type of the access token. Only present if a user token was requested at the start of the auth flow. */
388
169
  export type V2AccessResponseAuthedUserTokenType = "user";
389
- export const V2AccessResponseAuthedUserTokenType = S.String;
390
-
391
170
  /** Details about the installing user, and the user token if one was requested at the start of the auth flow. */
392
171
  export interface V2AccessResponseAuthedUser {
393
172
  /** ID of the installing user. If a user token was requested, this is also the ID of the user to which the user token authenticates. */
@@ -403,19 +182,6 @@ export interface V2AccessResponseAuthedUser {
403
182
  /** Refresh token for this credential. */
404
183
  refresh_token?: string | Redacted.Redacted<string>;
405
184
  }
406
- export const V2AccessResponseAuthedUser = /*@__PURE__*/ S.suspend(() =>
407
- S.Struct({
408
- id: S.String,
409
- access_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
410
- token_type: S.optional(V2AccessResponseAuthedUserTokenType),
411
- scope: S.optional(S.String),
412
- expires_in: S.optional(S.Number),
413
- refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
414
- }),
415
- ).annotate({
416
- identifier: "V2AccessResponseAuthedUser",
417
- }) as any as S.Schema<V2AccessResponseAuthedUser>;
418
-
419
185
  /** Details about a newly-created incoming webhook. Only present if an incoming webhook was requested at the start of the auth flow. */
420
186
  export interface V2AccessResponseIncomingWebhook {
421
187
  /** Name of channel. */
@@ -427,17 +193,6 @@ export interface V2AccessResponseIncomingWebhook {
427
193
  /** Endpoint for triggering the wehbook. */
428
194
  url: string;
429
195
  }
430
- export const V2AccessResponseIncomingWebhook = /*@__PURE__*/ S.suspend(() =>
431
- S.Struct({
432
- channel: S.String,
433
- channel_id: S.String,
434
- configuration_url: S.String,
435
- url: S.String,
436
- }),
437
- ).annotate({
438
- identifier: "V2AccessResponseIncomingWebhook",
439
- }) as any as S.Schema<V2AccessResponseIncomingWebhook>;
440
-
441
196
  export interface V2AccessResponse {
442
197
  /** Always `true` (a failed call raises a typed error instead). */
443
198
  ok: boolean;
@@ -466,49 +221,14 @@ export interface V2AccessResponse {
466
221
  /** Details about a newly-created incoming webhook. Only present if an incoming webhook was requested at the start of the auth flow. */
467
222
  incoming_webhook?: V2AccessResponseIncomingWebhook;
468
223
  }
469
- export const V2AccessResponse = /*@__PURE__*/ S.suspend(() =>
470
- S.Struct({
471
- ok: S.Boolean,
472
- access_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
473
- token_type: S.optional(V2AccessResponseTokenType),
474
- scope: S.optional(S.String),
475
- bot_user_id: S.optional(S.String),
476
- user_id: S.optional(S.String),
477
- app_id: S.String,
478
- is_enterprise_install: S.optional(S.Boolean),
479
- expires_in: S.optional(S.Number),
480
- refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
481
- team: S.NullOr(V2AccessResponseTeam),
482
- enterprise: S.NullOr(V2AccessResponseEnterprise),
483
- authed_user: S.optional(V2AccessResponseAuthedUser),
484
- incoming_webhook: S.optional(V2AccessResponseIncomingWebhook),
485
- }),
486
- ).annotate({ identifier: "V2AccessResponse" }) as any as S.Schema<V2AccessResponse>;
487
-
488
224
  export interface V2ExchangeRequest {
489
225
  /** Issued when you created your application. */
490
226
  client_id: string;
491
227
  /** Issued when you created your application. */
492
228
  client_secret: string | Redacted.Redacted<string>;
493
229
  }
494
- export const V2ExchangeRequest = /*@__PURE__*/ S.suspend(() =>
495
- S.Struct({
496
- client_id: S.String,
497
- client_secret: S.String.pipe(T.SensitiveValue({})),
498
- }).pipe(
499
- T.Http({
500
- method: "POST",
501
- uri: "/oauth.v2.exchange",
502
- code: 200,
503
- contentType: "form-urlencoded",
504
- }),
505
- ),
506
- ).annotate({ identifier: "V2ExchangeRequest" }) as any as S.Schema<V2ExchangeRequest>;
507
-
508
230
  /** The type of access token. */
509
231
  export type V2ExchangeResponseTokenType = "bot" | "user";
510
- export const V2ExchangeResponseTokenType = S.String;
511
-
512
232
  export interface V2ExchangeResponse {
513
233
  /** Always `true` (a failed call raises a typed error instead). */
514
234
  ok: boolean;
@@ -530,22 +250,6 @@ export interface V2ExchangeResponse {
530
250
  team?: unknown | null;
531
251
  enterprise?: unknown | null;
532
252
  }
533
- export const V2ExchangeResponse = /*@__PURE__*/ S.suspend(() =>
534
- S.Struct({
535
- ok: S.Boolean,
536
- app_id: S.String,
537
- token_type: V2ExchangeResponseTokenType,
538
- scope: S.String,
539
- bot_user_id: S.optional(S.String),
540
- user_id: S.optional(S.String),
541
- access_token: S.String.pipe(T.SensitiveValue({})),
542
- expires_in: S.Number,
543
- refresh_token: S.String.pipe(T.SensitiveValue({})),
544
- team: S.optional(S.NullOr(S.Unknown)),
545
- enterprise: S.optional(S.NullOr(S.Unknown)),
546
- }),
547
- ).annotate({ identifier: "V2ExchangeResponse" }) as any as S.Schema<V2ExchangeResponse>;
548
-
549
253
  export interface V2UserAccessRequest {
550
254
  /** Issued when you created your application. If possible, avoid sending `client_id` and `client_secret` as parameters in your request and instead supply the Client ID and Client Secret using the HTTP Basic authentication scheme. */
551
255
  client_id?: string;
@@ -564,38 +268,12 @@ export interface V2UserAccessRequest {
564
268
  /** Identity assertion JWT authorization grant. */
565
269
  assertion?: string;
566
270
  }
567
- export const V2UserAccessRequest = /*@__PURE__*/ S.suspend(() =>
568
- S.Struct({
569
- client_id: S.optional(S.String),
570
- client_secret: S.optional(S.String.pipe(T.SensitiveValue({}))),
571
- code: S.optional(S.String),
572
- code_verifier: S.optional(S.String),
573
- redirect_uri: S.optional(S.String),
574
- grant_type: S.optional(S.String),
575
- refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
576
- assertion: S.optional(S.String),
577
- }).pipe(
578
- T.Http({
579
- method: "POST",
580
- uri: "/oauth.v2.user.access",
581
- code: 200,
582
- contentType: "form-urlencoded",
583
- }),
584
- ),
585
- ).annotate({ identifier: "V2UserAccessRequest" }) as any as S.Schema<V2UserAccessRequest>;
586
-
587
271
  /** The type of access token. */
588
272
  export type V2UserAccessResponseTokenType = "user";
589
- export const V2UserAccessResponseTokenType = S.String;
590
-
591
273
  /** Details about the team. */
592
274
  export type V2UserAccessResponseTeam = V2AccessResponseTeam;
593
- export const V2UserAccessResponseTeam = V2AccessResponseTeam;
594
-
595
275
  /** Details about the enterprise. */
596
276
  export type V2UserAccessResponseEnterprise = V2AccessResponseEnterprise;
597
- export const V2UserAccessResponseEnterprise = V2AccessResponseEnterprise;
598
-
599
277
  export interface V2UserAccessResponse {
600
278
  /** Always `true` (a failed call raises a typed error instead). */
601
279
  ok: boolean;
@@ -618,108 +296,414 @@ export interface V2UserAccessResponse {
618
296
  team: V2AccessResponseTeam | null;
619
297
  enterprise: V2AccessResponseEnterprise | null;
620
298
  }
621
- export const V2UserAccessResponse = /*@__PURE__*/ S.suspend(() =>
622
- S.Struct({
623
- ok: S.Boolean,
624
- access_token: S.String.pipe(T.SensitiveValue({})),
625
- token_type: V2UserAccessResponseTokenType,
626
- scope: S.optional(S.String),
627
- user_id: S.String,
628
- app_id: S.String,
629
- is_enterprise_install: S.Boolean,
630
- expires_in: S.optional(S.Number),
631
- refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
632
- team: S.NullOr(V2AccessResponseTeam),
633
- enterprise: S.NullOr(V2AccessResponseEnterprise),
634
- }),
635
- ).annotate({ identifier: "V2UserAccessResponse" }) as any as S.Schema<V2UserAccessResponse>;
636
-
637
299
  export type BeginShortTokenRotationError = SlackOpError;
638
- /** Call this to rotate the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.completeShortTokenRotation to confirm the change. Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` — Value passed for `client_secret` was invalid. - `invalid_client_id` — Value passed for `client_id` was invalid, or is not the app the token being rotated was issued to. - `invalid_token` — This token is invalid. - `internal_error` — A server-side error occurred. - `token_too_long` — This token is not short enough to be rotated. See https://docs.slack.dev/reference/methods/oauth.v2.beginShortTokenRotation */
300
+ /** Call this to rotate the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.completeShortTokenRotation to confirm the change. Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `invalid_client_id` -- Value passed for `client_id` was invalid, or is not the app the token being rotated was issued to. - `invalid_token` -- This token is invalid. - `internal_error` -- A server-side error occurred. - `token_too_long` -- This token is not short enough to be rotated. See https://docs.slack.dev/reference/methods/oauth.v2.beginShortTokenRotation */
639
301
  export const beginShortTokenRotation: API.OperationMethod<
640
302
  BeginShortTokenRotationRequest,
641
303
  BeginShortTokenRotationResponse,
642
304
  BeginShortTokenRotationError,
643
305
  SlackOpContext
644
306
  > = /*@__PURE__*/ API.make(() => ({
645
- input: BeginShortTokenRotationRequest,
646
- output: BeginShortTokenRotationResponse,
307
+ input: __S(0, __c0, 0) as any as S.Schema<BeginShortTokenRotationRequest>,
308
+ output: __S(1, __c0, 1) as any as S.Schema<BeginShortTokenRotationResponse>,
647
309
  errors: [SlackError, SlackRateLimited],
648
310
  protocol: SlackProtocol,
649
311
  retry: Retry.Retry,
650
312
  }));
651
313
 
652
314
  export type CompleteShortTokenRotationError = SlackOpError;
653
- /** Call this to finish rotating the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.beginShortTokenRotation to start the process. Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` — Value passed for `client_secret` was invalid. - `invalid_client_id` — Value passed for `client_id` was invalid, or is not the app the token being rotated was issued to. - `invalid_token` — This token is invalid. - `rotation_not_found` — No pending rotation was found for this token. Call oauth.v2.beginShortTokenRotation first, or the pending rotation may have expired. - `internal_error` — A server-side error occurred. - `token_too_long` — This token is not short enough to be rotated. See https://docs.slack.dev/reference/methods/oauth.v2.completeShortTokenRotation */
315
+ /** Call this to finish rotating the secret on an old API token with a short secret. Must be paired with a call to oauth.v2.beginShortTokenRotation to start the process. Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `invalid_client_id` -- Value passed for `client_id` was invalid, or is not the app the token being rotated was issued to. - `invalid_token` -- This token is invalid. - `rotation_not_found` -- No pending rotation was found for this token. Call oauth.v2.beginShortTokenRotation first, or the pending rotation may have expired. - `internal_error` -- A server-side error occurred. - `token_too_long` -- This token is not short enough to be rotated. See https://docs.slack.dev/reference/methods/oauth.v2.completeShortTokenRotation */
654
316
  export const completeShortTokenRotation: API.OperationMethod<
655
317
  CompleteShortTokenRotationRequest,
656
318
  CompleteShortTokenRotationResponse,
657
319
  CompleteShortTokenRotationError,
658
320
  SlackOpContext
659
321
  > = /*@__PURE__*/ API.make(() => ({
660
- input: CompleteShortTokenRotationRequest,
661
- output: CompleteShortTokenRotationResponse,
322
+ input: __S(16, __c1, 0) as any as S.Schema<CompleteShortTokenRotationRequest>,
323
+ output: __S(17, __c1, 1) as any as S.Schema<CompleteShortTokenRotationResponse>,
662
324
  errors: [SlackError, SlackRateLimited],
663
325
  protocol: SlackProtocol,
664
326
  retry: Retry.Retry,
665
327
  }));
666
328
 
667
329
  export type OauthAccessError = SlackOpError;
668
- /** Exchanges a temporary OAuth verifier code for an access token. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` — Value passed for `client_secret` was invalid. - `bad_redirect_uri` — Value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `code_already_used` — Value passed for `code` was already exchanged. - `internal_error` — Something went wrong during app installation. - `invalid_client_id` — Value passed for `client_id` was invalid. - `invalid_code` — Value passed for `code` was invalid. - `invalid_token` — Invalid refresh token. - `missing_resource` — Missing permission resource. - `ratelimited` — Too many requests made in succession. - `oauth_authorization_url_mismatch` — The OAuth flow was initiated on an incorrect version of the authorization url. The flow must be initiated via /oauth/authorize. - `user_email_unverified` — The users email is unverified See https://docs.slack.dev/reference/methods/oauth.access */
330
+ /** Exchanges a temporary OAuth verifier code for an access token. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `bad_redirect_uri` -- Value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `code_already_used` -- Value passed for `code` was already exchanged. - `internal_error` -- Something went wrong during app installation. - `invalid_client_id` -- Value passed for `client_id` was invalid. - `invalid_code` -- Value passed for `code` was invalid. - `invalid_token` -- Invalid refresh token. - `missing_resource` -- Missing permission resource. - `ratelimited` -- Too many requests made in succession. - `oauth_authorization_url_mismatch` -- The OAuth flow was initiated on an incorrect version of the authorization url. The flow must be initiated via /oauth/authorize. - `user_email_unverified` -- The users email is unverified See https://docs.slack.dev/reference/methods/oauth.access */
669
331
  export const oauthAccess: API.OperationMethod<
670
332
  OauthAccessRequest,
671
333
  OauthAccessResponse,
672
334
  OauthAccessError,
673
335
  SlackOpContext
674
336
  > = /*@__PURE__*/ API.make(() => ({
675
- input: OauthAccessRequest,
676
- output: OauthAccessResponse,
337
+ input: __S(32, __c2, 0) as any as S.Schema<OauthAccessRequest>,
338
+ output: __S(40, __c2, 8) as any as S.Schema<OauthAccessResponse>,
677
339
  errors: [SlackError, SlackRateLimited],
678
340
  protocol: SlackProtocol,
679
341
  retry: Retry.Retry,
680
342
  }));
681
343
 
682
344
  export type V2AccessError = SlackOpError;
683
- /** Exchanges a temporary OAuth verifier code for an access token. Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` — Value passed for `client_secret` was invalid. - `bad_redirect_uri` — Value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `cannot_install_an_org_installed_app` — Returned when the the org-installed app cannot be installed on a workspace. - `invalid_client_id` — Value passed for `client_id` was invalid. - `invalid_code` — Value passed for `code` was invalid. - `invalid_grant_type` — Value passed for `grant_type` was invalid. - `invalid_refresh_token` — The given refresh token is invalid. - `no_scopes` — Missing `scope` in the request. - `oauth_authorization_url_mismatch` — The OAuth flow was initiated on an incorrect version of the authorization url. The flow must be initiated via /oauth/v2/authorize. - `preview_feature_not_available` — Returned when the API method is not yet available on the team in context. - `user_email_unverified` — The users email is unverified. - `pkce_not_allowed` — The app is not allowed to use the PKCE flow. - `invalid_code_verifier` — The code_verifier is invalid. See https://docs.slack.dev/reference/methods/oauth.v2.access */
345
+ /** Exchanges a temporary OAuth verifier code for an access token. Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `bad_redirect_uri` -- Value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `cannot_install_an_org_installed_app` -- Returned when the the org-installed app cannot be installed on a workspace. - `invalid_client_id` -- Value passed for `client_id` was invalid. - `invalid_code` -- Value passed for `code` was invalid. - `invalid_grant_type` -- Value passed for `grant_type` was invalid. - `invalid_refresh_token` -- The given refresh token is invalid. - `no_scopes` -- Missing `scope` in the request. - `oauth_authorization_url_mismatch` -- The OAuth flow was initiated on an incorrect version of the authorization url. The flow must be initiated via /oauth/v2/authorize. - `preview_feature_not_available` -- Returned when the API method is not yet available on the team in context. - `user_email_unverified` -- The users email is unverified. - `pkce_not_allowed` -- The app is not allowed to use the PKCE flow. - `invalid_code_verifier` -- The code_verifier is invalid. See https://docs.slack.dev/reference/methods/oauth.v2.access */
684
346
  export const v2Access: API.OperationMethod<
685
347
  V2AccessRequest,
686
348
  V2AccessResponse,
687
349
  V2AccessError,
688
350
  SlackOpContext
689
351
  > = /*@__PURE__*/ API.make(() => ({
690
- input: V2AccessRequest,
691
- output: V2AccessResponse,
352
+ input: __S(48, __c3, 0) as any as S.Schema<V2AccessRequest>,
353
+ output: __S(51, __c3, 3) as any as S.Schema<V2AccessResponse>,
692
354
  errors: [SlackError, SlackRateLimited],
693
355
  protocol: SlackProtocol,
694
356
  retry: Retry.Retry,
695
357
  }));
696
358
 
697
359
  export type V2ExchangeError = SlackOpError;
698
- /** Exchanges a legacy access token for a new expiring access token and refresh token Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `authorization_not_found` — The underlying authorization for this token was revoked or is invalid. - `bad_client_secret` — Value passed for `client_secret` was invalid. - `internal_error` — A server-side error occurred. - `invalid_client_id` — Value passed for `client_id` was invalid. - `invalid_token` — The legacy token provided cannot be exchanged for a new pair of token credentials. - `token_already_exchanged` — This token has already been exchanged for a pair of token credentials. - `token_rotation_not_enabled` — The app does not have token rotation enabled. See https://docs.slack.dev/reference/methods/oauth.v2.exchange */
360
+ /** Exchanges a legacy access token for a new expiring access token and refresh token Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `authorization_not_found` -- The underlying authorization for this token was revoked or is invalid. - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `internal_error` -- A server-side error occurred. - `invalid_client_id` -- Value passed for `client_id` was invalid. - `invalid_token` -- The legacy token provided cannot be exchanged for a new pair of token credentials. - `token_already_exchanged` -- This token has already been exchanged for a pair of token credentials. - `token_rotation_not_enabled` -- The app does not have token rotation enabled. See https://docs.slack.dev/reference/methods/oauth.v2.exchange */
699
361
  export const v2Exchange: API.OperationMethod<
700
362
  V2ExchangeRequest,
701
363
  V2ExchangeResponse,
702
364
  V2ExchangeError,
703
365
  SlackOpContext
704
366
  > = /*@__PURE__*/ API.make(() => ({
705
- input: V2ExchangeRequest,
706
- output: V2ExchangeResponse,
367
+ input: __S(80, __c5, 0) as any as S.Schema<V2ExchangeRequest>,
368
+ output: __S(81, __c5, 1) as any as S.Schema<V2ExchangeResponse>,
707
369
  errors: [SlackError, SlackRateLimited],
708
370
  protocol: SlackProtocol,
709
371
  retry: Retry.Retry,
710
372
  }));
711
373
 
712
374
  export type V2UserAccessError = SlackOpError;
713
- /** Exchanges a temporary OAuth verifier code for a user access token. Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` — Value passed for `client_secret` was invalid. - `bad_redirect_uri` — Value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `cannot_install_an_org_installed_app` — Returned when the the org-installed app cannot be installed on a workspace. - `invalid_client_id` — Value passed for `client_id` was invalid. - `invalid_code` — Value passed for `code` was invalid. - `invalid_grant_type` — Value passed for `grant_type` was invalid. - `invalid_refresh_token` — The given refresh token is invalid. - `invalid_resource` — The `resource` in the assertion is malformed, or is not a resource tokens can be issued for. - `no_scopes` — Missing `scope` in the request. - `no_user_scopes` — Missing user `scope` in the auth request. - `not_implemented` — Method not yet supported - `oauth_authorization_url_mismatch` — The OAuth flow was initiated on an incorrect version of the authorization url. The flow must be initiated via /oauth/v2/authorize . - `preview_feature_not_available` — Returned when the API method is not yet available on the team in context. - `user_email_unverified` — The users email is unverified - `app_not_admin_approved` — The app has not been approved by an org admin, so no tokens can be issued for this user. Ask an org admin to approve the app before requesting a token with the `urn:ietf:params:oauth:grant-type:jwt-bearer` grant. - `app_not_org_installed` — The app is not installed at the organization level. Using the `urn:ietf:params:oauth:grant-type:jwt-bearer` grant type requires org level app installs. - `client_id_mismatch` — Value passed for `client_id` did not match the `client_id` in the assertion. - `ema_disabled` — Enterprise-managed auth is disabled. - `ema_issuer_mismatch` — The issuer in the assertion did not match the issuer configured for enterprise-managed auth. - `invalid_audience` — The audience in the assertion is not one this token endpoint supports. - `missing_scope` — Missing `scope` in the assertion. The identity assertion JWT must carry a space-delimited `scope` claim. - `no_app_scopes_requested` — None of the scopes requested in the identity assertion are configured on the app. Request only scopes the app already declares. - `no_approved_scopes_requested` — The app is approved by org admins, but none of the requested scopes are approved ones. Ask an org admin to approve the requested scopes. - `no_assertion` — Missing `assertion` in the request. - `user_not_authenticated` — The user has never authenticated via single sign-on. See https://docs.slack.dev/reference/methods/oauth.v2.user.access */
375
+ /** Exchanges a temporary OAuth verifier code for a user access token. Rate limit tier: 5 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` -- Value passed for `client_secret` was invalid. - `bad_redirect_uri` -- Value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `cannot_install_an_org_installed_app` -- Returned when the the org-installed app cannot be installed on a workspace. - `invalid_client_id` -- Value passed for `client_id` was invalid. - `invalid_code` -- Value passed for `code` was invalid. - `invalid_grant_type` -- Value passed for `grant_type` was invalid. - `invalid_refresh_token` -- The given refresh token is invalid. - `invalid_resource` -- The `resource` in the assertion is malformed, or is not a resource tokens can be issued for. - `no_scopes` -- Missing `scope` in the request. - `no_user_scopes` -- Missing user `scope` in the auth request. - `not_implemented` -- Method not yet supported - `oauth_authorization_url_mismatch` -- The OAuth flow was initiated on an incorrect version of the authorization url. The flow must be initiated via /oauth/v2/authorize . - `preview_feature_not_available` -- Returned when the API method is not yet available on the team in context. - `user_email_unverified` -- The users email is unverified - `app_not_admin_approved` -- The app has not been approved by an org admin, so no tokens can be issued for this user. Ask an org admin to approve the app before requesting a token with the `urn:ietf:params:oauth:grant-type:jwt-bearer` grant. - `app_not_org_installed` -- The app is not installed at the organization level. Using the `urn:ietf:params:oauth:grant-type:jwt-bearer` grant type requires org level app installs. - `client_id_mismatch` -- Value passed for `client_id` did not match the `client_id` in the assertion. - `ema_disabled` -- Enterprise-managed auth is disabled. - `ema_issuer_mismatch` -- The issuer in the assertion did not match the issuer configured for enterprise-managed auth. - `invalid_audience` -- The audience in the assertion is not one this token endpoint supports. - `missing_scope` -- Missing `scope` in the assertion. The identity assertion JWT must carry a space-delimited `scope` claim. - `no_app_scopes_requested` -- None of the scopes requested in the identity assertion are configured on the app. Request only scopes the app already declares. - `no_approved_scopes_requested` -- The app is approved by org admins, but none of the requested scopes are approved ones. Ask an org admin to approve the requested scopes. - `no_assertion` -- Missing `assertion` in the request. - `user_not_authenticated` -- The user has never authenticated via single sign-on. See https://docs.slack.dev/reference/methods/oauth.v2.user.access */
714
376
  export const v2UserAccess: API.OperationMethod<
715
377
  V2UserAccessRequest,
716
378
  V2UserAccessResponse,
717
379
  V2UserAccessError,
718
380
  SlackOpContext
719
381
  > = /*@__PURE__*/ API.make(() => ({
720
- input: V2UserAccessRequest,
721
- output: V2UserAccessResponse,
382
+ input: __S(96, __c6, 0) as any as S.Schema<V2UserAccessRequest>,
383
+ output: __S(97, __c6, 1) as any as S.Schema<V2UserAccessResponse>,
722
384
  errors: [SlackError, SlackRateLimited],
723
385
  protocol: SlackProtocol,
724
386
  retry: Retry.Retry,
725
387
  }));
388
+
389
+ // Schema builders: each runs one schema initializer, on that schema's first use.
390
+ function __c0(j: number): any {
391
+ switch (j) {
392
+ case 0:
393
+ return S.suspend(() =>
394
+ S.Struct({
395
+ client_id: S.String,
396
+ client_secret: S.String.pipe(T.SensitiveValue({})),
397
+ }).pipe(
398
+ T.Http({
399
+ method: "POST",
400
+ uri: "/oauth.v2.beginShortTokenRotation",
401
+ code: 200,
402
+ contentType: "form-urlencoded",
403
+ }),
404
+ ),
405
+ ).annotate({ identifier: "BeginShortTokenRotationRequest" });
406
+ case 1:
407
+ return S.suspend(() =>
408
+ S.Struct({
409
+ ok: S.Boolean,
410
+ new_token: S.String,
411
+ }),
412
+ ).annotate({ identifier: "BeginShortTokenRotationResponse" });
413
+ }
414
+ }
415
+ function __c1(j: number): any {
416
+ switch (j) {
417
+ case 0:
418
+ return S.suspend(() =>
419
+ S.Struct({
420
+ client_id: S.String,
421
+ client_secret: S.String.pipe(T.SensitiveValue({})),
422
+ new_token: S.String,
423
+ }).pipe(
424
+ T.Http({
425
+ method: "POST",
426
+ uri: "/oauth.v2.completeShortTokenRotation",
427
+ code: 200,
428
+ contentType: "form-urlencoded",
429
+ }),
430
+ ),
431
+ ).annotate({ identifier: "CompleteShortTokenRotationRequest" });
432
+ case 1:
433
+ return S.suspend(() =>
434
+ S.Struct({
435
+ ok: S.Boolean,
436
+ token: S.String,
437
+ }),
438
+ ).annotate({ identifier: "CompleteShortTokenRotationResponse" });
439
+ }
440
+ }
441
+ function __c2(j: number): any {
442
+ switch (j) {
443
+ case 0:
444
+ return S.suspend(() =>
445
+ S.Struct({
446
+ client_id: S.optional(S.String),
447
+ client_secret: S.optional(S.String.pipe(T.SensitiveValue({}))),
448
+ code: S.optional(S.String),
449
+ redirect_uri: S.optional(S.String),
450
+ single_channel: S.optional(S.Boolean),
451
+ }).pipe(
452
+ T.Http({
453
+ method: "POST",
454
+ uri: "/oauth.access",
455
+ code: 200,
456
+ contentType: "form-urlencoded",
457
+ }),
458
+ ),
459
+ ).annotate({ identifier: "OauthAccessRequest" });
460
+ case 1:
461
+ return S.suspend(() =>
462
+ S.Struct({
463
+ user_id: S.optional(S.String),
464
+ app_home: S.optional(S.NullOr(S.String)),
465
+ }),
466
+ ).annotate({ identifier: "OauthAccessResponseAuthorizingUser" });
467
+ case 2:
468
+ return S.Array(S.String);
469
+ case 3:
470
+ return S.suspend(() =>
471
+ S.Struct({
472
+ app_home: S.optional(__S(34, __c2, 2)),
473
+ team: S.optional(__S(34, __c2, 2)),
474
+ channel: S.optional(__S(34, __c2, 2)),
475
+ group: S.optional(__S(34, __c2, 2)),
476
+ mpim: S.optional(__S(34, __c2, 2)),
477
+ im: S.optional(__S(34, __c2, 2)),
478
+ }),
479
+ ).annotate({ identifier: "OauthAccessResponseScopes" });
480
+ case 4:
481
+ return S.suspend(() =>
482
+ S.Struct({
483
+ bot_user_id: S.optional(S.String),
484
+ bot_access_token: S.optional(S.String),
485
+ scope: S.optional(S.String),
486
+ }),
487
+ ).annotate({ identifier: "OauthAccessResponseBot" });
488
+ case 5:
489
+ return S.suspend(() =>
490
+ S.Struct({
491
+ name: S.optional(S.String),
492
+ id: S.optional(S.String),
493
+ email: S.optional(S.String),
494
+ image_24: S.optional(S.String),
495
+ image_32: S.optional(S.String),
496
+ image_48: S.optional(S.String),
497
+ image_72: S.optional(S.String),
498
+ image_192: S.optional(S.String),
499
+ image_512: S.optional(S.String),
500
+ scope: S.optional(S.String),
501
+ access_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
502
+ token_type: S.optional(S.String),
503
+ }),
504
+ ).annotate({ identifier: "OauthAccessResponseUser" });
505
+ case 6:
506
+ return S.suspend(() =>
507
+ S.Struct({
508
+ id: S.optional(S.String),
509
+ name: S.optional(S.String),
510
+ domain: S.optional(S.String),
511
+ image_34: S.optional(S.String),
512
+ image_44: S.optional(S.String),
513
+ image_68: S.optional(S.String),
514
+ image_88: S.optional(S.String),
515
+ image_102: S.optional(S.String),
516
+ image_132: S.optional(S.String),
517
+ image_230: S.optional(S.String),
518
+ image_default: S.optional(S.Boolean),
519
+ image_original: S.optional(S.String),
520
+ }),
521
+ ).annotate({ identifier: "OauthAccessResponseTeam" });
522
+ case 7:
523
+ return S.suspend(() =>
524
+ S.Struct({
525
+ channel: S.optional(S.String),
526
+ channel_id: S.optional(S.String),
527
+ configuration_url: S.optional(S.String),
528
+ url: S.optional(S.String),
529
+ }),
530
+ ).annotate({ identifier: "OauthAccessResponseIncomingWebhook" });
531
+ case 8:
532
+ return S.suspend(() =>
533
+ S.Struct({
534
+ ok: S.Boolean,
535
+ token_type: S.optional(S.String),
536
+ app_id: S.optional(S.String),
537
+ app_user_id: S.optional(S.String),
538
+ team_name: S.optional(S.String),
539
+ team_id: S.String,
540
+ access_token: S.String.pipe(T.SensitiveValue({})),
541
+ authorizing_user: S.optional(__S(33, __c2, 1)),
542
+ installer_user: S.optional(__S(33, __c2, 1)),
543
+ scopes: S.optional(__S(35, __c2, 3)),
544
+ scope: S.optional(S.String),
545
+ user_id: S.optional(S.String),
546
+ bot: S.optional(__S(36, __c2, 4)),
547
+ refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
548
+ expires_in: S.optional(S.Number),
549
+ user: S.optional(__S(37, __c2, 5)),
550
+ team: S.optional(__S(38, __c2, 6)),
551
+ enterprise_id: S.optional(S.NullOr(S.String)),
552
+ incoming_webhook: S.optional(__S(39, __c2, 7)),
553
+ single_channel_id: S.optional(S.String),
554
+ }),
555
+ ).annotate({ identifier: "OauthAccessResponse" });
556
+ }
557
+ }
558
+ function __c3(j: number): any {
559
+ switch (j) {
560
+ case 0:
561
+ return S.suspend(() =>
562
+ S.Struct({
563
+ client_id: S.optional(S.String),
564
+ client_secret: S.optional(S.String.pipe(T.SensitiveValue({}))),
565
+ code: S.optional(S.String),
566
+ code_verifier: S.optional(S.String),
567
+ redirect_uri: S.optional(S.String),
568
+ grant_type: S.optional(S.String),
569
+ refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
570
+ assertion: S.optional(S.String),
571
+ }).pipe(
572
+ T.Http({
573
+ method: "POST",
574
+ uri: "/oauth.v2.access",
575
+ code: 200,
576
+ contentType: "form-urlencoded",
577
+ }),
578
+ ),
579
+ ).annotate({ identifier: "V2AccessRequest" });
580
+ case 1:
581
+ return S.suspend(() =>
582
+ S.Struct({
583
+ id: S.String,
584
+ access_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
585
+ token_type: S.optional(S.String),
586
+ scope: S.optional(S.String),
587
+ expires_in: S.optional(S.Number),
588
+ refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
589
+ }),
590
+ ).annotate({ identifier: "V2AccessResponseAuthedUser" });
591
+ case 2:
592
+ return S.suspend(() =>
593
+ S.Struct({
594
+ channel: S.String,
595
+ channel_id: S.String,
596
+ configuration_url: S.String,
597
+ url: S.String,
598
+ }),
599
+ ).annotate({ identifier: "V2AccessResponseIncomingWebhook" });
600
+ case 3:
601
+ return S.suspend(() =>
602
+ S.Struct({
603
+ ok: S.Boolean,
604
+ access_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
605
+ token_type: S.optional(S.String),
606
+ scope: S.optional(S.String),
607
+ bot_user_id: S.optional(S.String),
608
+ user_id: S.optional(S.String),
609
+ app_id: S.String,
610
+ is_enterprise_install: S.optional(S.Boolean),
611
+ expires_in: S.optional(S.Number),
612
+ refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
613
+ team: S.NullOr(__S(64, __c4, 0)),
614
+ enterprise: S.NullOr(__S(64, __c4, 0)),
615
+ authed_user: S.optional(__S(49, __c3, 1)),
616
+ incoming_webhook: S.optional(__S(50, __c3, 2)),
617
+ }),
618
+ ).annotate({ identifier: "V2AccessResponse" });
619
+ }
620
+ }
621
+ function __c4(j: number): any {
622
+ switch (j) {
623
+ case 0:
624
+ return S.suspend(() =>
625
+ S.Struct({
626
+ id: S.String,
627
+ name: S.optional(S.String),
628
+ }),
629
+ ).annotate({ identifier: "V2AccessResponseTeam" });
630
+ }
631
+ }
632
+ function __c5(j: number): any {
633
+ switch (j) {
634
+ case 0:
635
+ return S.suspend(() =>
636
+ S.Struct({
637
+ client_id: S.String,
638
+ client_secret: S.String.pipe(T.SensitiveValue({})),
639
+ }).pipe(
640
+ T.Http({
641
+ method: "POST",
642
+ uri: "/oauth.v2.exchange",
643
+ code: 200,
644
+ contentType: "form-urlencoded",
645
+ }),
646
+ ),
647
+ ).annotate({ identifier: "V2ExchangeRequest" });
648
+ case 1:
649
+ return S.suspend(() =>
650
+ S.Struct({
651
+ ok: S.Boolean,
652
+ app_id: S.String,
653
+ token_type: S.String,
654
+ scope: S.String,
655
+ bot_user_id: S.optional(S.String),
656
+ user_id: S.optional(S.String),
657
+ access_token: S.String.pipe(T.SensitiveValue({})),
658
+ expires_in: S.Number,
659
+ refresh_token: S.String.pipe(T.SensitiveValue({})),
660
+ team: S.optional(S.NullOr(S.Unknown)),
661
+ enterprise: S.optional(S.NullOr(S.Unknown)),
662
+ }),
663
+ ).annotate({ identifier: "V2ExchangeResponse" });
664
+ }
665
+ }
666
+ function __c6(j: number): any {
667
+ switch (j) {
668
+ case 0:
669
+ return S.suspend(() =>
670
+ S.Struct({
671
+ client_id: S.optional(S.String),
672
+ client_secret: S.optional(S.String.pipe(T.SensitiveValue({}))),
673
+ code: S.optional(S.String),
674
+ code_verifier: S.optional(S.String),
675
+ redirect_uri: S.optional(S.String),
676
+ grant_type: S.optional(S.String),
677
+ refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
678
+ assertion: S.optional(S.String),
679
+ }).pipe(
680
+ T.Http({
681
+ method: "POST",
682
+ uri: "/oauth.v2.user.access",
683
+ code: 200,
684
+ contentType: "form-urlencoded",
685
+ }),
686
+ ),
687
+ ).annotate({ identifier: "V2UserAccessRequest" });
688
+ case 1:
689
+ return S.suspend(() =>
690
+ S.Struct({
691
+ ok: S.Boolean,
692
+ access_token: S.String.pipe(T.SensitiveValue({})),
693
+ token_type: S.String,
694
+ scope: S.optional(S.String),
695
+ user_id: S.String,
696
+ app_id: S.String,
697
+ is_enterprise_install: S.Boolean,
698
+ expires_in: S.optional(S.Number),
699
+ refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
700
+ team: S.NullOr(__S(64, __c4, 0)),
701
+ enterprise: S.NullOr(__S(64, __c4, 0)),
702
+ }),
703
+ ).annotate({ identifier: "V2UserAccessResponse" });
704
+ }
705
+ }
706
+ // Schema table: entry i is schema j of builder f, made on first reach.
707
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
708
+ return (__s[i] ??= __L.at(f, j));
709
+ }