@distilled.cloud/slack 0.0.0 → 1.0.0-rc.9
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/LICENSE +201 -0
- package/lib/credentials.d.ts +27 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +53 -0
- package/lib/credentials.js.map +1 -0
- package/lib/errors.d.ts +83 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +59 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +17 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +17 -0
- package/lib/index.js.map +1 -0
- package/lib/pagination.d.ts +31 -0
- package/lib/pagination.d.ts.map +1 -0
- package/lib/pagination.js +31 -0
- package/lib/pagination.js.map +1 -0
- package/lib/protocol.d.ts +18 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +230 -0
- package/lib/protocol.js.map +1 -0
- package/lib/retry.d.ts +52 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +45 -0
- package/lib/retry.js.map +1 -0
- package/lib/services/admin.d.ts +2796 -0
- package/lib/services/admin.d.ts.map +1 -0
- package/lib/services/admin.js +3225 -0
- package/lib/services/admin.js.map +1 -0
- package/lib/services/api.d.ts +23 -0
- package/lib/services/api.d.ts.map +1 -0
- package/lib/services/api.js +26 -0
- package/lib/services/api.js.map +1 -0
- package/lib/services/apps.d.ts +568 -0
- package/lib/services/apps.d.ts.map +1 -0
- package/lib/services/apps.js +584 -0
- package/lib/services/apps.js.map +1 -0
- package/lib/services/assistant.d.ts +290 -0
- package/lib/services/assistant.d.ts.map +1 -0
- package/lib/services/assistant.js +232 -0
- package/lib/services/assistant.js.map +1 -0
- package/lib/services/auth.d.ts +90 -0
- package/lib/services/auth.d.ts.map +1 -0
- package/lib/services/auth.js +114 -0
- package/lib/services/auth.js.map +1 -0
- package/lib/services/blocks.d.ts +31 -0
- package/lib/services/blocks.d.ts.map +1 -0
- package/lib/services/blocks.js +31 -0
- package/lib/services/blocks.js.map +1 -0
- package/lib/services/bookmarks.d.ts +91 -0
- package/lib/services/bookmarks.d.ts.map +1 -0
- package/lib/services/bookmarks.js +98 -0
- package/lib/services/bookmarks.js.map +1 -0
- package/lib/services/bots.d.ts +60 -0
- package/lib/services/bots.d.ts.map +1 -0
- package/lib/services/bots.js +68 -0
- package/lib/services/bots.js.map +1 -0
- package/lib/services/calls.d.ts +124 -0
- package/lib/services/calls.d.ts.map +1 -0
- package/lib/services/calls.js +136 -0
- package/lib/services/calls.js.map +1 -0
- package/lib/services/canvases.d.ts +152 -0
- package/lib/services/canvases.d.ts.map +1 -0
- package/lib/services/canvases.js +152 -0
- package/lib/services/canvases.js.map +1 -0
- package/lib/services/chat.d.ts +525 -0
- package/lib/services/chat.d.ts.map +1 -0
- package/lib/services/chat.js +436 -0
- package/lib/services/chat.js.map +1 -0
- package/lib/services/conversations.d.ts +642 -0
- package/lib/services/conversations.d.ts.map +1 -0
- package/lib/services/conversations.js +769 -0
- package/lib/services/conversations.js.map +1 -0
- package/lib/services/dialog.d.ts +20 -0
- package/lib/services/dialog.d.ts.map +1 -0
- package/lib/services/dialog.js +27 -0
- package/lib/services/dialog.js.map +1 -0
- package/lib/services/dnd.d.ts +94 -0
- package/lib/services/dnd.d.ts.map +1 -0
- package/lib/services/dnd.js +111 -0
- package/lib/services/dnd.js.map +1 -0
- package/lib/services/emoji.d.ts +35 -0
- package/lib/services/emoji.d.ts.map +1 -0
- package/lib/services/emoji.js +40 -0
- package/lib/services/emoji.js.map +1 -0
- package/lib/services/entity.d.ts +93 -0
- package/lib/services/entity.d.ts.map +1 -0
- package/lib/services/entity.js +89 -0
- package/lib/services/entity.js.map +1 -0
- package/lib/services/files.d.ts +473 -0
- package/lib/services/files.d.ts.map +1 -0
- package/lib/services/files.js +510 -0
- package/lib/services/files.js.map +1 -0
- package/lib/services/functions.d.ts +235 -0
- package/lib/services/functions.d.ts.map +1 -0
- package/lib/services/functions.js +261 -0
- package/lib/services/functions.js.map +1 -0
- package/lib/services/index.d.ts +35 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +36 -0
- package/lib/services/index.js.map +1 -0
- package/lib/services/lists.d.ts +300 -0
- package/lib/services/lists.d.ts.map +1 -0
- package/lib/services/lists.js +366 -0
- package/lib/services/lists.js.map +1 -0
- package/lib/services/migration.d.ts +34 -0
- package/lib/services/migration.d.ts.map +1 -0
- package/lib/services/migration.js +36 -0
- package/lib/services/migration.js.map +1 -0
- package/lib/services/oauth.d.ts +307 -0
- package/lib/services/oauth.d.ts.map +1 -0
- package/lib/services/oauth.js +278 -0
- package/lib/services/oauth.js.map +1 -0
- package/lib/services/openid.d.ts +86 -0
- package/lib/services/openid.d.ts.map +1 -0
- package/lib/services/openid.js +93 -0
- package/lib/services/openid.js.map +1 -0
- package/lib/services/pins.d.ts +64 -0
- package/lib/services/pins.d.ts.map +1 -0
- package/lib/services/pins.js +75 -0
- package/lib/services/pins.js.map +1 -0
- package/lib/services/reactions.d.ts +108 -0
- package/lib/services/reactions.d.ts.map +1 -0
- package/lib/services/reactions.js +119 -0
- package/lib/services/reactions.js.map +1 -0
- package/lib/services/reminders.d.ts +89 -0
- package/lib/services/reminders.d.ts.map +1 -0
- package/lib/services/reminders.js +109 -0
- package/lib/services/reminders.js.map +1 -0
- package/lib/services/rtm.d.ts +68 -0
- package/lib/services/rtm.d.ts.map +1 -0
- package/lib/services/rtm.js +74 -0
- package/lib/services/rtm.js.map +1 -0
- package/lib/services/search.d.ts +239 -0
- package/lib/services/search.d.ts.map +1 -0
- package/lib/services/search.js +190 -0
- package/lib/services/search.js.map +1 -0
- package/lib/services/stars.d.ts +126 -0
- package/lib/services/stars.d.ts.map +1 -0
- package/lib/services/stars.js +145 -0
- package/lib/services/stars.js.map +1 -0
- package/lib/services/team.d.ts +309 -0
- package/lib/services/team.d.ts.map +1 -0
- package/lib/services/team.js +336 -0
- package/lib/services/team.js.map +1 -0
- package/lib/services/tooling.d.ts +31 -0
- package/lib/services/tooling.d.ts.map +1 -0
- package/lib/services/tooling.js +38 -0
- package/lib/services/tooling.js.map +1 -0
- package/lib/services/usergroups.d.ts +183 -0
- package/lib/services/usergroups.d.ts.map +1 -0
- package/lib/services/usergroups.js +180 -0
- package/lib/services/usergroups.js.map +1 -0
- package/lib/services/users.d.ts +246 -0
- package/lib/services/users.d.ts.map +1 -0
- package/lib/services/users.js +309 -0
- package/lib/services/users.js.map +1 -0
- package/lib/services/views.d.ts +84 -0
- package/lib/services/views.d.ts.map +1 -0
- package/lib/services/views.js +95 -0
- package/lib/services/views.js.map +1 -0
- package/lib/services/workflows.d.ts +231 -0
- package/lib/services/workflows.d.ts.map +1 -0
- package/lib/services/workflows.js +240 -0
- package/lib/services/workflows.js.map +1 -0
- package/lib/traits.d.ts +11 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +12 -0
- package/lib/traits.js.map +1 -0
- package/package.json +82 -4
- package/src/credentials.ts +86 -0
- package/src/errors.ts +101 -0
- package/src/index.ts +20 -0
- package/src/pagination.ts +35 -0
- package/src/protocol.ts +326 -0
- package/src/retry.ts +76 -0
- package/src/services/admin.ts +7729 -0
- package/src/services/api.ts +58 -0
- package/src/services/apps.ts +1441 -0
- package/src/services/assistant.ts +639 -0
- package/src/services/auth.ts +241 -0
- package/src/services/blocks.ts +80 -0
- package/src/services/bookmarks.ts +223 -0
- package/src/services/bots.ts +144 -0
- package/src/services/calls.ts +318 -0
- package/src/services/canvases.ts +392 -0
- package/src/services/chat.ts +1191 -0
- package/src/services/conversations.ts +1754 -0
- package/src/services/dialog.ts +55 -0
- package/src/services/dnd.ts +246 -0
- package/src/services/emoji.ts +91 -0
- package/src/services/entity.ts +225 -0
- package/src/services/files.ts +1192 -0
- package/src/services/functions.ts +647 -0
- package/src/services/index.ts +35 -0
- package/src/services/lists.ts +832 -0
- package/src/services/migration.ts +85 -0
- package/src/services/oauth.ts +658 -0
- package/src/services/openid.ts +243 -0
- package/src/services/pins.ts +167 -0
- package/src/services/reactions.ts +272 -0
- package/src/services/reminders.ts +240 -0
- package/src/services/rtm.ts +162 -0
- package/src/services/search.ts +507 -0
- package/src/services/stars.ts +323 -0
- package/src/services/team.ts +836 -0
- package/src/services/tooling.ts +78 -0
- package/src/services/usergroups.ts +441 -0
- package/src/services/users.ts +685 -0
- package/src/services/views.ts +212 -0
- package/src/services/workflows.ts +607 -0
- package/src/traits.ts +45 -0
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
2
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as Redacted from "effect/Redacted";
|
|
4
|
+
import * as API from "@distilled.cloud/core/api";
|
|
5
|
+
import * as T from "../traits.ts";
|
|
6
|
+
import {
|
|
7
|
+
SlackProtocol,
|
|
8
|
+
type SlackOpError,
|
|
9
|
+
type SlackOpContext,
|
|
10
|
+
} from "../protocol.ts";
|
|
11
|
+
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
12
|
+
import * as Retry from "../retry.ts";
|
|
13
|
+
|
|
14
|
+
export type { SlackOpError, SlackOpContext };
|
|
15
|
+
|
|
16
|
+
/** The `grant_type` param as described in the OAuth spec. */
|
|
17
|
+
export type ConnectTokenRequestGrantType =
|
|
18
|
+
| "authorization_code"
|
|
19
|
+
| "refresh_token";
|
|
20
|
+
export const ConnectTokenRequestGrantType = /*@__PURE__*/ S.String;
|
|
21
|
+
|
|
22
|
+
export interface ConnectTokenRequest {
|
|
23
|
+
/** Issued when you created your application. */
|
|
24
|
+
client_id?: string;
|
|
25
|
+
/** Issued when you created your application. */
|
|
26
|
+
client_secret?: string | Redacted.Redacted<string>;
|
|
27
|
+
/** The `code` param returned via the OAuth callback. */
|
|
28
|
+
code?: string;
|
|
29
|
+
/** This must match the originally submitted URI (if one was sent). */
|
|
30
|
+
redirect_uri?: string;
|
|
31
|
+
/** The `grant_type` param as described in the OAuth spec. */
|
|
32
|
+
grant_type?: ConnectTokenRequestGrantType | (string & {});
|
|
33
|
+
/** The `refresh_token` param as described in the OAuth spec. */
|
|
34
|
+
refresh_token?: string | Redacted.Redacted<string>;
|
|
35
|
+
/** PKCE code verifier (RFC 7636). Required when the authorization request included a `code_challenge`. */
|
|
36
|
+
code_verifier?: string;
|
|
37
|
+
}
|
|
38
|
+
export const ConnectTokenRequest = /*@__PURE__*/ S.suspend(() =>
|
|
39
|
+
S.Struct({
|
|
40
|
+
client_id: S.optional(S.String),
|
|
41
|
+
client_secret: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
42
|
+
code: S.optional(S.String),
|
|
43
|
+
redirect_uri: S.optional(S.String),
|
|
44
|
+
grant_type: S.optional(ConnectTokenRequestGrantType),
|
|
45
|
+
refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
46
|
+
code_verifier: S.optional(S.String),
|
|
47
|
+
}).pipe(
|
|
48
|
+
T.Http({
|
|
49
|
+
method: "POST",
|
|
50
|
+
uri: "/openid.connect.token",
|
|
51
|
+
code: 200,
|
|
52
|
+
contentType: "form-urlencoded",
|
|
53
|
+
}),
|
|
54
|
+
),
|
|
55
|
+
).annotate({
|
|
56
|
+
identifier: "ConnectTokenRequest",
|
|
57
|
+
}) as any as S.Schema<ConnectTokenRequest>;
|
|
58
|
+
|
|
59
|
+
export type ConnectTokenResponseTokenType = "Bearer";
|
|
60
|
+
export const ConnectTokenResponseTokenType = /*@__PURE__*/ S.String;
|
|
61
|
+
|
|
62
|
+
export interface ConnectTokenResponse {
|
|
63
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
64
|
+
ok: boolean;
|
|
65
|
+
access_token: string | Redacted.Redacted<string>;
|
|
66
|
+
token_type: ConnectTokenResponseTokenType;
|
|
67
|
+
id_token?: string;
|
|
68
|
+
state?: string;
|
|
69
|
+
/** Time until this credential expires, if it expires at all */
|
|
70
|
+
expires_in?: number;
|
|
71
|
+
/** Refresh token for this credential */
|
|
72
|
+
refresh_token?: string | Redacted.Redacted<string>;
|
|
73
|
+
}
|
|
74
|
+
export const ConnectTokenResponse = /*@__PURE__*/ S.suspend(() =>
|
|
75
|
+
S.Struct({
|
|
76
|
+
ok: S.Boolean,
|
|
77
|
+
access_token: S.String.pipe(T.SensitiveValue({})),
|
|
78
|
+
token_type: ConnectTokenResponseTokenType,
|
|
79
|
+
id_token: S.optional(S.String),
|
|
80
|
+
state: S.optional(S.String),
|
|
81
|
+
expires_in: S.optional(S.Number),
|
|
82
|
+
refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
83
|
+
}),
|
|
84
|
+
).annotate({
|
|
85
|
+
identifier: "ConnectTokenResponse",
|
|
86
|
+
}) as any as S.Schema<ConnectTokenResponse>;
|
|
87
|
+
|
|
88
|
+
export interface UserInfoRequest {}
|
|
89
|
+
export const UserInfoRequest = /*@__PURE__*/ S.suspend(() =>
|
|
90
|
+
S.Struct({}).pipe(
|
|
91
|
+
T.Http({ method: "POST", uri: "/openid.connect.userInfo", code: 200 }),
|
|
92
|
+
),
|
|
93
|
+
).annotate({
|
|
94
|
+
identifier: "UserInfoRequest",
|
|
95
|
+
}) as any as S.Schema<UserInfoRequest>;
|
|
96
|
+
|
|
97
|
+
export interface UserInfoResponse {
|
|
98
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
99
|
+
ok: boolean;
|
|
100
|
+
sub: string;
|
|
101
|
+
https___slack_com_user_id: string;
|
|
102
|
+
https___slack_com_team_id?: string;
|
|
103
|
+
https___slack_com_enterprise_id?: string;
|
|
104
|
+
email?: string;
|
|
105
|
+
email_verified?: boolean;
|
|
106
|
+
date_email_verified?: number;
|
|
107
|
+
locale?: string;
|
|
108
|
+
name?: string;
|
|
109
|
+
given_name?: string;
|
|
110
|
+
family_name?: string;
|
|
111
|
+
picture?: string;
|
|
112
|
+
https___slack_com_user_image_24?: string;
|
|
113
|
+
https___slack_com_user_image_32?: string;
|
|
114
|
+
https___slack_com_user_image_48?: string;
|
|
115
|
+
https___slack_com_user_image_72?: string;
|
|
116
|
+
https___slack_com_user_image_192?: string;
|
|
117
|
+
https___slack_com_user_image_512?: string;
|
|
118
|
+
https___slack_com_user_image_1024?: string;
|
|
119
|
+
https___slack_com_team_name?: string;
|
|
120
|
+
https___slack_com_team_domain?: string;
|
|
121
|
+
https___slack_com_enterprise_name?: string;
|
|
122
|
+
https___slack_com_enterprise_domain?: string;
|
|
123
|
+
https___slack_com_team_image_34?: string;
|
|
124
|
+
https___slack_com_team_image_44?: string;
|
|
125
|
+
https___slack_com_team_image_68?: string;
|
|
126
|
+
https___slack_com_team_image_88?: string;
|
|
127
|
+
https___slack_com_team_image_102?: string;
|
|
128
|
+
https___slack_com_team_image_132?: string;
|
|
129
|
+
https___slack_com_team_image_230?: string;
|
|
130
|
+
https___slack_com_team_image_default?: boolean;
|
|
131
|
+
}
|
|
132
|
+
export const UserInfoResponse = /*@__PURE__*/ S.suspend(() =>
|
|
133
|
+
S.Struct({
|
|
134
|
+
ok: S.Boolean,
|
|
135
|
+
sub: S.String,
|
|
136
|
+
https___slack_com_user_id: S.String.pipe(
|
|
137
|
+
T.Body("https://slack.com/user_id"),
|
|
138
|
+
),
|
|
139
|
+
https___slack_com_team_id: S.optional(
|
|
140
|
+
S.String.pipe(T.Body("https://slack.com/team_id")),
|
|
141
|
+
),
|
|
142
|
+
https___slack_com_enterprise_id: S.optional(
|
|
143
|
+
S.String.pipe(T.Body("https://slack.com/enterprise_id")),
|
|
144
|
+
),
|
|
145
|
+
email: S.optional(S.String),
|
|
146
|
+
email_verified: S.optional(S.Boolean),
|
|
147
|
+
date_email_verified: S.optional(S.Number),
|
|
148
|
+
locale: S.optional(S.String),
|
|
149
|
+
name: S.optional(S.String),
|
|
150
|
+
given_name: S.optional(S.String),
|
|
151
|
+
family_name: S.optional(S.String),
|
|
152
|
+
picture: S.optional(S.String),
|
|
153
|
+
https___slack_com_user_image_24: S.optional(
|
|
154
|
+
S.String.pipe(T.Body("https://slack.com/user_image_24")),
|
|
155
|
+
),
|
|
156
|
+
https___slack_com_user_image_32: S.optional(
|
|
157
|
+
S.String.pipe(T.Body("https://slack.com/user_image_32")),
|
|
158
|
+
),
|
|
159
|
+
https___slack_com_user_image_48: S.optional(
|
|
160
|
+
S.String.pipe(T.Body("https://slack.com/user_image_48")),
|
|
161
|
+
),
|
|
162
|
+
https___slack_com_user_image_72: S.optional(
|
|
163
|
+
S.String.pipe(T.Body("https://slack.com/user_image_72")),
|
|
164
|
+
),
|
|
165
|
+
https___slack_com_user_image_192: S.optional(
|
|
166
|
+
S.String.pipe(T.Body("https://slack.com/user_image_192")),
|
|
167
|
+
),
|
|
168
|
+
https___slack_com_user_image_512: S.optional(
|
|
169
|
+
S.String.pipe(T.Body("https://slack.com/user_image_512")),
|
|
170
|
+
),
|
|
171
|
+
https___slack_com_user_image_1024: S.optional(
|
|
172
|
+
S.String.pipe(T.Body("https://slack.com/user_image_1024")),
|
|
173
|
+
),
|
|
174
|
+
https___slack_com_team_name: S.optional(
|
|
175
|
+
S.String.pipe(T.Body("https://slack.com/team_name")),
|
|
176
|
+
),
|
|
177
|
+
https___slack_com_team_domain: S.optional(
|
|
178
|
+
S.String.pipe(T.Body("https://slack.com/team_domain")),
|
|
179
|
+
),
|
|
180
|
+
https___slack_com_enterprise_name: S.optional(
|
|
181
|
+
S.String.pipe(T.Body("https://slack.com/enterprise_name")),
|
|
182
|
+
),
|
|
183
|
+
https___slack_com_enterprise_domain: S.optional(
|
|
184
|
+
S.String.pipe(T.Body("https://slack.com/enterprise_domain")),
|
|
185
|
+
),
|
|
186
|
+
https___slack_com_team_image_34: S.optional(
|
|
187
|
+
S.String.pipe(T.Body("https://slack.com/team_image_34")),
|
|
188
|
+
),
|
|
189
|
+
https___slack_com_team_image_44: S.optional(
|
|
190
|
+
S.String.pipe(T.Body("https://slack.com/team_image_44")),
|
|
191
|
+
),
|
|
192
|
+
https___slack_com_team_image_68: S.optional(
|
|
193
|
+
S.String.pipe(T.Body("https://slack.com/team_image_68")),
|
|
194
|
+
),
|
|
195
|
+
https___slack_com_team_image_88: S.optional(
|
|
196
|
+
S.String.pipe(T.Body("https://slack.com/team_image_88")),
|
|
197
|
+
),
|
|
198
|
+
https___slack_com_team_image_102: S.optional(
|
|
199
|
+
S.String.pipe(T.Body("https://slack.com/team_image_102")),
|
|
200
|
+
),
|
|
201
|
+
https___slack_com_team_image_132: S.optional(
|
|
202
|
+
S.String.pipe(T.Body("https://slack.com/team_image_132")),
|
|
203
|
+
),
|
|
204
|
+
https___slack_com_team_image_230: S.optional(
|
|
205
|
+
S.String.pipe(T.Body("https://slack.com/team_image_230")),
|
|
206
|
+
),
|
|
207
|
+
https___slack_com_team_image_default: S.optional(
|
|
208
|
+
S.Boolean.pipe(T.Body("https://slack.com/team_image_default")),
|
|
209
|
+
),
|
|
210
|
+
}),
|
|
211
|
+
).annotate({
|
|
212
|
+
identifier: "UserInfoResponse",
|
|
213
|
+
}) as any as S.Schema<UserInfoResponse>;
|
|
214
|
+
|
|
215
|
+
export type ConnectTokenError = SlackOpError;
|
|
216
|
+
/** 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 */
|
|
217
|
+
export const connectToken: API.OperationMethod<
|
|
218
|
+
ConnectTokenRequest,
|
|
219
|
+
ConnectTokenResponse,
|
|
220
|
+
ConnectTokenError,
|
|
221
|
+
SlackOpContext
|
|
222
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
223
|
+
input: ConnectTokenRequest,
|
|
224
|
+
output: ConnectTokenResponse,
|
|
225
|
+
errors: [SlackError, SlackRateLimited],
|
|
226
|
+
protocol: SlackProtocol,
|
|
227
|
+
retry: Retry.Retry,
|
|
228
|
+
}));
|
|
229
|
+
|
|
230
|
+
export type UserInfoError = SlackOpError;
|
|
231
|
+
/** Get the identity of a user who has authorized Sign in with Slack. Required scopes — user: `openid` Rate limit tier: 3 See https://docs.slack.dev/reference/methods/openid.connect.userInfo */
|
|
232
|
+
export const userInfo: API.OperationMethod<
|
|
233
|
+
UserInfoRequest,
|
|
234
|
+
UserInfoResponse,
|
|
235
|
+
UserInfoError,
|
|
236
|
+
SlackOpContext
|
|
237
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
238
|
+
input: UserInfoRequest,
|
|
239
|
+
output: UserInfoResponse,
|
|
240
|
+
errors: [SlackError, SlackRateLimited],
|
|
241
|
+
protocol: SlackProtocol,
|
|
242
|
+
retry: Retry.Retry,
|
|
243
|
+
}));
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
2
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as API from "@distilled.cloud/core/api";
|
|
4
|
+
import * as T from "../traits.ts";
|
|
5
|
+
import {
|
|
6
|
+
SlackProtocol,
|
|
7
|
+
type SlackOpError,
|
|
8
|
+
type SlackOpContext,
|
|
9
|
+
} from "../protocol.ts";
|
|
10
|
+
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
11
|
+
import * as Retry from "../retry.ts";
|
|
12
|
+
|
|
13
|
+
export type { SlackOpError, SlackOpContext };
|
|
14
|
+
|
|
15
|
+
export interface AddPinRequest {
|
|
16
|
+
/** Channel to pin the messsage to. You must also include a `timestamp` when pinning messages. */
|
|
17
|
+
channel: string;
|
|
18
|
+
/** Timestamp of the message to pin. You must also include the `channel`. */
|
|
19
|
+
timestamp?: string;
|
|
20
|
+
}
|
|
21
|
+
export const AddPinRequest = /*@__PURE__*/ S.suspend(() =>
|
|
22
|
+
S.Struct({
|
|
23
|
+
channel: S.String,
|
|
24
|
+
timestamp: S.optional(S.String),
|
|
25
|
+
}).pipe(T.Http({ method: "POST", uri: "/pins.add", code: 200 })),
|
|
26
|
+
).annotate({ identifier: "AddPinRequest" }) as any as S.Schema<AddPinRequest>;
|
|
27
|
+
|
|
28
|
+
export interface AddPinResponse {
|
|
29
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
30
|
+
ok: boolean;
|
|
31
|
+
}
|
|
32
|
+
export const AddPinResponse = /*@__PURE__*/ S.suspend(() =>
|
|
33
|
+
S.Struct({
|
|
34
|
+
ok: S.Boolean,
|
|
35
|
+
}),
|
|
36
|
+
).annotate({ identifier: "AddPinResponse" }) as any as S.Schema<AddPinResponse>;
|
|
37
|
+
|
|
38
|
+
export interface ListPinsRequest {
|
|
39
|
+
/** Channel to get pinned items for. */
|
|
40
|
+
channel: string;
|
|
41
|
+
}
|
|
42
|
+
export const ListPinsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
43
|
+
S.Struct({
|
|
44
|
+
channel: S.String.pipe(T.Query()),
|
|
45
|
+
}).pipe(T.Http({ method: "GET", uri: "/pins.list", code: 200 })),
|
|
46
|
+
).annotate({
|
|
47
|
+
identifier: "ListPinsRequest",
|
|
48
|
+
}) as any as S.Schema<ListPinsRequest>;
|
|
49
|
+
|
|
50
|
+
export type ListPinsResponseItemsItemType = "file" | "message" | "file_comment";
|
|
51
|
+
export const ListPinsResponseItemsItemType = /*@__PURE__*/ S.String;
|
|
52
|
+
|
|
53
|
+
export interface ListPinsResponseItemsItem {
|
|
54
|
+
type: ListPinsResponseItemsItemType;
|
|
55
|
+
created: number;
|
|
56
|
+
created_by: string;
|
|
57
|
+
channel?: string;
|
|
58
|
+
message?: unknown;
|
|
59
|
+
file?: unknown;
|
|
60
|
+
comment?: string;
|
|
61
|
+
}
|
|
62
|
+
export const ListPinsResponseItemsItem = /*@__PURE__*/ S.suspend(() =>
|
|
63
|
+
S.Struct({
|
|
64
|
+
type: ListPinsResponseItemsItemType,
|
|
65
|
+
created: S.Number,
|
|
66
|
+
created_by: S.String,
|
|
67
|
+
channel: S.optional(S.String),
|
|
68
|
+
message: S.optional(S.Unknown),
|
|
69
|
+
file: S.optional(S.Unknown),
|
|
70
|
+
comment: S.optional(S.String),
|
|
71
|
+
}),
|
|
72
|
+
).annotate({
|
|
73
|
+
identifier: "ListPinsResponseItemsItem",
|
|
74
|
+
}) as any as S.Schema<ListPinsResponseItemsItem>;
|
|
75
|
+
|
|
76
|
+
export type ListPinsResponseItemsList = Array<ListPinsResponseItemsItem>;
|
|
77
|
+
export const ListPinsResponseItemsList = /*@__PURE__*/ S.Array(
|
|
78
|
+
ListPinsResponseItemsItem,
|
|
79
|
+
) as any as S.Schema<ListPinsResponseItemsList>;
|
|
80
|
+
|
|
81
|
+
export interface ListPinsResponse {
|
|
82
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
83
|
+
ok: boolean;
|
|
84
|
+
items?: ListPinsResponseItemsList;
|
|
85
|
+
count?: number;
|
|
86
|
+
}
|
|
87
|
+
export const ListPinsResponse = /*@__PURE__*/ S.suspend(() =>
|
|
88
|
+
S.Struct({
|
|
89
|
+
ok: S.Boolean,
|
|
90
|
+
items: S.optional(ListPinsResponseItemsList),
|
|
91
|
+
count: S.optional(S.Number),
|
|
92
|
+
}),
|
|
93
|
+
).annotate({
|
|
94
|
+
identifier: "ListPinsResponse",
|
|
95
|
+
}) as any as S.Schema<ListPinsResponse>;
|
|
96
|
+
|
|
97
|
+
export interface RemovePinRequest {
|
|
98
|
+
/** Channel where the item is pinned to. */
|
|
99
|
+
channel: string;
|
|
100
|
+
/** Timestamp of the message to un-pin. */
|
|
101
|
+
timestamp?: string;
|
|
102
|
+
}
|
|
103
|
+
export const RemovePinRequest = /*@__PURE__*/ S.suspend(() =>
|
|
104
|
+
S.Struct({
|
|
105
|
+
channel: S.String,
|
|
106
|
+
timestamp: S.optional(S.String),
|
|
107
|
+
}).pipe(T.Http({ method: "POST", uri: "/pins.remove", code: 200 })),
|
|
108
|
+
).annotate({
|
|
109
|
+
identifier: "RemovePinRequest",
|
|
110
|
+
}) as any as S.Schema<RemovePinRequest>;
|
|
111
|
+
|
|
112
|
+
export interface RemovePinResponse {
|
|
113
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
114
|
+
ok: boolean;
|
|
115
|
+
}
|
|
116
|
+
export const RemovePinResponse = /*@__PURE__*/ S.suspend(() =>
|
|
117
|
+
S.Struct({
|
|
118
|
+
ok: S.Boolean,
|
|
119
|
+
}),
|
|
120
|
+
).annotate({
|
|
121
|
+
identifier: "RemovePinResponse",
|
|
122
|
+
}) as any as S.Schema<RemovePinResponse>;
|
|
123
|
+
|
|
124
|
+
export type AddPinError = SlackOpError;
|
|
125
|
+
/** 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 */
|
|
126
|
+
export const addPin: API.OperationMethod<
|
|
127
|
+
AddPinRequest,
|
|
128
|
+
AddPinResponse,
|
|
129
|
+
AddPinError,
|
|
130
|
+
SlackOpContext
|
|
131
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
132
|
+
input: AddPinRequest,
|
|
133
|
+
output: AddPinResponse,
|
|
134
|
+
errors: [SlackError, SlackRateLimited],
|
|
135
|
+
protocol: SlackProtocol,
|
|
136
|
+
retry: Retry.Retry,
|
|
137
|
+
}));
|
|
138
|
+
|
|
139
|
+
export type ListPinsError = SlackOpError;
|
|
140
|
+
/** Lists items pinned to a channel. Required scopes — bot: `pins:read`; user: `pins:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `channel_not_found` — Value passed for `channel` was invalid. - `restricted_action` — The user does not have permission to view the channel. See https://docs.slack.dev/reference/methods/pins.list */
|
|
141
|
+
export const listPins: API.OperationMethod<
|
|
142
|
+
ListPinsRequest,
|
|
143
|
+
ListPinsResponse,
|
|
144
|
+
ListPinsError,
|
|
145
|
+
SlackOpContext
|
|
146
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
147
|
+
input: ListPinsRequest,
|
|
148
|
+
output: ListPinsResponse,
|
|
149
|
+
errors: [SlackError, SlackRateLimited],
|
|
150
|
+
protocol: SlackProtocol,
|
|
151
|
+
retry: Retry.Retry,
|
|
152
|
+
}));
|
|
153
|
+
|
|
154
|
+
export type RemovePinError = SlackOpError;
|
|
155
|
+
/** Un-pins an item from a channel. Required scopes — bot: `pins:write`; user: `pins:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_timestamp` — Value passed for `timestamp` was invalid. - `channel_not_found` — The `channel` argument was not specified or was invalid - `external_channel_migrating` — Channel is undergoing an active migration. - `file_comment_not_found` — File comment specified by `file_comment` does not exist. - `file_not_found` — File specified by `file` does not exist. - `message_not_found` — Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` — One of `file`, `file_comment`, or `timestamp` was not specified. - `no_pin` — The pin could not be found. - `not_pinned` — The specified item is not pinned to the channel. - `restricted_action` — The user does not have permission to remove pins from the channel. See https://docs.slack.dev/reference/methods/pins.remove */
|
|
156
|
+
export const removePin: API.OperationMethod<
|
|
157
|
+
RemovePinRequest,
|
|
158
|
+
RemovePinResponse,
|
|
159
|
+
RemovePinError,
|
|
160
|
+
SlackOpContext
|
|
161
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
162
|
+
input: RemovePinRequest,
|
|
163
|
+
output: RemovePinResponse,
|
|
164
|
+
errors: [SlackError, SlackRateLimited],
|
|
165
|
+
protocol: SlackProtocol,
|
|
166
|
+
retry: Retry.Retry,
|
|
167
|
+
}));
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
2
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as API from "@distilled.cloud/core/api";
|
|
4
|
+
import * as T from "../traits.ts";
|
|
5
|
+
import {
|
|
6
|
+
SlackProtocol,
|
|
7
|
+
type SlackOpError,
|
|
8
|
+
type SlackOpContext,
|
|
9
|
+
} from "../protocol.ts";
|
|
10
|
+
import { slackPaginate } from "../pagination.ts";
|
|
11
|
+
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
12
|
+
import * as Retry from "../retry.ts";
|
|
13
|
+
|
|
14
|
+
export type { SlackOpError, SlackOpContext };
|
|
15
|
+
|
|
16
|
+
export interface AddReactionRequest {
|
|
17
|
+
/** Channel where the message to add reaction to was posted. */
|
|
18
|
+
channel: string;
|
|
19
|
+
/** Reaction (emoji) name */
|
|
20
|
+
name: string;
|
|
21
|
+
/** Timestamp of the message to add reaction to. */
|
|
22
|
+
timestamp: string;
|
|
23
|
+
}
|
|
24
|
+
export const AddReactionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
25
|
+
S.Struct({
|
|
26
|
+
channel: S.String,
|
|
27
|
+
name: S.String,
|
|
28
|
+
timestamp: S.String,
|
|
29
|
+
}).pipe(T.Http({ method: "POST", uri: "/reactions.add", code: 200 })),
|
|
30
|
+
).annotate({
|
|
31
|
+
identifier: "AddReactionRequest",
|
|
32
|
+
}) as any as S.Schema<AddReactionRequest>;
|
|
33
|
+
|
|
34
|
+
export interface AddReactionResponse {
|
|
35
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
36
|
+
ok: boolean;
|
|
37
|
+
}
|
|
38
|
+
export const AddReactionResponse = /*@__PURE__*/ S.suspend(() =>
|
|
39
|
+
S.Struct({
|
|
40
|
+
ok: S.Boolean,
|
|
41
|
+
}),
|
|
42
|
+
).annotate({
|
|
43
|
+
identifier: "AddReactionResponse",
|
|
44
|
+
}) as any as S.Schema<AddReactionResponse>;
|
|
45
|
+
|
|
46
|
+
export interface GetReactionRequest {
|
|
47
|
+
/** Channel where the message to get reactions for was posted. */
|
|
48
|
+
channel?: string;
|
|
49
|
+
/** File to get reactions for. */
|
|
50
|
+
file?: string;
|
|
51
|
+
/** File comment to get reactions for. */
|
|
52
|
+
file_comment?: string;
|
|
53
|
+
/** If true always return the complete reaction list. */
|
|
54
|
+
full?: boolean;
|
|
55
|
+
/** Timestamp of the message to get reactions for. */
|
|
56
|
+
timestamp?: string;
|
|
57
|
+
}
|
|
58
|
+
export const GetReactionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
59
|
+
S.Struct({
|
|
60
|
+
channel: S.optional(S.String.pipe(T.Query())),
|
|
61
|
+
file: S.optional(S.String.pipe(T.Query())),
|
|
62
|
+
file_comment: S.optional(S.String.pipe(T.Query())),
|
|
63
|
+
full: S.optional(S.Boolean.pipe(T.Query())),
|
|
64
|
+
timestamp: S.optional(S.String.pipe(T.Query())),
|
|
65
|
+
}).pipe(T.Http({ method: "GET", uri: "/reactions.get", code: 200 })),
|
|
66
|
+
).annotate({
|
|
67
|
+
identifier: "GetReactionRequest",
|
|
68
|
+
}) as any as S.Schema<GetReactionRequest>;
|
|
69
|
+
|
|
70
|
+
export interface GetReactionResponse {
|
|
71
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
72
|
+
ok: boolean;
|
|
73
|
+
comment?: unknown;
|
|
74
|
+
message?: unknown;
|
|
75
|
+
type: string;
|
|
76
|
+
channel?: string;
|
|
77
|
+
file?: unknown;
|
|
78
|
+
}
|
|
79
|
+
export const GetReactionResponse = /*@__PURE__*/ S.suspend(() =>
|
|
80
|
+
S.Struct({
|
|
81
|
+
ok: S.Boolean,
|
|
82
|
+
comment: S.optional(S.Unknown),
|
|
83
|
+
message: S.optional(S.Unknown),
|
|
84
|
+
type: S.String,
|
|
85
|
+
channel: S.optional(S.String),
|
|
86
|
+
file: S.optional(S.Unknown),
|
|
87
|
+
}),
|
|
88
|
+
).annotate({
|
|
89
|
+
identifier: "GetReactionResponse",
|
|
90
|
+
}) as any as S.Schema<GetReactionResponse>;
|
|
91
|
+
|
|
92
|
+
export interface ListReactionsRequest {
|
|
93
|
+
/** Show reactions made by this user. Defaults to the authed user. */
|
|
94
|
+
user?: string;
|
|
95
|
+
/** If true always return the complete reaction list. */
|
|
96
|
+
full?: boolean;
|
|
97
|
+
count?: number;
|
|
98
|
+
page?: number;
|
|
99
|
+
/** Parameter for pagination. Set `cursor` equal to the `next_cursor` attribute returned by the previous request's `response_metadata`. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection. See [pagination](/apis/web-api/pagination) for more details. */
|
|
100
|
+
cursor?: string;
|
|
101
|
+
/** The maximum number of items to return. Fewer than the requested number of items may be returned, even if the end of the list hasn't been reached. */
|
|
102
|
+
limit?: number;
|
|
103
|
+
/** encoded team id to list reactions in, required if org token is used */
|
|
104
|
+
team_id?: string;
|
|
105
|
+
}
|
|
106
|
+
export const ListReactionsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
107
|
+
S.Struct({
|
|
108
|
+
user: S.optional(S.String.pipe(T.Query())),
|
|
109
|
+
full: S.optional(S.Boolean.pipe(T.Query())),
|
|
110
|
+
count: S.optional(S.Number.pipe(T.Query())),
|
|
111
|
+
page: S.optional(S.Number.pipe(T.Query())),
|
|
112
|
+
cursor: S.optional(S.String.pipe(T.Query())),
|
|
113
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
114
|
+
team_id: S.optional(S.String.pipe(T.Query())),
|
|
115
|
+
}).pipe(T.Http({ method: "GET", uri: "/reactions.list", code: 200 })),
|
|
116
|
+
).annotate({
|
|
117
|
+
identifier: "ListReactionsRequest",
|
|
118
|
+
}) as any as S.Schema<ListReactionsRequest>;
|
|
119
|
+
|
|
120
|
+
export type ListReactionsResponseItemsItemMap = {
|
|
121
|
+
[key: string]: unknown | undefined;
|
|
122
|
+
};
|
|
123
|
+
export const ListReactionsResponseItemsItemMap = /*@__PURE__*/ S.Record(
|
|
124
|
+
S.String,
|
|
125
|
+
S.Unknown,
|
|
126
|
+
) as any as S.Schema<ListReactionsResponseItemsItemMap>;
|
|
127
|
+
|
|
128
|
+
export type ListReactionsResponseItemsList =
|
|
129
|
+
Array<ListReactionsResponseItemsItemMap>;
|
|
130
|
+
export const ListReactionsResponseItemsList = /*@__PURE__*/ S.Array(
|
|
131
|
+
ListReactionsResponseItemsItemMap,
|
|
132
|
+
) as any as S.Schema<ListReactionsResponseItemsList>;
|
|
133
|
+
|
|
134
|
+
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
135
|
+
export interface ListReactionsResponseResponseMetadata {
|
|
136
|
+
/** Cursor for the next page — pass as `cursor` on the next call. */
|
|
137
|
+
next_cursor?: string;
|
|
138
|
+
}
|
|
139
|
+
export const ListReactionsResponseResponseMetadata = /*@__PURE__*/ S.suspend(
|
|
140
|
+
() =>
|
|
141
|
+
S.Struct({
|
|
142
|
+
next_cursor: S.optional(S.String),
|
|
143
|
+
}),
|
|
144
|
+
).annotate({
|
|
145
|
+
identifier: "ListReactionsResponseResponseMetadata",
|
|
146
|
+
}) as any as S.Schema<ListReactionsResponseResponseMetadata>;
|
|
147
|
+
|
|
148
|
+
export interface ListReactionsResponse {
|
|
149
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
150
|
+
ok: boolean;
|
|
151
|
+
items: ListReactionsResponseItemsList;
|
|
152
|
+
paging?: unknown;
|
|
153
|
+
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
154
|
+
response_metadata?: ListReactionsResponseResponseMetadata;
|
|
155
|
+
}
|
|
156
|
+
export const ListReactionsResponse = /*@__PURE__*/ S.suspend(() =>
|
|
157
|
+
S.Struct({
|
|
158
|
+
ok: S.Boolean,
|
|
159
|
+
items: ListReactionsResponseItemsList,
|
|
160
|
+
paging: S.optional(S.Unknown),
|
|
161
|
+
response_metadata: S.optional(ListReactionsResponseResponseMetadata),
|
|
162
|
+
}),
|
|
163
|
+
).annotate({
|
|
164
|
+
identifier: "ListReactionsResponse",
|
|
165
|
+
}) as any as S.Schema<ListReactionsResponse>;
|
|
166
|
+
|
|
167
|
+
export interface RemoveReactionRequest {
|
|
168
|
+
/** Reaction (emoji) name. */
|
|
169
|
+
name: string;
|
|
170
|
+
/** File to remove reaction from. */
|
|
171
|
+
file?: string;
|
|
172
|
+
/** File comment to remove reaction from. */
|
|
173
|
+
file_comment?: string;
|
|
174
|
+
/** Channel where the message to remove reaction from was posted. */
|
|
175
|
+
channel?: string;
|
|
176
|
+
/** Timestamp of the message to remove reaction from. */
|
|
177
|
+
timestamp?: string;
|
|
178
|
+
}
|
|
179
|
+
export const RemoveReactionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
180
|
+
S.Struct({
|
|
181
|
+
name: S.String,
|
|
182
|
+
file: S.optional(S.String),
|
|
183
|
+
file_comment: S.optional(S.String),
|
|
184
|
+
channel: S.optional(S.String),
|
|
185
|
+
timestamp: S.optional(S.String),
|
|
186
|
+
}).pipe(T.Http({ method: "POST", uri: "/reactions.remove", code: 200 })),
|
|
187
|
+
).annotate({
|
|
188
|
+
identifier: "RemoveReactionRequest",
|
|
189
|
+
}) as any as S.Schema<RemoveReactionRequest>;
|
|
190
|
+
|
|
191
|
+
export interface RemoveReactionResponse {
|
|
192
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
193
|
+
ok: boolean;
|
|
194
|
+
}
|
|
195
|
+
export const RemoveReactionResponse = /*@__PURE__*/ S.suspend(() =>
|
|
196
|
+
S.Struct({
|
|
197
|
+
ok: S.Boolean,
|
|
198
|
+
}),
|
|
199
|
+
).annotate({
|
|
200
|
+
identifier: "RemoveReactionResponse",
|
|
201
|
+
}) as any as S.Schema<RemoveReactionResponse>;
|
|
202
|
+
|
|
203
|
+
export type AddReactionError = SlackOpError;
|
|
204
|
+
/** 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 */
|
|
205
|
+
export const addReaction: API.OperationMethod<
|
|
206
|
+
AddReactionRequest,
|
|
207
|
+
AddReactionResponse,
|
|
208
|
+
AddReactionError,
|
|
209
|
+
SlackOpContext
|
|
210
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
211
|
+
input: AddReactionRequest,
|
|
212
|
+
output: AddReactionResponse,
|
|
213
|
+
errors: [SlackError, SlackRateLimited],
|
|
214
|
+
protocol: SlackProtocol,
|
|
215
|
+
retry: Retry.Retry,
|
|
216
|
+
}));
|
|
217
|
+
|
|
218
|
+
export type GetReactionError = SlackOpError;
|
|
219
|
+
/** Gets reactions for an item. Required scopes — bot: `reactions:read`; user: `reactions:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `bad_timestamp` — Value passed for `timestamp` was invalid. - `channel_not_found` — Value passed for `channel` was invalid. - `file_comment_not_found` — File comment specified by `file_comment` does not exist. - `file_not_found` — File specified by `file` does not exist. - `message_not_found` — Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` — `file`, `file_comment`, or combination of `channel` and `timestamp` was not specified. See https://docs.slack.dev/reference/methods/reactions.get */
|
|
220
|
+
export const getReaction: API.OperationMethod<
|
|
221
|
+
GetReactionRequest,
|
|
222
|
+
GetReactionResponse,
|
|
223
|
+
GetReactionError,
|
|
224
|
+
SlackOpContext
|
|
225
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
226
|
+
input: GetReactionRequest,
|
|
227
|
+
output: GetReactionResponse,
|
|
228
|
+
errors: [SlackError, SlackRateLimited],
|
|
229
|
+
protocol: SlackProtocol,
|
|
230
|
+
retry: Retry.Retry,
|
|
231
|
+
}));
|
|
232
|
+
|
|
233
|
+
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 */
|
|
235
|
+
export const listReactions: API.PaginatedOperationMethod<
|
|
236
|
+
ListReactionsRequest,
|
|
237
|
+
ListReactionsResponse,
|
|
238
|
+
ListReactionsError,
|
|
239
|
+
SlackOpContext,
|
|
240
|
+
ListReactionsResponseItemsItemMap
|
|
241
|
+
> = /*@__PURE__*/ API.makePaginated(
|
|
242
|
+
() => ({
|
|
243
|
+
input: ListReactionsRequest,
|
|
244
|
+
output: ListReactionsResponse,
|
|
245
|
+
errors: [SlackError, SlackRateLimited],
|
|
246
|
+
protocol: SlackProtocol,
|
|
247
|
+
retry: Retry.Retry,
|
|
248
|
+
pagination: {
|
|
249
|
+
mode: "cursor",
|
|
250
|
+
inputToken: "cursor",
|
|
251
|
+
outputToken: "response_metadata.next_cursor",
|
|
252
|
+
items: "items",
|
|
253
|
+
pageSize: "limit",
|
|
254
|
+
} as const,
|
|
255
|
+
}),
|
|
256
|
+
slackPaginate,
|
|
257
|
+
) as any;
|
|
258
|
+
|
|
259
|
+
export type RemoveReactionError = SlackOpError;
|
|
260
|
+
/** Removes a reaction from an item. Required scopes — bot: `reactions:write`; user: `reactions:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_timestamp` — Value passed for `timestamp` was invalid. - `channel_not_found` — The specified channel was not found. - `external_channel_migrating` — The reaction is in a channel that is being migrated - `file_not_found` — File specified by `file` does not exist. - `file_comment_not_found` — File comment specified by `file_comment` does not exist. - `invalid_name` — Value passed for `name` was invalid. - `message_not_found` — Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` — `file`, `file_comment`, or combination of `channel` and `timestamp` was not specified. - `no_access` — The requestor does not have permission to perform this action on the specified item. - `no_reaction` — The specified reaction does not exist, or the requestor is not the original reaction author. - `thread_locked` — Reactions are disabled as the specified message is part of a locked thread. See https://docs.slack.dev/reference/methods/reactions.remove */
|
|
261
|
+
export const removeReaction: API.OperationMethod<
|
|
262
|
+
RemoveReactionRequest,
|
|
263
|
+
RemoveReactionResponse,
|
|
264
|
+
RemoveReactionError,
|
|
265
|
+
SlackOpContext
|
|
266
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
267
|
+
input: RemoveReactionRequest,
|
|
268
|
+
output: RemoveReactionResponse,
|
|
269
|
+
errors: [SlackError, SlackRateLimited],
|
|
270
|
+
protocol: SlackProtocol,
|
|
271
|
+
retry: Retry.Retry,
|
|
272
|
+
}));
|