@distilled.cloud/slack 1.0.0-rc.13 → 1.0.0-rc.15
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.
- package/lib/credentials.d.ts +2 -2
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +3 -3
- package/lib/credentials.js.map +1 -1
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -1
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -3
- package/lib/index.js.map +1 -1
- package/lib/pagination.d.ts.map +1 -1
- package/lib/pagination.js.map +1 -1
- package/lib/protocol.d.ts +3 -3
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +12 -18
- package/lib/protocol.js.map +1 -1
- package/lib/protocol.test.d.ts +2 -0
- package/lib/protocol.test.d.ts.map +1 -0
- package/lib/protocol.test.js +288 -0
- package/lib/protocol.test.js.map +1 -0
- package/lib/retry.d.ts +1 -1
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +1 -1
- package/lib/retry.js.map +1 -1
- package/lib/services/admin.d.ts +236 -29
- package/lib/services/admin.d.ts.map +1 -1
- package/lib/services/admin.js +417 -749
- package/lib/services/admin.js.map +1 -1
- package/lib/services/agents.d.ts +423 -0
- package/lib/services/agents.d.ts.map +1 -0
- package/lib/services/agents.js +315 -0
- package/lib/services/agents.js.map +1 -0
- package/lib/services/api.d.ts +1 -1
- package/lib/services/api.d.ts.map +1 -1
- package/lib/services/api.js +4 -6
- package/lib/services/api.js.map +1 -1
- package/lib/services/apps.d.ts +21 -3
- package/lib/services/apps.d.ts.map +1 -1
- package/lib/services/apps.js +65 -133
- package/lib/services/apps.js.map +1 -1
- package/lib/services/assistant.d.ts +4 -4
- package/lib/services/assistant.d.ts.map +1 -1
- package/lib/services/assistant.js +16 -38
- package/lib/services/assistant.js.map +1 -1
- package/lib/services/auth.d.ts +2 -2
- package/lib/services/auth.d.ts.map +1 -1
- package/lib/services/auth.js +11 -28
- package/lib/services/auth.js.map +1 -1
- package/lib/services/blocks.d.ts +1 -1
- package/lib/services/blocks.d.ts.map +1 -1
- package/lib/services/blocks.js +5 -9
- package/lib/services/blocks.js.map +1 -1
- package/lib/services/bookmarks.d.ts +4 -4
- package/lib/services/bookmarks.d.ts.map +1 -1
- package/lib/services/bookmarks.js +14 -30
- package/lib/services/bookmarks.js.map +1 -1
- package/lib/services/bots.d.ts +1 -1
- package/lib/services/bots.d.ts.map +1 -1
- package/lib/services/bots.js +7 -15
- package/lib/services/bots.js.map +1 -1
- package/lib/services/calls.d.ts +1 -1
- package/lib/services/calls.d.ts.map +1 -1
- package/lib/services/calls.js +13 -33
- package/lib/services/calls.js.map +1 -1
- package/lib/services/canvases.d.ts +22 -2
- package/lib/services/canvases.d.ts.map +1 -1
- package/lib/services/canvases.js +37 -48
- package/lib/services/canvases.js.map +1 -1
- package/lib/services/chat.d.ts +29 -25
- package/lib/services/chat.d.ts.map +1 -1
- package/lib/services/chat.js +47 -95
- package/lib/services/chat.js.map +1 -1
- package/lib/services/conversations.d.ts +10 -8
- package/lib/services/conversations.d.ts.map +1 -1
- package/lib/services/conversations.js +43 -115
- package/lib/services/conversations.js.map +1 -1
- package/lib/services/dialog.d.ts +1 -1
- package/lib/services/dialog.d.ts.map +1 -1
- package/lib/services/dialog.js +5 -9
- package/lib/services/dialog.js.map +1 -1
- package/lib/services/dnd.d.ts +1 -1
- package/lib/services/dnd.d.ts.map +1 -1
- package/lib/services/dnd.js +10 -24
- package/lib/services/dnd.js.map +1 -1
- package/lib/services/emoji.d.ts +1 -1
- package/lib/services/emoji.d.ts.map +1 -1
- package/lib/services/emoji.js +6 -11
- package/lib/services/emoji.js.map +1 -1
- package/lib/services/entity.d.ts +1 -1
- package/lib/services/entity.d.ts.map +1 -1
- package/lib/services/entity.js +8 -20
- package/lib/services/entity.js.map +1 -1
- package/lib/services/files.d.ts +5 -5
- package/lib/services/files.d.ts.map +1 -1
- package/lib/services/files.js +39 -109
- package/lib/services/files.js.map +1 -1
- package/lib/services/functions.d.ts +1 -1
- package/lib/services/functions.d.ts.map +1 -1
- package/lib/services/functions.js +28 -75
- package/lib/services/functions.js.map +1 -1
- package/lib/services/index.d.ts +1 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/index.js +1 -0
- package/lib/services/index.js.map +1 -1
- package/lib/services/lists.d.ts +5 -1
- package/lib/services/lists.d.ts.map +1 -1
- package/lib/services/lists.js +35 -146
- package/lib/services/lists.js.map +1 -1
- package/lib/services/migration.d.ts +1 -1
- package/lib/services/migration.d.ts.map +1 -1
- package/lib/services/migration.js +5 -8
- package/lib/services/migration.js.map +1 -1
- package/lib/services/oauth.d.ts +38 -2
- package/lib/services/oauth.d.ts.map +1 -1
- package/lib/services/oauth.js +67 -50
- package/lib/services/oauth.js.map +1 -1
- package/lib/services/openid.d.ts +1 -1
- package/lib/services/openid.d.ts.map +1 -1
- package/lib/services/openid.js +7 -15
- package/lib/services/openid.js.map +1 -1
- package/lib/services/pins.d.ts +1 -1
- package/lib/services/pins.d.ts.map +1 -1
- package/lib/services/pins.js +7 -15
- package/lib/services/pins.js.map +1 -1
- package/lib/services/reactions.d.ts +2 -2
- package/lib/services/reactions.d.ts.map +1 -1
- package/lib/services/reactions.js +13 -29
- package/lib/services/reactions.js.map +1 -1
- package/lib/services/reminders.d.ts +1 -1
- package/lib/services/reminders.d.ts.map +1 -1
- package/lib/services/reminders.js +13 -33
- package/lib/services/reminders.js.map +1 -1
- package/lib/services/rtm.d.ts +1 -1
- package/lib/services/rtm.d.ts.map +1 -1
- package/lib/services/rtm.js +9 -21
- package/lib/services/rtm.js.map +1 -1
- package/lib/services/search.d.ts +1 -1
- package/lib/services/search.d.ts.map +1 -1
- package/lib/services/search.js +13 -30
- package/lib/services/search.js.map +1 -1
- package/lib/services/stars.d.ts +1 -1
- package/lib/services/stars.d.ts.map +1 -1
- package/lib/services/stars.js +10 -20
- package/lib/services/stars.js.map +1 -1
- package/lib/services/team.d.ts +1 -1
- package/lib/services/team.d.ts.map +1 -1
- package/lib/services/team.js +25 -62
- package/lib/services/team.js.map +1 -1
- package/lib/services/tooling.d.ts +1 -1
- package/lib/services/tooling.d.ts.map +1 -1
- package/lib/services/tooling.js +5 -9
- package/lib/services/tooling.js.map +1 -1
- package/lib/services/usergroups.d.ts +8 -3
- package/lib/services/usergroups.d.ts.map +1 -1
- package/lib/services/usergroups.js +23 -51
- package/lib/services/usergroups.js.map +1 -1
- package/lib/services/users.d.ts +2 -2
- package/lib/services/users.d.ts.map +1 -1
- package/lib/services/users.js +28 -81
- package/lib/services/users.js.map +1 -1
- package/lib/services/views.d.ts +1 -1
- package/lib/services/views.d.ts.map +1 -1
- package/lib/services/views.js +11 -27
- package/lib/services/views.js.map +1 -1
- package/lib/services/workflows.d.ts +1 -1
- package/lib/services/workflows.d.ts.map +1 -1
- package/lib/services/workflows.js +27 -71
- package/lib/services/workflows.js.map +1 -1
- package/package.json +15 -11
- package/src/credentials.ts +8 -10
- package/src/errors.ts +17 -31
- package/src/index.ts +3 -7
- package/src/pagination.ts +2 -5
- package/src/protocol.test.ts +372 -0
- package/src/protocol.ts +34 -66
- package/src/retry.ts +4 -9
- package/src/services/admin.ts +1241 -1557
- package/src/services/agents.ts +853 -0
- package/src/services/api.ts +4 -10
- package/src/services/apps.ts +146 -243
- package/src/services/assistant.ts +93 -144
- package/src/services/auth.ts +12 -33
- package/src/services/blocks.ts +9 -24
- package/src/services/bookmarks.ts +14 -34
- package/src/services/bots.ts +7 -19
- package/src/services/calls.ts +15 -43
- package/src/services/canvases.ts +82 -85
- package/src/services/chat.ts +134 -254
- package/src/services/conversations.ts +101 -217
- package/src/services/dialog.ts +5 -13
- package/src/services/dnd.ts +11 -31
- package/src/services/emoji.ts +9 -19
- package/src/services/entity.ts +17 -45
- package/src/services/files.ts +72 -165
- package/src/services/functions.ts +95 -168
- package/src/services/index.ts +1 -0
- package/src/services/lists.ts +65 -208
- package/src/services/migration.ts +8 -17
- package/src/services/oauth.ts +127 -60
- package/src/services/openid.ts +12 -34
- package/src/services/pins.ts +7 -19
- package/src/services/reactions.ts +19 -43
- package/src/services/reminders.ts +13 -37
- package/src/services/rtm.ts +9 -25
- package/src/services/search.ts +51 -92
- package/src/services/stars.ts +20 -31
- package/src/services/team.ts +81 -155
- package/src/services/tooling.ts +5 -13
- package/src/services/usergroups.ts +37 -68
- package/src/services/users.ts +35 -102
- package/src/services/views.ts +11 -31
- package/src/services/workflows.ts +65 -129
- package/lib/response-validation.test.d.ts +0 -4
- package/lib/response-validation.test.d.ts.map +0 -1
- package/lib/response-validation.test.js +0 -40
- package/lib/response-validation.test.js.map +0 -1
- package/src/response-validation.test.ts +0 -54
package/src/services/oauth.ts
CHANGED
|
@@ -1,18 +1,91 @@
|
|
|
1
|
+
import * as API from "@distilled.cloud/core/api";
|
|
1
2
|
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
2
3
|
import * as S from "@distilled.cloud/core/schema";
|
|
3
4
|
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
5
|
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
6
|
+
import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
12
7
|
import * as Retry from "../retry.ts";
|
|
8
|
+
import * as T from "../traits.ts";
|
|
13
9
|
|
|
14
10
|
export type { SlackOpError, SlackOpContext };
|
|
15
11
|
|
|
12
|
+
export interface BeginShortTokenRotationRequest {
|
|
13
|
+
/** Issued when you created your application. Must be the app the token being rotated was issued to. */
|
|
14
|
+
client_id: string;
|
|
15
|
+
/** Issued when you created your application. */
|
|
16
|
+
client_secret: string | Redacted.Redacted<string>;
|
|
17
|
+
}
|
|
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
|
+
export interface BeginShortTokenRotationResponse {
|
|
35
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
36
|
+
ok: boolean;
|
|
37
|
+
/** A new xoxp access token to replace the token with a shorter secret. Not yet active until completeShortTokenRotation is called. */
|
|
38
|
+
new_token: string;
|
|
39
|
+
}
|
|
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
|
+
export interface CompleteShortTokenRotationRequest {
|
|
50
|
+
/** Issued when you created your application. Must be the app the token being rotated was issued to. */
|
|
51
|
+
client_id: string;
|
|
52
|
+
/** Issued when you created your application. */
|
|
53
|
+
client_secret: string | Redacted.Redacted<string>;
|
|
54
|
+
/** The new xoxp token returned by oauth.v2.beginShortTokenRotation. */
|
|
55
|
+
new_token: string;
|
|
56
|
+
}
|
|
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
|
+
export interface CompleteShortTokenRotationResponse {
|
|
75
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
76
|
+
ok: boolean;
|
|
77
|
+
/** The new xoxp access token, now active. The previous token is no longer valid. */
|
|
78
|
+
token: string;
|
|
79
|
+
}
|
|
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
|
+
|
|
16
89
|
export interface OauthAccessRequest {
|
|
17
90
|
/** 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. */
|
|
18
91
|
client_id?: string;
|
|
@@ -33,16 +106,9 @@ export const OauthAccessRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
33
106
|
redirect_uri: S.optional(S.String),
|
|
34
107
|
single_channel: S.optional(S.Boolean),
|
|
35
108
|
}).pipe(
|
|
36
|
-
T.Http({
|
|
37
|
-
method: "POST",
|
|
38
|
-
uri: "/oauth.access",
|
|
39
|
-
code: 200,
|
|
40
|
-
contentType: "form-urlencoded",
|
|
41
|
-
}),
|
|
109
|
+
T.Http({ method: "POST", uri: "/oauth.access", code: 200, contentType: "form-urlencoded" }),
|
|
42
110
|
),
|
|
43
|
-
).annotate({
|
|
44
|
-
identifier: "OauthAccessRequest",
|
|
45
|
-
}) as any as S.Schema<OauthAccessRequest>;
|
|
111
|
+
).annotate({ identifier: "OauthAccessRequest" }) as any as S.Schema<OauthAccessRequest>;
|
|
46
112
|
|
|
47
113
|
export interface OauthAccessResponseAuthorizingUser {
|
|
48
114
|
user_id?: string;
|
|
@@ -57,10 +123,8 @@ export const OauthAccessResponseAuthorizingUser = /*@__PURE__*/ S.suspend(() =>
|
|
|
57
123
|
identifier: "OauthAccessResponseAuthorizingUser",
|
|
58
124
|
}) as any as S.Schema<OauthAccessResponseAuthorizingUser>;
|
|
59
125
|
|
|
60
|
-
export type OauthAccessResponseInstallerUser =
|
|
61
|
-
|
|
62
|
-
export const OauthAccessResponseInstallerUser =
|
|
63
|
-
OauthAccessResponseAuthorizingUser;
|
|
126
|
+
export type OauthAccessResponseInstallerUser = OauthAccessResponseAuthorizingUser;
|
|
127
|
+
export const OauthAccessResponseInstallerUser = OauthAccessResponseAuthorizingUser;
|
|
64
128
|
|
|
65
129
|
export type OauthAccessResponseScopesAppHomeList = Array<string>;
|
|
66
130
|
export const OauthAccessResponseScopesAppHomeList = /*@__PURE__*/ S.Array(
|
|
@@ -124,9 +188,7 @@ export const OauthAccessResponseBot = /*@__PURE__*/ S.suspend(() =>
|
|
|
124
188
|
bot_access_token: S.optional(S.String),
|
|
125
189
|
scope: S.optional(S.String),
|
|
126
190
|
}),
|
|
127
|
-
).annotate({
|
|
128
|
-
identifier: "OauthAccessResponseBot",
|
|
129
|
-
}) as any as S.Schema<OauthAccessResponseBot>;
|
|
191
|
+
).annotate({ identifier: "OauthAccessResponseBot" }) as any as S.Schema<OauthAccessResponseBot>;
|
|
130
192
|
|
|
131
193
|
export interface OauthAccessResponseUser {
|
|
132
194
|
name?: string;
|
|
@@ -157,9 +219,7 @@ export const OauthAccessResponseUser = /*@__PURE__*/ S.suspend(() =>
|
|
|
157
219
|
access_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
158
220
|
token_type: S.optional(S.String),
|
|
159
221
|
}),
|
|
160
|
-
).annotate({
|
|
161
|
-
identifier: "OauthAccessResponseUser",
|
|
162
|
-
}) as any as S.Schema<OauthAccessResponseUser>;
|
|
222
|
+
).annotate({ identifier: "OauthAccessResponseUser" }) as any as S.Schema<OauthAccessResponseUser>;
|
|
163
223
|
|
|
164
224
|
export interface OauthAccessResponseTeam {
|
|
165
225
|
id?: string;
|
|
@@ -190,9 +250,7 @@ export const OauthAccessResponseTeam = /*@__PURE__*/ S.suspend(() =>
|
|
|
190
250
|
image_default: S.optional(S.Boolean),
|
|
191
251
|
image_original: S.optional(S.String),
|
|
192
252
|
}),
|
|
193
|
-
).annotate({
|
|
194
|
-
identifier: "OauthAccessResponseTeam",
|
|
195
|
-
}) as any as S.Schema<OauthAccessResponseTeam>;
|
|
253
|
+
).annotate({ identifier: "OauthAccessResponseTeam" }) as any as S.Schema<OauthAccessResponseTeam>;
|
|
196
254
|
|
|
197
255
|
export interface OauthAccessResponseIncomingWebhook {
|
|
198
256
|
channel?: string;
|
|
@@ -257,9 +315,7 @@ export const OauthAccessResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
257
315
|
incoming_webhook: S.optional(OauthAccessResponseIncomingWebhook),
|
|
258
316
|
single_channel_id: S.optional(S.String),
|
|
259
317
|
}),
|
|
260
|
-
).annotate({
|
|
261
|
-
identifier: "OauthAccessResponse",
|
|
262
|
-
}) as any as S.Schema<OauthAccessResponse>;
|
|
318
|
+
).annotate({ identifier: "OauthAccessResponse" }) as any as S.Schema<OauthAccessResponse>;
|
|
263
319
|
|
|
264
320
|
export interface V2AccessRequest {
|
|
265
321
|
/** 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. */
|
|
@@ -290,16 +346,9 @@ export const V2AccessRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
290
346
|
refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
291
347
|
assertion: S.optional(S.String),
|
|
292
348
|
}).pipe(
|
|
293
|
-
T.Http({
|
|
294
|
-
method: "POST",
|
|
295
|
-
uri: "/oauth.v2.access",
|
|
296
|
-
code: 200,
|
|
297
|
-
contentType: "form-urlencoded",
|
|
298
|
-
}),
|
|
349
|
+
T.Http({ method: "POST", uri: "/oauth.v2.access", code: 200, contentType: "form-urlencoded" }),
|
|
299
350
|
),
|
|
300
|
-
).annotate({
|
|
301
|
-
identifier: "V2AccessRequest",
|
|
302
|
-
}) as any as S.Schema<V2AccessRequest>;
|
|
351
|
+
).annotate({ identifier: "V2AccessRequest" }) as any as S.Schema<V2AccessRequest>;
|
|
303
352
|
|
|
304
353
|
/** The type of access token. Only present if a bot token was requested at the start of the auth flow. */
|
|
305
354
|
export type V2AccessResponseTokenType = "granular_bot";
|
|
@@ -317,9 +366,7 @@ export const V2AccessResponseTeam = /*@__PURE__*/ S.suspend(() =>
|
|
|
317
366
|
id: S.String,
|
|
318
367
|
name: S.optional(S.String),
|
|
319
368
|
}),
|
|
320
|
-
).annotate({
|
|
321
|
-
identifier: "V2AccessResponseTeam",
|
|
322
|
-
}) as any as S.Schema<V2AccessResponseTeam>;
|
|
369
|
+
).annotate({ identifier: "V2AccessResponseTeam" }) as any as S.Schema<V2AccessResponseTeam>;
|
|
323
370
|
|
|
324
371
|
/** Details about the installing team, and the user token if one was requested at the start of the auth flow. */
|
|
325
372
|
export interface V2AccessResponseEnterprise {
|
|
@@ -436,9 +483,7 @@ export const V2AccessResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
436
483
|
authed_user: S.optional(V2AccessResponseAuthedUser),
|
|
437
484
|
incoming_webhook: S.optional(V2AccessResponseIncomingWebhook),
|
|
438
485
|
}),
|
|
439
|
-
).annotate({
|
|
440
|
-
identifier: "V2AccessResponse",
|
|
441
|
-
}) as any as S.Schema<V2AccessResponse>;
|
|
486
|
+
).annotate({ identifier: "V2AccessResponse" }) as any as S.Schema<V2AccessResponse>;
|
|
442
487
|
|
|
443
488
|
export interface V2ExchangeRequest {
|
|
444
489
|
/** Issued when you created your application. */
|
|
@@ -458,9 +503,7 @@ export const V2ExchangeRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
458
503
|
contentType: "form-urlencoded",
|
|
459
504
|
}),
|
|
460
505
|
),
|
|
461
|
-
).annotate({
|
|
462
|
-
identifier: "V2ExchangeRequest",
|
|
463
|
-
}) as any as S.Schema<V2ExchangeRequest>;
|
|
506
|
+
).annotate({ identifier: "V2ExchangeRequest" }) as any as S.Schema<V2ExchangeRequest>;
|
|
464
507
|
|
|
465
508
|
/** The type of access token. */
|
|
466
509
|
export type V2ExchangeResponseTokenType = "bot" | "user";
|
|
@@ -501,9 +544,7 @@ export const V2ExchangeResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
501
544
|
team: S.optional(S.NullOr(S.Unknown)),
|
|
502
545
|
enterprise: S.optional(S.NullOr(S.Unknown)),
|
|
503
546
|
}),
|
|
504
|
-
).annotate({
|
|
505
|
-
identifier: "V2ExchangeResponse",
|
|
506
|
-
}) as any as S.Schema<V2ExchangeResponse>;
|
|
547
|
+
).annotate({ identifier: "V2ExchangeResponse" }) as any as S.Schema<V2ExchangeResponse>;
|
|
507
548
|
|
|
508
549
|
export interface V2UserAccessRequest {
|
|
509
550
|
/** 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. */
|
|
@@ -541,9 +582,7 @@ export const V2UserAccessRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
541
582
|
contentType: "form-urlencoded",
|
|
542
583
|
}),
|
|
543
584
|
),
|
|
544
|
-
).annotate({
|
|
545
|
-
identifier: "V2UserAccessRequest",
|
|
546
|
-
}) as any as S.Schema<V2UserAccessRequest>;
|
|
585
|
+
).annotate({ identifier: "V2UserAccessRequest" }) as any as S.Schema<V2UserAccessRequest>;
|
|
547
586
|
|
|
548
587
|
/** The type of access token. */
|
|
549
588
|
export type V2UserAccessResponseTokenType = "user";
|
|
@@ -593,9 +632,37 @@ export const V2UserAccessResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
593
632
|
team: S.NullOr(V2AccessResponseTeam),
|
|
594
633
|
enterprise: S.NullOr(V2AccessResponseEnterprise),
|
|
595
634
|
}),
|
|
596
|
-
).annotate({
|
|
597
|
-
|
|
598
|
-
|
|
635
|
+
).annotate({ identifier: "V2UserAccessResponse" }) as any as S.Schema<V2UserAccessResponse>;
|
|
636
|
+
|
|
637
|
+
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 */
|
|
639
|
+
export const beginShortTokenRotation: API.OperationMethod<
|
|
640
|
+
BeginShortTokenRotationRequest,
|
|
641
|
+
BeginShortTokenRotationResponse,
|
|
642
|
+
BeginShortTokenRotationError,
|
|
643
|
+
SlackOpContext
|
|
644
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
645
|
+
input: BeginShortTokenRotationRequest,
|
|
646
|
+
output: BeginShortTokenRotationResponse,
|
|
647
|
+
errors: [SlackError, SlackRateLimited],
|
|
648
|
+
protocol: SlackProtocol,
|
|
649
|
+
retry: Retry.Retry,
|
|
650
|
+
}));
|
|
651
|
+
|
|
652
|
+
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 */
|
|
654
|
+
export const completeShortTokenRotation: API.OperationMethod<
|
|
655
|
+
CompleteShortTokenRotationRequest,
|
|
656
|
+
CompleteShortTokenRotationResponse,
|
|
657
|
+
CompleteShortTokenRotationError,
|
|
658
|
+
SlackOpContext
|
|
659
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
660
|
+
input: CompleteShortTokenRotationRequest,
|
|
661
|
+
output: CompleteShortTokenRotationResponse,
|
|
662
|
+
errors: [SlackError, SlackRateLimited],
|
|
663
|
+
protocol: SlackProtocol,
|
|
664
|
+
retry: Retry.Retry,
|
|
665
|
+
}));
|
|
599
666
|
|
|
600
667
|
export type OauthAccessError = SlackOpError;
|
|
601
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 */
|
|
@@ -643,7 +710,7 @@ export const v2Exchange: API.OperationMethod<
|
|
|
643
710
|
}));
|
|
644
711
|
|
|
645
712
|
export type V2UserAccessError = SlackOpError;
|
|
646
|
-
/** 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. - `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 See https://docs.slack.dev/reference/methods/oauth.v2.user.access */
|
|
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 */
|
|
647
714
|
export const v2UserAccess: API.OperationMethod<
|
|
648
715
|
V2UserAccessRequest,
|
|
649
716
|
V2UserAccessResponse,
|
package/src/services/openid.ts
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
|
+
import * as API from "@distilled.cloud/core/api";
|
|
1
2
|
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
2
3
|
import * as S from "@distilled.cloud/core/schema";
|
|
3
4
|
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
5
|
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
6
|
+
import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
12
7
|
import * as Retry from "../retry.ts";
|
|
8
|
+
import * as T from "../traits.ts";
|
|
13
9
|
|
|
14
10
|
export type { SlackOpError, SlackOpContext };
|
|
15
11
|
|
|
16
12
|
/** The `grant_type` param as described in the OAuth spec. */
|
|
17
|
-
export type ConnectTokenRequestGrantType =
|
|
18
|
-
| "authorization_code"
|
|
19
|
-
| "refresh_token";
|
|
13
|
+
export type ConnectTokenRequestGrantType = "authorization_code" | "refresh_token";
|
|
20
14
|
export const ConnectTokenRequestGrantType = S.String;
|
|
21
15
|
|
|
22
16
|
export interface ConnectTokenRequest {
|
|
@@ -52,9 +46,7 @@ export const ConnectTokenRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
52
46
|
contentType: "form-urlencoded",
|
|
53
47
|
}),
|
|
54
48
|
),
|
|
55
|
-
).annotate({
|
|
56
|
-
identifier: "ConnectTokenRequest",
|
|
57
|
-
}) as any as S.Schema<ConnectTokenRequest>;
|
|
49
|
+
).annotate({ identifier: "ConnectTokenRequest" }) as any as S.Schema<ConnectTokenRequest>;
|
|
58
50
|
|
|
59
51
|
export type ConnectTokenResponseTokenType = "Bearer";
|
|
60
52
|
export const ConnectTokenResponseTokenType = S.String;
|
|
@@ -81,18 +73,12 @@ export const ConnectTokenResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
81
73
|
expires_in: S.optional(S.Number),
|
|
82
74
|
refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
83
75
|
}),
|
|
84
|
-
).annotate({
|
|
85
|
-
identifier: "ConnectTokenResponse",
|
|
86
|
-
}) as any as S.Schema<ConnectTokenResponse>;
|
|
76
|
+
).annotate({ identifier: "ConnectTokenResponse" }) as any as S.Schema<ConnectTokenResponse>;
|
|
87
77
|
|
|
88
78
|
export interface UserInfoRequest {}
|
|
89
79
|
export const UserInfoRequest = /*@__PURE__*/ S.suspend(() =>
|
|
90
|
-
S.Struct({}).pipe(
|
|
91
|
-
|
|
92
|
-
),
|
|
93
|
-
).annotate({
|
|
94
|
-
identifier: "UserInfoRequest",
|
|
95
|
-
}) as any as S.Schema<UserInfoRequest>;
|
|
80
|
+
S.Struct({}).pipe(T.Http({ method: "POST", uri: "/openid.connect.userInfo", code: 200 })),
|
|
81
|
+
).annotate({ identifier: "UserInfoRequest" }) as any as S.Schema<UserInfoRequest>;
|
|
96
82
|
|
|
97
83
|
export interface UserInfoResponse {
|
|
98
84
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -133,12 +119,8 @@ export const UserInfoResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
133
119
|
S.Struct({
|
|
134
120
|
ok: S.Boolean,
|
|
135
121
|
sub: S.String,
|
|
136
|
-
https___slack_com_user_id: S.String.pipe(
|
|
137
|
-
|
|
138
|
-
),
|
|
139
|
-
https___slack_com_team_id: S.optional(
|
|
140
|
-
S.String.pipe(T.Body("https://slack.com/team_id")),
|
|
141
|
-
),
|
|
122
|
+
https___slack_com_user_id: S.String.pipe(T.Body("https://slack.com/user_id")),
|
|
123
|
+
https___slack_com_team_id: S.optional(S.String.pipe(T.Body("https://slack.com/team_id"))),
|
|
142
124
|
https___slack_com_enterprise_id: S.optional(
|
|
143
125
|
S.String.pipe(T.Body("https://slack.com/enterprise_id")),
|
|
144
126
|
),
|
|
@@ -171,9 +153,7 @@ export const UserInfoResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
171
153
|
https___slack_com_user_image_1024: S.optional(
|
|
172
154
|
S.String.pipe(T.Body("https://slack.com/user_image_1024")),
|
|
173
155
|
),
|
|
174
|
-
https___slack_com_team_name: S.optional(
|
|
175
|
-
S.String.pipe(T.Body("https://slack.com/team_name")),
|
|
176
|
-
),
|
|
156
|
+
https___slack_com_team_name: S.optional(S.String.pipe(T.Body("https://slack.com/team_name"))),
|
|
177
157
|
https___slack_com_team_domain: S.optional(
|
|
178
158
|
S.String.pipe(T.Body("https://slack.com/team_domain")),
|
|
179
159
|
),
|
|
@@ -208,9 +188,7 @@ export const UserInfoResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
208
188
|
S.Boolean.pipe(T.Body("https://slack.com/team_image_default")),
|
|
209
189
|
),
|
|
210
190
|
}),
|
|
211
|
-
).annotate({
|
|
212
|
-
identifier: "UserInfoResponse",
|
|
213
|
-
}) as any as S.Schema<UserInfoResponse>;
|
|
191
|
+
).annotate({ identifier: "UserInfoResponse" }) as any as S.Schema<UserInfoResponse>;
|
|
214
192
|
|
|
215
193
|
export type ConnectTokenError = SlackOpError;
|
|
216
194
|
/** Exchanges a temporary OAuth verifier code for an access token for Sign in with Slack. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `bad_client_secret` — The value passed for `client_secret` was invalid. - `bad_redirect_uri` — The value passed for `redirect_uri` did not match the `redirect_uri` in the original request. - `cannot_install_an_org_installed_app` — An org-installed app cannot be installed on a workspace. - `invalid_client` — Client authentication failed (unknown `client_id` or bad `client_secret`). - `invalid_client_id` — The value passed for `client_id` was invalid. - `invalid_code` — The value passed for `code` was invalid. - `invalid_grant` — The authorization code is invalid, expired, revoked, or the PKCE `code_verifier` does not match. - `invalid_grant_type` — The value passed for `grant_type` was invalid. - `invalid_refresh_token` — The given refresh token is invalid. - `invalid_request` — The request is missing a required parameter or includes an invalid parameter value. - `oauth_authorization_url_mismatch` — The OAuth flow was initiated on an incorrect version of the authorization URL. The flow must be initiated via /openid/connect/authorize . - `preview_feature_not_available` — The API method is not yet available on the team. - `unsupported_grant_type` — The `grant_type` is not supported by this endpoint. See https://docs.slack.dev/reference/methods/openid.connect.token */
|
package/src/services/pins.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
+
import * as API from "@distilled.cloud/core/api";
|
|
1
2
|
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
2
3
|
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
4
|
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
5
|
+
import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
11
6
|
import * as Retry from "../retry.ts";
|
|
7
|
+
import * as T from "../traits.ts";
|
|
12
8
|
|
|
13
9
|
export type { SlackOpError, SlackOpContext };
|
|
14
10
|
|
|
@@ -43,9 +39,7 @@ export const ListPinsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
43
39
|
S.Struct({
|
|
44
40
|
channel: S.String.pipe(T.Query()),
|
|
45
41
|
}).pipe(T.Http({ method: "GET", uri: "/pins.list", code: 200 })),
|
|
46
|
-
).annotate({
|
|
47
|
-
identifier: "ListPinsRequest",
|
|
48
|
-
}) as any as S.Schema<ListPinsRequest>;
|
|
42
|
+
).annotate({ identifier: "ListPinsRequest" }) as any as S.Schema<ListPinsRequest>;
|
|
49
43
|
|
|
50
44
|
export type ListPinsResponseItemsItemType = "file" | "message" | "file_comment";
|
|
51
45
|
export const ListPinsResponseItemsItemType = S.String;
|
|
@@ -90,9 +84,7 @@ export const ListPinsResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
90
84
|
items: S.optional(ListPinsResponseItemsList),
|
|
91
85
|
count: S.optional(S.Number),
|
|
92
86
|
}),
|
|
93
|
-
).annotate({
|
|
94
|
-
identifier: "ListPinsResponse",
|
|
95
|
-
}) as any as S.Schema<ListPinsResponse>;
|
|
87
|
+
).annotate({ identifier: "ListPinsResponse" }) as any as S.Schema<ListPinsResponse>;
|
|
96
88
|
|
|
97
89
|
export interface RemovePinRequest {
|
|
98
90
|
/** Channel where the item is pinned to. */
|
|
@@ -105,9 +97,7 @@ export const RemovePinRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
105
97
|
channel: S.String,
|
|
106
98
|
timestamp: S.optional(S.String),
|
|
107
99
|
}).pipe(T.Http({ method: "POST", uri: "/pins.remove", code: 200 })),
|
|
108
|
-
).annotate({
|
|
109
|
-
identifier: "RemovePinRequest",
|
|
110
|
-
}) as any as S.Schema<RemovePinRequest>;
|
|
100
|
+
).annotate({ identifier: "RemovePinRequest" }) as any as S.Schema<RemovePinRequest>;
|
|
111
101
|
|
|
112
102
|
export interface RemovePinResponse {
|
|
113
103
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -117,9 +107,7 @@ export const RemovePinResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
117
107
|
S.Struct({
|
|
118
108
|
ok: S.Boolean,
|
|
119
109
|
}),
|
|
120
|
-
).annotate({
|
|
121
|
-
identifier: "RemovePinResponse",
|
|
122
|
-
}) as any as S.Schema<RemovePinResponse>;
|
|
110
|
+
).annotate({ identifier: "RemovePinResponse" }) as any as S.Schema<RemovePinResponse>;
|
|
123
111
|
|
|
124
112
|
export type AddPinError = SlackOpError;
|
|
125
113
|
/** Pins an item to a channel. Required scopes — bot: `pins:write`; user: `pins:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `already_pinned` — The specified item is already pinned to the channel. - `bad_timestamp` — Value passed for `timestamp` was invalid. - `channel_not_found` — The `channel` argument was not specified or was invalid - `external_channel_migrating` — Channel is undergoing an active migration. - `file_not_found` — File not found. - `file_not_shared` — File specified by `file` is not public nor shared to the channel. - `message_not_found` — Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` — One of `file`, `file_comment`, or `timestamp` was not specified. - `not_in_channel` — Item is not in channel. - `not_pinnable` — This message type is not pinnable. - `restricted_action` — The user does not have permission to add pins to the channel. - `too_many_pins` — Too many pins in channel. See https://docs.slack.dev/reference/methods/pins.add */
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
+
import * as API from "@distilled.cloud/core/api";
|
|
1
2
|
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
2
3
|
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 { slackPaginate } from "../pagination.ts";
|
|
11
4
|
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
5
|
+
import { slackPaginate } from "../pagination.ts";
|
|
6
|
+
import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
12
7
|
import * as Retry from "../retry.ts";
|
|
8
|
+
import * as T from "../traits.ts";
|
|
13
9
|
|
|
14
10
|
export type { SlackOpError, SlackOpContext };
|
|
15
11
|
|
|
@@ -27,9 +23,7 @@ export const AddReactionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
27
23
|
name: S.String,
|
|
28
24
|
timestamp: S.String,
|
|
29
25
|
}).pipe(T.Http({ method: "POST", uri: "/reactions.add", code: 200 })),
|
|
30
|
-
).annotate({
|
|
31
|
-
identifier: "AddReactionRequest",
|
|
32
|
-
}) as any as S.Schema<AddReactionRequest>;
|
|
26
|
+
).annotate({ identifier: "AddReactionRequest" }) as any as S.Schema<AddReactionRequest>;
|
|
33
27
|
|
|
34
28
|
export interface AddReactionResponse {
|
|
35
29
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -39,9 +33,7 @@ export const AddReactionResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
39
33
|
S.Struct({
|
|
40
34
|
ok: S.Boolean,
|
|
41
35
|
}),
|
|
42
|
-
).annotate({
|
|
43
|
-
identifier: "AddReactionResponse",
|
|
44
|
-
}) as any as S.Schema<AddReactionResponse>;
|
|
36
|
+
).annotate({ identifier: "AddReactionResponse" }) as any as S.Schema<AddReactionResponse>;
|
|
45
37
|
|
|
46
38
|
export interface GetReactionRequest {
|
|
47
39
|
/** Channel where the message to get reactions for was posted. */
|
|
@@ -63,9 +55,7 @@ export const GetReactionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
63
55
|
full: S.optional(S.Boolean.pipe(T.Query())),
|
|
64
56
|
timestamp: S.optional(S.String.pipe(T.Query())),
|
|
65
57
|
}).pipe(T.Http({ method: "GET", uri: "/reactions.get", code: 200 })),
|
|
66
|
-
).annotate({
|
|
67
|
-
identifier: "GetReactionRequest",
|
|
68
|
-
}) as any as S.Schema<GetReactionRequest>;
|
|
58
|
+
).annotate({ identifier: "GetReactionRequest" }) as any as S.Schema<GetReactionRequest>;
|
|
69
59
|
|
|
70
60
|
export interface GetReactionResponse {
|
|
71
61
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -85,9 +75,7 @@ export const GetReactionResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
85
75
|
channel: S.optional(S.String),
|
|
86
76
|
file: S.optional(S.Unknown),
|
|
87
77
|
}),
|
|
88
|
-
).annotate({
|
|
89
|
-
identifier: "GetReactionResponse",
|
|
90
|
-
}) as any as S.Schema<GetReactionResponse>;
|
|
78
|
+
).annotate({ identifier: "GetReactionResponse" }) as any as S.Schema<GetReactionResponse>;
|
|
91
79
|
|
|
92
80
|
export interface ListReactionsRequest {
|
|
93
81
|
/** Show reactions made by this user. Defaults to the authed user. */
|
|
@@ -113,20 +101,15 @@ export const ListReactionsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
113
101
|
limit: S.optional(S.Number.pipe(T.Query())),
|
|
114
102
|
team_id: S.optional(S.String.pipe(T.Query())),
|
|
115
103
|
}).pipe(T.Http({ method: "GET", uri: "/reactions.list", code: 200 })),
|
|
116
|
-
).annotate({
|
|
117
|
-
identifier: "ListReactionsRequest",
|
|
118
|
-
}) as any as S.Schema<ListReactionsRequest>;
|
|
104
|
+
).annotate({ identifier: "ListReactionsRequest" }) as any as S.Schema<ListReactionsRequest>;
|
|
119
105
|
|
|
120
|
-
export type ListReactionsResponseItemsItemMap = {
|
|
121
|
-
[key: string]: unknown | undefined;
|
|
122
|
-
};
|
|
106
|
+
export type ListReactionsResponseItemsItemMap = { [key: string]: unknown | undefined };
|
|
123
107
|
export const ListReactionsResponseItemsItemMap = /*@__PURE__*/ S.Record(
|
|
124
108
|
S.String,
|
|
125
109
|
S.Unknown,
|
|
126
110
|
) as any as S.Schema<ListReactionsResponseItemsItemMap>;
|
|
127
111
|
|
|
128
|
-
export type ListReactionsResponseItemsList =
|
|
129
|
-
Array<ListReactionsResponseItemsItemMap>;
|
|
112
|
+
export type ListReactionsResponseItemsList = Array<ListReactionsResponseItemsItemMap>;
|
|
130
113
|
export const ListReactionsResponseItemsList = /*@__PURE__*/ S.Array(
|
|
131
114
|
ListReactionsResponseItemsItemMap,
|
|
132
115
|
) as any as S.Schema<ListReactionsResponseItemsList>;
|
|
@@ -136,11 +119,10 @@ export interface ListReactionsResponseResponseMetadata {
|
|
|
136
119
|
/** Cursor for the next page — pass as `cursor` on the next call. */
|
|
137
120
|
next_cursor?: string;
|
|
138
121
|
}
|
|
139
|
-
export const ListReactionsResponseResponseMetadata = /*@__PURE__*/ S.suspend(
|
|
140
|
-
(
|
|
141
|
-
S.
|
|
142
|
-
|
|
143
|
-
}),
|
|
122
|
+
export const ListReactionsResponseResponseMetadata = /*@__PURE__*/ S.suspend(() =>
|
|
123
|
+
S.Struct({
|
|
124
|
+
next_cursor: S.optional(S.String),
|
|
125
|
+
}),
|
|
144
126
|
).annotate({
|
|
145
127
|
identifier: "ListReactionsResponseResponseMetadata",
|
|
146
128
|
}) as any as S.Schema<ListReactionsResponseResponseMetadata>;
|
|
@@ -160,9 +142,7 @@ export const ListReactionsResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
160
142
|
paging: S.optional(S.Unknown),
|
|
161
143
|
response_metadata: S.optional(ListReactionsResponseResponseMetadata),
|
|
162
144
|
}),
|
|
163
|
-
).annotate({
|
|
164
|
-
identifier: "ListReactionsResponse",
|
|
165
|
-
}) as any as S.Schema<ListReactionsResponse>;
|
|
145
|
+
).annotate({ identifier: "ListReactionsResponse" }) as any as S.Schema<ListReactionsResponse>;
|
|
166
146
|
|
|
167
147
|
export interface RemoveReactionRequest {
|
|
168
148
|
/** Reaction (emoji) name. */
|
|
@@ -184,9 +164,7 @@ export const RemoveReactionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
184
164
|
channel: S.optional(S.String),
|
|
185
165
|
timestamp: S.optional(S.String),
|
|
186
166
|
}).pipe(T.Http({ method: "POST", uri: "/reactions.remove", code: 200 })),
|
|
187
|
-
).annotate({
|
|
188
|
-
identifier: "RemoveReactionRequest",
|
|
189
|
-
}) as any as S.Schema<RemoveReactionRequest>;
|
|
167
|
+
).annotate({ identifier: "RemoveReactionRequest" }) as any as S.Schema<RemoveReactionRequest>;
|
|
190
168
|
|
|
191
169
|
export interface RemoveReactionResponse {
|
|
192
170
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -196,9 +174,7 @@ export const RemoveReactionResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
196
174
|
S.Struct({
|
|
197
175
|
ok: S.Boolean,
|
|
198
176
|
}),
|
|
199
|
-
).annotate({
|
|
200
|
-
identifier: "RemoveReactionResponse",
|
|
201
|
-
}) as any as S.Schema<RemoveReactionResponse>;
|
|
177
|
+
).annotate({ identifier: "RemoveReactionResponse" }) as any as S.Schema<RemoveReactionResponse>;
|
|
202
178
|
|
|
203
179
|
export type AddReactionError = SlackOpError;
|
|
204
180
|
/** Adds a reaction to an item. Required scopes — bot: `reactions:write`; user: `reactions:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `already_reacted` — The specified item already has the user/reaction combination. - `bad_timestamp` — Value passed for `timestamp` was invalid. - `channel_not_found` — Value passed for `channel` is invalid. - `external_channel_migrating` — The channel is in the process of being migrated. - `invalid_name` — Value passed for `name` was invalid. - `is_archived` — Channel specified has been archived. - `message_not_found` — Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` — combination of `channel` and `timestamp` was not specified. - `not_reactable` — Whatever you passed in, like a `file` or `file_comment`, can't be reacted to anymore. Your app can react to messages though. - `thread_locked` — Reactions are disabled as the specified message is part of a locked thread. - `too_many_emoji` — The limit for distinct reactions (i.e emoji) on the item has been reached. - `too_many_reactions` — The limit for reactions a person may add to the item has been reached. - `no_access` — User does not have access to react to this canvas. See https://docs.slack.dev/reference/methods/reactions.add */
|
|
@@ -231,7 +207,7 @@ export const getReaction: API.OperationMethod<
|
|
|
231
207
|
}));
|
|
232
208
|
|
|
233
209
|
export type ListReactionsError = SlackOpError;
|
|
234
|
-
/** Lists reactions made by a user. Required scopes — bot: `reactions:read`; user: `reactions:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `user_not_found` — Value passed for `user` was invalid. See https://docs.slack.dev/reference/methods/reactions.list */
|
|
210
|
+
/** Lists reactions made by a user. Required scopes — bot: `reactions:read`; user: `reactions:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` — Value passed for `cursor` was not valid or is no longer valid. - `user_not_found` — Value passed for `user` was invalid. See https://docs.slack.dev/reference/methods/reactions.list */
|
|
235
211
|
export const listReactions: API.PaginatedOperationMethod<
|
|
236
212
|
ListReactionsRequest,
|
|
237
213
|
ListReactionsResponse,
|