@distilled.cloud/slack 0.0.0 → 1.0.0-rc.11
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 +3217 -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 +256 -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 +333 -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 +238 -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 +7722 -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 +642 -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 +834 -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 +605 -0
- package/src/traits.ts +45 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
2
|
+
import * as Redacted from "effect/Redacted";
|
|
3
|
+
import * as API from "@distilled.cloud/core/api";
|
|
4
|
+
import { type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
5
|
+
export type { SlackOpError, SlackOpContext };
|
|
6
|
+
/** The `grant_type` param as described in the OAuth spec. */
|
|
7
|
+
export type ConnectTokenRequestGrantType = "authorization_code" | "refresh_token";
|
|
8
|
+
export declare const ConnectTokenRequestGrantType: any;
|
|
9
|
+
export interface ConnectTokenRequest {
|
|
10
|
+
/** Issued when you created your application. */
|
|
11
|
+
client_id?: string;
|
|
12
|
+
/** Issued when you created your application. */
|
|
13
|
+
client_secret?: string | Redacted.Redacted<string>;
|
|
14
|
+
/** The `code` param returned via the OAuth callback. */
|
|
15
|
+
code?: string;
|
|
16
|
+
/** This must match the originally submitted URI (if one was sent). */
|
|
17
|
+
redirect_uri?: string;
|
|
18
|
+
/** The `grant_type` param as described in the OAuth spec. */
|
|
19
|
+
grant_type?: ConnectTokenRequestGrantType | (string & {});
|
|
20
|
+
/** The `refresh_token` param as described in the OAuth spec. */
|
|
21
|
+
refresh_token?: string | Redacted.Redacted<string>;
|
|
22
|
+
/** PKCE code verifier (RFC 7636). Required when the authorization request included a `code_challenge`. */
|
|
23
|
+
code_verifier?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const ConnectTokenRequest: S.Schema<ConnectTokenRequest>;
|
|
26
|
+
export type ConnectTokenResponseTokenType = "Bearer";
|
|
27
|
+
export declare const ConnectTokenResponseTokenType: any;
|
|
28
|
+
export interface ConnectTokenResponse {
|
|
29
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
30
|
+
ok: boolean;
|
|
31
|
+
access_token: string | Redacted.Redacted<string>;
|
|
32
|
+
token_type: ConnectTokenResponseTokenType;
|
|
33
|
+
id_token?: string;
|
|
34
|
+
state?: string;
|
|
35
|
+
/** Time until this credential expires, if it expires at all */
|
|
36
|
+
expires_in?: number;
|
|
37
|
+
/** Refresh token for this credential */
|
|
38
|
+
refresh_token?: string | Redacted.Redacted<string>;
|
|
39
|
+
}
|
|
40
|
+
export declare const ConnectTokenResponse: S.Schema<ConnectTokenResponse>;
|
|
41
|
+
export interface UserInfoRequest {
|
|
42
|
+
}
|
|
43
|
+
export declare const UserInfoRequest: S.Schema<UserInfoRequest>;
|
|
44
|
+
export interface UserInfoResponse {
|
|
45
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
46
|
+
ok: boolean;
|
|
47
|
+
sub: string;
|
|
48
|
+
https___slack_com_user_id: string;
|
|
49
|
+
https___slack_com_team_id?: string;
|
|
50
|
+
https___slack_com_enterprise_id?: string;
|
|
51
|
+
email?: string;
|
|
52
|
+
email_verified?: boolean;
|
|
53
|
+
date_email_verified?: number;
|
|
54
|
+
locale?: string;
|
|
55
|
+
name?: string;
|
|
56
|
+
given_name?: string;
|
|
57
|
+
family_name?: string;
|
|
58
|
+
picture?: string;
|
|
59
|
+
https___slack_com_user_image_24?: string;
|
|
60
|
+
https___slack_com_user_image_32?: string;
|
|
61
|
+
https___slack_com_user_image_48?: string;
|
|
62
|
+
https___slack_com_user_image_72?: string;
|
|
63
|
+
https___slack_com_user_image_192?: string;
|
|
64
|
+
https___slack_com_user_image_512?: string;
|
|
65
|
+
https___slack_com_user_image_1024?: string;
|
|
66
|
+
https___slack_com_team_name?: string;
|
|
67
|
+
https___slack_com_team_domain?: string;
|
|
68
|
+
https___slack_com_enterprise_name?: string;
|
|
69
|
+
https___slack_com_enterprise_domain?: string;
|
|
70
|
+
https___slack_com_team_image_34?: string;
|
|
71
|
+
https___slack_com_team_image_44?: string;
|
|
72
|
+
https___slack_com_team_image_68?: string;
|
|
73
|
+
https___slack_com_team_image_88?: string;
|
|
74
|
+
https___slack_com_team_image_102?: string;
|
|
75
|
+
https___slack_com_team_image_132?: string;
|
|
76
|
+
https___slack_com_team_image_230?: string;
|
|
77
|
+
https___slack_com_team_image_default?: boolean;
|
|
78
|
+
}
|
|
79
|
+
export declare const UserInfoResponse: S.Schema<UserInfoResponse>;
|
|
80
|
+
export type ConnectTokenError = SlackOpError;
|
|
81
|
+
/** 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 */
|
|
82
|
+
export declare const connectToken: API.OperationMethod<ConnectTokenRequest, ConnectTokenResponse, ConnectTokenError, SlackOpContext>;
|
|
83
|
+
export type UserInfoError = SlackOpError;
|
|
84
|
+
/** 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 */
|
|
85
|
+
export declare const userInfo: API.OperationMethod<UserInfoRequest, UserInfoResponse, UserInfoError, SlackOpContext>;
|
|
86
|
+
//# sourceMappingURL=openid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openid.d.ts","sourceRoot":"","sources":["../../src/services/openid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAClD,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AAEjD,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAIxB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;AAE7C,6DAA6D;AAC7D,MAAM,MAAM,4BAA4B,GACpC,oBAAoB,GACpB,eAAe,CAAC;AACpB,eAAO,MAAM,4BAA4B,KAAW,CAAC;AAErD,MAAM,WAAW,mBAAmB;IAClC,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACnD,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,6DAA6D;IAC7D,UAAU,CAAC,EAAE,4BAA4B,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IAC1D,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACnD,0GAA0G;IAC1G,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AACD,eAAO,MAAM,mBAAmB,EAmBnB,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAE3C,MAAM,MA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/schema";
|
|
3
|
+
import * as Redacted from "effect/Redacted";
|
|
4
|
+
import * as API from "@distilled.cloud/core/api";
|
|
5
|
+
import * as T from "../traits.js";
|
|
6
|
+
import { SlackProtocol, } from "../protocol.js";
|
|
7
|
+
import { SlackError, SlackRateLimited } from "../errors.js";
|
|
8
|
+
import * as Retry from "../retry.js";
|
|
9
|
+
export const ConnectTokenRequestGrantType = S.String;
|
|
10
|
+
export const ConnectTokenRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
11
|
+
client_id: S.optional(S.String),
|
|
12
|
+
client_secret: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
13
|
+
code: S.optional(S.String),
|
|
14
|
+
redirect_uri: S.optional(S.String),
|
|
15
|
+
grant_type: S.optional(ConnectTokenRequestGrantType),
|
|
16
|
+
refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
17
|
+
code_verifier: S.optional(S.String),
|
|
18
|
+
}).pipe(T.Http({
|
|
19
|
+
method: "POST",
|
|
20
|
+
uri: "/openid.connect.token",
|
|
21
|
+
code: 200,
|
|
22
|
+
contentType: "form-urlencoded",
|
|
23
|
+
}))).annotate({
|
|
24
|
+
identifier: "ConnectTokenRequest",
|
|
25
|
+
});
|
|
26
|
+
export const ConnectTokenResponseTokenType = S.String;
|
|
27
|
+
export const ConnectTokenResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
28
|
+
ok: S.Boolean,
|
|
29
|
+
access_token: S.String.pipe(T.SensitiveValue({})),
|
|
30
|
+
token_type: ConnectTokenResponseTokenType,
|
|
31
|
+
id_token: S.optional(S.String),
|
|
32
|
+
state: S.optional(S.String),
|
|
33
|
+
expires_in: S.optional(S.Number),
|
|
34
|
+
refresh_token: S.optional(S.String.pipe(T.SensitiveValue({}))),
|
|
35
|
+
})).annotate({
|
|
36
|
+
identifier: "ConnectTokenResponse",
|
|
37
|
+
});
|
|
38
|
+
export const UserInfoRequest = /*@__PURE__*/ S.suspend(() => S.Struct({}).pipe(T.Http({ method: "POST", uri: "/openid.connect.userInfo", code: 200 }))).annotate({
|
|
39
|
+
identifier: "UserInfoRequest",
|
|
40
|
+
});
|
|
41
|
+
export const UserInfoResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
42
|
+
ok: S.Boolean,
|
|
43
|
+
sub: S.String,
|
|
44
|
+
https___slack_com_user_id: S.String.pipe(T.Body("https://slack.com/user_id")),
|
|
45
|
+
https___slack_com_team_id: S.optional(S.String.pipe(T.Body("https://slack.com/team_id"))),
|
|
46
|
+
https___slack_com_enterprise_id: S.optional(S.String.pipe(T.Body("https://slack.com/enterprise_id"))),
|
|
47
|
+
email: S.optional(S.String),
|
|
48
|
+
email_verified: S.optional(S.Boolean),
|
|
49
|
+
date_email_verified: S.optional(S.Number),
|
|
50
|
+
locale: S.optional(S.String),
|
|
51
|
+
name: S.optional(S.String),
|
|
52
|
+
given_name: S.optional(S.String),
|
|
53
|
+
family_name: S.optional(S.String),
|
|
54
|
+
picture: S.optional(S.String),
|
|
55
|
+
https___slack_com_user_image_24: S.optional(S.String.pipe(T.Body("https://slack.com/user_image_24"))),
|
|
56
|
+
https___slack_com_user_image_32: S.optional(S.String.pipe(T.Body("https://slack.com/user_image_32"))),
|
|
57
|
+
https___slack_com_user_image_48: S.optional(S.String.pipe(T.Body("https://slack.com/user_image_48"))),
|
|
58
|
+
https___slack_com_user_image_72: S.optional(S.String.pipe(T.Body("https://slack.com/user_image_72"))),
|
|
59
|
+
https___slack_com_user_image_192: S.optional(S.String.pipe(T.Body("https://slack.com/user_image_192"))),
|
|
60
|
+
https___slack_com_user_image_512: S.optional(S.String.pipe(T.Body("https://slack.com/user_image_512"))),
|
|
61
|
+
https___slack_com_user_image_1024: S.optional(S.String.pipe(T.Body("https://slack.com/user_image_1024"))),
|
|
62
|
+
https___slack_com_team_name: S.optional(S.String.pipe(T.Body("https://slack.com/team_name"))),
|
|
63
|
+
https___slack_com_team_domain: S.optional(S.String.pipe(T.Body("https://slack.com/team_domain"))),
|
|
64
|
+
https___slack_com_enterprise_name: S.optional(S.String.pipe(T.Body("https://slack.com/enterprise_name"))),
|
|
65
|
+
https___slack_com_enterprise_domain: S.optional(S.String.pipe(T.Body("https://slack.com/enterprise_domain"))),
|
|
66
|
+
https___slack_com_team_image_34: S.optional(S.String.pipe(T.Body("https://slack.com/team_image_34"))),
|
|
67
|
+
https___slack_com_team_image_44: S.optional(S.String.pipe(T.Body("https://slack.com/team_image_44"))),
|
|
68
|
+
https___slack_com_team_image_68: S.optional(S.String.pipe(T.Body("https://slack.com/team_image_68"))),
|
|
69
|
+
https___slack_com_team_image_88: S.optional(S.String.pipe(T.Body("https://slack.com/team_image_88"))),
|
|
70
|
+
https___slack_com_team_image_102: S.optional(S.String.pipe(T.Body("https://slack.com/team_image_102"))),
|
|
71
|
+
https___slack_com_team_image_132: S.optional(S.String.pipe(T.Body("https://slack.com/team_image_132"))),
|
|
72
|
+
https___slack_com_team_image_230: S.optional(S.String.pipe(T.Body("https://slack.com/team_image_230"))),
|
|
73
|
+
https___slack_com_team_image_default: S.optional(S.Boolean.pipe(T.Body("https://slack.com/team_image_default"))),
|
|
74
|
+
})).annotate({
|
|
75
|
+
identifier: "UserInfoResponse",
|
|
76
|
+
});
|
|
77
|
+
/** 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 */
|
|
78
|
+
export const connectToken = /*@__PURE__*/ API.make(() => ({
|
|
79
|
+
input: ConnectTokenRequest,
|
|
80
|
+
output: ConnectTokenResponse,
|
|
81
|
+
errors: [SlackError, SlackRateLimited],
|
|
82
|
+
protocol: SlackProtocol,
|
|
83
|
+
retry: Retry.Retry,
|
|
84
|
+
}));
|
|
85
|
+
/** 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 */
|
|
86
|
+
export const userInfo = /*@__PURE__*/ API.make(() => ({
|
|
87
|
+
input: UserInfoRequest,
|
|
88
|
+
output: UserInfoResponse,
|
|
89
|
+
errors: [SlackError, SlackRateLimited],
|
|
90
|
+
protocol: SlackProtocol,
|
|
91
|
+
retry: Retry.Retry,
|
|
92
|
+
}));
|
|
93
|
+
//# sourceMappingURL=openid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"openid.js","sourceRoot":"","sources":["../../src/services/openid.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAClD,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EACL,aAAa,GAGd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AAQrC,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MA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AAK,EAAE,eAAe;IACtB,MAAM,EAAE,gBAAgB;IACxB,MAAM,EAAE,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,EAAE,aAAa;IACvB,KAAK,EAAE,KAAK,CAAC,KAAK;CACnB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
2
|
+
import * as API from "@distilled.cloud/core/api";
|
|
3
|
+
import { type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
4
|
+
export type { SlackOpError, SlackOpContext };
|
|
5
|
+
export interface AddPinRequest {
|
|
6
|
+
/** Channel to pin the messsage to. You must also include a `timestamp` when pinning messages. */
|
|
7
|
+
channel: string;
|
|
8
|
+
/** Timestamp of the message to pin. You must also include the `channel`. */
|
|
9
|
+
timestamp?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const AddPinRequest: S.Schema<AddPinRequest>;
|
|
12
|
+
export interface AddPinResponse {
|
|
13
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
14
|
+
ok: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const AddPinResponse: S.Schema<AddPinResponse>;
|
|
17
|
+
export interface ListPinsRequest {
|
|
18
|
+
/** Channel to get pinned items for. */
|
|
19
|
+
channel: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const ListPinsRequest: S.Schema<ListPinsRequest>;
|
|
22
|
+
export type ListPinsResponseItemsItemType = "file" | "message" | "file_comment";
|
|
23
|
+
export declare const ListPinsResponseItemsItemType: any;
|
|
24
|
+
export interface ListPinsResponseItemsItem {
|
|
25
|
+
type: ListPinsResponseItemsItemType;
|
|
26
|
+
created: number;
|
|
27
|
+
created_by: string;
|
|
28
|
+
channel?: string;
|
|
29
|
+
message?: unknown;
|
|
30
|
+
file?: unknown;
|
|
31
|
+
comment?: string;
|
|
32
|
+
}
|
|
33
|
+
export declare const ListPinsResponseItemsItem: S.Schema<ListPinsResponseItemsItem>;
|
|
34
|
+
export type ListPinsResponseItemsList = Array<ListPinsResponseItemsItem>;
|
|
35
|
+
export declare const ListPinsResponseItemsList: S.Schema<ListPinsResponseItemsList>;
|
|
36
|
+
export interface ListPinsResponse {
|
|
37
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
38
|
+
ok: boolean;
|
|
39
|
+
items?: ListPinsResponseItemsList;
|
|
40
|
+
count?: number;
|
|
41
|
+
}
|
|
42
|
+
export declare const ListPinsResponse: S.Schema<ListPinsResponse>;
|
|
43
|
+
export interface RemovePinRequest {
|
|
44
|
+
/** Channel where the item is pinned to. */
|
|
45
|
+
channel: string;
|
|
46
|
+
/** Timestamp of the message to un-pin. */
|
|
47
|
+
timestamp?: string;
|
|
48
|
+
}
|
|
49
|
+
export declare const RemovePinRequest: S.Schema<RemovePinRequest>;
|
|
50
|
+
export interface RemovePinResponse {
|
|
51
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
52
|
+
ok: boolean;
|
|
53
|
+
}
|
|
54
|
+
export declare const RemovePinResponse: S.Schema<RemovePinResponse>;
|
|
55
|
+
export type AddPinError = SlackOpError;
|
|
56
|
+
/** 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 */
|
|
57
|
+
export declare const addPin: API.OperationMethod<AddPinRequest, AddPinResponse, AddPinError, SlackOpContext>;
|
|
58
|
+
export type ListPinsError = SlackOpError;
|
|
59
|
+
/** 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 */
|
|
60
|
+
export declare const listPins: API.OperationMethod<ListPinsRequest, ListPinsResponse, ListPinsError, SlackOpContext>;
|
|
61
|
+
export type RemovePinError = SlackOpError;
|
|
62
|
+
/** 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 */
|
|
63
|
+
export declare const removePin: API.OperationMethod<RemovePinRequest, RemovePinResponse, RemovePinError, SlackOpContext>;
|
|
64
|
+
//# sourceMappingURL=pins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pins.d.ts","sourceRoot":"","sources":["../../src/services/pins.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAClD,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AAEjD,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAIxB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;AAE7C,MAAM,WAAW,aAAa;IAC5B,iGAAiG;IACj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AQhB,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAExC,MAAM,WAAW,gBAAgB;IAC/B,2CAA2C;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,eAAO,MAAM,gBAAgB,EAOhB,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,EAAE,EAAE,OAAO,CAAC;CACb;AACD,eAAO,MAAM,iBAAiB,EAMjB,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;AAEzC,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC;AACvC,uhCAAuhC;AACvhC,eAAO,MAAM,MAAM,EAAE,GAAG,CAAC,eAAe,CACtC,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAAc,CAOb,CAAC;AAEJ,MAAM,MAAM,aAAa,GAAG,YAAY,CAAC;AACzC,mXAAmX;AACnX,eAAO,MAAM,QAAQ,EAAE,GAAG,CAAC,eAAe,CACxC,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,cAAc,CAOb,CAAC;AAEJ,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC;AAC1C,28BAA28B;AAC38B,eAAO,MAAM,SAAS,EAAE,GAAG,CAAC,eAAe,CACzC,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,cAAc,CAOb,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
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.js";
|
|
5
|
+
import { SlackProtocol, } from "../protocol.js";
|
|
6
|
+
import { SlackError, SlackRateLimited } from "../errors.js";
|
|
7
|
+
import * as Retry from "../retry.js";
|
|
8
|
+
export const AddPinRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
9
|
+
channel: S.String,
|
|
10
|
+
timestamp: S.optional(S.String),
|
|
11
|
+
}).pipe(T.Http({ method: "POST", uri: "/pins.add", code: 200 }))).annotate({ identifier: "AddPinRequest" });
|
|
12
|
+
export const AddPinResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
13
|
+
ok: S.Boolean,
|
|
14
|
+
})).annotate({ identifier: "AddPinResponse" });
|
|
15
|
+
export const ListPinsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
16
|
+
channel: S.String.pipe(T.Query()),
|
|
17
|
+
}).pipe(T.Http({ method: "GET", uri: "/pins.list", code: 200 }))).annotate({
|
|
18
|
+
identifier: "ListPinsRequest",
|
|
19
|
+
});
|
|
20
|
+
export const ListPinsResponseItemsItemType = S.String;
|
|
21
|
+
export const ListPinsResponseItemsItem = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
22
|
+
type: ListPinsResponseItemsItemType,
|
|
23
|
+
created: S.Number,
|
|
24
|
+
created_by: S.String,
|
|
25
|
+
channel: S.optional(S.String),
|
|
26
|
+
message: S.optional(S.Unknown),
|
|
27
|
+
file: S.optional(S.Unknown),
|
|
28
|
+
comment: S.optional(S.String),
|
|
29
|
+
})).annotate({
|
|
30
|
+
identifier: "ListPinsResponseItemsItem",
|
|
31
|
+
});
|
|
32
|
+
export const ListPinsResponseItemsList = /*@__PURE__*/ S.Array(ListPinsResponseItemsItem);
|
|
33
|
+
export const ListPinsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
34
|
+
ok: S.Boolean,
|
|
35
|
+
items: S.optional(ListPinsResponseItemsList),
|
|
36
|
+
count: S.optional(S.Number),
|
|
37
|
+
})).annotate({
|
|
38
|
+
identifier: "ListPinsResponse",
|
|
39
|
+
});
|
|
40
|
+
export const RemovePinRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
41
|
+
channel: S.String,
|
|
42
|
+
timestamp: S.optional(S.String),
|
|
43
|
+
}).pipe(T.Http({ method: "POST", uri: "/pins.remove", code: 200 }))).annotate({
|
|
44
|
+
identifier: "RemovePinRequest",
|
|
45
|
+
});
|
|
46
|
+
export const RemovePinResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
47
|
+
ok: S.Boolean,
|
|
48
|
+
})).annotate({
|
|
49
|
+
identifier: "RemovePinResponse",
|
|
50
|
+
});
|
|
51
|
+
/** 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 */
|
|
52
|
+
export const addPin = /*@__PURE__*/ API.make(() => ({
|
|
53
|
+
input: AddPinRequest,
|
|
54
|
+
output: AddPinResponse,
|
|
55
|
+
errors: [SlackError, SlackRateLimited],
|
|
56
|
+
protocol: SlackProtocol,
|
|
57
|
+
retry: Retry.Retry,
|
|
58
|
+
}));
|
|
59
|
+
/** 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 */
|
|
60
|
+
export const listPins = /*@__PURE__*/ API.make(() => ({
|
|
61
|
+
input: ListPinsRequest,
|
|
62
|
+
output: ListPinsResponse,
|
|
63
|
+
errors: [SlackError, SlackRateLimited],
|
|
64
|
+
protocol: SlackProtocol,
|
|
65
|
+
retry: Retry.Retry,
|
|
66
|
+
}));
|
|
67
|
+
/** 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 */
|
|
68
|
+
export const removePin = /*@__PURE__*/ API.make(() => ({
|
|
69
|
+
input: RemovePinRequest,
|
|
70
|
+
output: RemovePinResponse,
|
|
71
|
+
errors: [SlackError, SlackRateLimited],
|
|
72
|
+
protocol: SlackProtocol,
|
|
73
|
+
retry: Retry.Retry,
|
|
74
|
+
}));
|
|
75
|
+
//# sourceMappingURL=pins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pins.js","sourceRoot":"","sources":["../../src/services/pins.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAClD,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EACL,aAAa,GAGd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,aAAa,CAAC;AAUrC,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC,CAAC,CAAC,OAAO,C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108 @@
|
|
|
1
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
2
|
+
import * as API from "@distilled.cloud/core/api";
|
|
3
|
+
import { type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
4
|
+
export type { SlackOpError, SlackOpContext };
|
|
5
|
+
export interface AddReactionRequest {
|
|
6
|
+
/** Channel where the message to add reaction to was posted. */
|
|
7
|
+
channel: string;
|
|
8
|
+
/** Reaction (emoji) name */
|
|
9
|
+
name: string;
|
|
10
|
+
/** Timestamp of the message to add reaction to. */
|
|
11
|
+
timestamp: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const AddReactionRequest: S.Schema<AddReactionRequest>;
|
|
14
|
+
export interface AddReactionResponse {
|
|
15
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
16
|
+
ok: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare const AddReactionResponse: S.Schema<AddReactionResponse>;
|
|
19
|
+
export interface GetReactionRequest {
|
|
20
|
+
/** Channel where the message to get reactions for was posted. */
|
|
21
|
+
channel?: string;
|
|
22
|
+
/** File to get reactions for. */
|
|
23
|
+
file?: string;
|
|
24
|
+
/** File comment to get reactions for. */
|
|
25
|
+
file_comment?: string;
|
|
26
|
+
/** If true always return the complete reaction list. */
|
|
27
|
+
full?: boolean;
|
|
28
|
+
/** Timestamp of the message to get reactions for. */
|
|
29
|
+
timestamp?: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const GetReactionRequest: S.Schema<GetReactionRequest>;
|
|
32
|
+
export interface GetReactionResponse {
|
|
33
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
34
|
+
ok: boolean;
|
|
35
|
+
comment?: unknown;
|
|
36
|
+
message?: unknown;
|
|
37
|
+
type: string;
|
|
38
|
+
channel?: string;
|
|
39
|
+
file?: unknown;
|
|
40
|
+
}
|
|
41
|
+
export declare const GetReactionResponse: S.Schema<GetReactionResponse>;
|
|
42
|
+
export interface ListReactionsRequest {
|
|
43
|
+
/** Show reactions made by this user. Defaults to the authed user. */
|
|
44
|
+
user?: string;
|
|
45
|
+
/** If true always return the complete reaction list. */
|
|
46
|
+
full?: boolean;
|
|
47
|
+
count?: number;
|
|
48
|
+
page?: number;
|
|
49
|
+
/** 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. */
|
|
50
|
+
cursor?: string;
|
|
51
|
+
/** 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. */
|
|
52
|
+
limit?: number;
|
|
53
|
+
/** encoded team id to list reactions in, required if org token is used */
|
|
54
|
+
team_id?: string;
|
|
55
|
+
}
|
|
56
|
+
export declare const ListReactionsRequest: S.Schema<ListReactionsRequest>;
|
|
57
|
+
export type ListReactionsResponseItemsItemMap = {
|
|
58
|
+
[key: string]: unknown | undefined;
|
|
59
|
+
};
|
|
60
|
+
export declare const ListReactionsResponseItemsItemMap: S.Schema<ListReactionsResponseItemsItemMap>;
|
|
61
|
+
export type ListReactionsResponseItemsList = Array<ListReactionsResponseItemsItemMap>;
|
|
62
|
+
export declare const ListReactionsResponseItemsList: S.Schema<ListReactionsResponseItemsList>;
|
|
63
|
+
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
64
|
+
export interface ListReactionsResponseResponseMetadata {
|
|
65
|
+
/** Cursor for the next page — pass as `cursor` on the next call. */
|
|
66
|
+
next_cursor?: string;
|
|
67
|
+
}
|
|
68
|
+
export declare const ListReactionsResponseResponseMetadata: S.Schema<ListReactionsResponseResponseMetadata>;
|
|
69
|
+
export interface ListReactionsResponse {
|
|
70
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
71
|
+
ok: boolean;
|
|
72
|
+
items: ListReactionsResponseItemsList;
|
|
73
|
+
paging?: unknown;
|
|
74
|
+
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
75
|
+
response_metadata?: ListReactionsResponseResponseMetadata;
|
|
76
|
+
}
|
|
77
|
+
export declare const ListReactionsResponse: S.Schema<ListReactionsResponse>;
|
|
78
|
+
export interface RemoveReactionRequest {
|
|
79
|
+
/** Reaction (emoji) name. */
|
|
80
|
+
name: string;
|
|
81
|
+
/** File to remove reaction from. */
|
|
82
|
+
file?: string;
|
|
83
|
+
/** File comment to remove reaction from. */
|
|
84
|
+
file_comment?: string;
|
|
85
|
+
/** Channel where the message to remove reaction from was posted. */
|
|
86
|
+
channel?: string;
|
|
87
|
+
/** Timestamp of the message to remove reaction from. */
|
|
88
|
+
timestamp?: string;
|
|
89
|
+
}
|
|
90
|
+
export declare const RemoveReactionRequest: S.Schema<RemoveReactionRequest>;
|
|
91
|
+
export interface RemoveReactionResponse {
|
|
92
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
93
|
+
ok: boolean;
|
|
94
|
+
}
|
|
95
|
+
export declare const RemoveReactionResponse: S.Schema<RemoveReactionResponse>;
|
|
96
|
+
export type AddReactionError = SlackOpError;
|
|
97
|
+
/** 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 */
|
|
98
|
+
export declare const addReaction: API.OperationMethod<AddReactionRequest, AddReactionResponse, AddReactionError, SlackOpContext>;
|
|
99
|
+
export type GetReactionError = SlackOpError;
|
|
100
|
+
/** 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 */
|
|
101
|
+
export declare const getReaction: API.OperationMethod<GetReactionRequest, GetReactionResponse, GetReactionError, SlackOpContext>;
|
|
102
|
+
export type ListReactionsError = SlackOpError;
|
|
103
|
+
/** 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 */
|
|
104
|
+
export declare const listReactions: API.PaginatedOperationMethod<ListReactionsRequest, ListReactionsResponse, ListReactionsError, SlackOpContext, ListReactionsResponseItemsItemMap>;
|
|
105
|
+
export type RemoveReactionError = SlackOpError;
|
|
106
|
+
/** 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 */
|
|
107
|
+
export declare const removeReaction: API.OperationMethod<RemoveReactionRequest, RemoveReactionResponse, RemoveReactionError, SlackOpContext>;
|
|
108
|
+
//# sourceMappingURL=reactions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactions.d.ts","sourceRoot":"","sources":["../../src/services/reactions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAClD,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AAEjD,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AAKxB,YAAY,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;AAE7C,MAAM,WAAW,kBAAkB;IACjC,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,eAAO,MAAM,kBAAkB,EAQlB,CAAC,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;AAE1C,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,EAAE,EAAE,OAAO,CAAC;CACb;AACD,eAAO,MAAM,mBAAmB,EAMnB,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAE3C,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yCAAyC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wDAAwD;IACxD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,eAAO,MAAM,kBAAkB,EAUlB,CAAC,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MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC;AAC9C,4SAA4S;AAC5S,eAAO,MAAM,aAAa,EAAE,GAAG,CAAC,wBAAwB,CACtD,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,iCAAiC,CAiB3B,CAAC;AAET,MAAM,MAAM,mBAAmB,GAAG,YAAY,CAAC;AAC/C,6oCAA6oC;AAC7oC,eAAO,MAAM,cAAc,EAAE,GAAG,CAAC,eAAe,CAC9C,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,cAAc,CAOb,CAAC"}
|
|
@@ -0,0 +1,119 @@
|
|
|
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.js";
|
|
5
|
+
import { SlackProtocol, } from "../protocol.js";
|
|
6
|
+
import { slackPaginate } from "../pagination.js";
|
|
7
|
+
import { SlackError, SlackRateLimited } from "../errors.js";
|
|
8
|
+
import * as Retry from "../retry.js";
|
|
9
|
+
export const AddReactionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
10
|
+
channel: S.String,
|
|
11
|
+
name: S.String,
|
|
12
|
+
timestamp: S.String,
|
|
13
|
+
}).pipe(T.Http({ method: "POST", uri: "/reactions.add", code: 200 }))).annotate({
|
|
14
|
+
identifier: "AddReactionRequest",
|
|
15
|
+
});
|
|
16
|
+
export const AddReactionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
17
|
+
ok: S.Boolean,
|
|
18
|
+
})).annotate({
|
|
19
|
+
identifier: "AddReactionResponse",
|
|
20
|
+
});
|
|
21
|
+
export const GetReactionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
22
|
+
channel: S.optional(S.String.pipe(T.Query())),
|
|
23
|
+
file: S.optional(S.String.pipe(T.Query())),
|
|
24
|
+
file_comment: S.optional(S.String.pipe(T.Query())),
|
|
25
|
+
full: S.optional(S.Boolean.pipe(T.Query())),
|
|
26
|
+
timestamp: S.optional(S.String.pipe(T.Query())),
|
|
27
|
+
}).pipe(T.Http({ method: "GET", uri: "/reactions.get", code: 200 }))).annotate({
|
|
28
|
+
identifier: "GetReactionRequest",
|
|
29
|
+
});
|
|
30
|
+
export const GetReactionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
31
|
+
ok: S.Boolean,
|
|
32
|
+
comment: S.optional(S.Unknown),
|
|
33
|
+
message: S.optional(S.Unknown),
|
|
34
|
+
type: S.String,
|
|
35
|
+
channel: S.optional(S.String),
|
|
36
|
+
file: S.optional(S.Unknown),
|
|
37
|
+
})).annotate({
|
|
38
|
+
identifier: "GetReactionResponse",
|
|
39
|
+
});
|
|
40
|
+
export const ListReactionsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
41
|
+
user: S.optional(S.String.pipe(T.Query())),
|
|
42
|
+
full: S.optional(S.Boolean.pipe(T.Query())),
|
|
43
|
+
count: S.optional(S.Number.pipe(T.Query())),
|
|
44
|
+
page: S.optional(S.Number.pipe(T.Query())),
|
|
45
|
+
cursor: S.optional(S.String.pipe(T.Query())),
|
|
46
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
47
|
+
team_id: S.optional(S.String.pipe(T.Query())),
|
|
48
|
+
}).pipe(T.Http({ method: "GET", uri: "/reactions.list", code: 200 }))).annotate({
|
|
49
|
+
identifier: "ListReactionsRequest",
|
|
50
|
+
});
|
|
51
|
+
export const ListReactionsResponseItemsItemMap = /*@__PURE__*/ S.Record(S.String, S.Unknown);
|
|
52
|
+
export const ListReactionsResponseItemsList = /*@__PURE__*/ S.Array(ListReactionsResponseItemsItemMap);
|
|
53
|
+
export const ListReactionsResponseResponseMetadata = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
54
|
+
next_cursor: S.optional(S.String),
|
|
55
|
+
})).annotate({
|
|
56
|
+
identifier: "ListReactionsResponseResponseMetadata",
|
|
57
|
+
});
|
|
58
|
+
export const ListReactionsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
59
|
+
ok: S.Boolean,
|
|
60
|
+
items: ListReactionsResponseItemsList,
|
|
61
|
+
paging: S.optional(S.Unknown),
|
|
62
|
+
response_metadata: S.optional(ListReactionsResponseResponseMetadata),
|
|
63
|
+
})).annotate({
|
|
64
|
+
identifier: "ListReactionsResponse",
|
|
65
|
+
});
|
|
66
|
+
export const RemoveReactionRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
67
|
+
name: S.String,
|
|
68
|
+
file: S.optional(S.String),
|
|
69
|
+
file_comment: S.optional(S.String),
|
|
70
|
+
channel: S.optional(S.String),
|
|
71
|
+
timestamp: S.optional(S.String),
|
|
72
|
+
}).pipe(T.Http({ method: "POST", uri: "/reactions.remove", code: 200 }))).annotate({
|
|
73
|
+
identifier: "RemoveReactionRequest",
|
|
74
|
+
});
|
|
75
|
+
export const RemoveReactionResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
76
|
+
ok: S.Boolean,
|
|
77
|
+
})).annotate({
|
|
78
|
+
identifier: "RemoveReactionResponse",
|
|
79
|
+
});
|
|
80
|
+
/** 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 */
|
|
81
|
+
export const addReaction = /*@__PURE__*/ API.make(() => ({
|
|
82
|
+
input: AddReactionRequest,
|
|
83
|
+
output: AddReactionResponse,
|
|
84
|
+
errors: [SlackError, SlackRateLimited],
|
|
85
|
+
protocol: SlackProtocol,
|
|
86
|
+
retry: Retry.Retry,
|
|
87
|
+
}));
|
|
88
|
+
/** 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 */
|
|
89
|
+
export const getReaction = /*@__PURE__*/ API.make(() => ({
|
|
90
|
+
input: GetReactionRequest,
|
|
91
|
+
output: GetReactionResponse,
|
|
92
|
+
errors: [SlackError, SlackRateLimited],
|
|
93
|
+
protocol: SlackProtocol,
|
|
94
|
+
retry: Retry.Retry,
|
|
95
|
+
}));
|
|
96
|
+
/** 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 */
|
|
97
|
+
export const listReactions = /*@__PURE__*/ API.makePaginated(() => ({
|
|
98
|
+
input: ListReactionsRequest,
|
|
99
|
+
output: ListReactionsResponse,
|
|
100
|
+
errors: [SlackError, SlackRateLimited],
|
|
101
|
+
protocol: SlackProtocol,
|
|
102
|
+
retry: Retry.Retry,
|
|
103
|
+
pagination: {
|
|
104
|
+
mode: "cursor",
|
|
105
|
+
inputToken: "cursor",
|
|
106
|
+
outputToken: "response_metadata.next_cursor",
|
|
107
|
+
items: "items",
|
|
108
|
+
pageSize: "limit",
|
|
109
|
+
},
|
|
110
|
+
}), slackPaginate);
|
|
111
|
+
/** 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 */
|
|
112
|
+
export const removeReaction = /*@__PURE__*/ API.make(() => ({
|
|
113
|
+
input: RemoveReactionRequest,
|
|
114
|
+
output: RemoveReactionResponse,
|
|
115
|
+
errors: [SlackError, SlackRateLimited],
|
|
116
|
+
protocol: SlackProtocol,
|
|
117
|
+
retry: Retry.Retry,
|
|
118
|
+
}));
|
|
119
|
+
//# sourceMappingURL=reactions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactions.js","sourceRoot":"","sources":["../../src/services/reactions.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,OAAO,KAAK,CAAC,MAAM,8BAA8B,CAAC;AAClD,OAAO,KAAK,GAAG,MAAM,2BAA2B,CAAC;AACjD,OAAO,KAAK,CAAC,MAAM,cAAc,CAAC;AAClC,OAAO,EACL,aAAa,GAGd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,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