@distilled.cloud/slack 1.0.0-rc.15 → 1.0.0-rc.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/.lazy.json +1 -0
- package/lib/_bundle/lazy.js +4 -0
- package/lib/_bundle/sdk.js +2 -0
- package/lib/_bundle/sdk.js.map +1 -0
- package/lib/credentials.d.ts +1 -1
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +1 -53
- package/lib/errors.d.ts +31 -31
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -59
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -10
- package/lib/index.lazy.js +7 -0
- package/lib/pagination.d.ts +2 -2
- package/lib/pagination.js +1 -31
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +1 -231
- package/lib/retry.d.ts +2 -2
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +1 -45
- package/lib/services/admin.d.ts +123 -575
- package/lib/services/admin.d.ts.map +1 -1
- package/lib/services/admin.js +141 -2884
- package/lib/services/admin.js.map +1 -1
- package/lib/services/agents.d.ts +13 -55
- package/lib/services/agents.d.ts.map +1 -1
- package/lib/services/agents.js +1 -314
- package/lib/services/agents.js.map +1 -1
- package/lib/services/api.d.ts +0 -4
- package/lib/services/api.d.ts.map +1 -1
- package/lib/services/api.js +1 -23
- package/lib/services/api.js.map +1 -1
- package/lib/services/apps.d.ts +25 -106
- package/lib/services/apps.d.ts.map +1 -1
- package/lib/services/apps.js +35 -515
- package/lib/services/apps.js.map +1 -1
- package/lib/services/assistant.d.ts +6 -40
- package/lib/services/assistant.d.ts.map +1 -1
- package/lib/services/assistant.js +1 -209
- package/lib/services/assistant.js.map +1 -1
- package/lib/services/auth.d.ts +4 -15
- package/lib/services/auth.d.ts.map +1 -1
- package/lib/services/auth.js +1 -96
- package/lib/services/auth.js.map +1 -1
- package/lib/services/blocks.d.ts +1 -7
- package/lib/services/blocks.d.ts.map +1 -1
- package/lib/services/blocks.js +1 -26
- package/lib/services/blocks.js.map +1 -1
- package/lib/services/bookmarks.d.ts +4 -15
- package/lib/services/bookmarks.d.ts.map +1 -1
- package/lib/services/bookmarks.js +1 -81
- package/lib/services/bookmarks.js.map +1 -1
- package/lib/services/bots.d.ts +1 -9
- package/lib/services/bots.d.ts.map +1 -1
- package/lib/services/bots.js +1 -59
- package/lib/services/bots.js.map +1 -1
- package/lib/services/calls.d.ts +6 -22
- package/lib/services/calls.d.ts.map +1 -1
- package/lib/services/calls.js +1 -115
- package/lib/services/calls.js.map +1 -1
- package/lib/services/canvases.d.ts +7 -35
- package/lib/services/canvases.d.ts.map +1 -1
- package/lib/services/canvases.js +1 -140
- package/lib/services/canvases.js.map +1 -1
- package/lib/services/chat.d.ts +14 -83
- package/lib/services/chat.d.ts.map +1 -1
- package/lib/services/chat.js +1 -387
- package/lib/services/chat.js.map +1 -1
- package/lib/services/conversations.d.ts +31 -116
- package/lib/services/conversations.d.ts.map +1 -1
- package/lib/services/conversations.js +40 -696
- package/lib/services/conversations.js.map +1 -1
- package/lib/services/dialog.d.ts +1 -4
- package/lib/services/dialog.d.ts.map +1 -1
- package/lib/services/dialog.js +1 -22
- package/lib/services/dialog.js.map +1 -1
- package/lib/services/dnd.d.ts +5 -17
- package/lib/services/dnd.d.ts.map +1 -1
- package/lib/services/dnd.js +1 -96
- package/lib/services/dnd.js.map +1 -1
- package/lib/services/emoji.d.ts +1 -8
- package/lib/services/emoji.d.ts.map +1 -1
- package/lib/services/emoji.js +1 -34
- package/lib/services/emoji.js.map +1 -1
- package/lib/services/entity.d.ts +4 -16
- package/lib/services/entity.d.ts.map +1 -1
- package/lib/services/entity.js +1 -76
- package/lib/services/entity.js.map +1 -1
- package/lib/services/files.d.ts +16 -80
- package/lib/services/files.d.ts.map +1 -1
- package/lib/services/files.js +1 -439
- package/lib/services/files.js.map +1 -1
- package/lib/services/functions.d.ts +8 -49
- package/lib/services/functions.d.ts.map +1 -1
- package/lib/services/functions.js +1 -208
- package/lib/services/functions.js.map +1 -1
- package/lib/services/index.js +0 -2
- package/lib/services/lists.d.ts +13 -55
- package/lib/services/lists.d.ts.map +1 -1
- package/lib/services/lists.js +1 -254
- package/lib/services/lists.js.map +1 -1
- package/lib/services/migration.d.ts +1 -7
- package/lib/services/migration.d.ts.map +1 -1
- package/lib/services/migration.js +1 -32
- package/lib/services/migration.js.map +1 -1
- package/lib/services/oauth.d.ts +7 -43
- package/lib/services/oauth.d.ts.map +1 -1
- package/lib/services/oauth.js +1 -294
- package/lib/services/oauth.js.map +1 -1
- package/lib/services/openid.d.ts +3 -10
- package/lib/services/openid.d.ts.map +1 -1
- package/lib/services/openid.js +1 -84
- package/lib/services/openid.js.map +1 -1
- package/lib/services/pins.d.ts +3 -13
- package/lib/services/pins.d.ts.map +1 -1
- package/lib/services/pins.js +1 -66
- package/lib/services/pins.js.map +1 -1
- package/lib/services/reactions.d.ts +5 -17
- package/lib/services/reactions.d.ts.map +1 -1
- package/lib/services/reactions.js +1 -102
- package/lib/services/reactions.js.map +1 -1
- package/lib/services/reminders.d.ts +5 -17
- package/lib/services/reminders.d.ts.map +1 -1
- package/lib/services/reminders.js +1 -88
- package/lib/services/reminders.js.map +1 -1
- package/lib/services/rtm.d.ts +2 -11
- package/lib/services/rtm.d.ts.map +1 -1
- package/lib/services/rtm.js +1 -61
- package/lib/services/rtm.js.map +1 -1
- package/lib/services/search.d.ts +4 -35
- package/lib/services/search.d.ts.map +1 -1
- package/lib/services/search.js +1 -172
- package/lib/services/search.js.map +1 -1
- package/lib/services/stars.d.ts +4 -26
- package/lib/services/stars.d.ts.map +1 -1
- package/lib/services/stars.js +1 -134
- package/lib/services/stars.js.map +1 -1
- package/lib/services/team.d.ts +11 -63
- package/lib/services/team.d.ts.map +1 -1
- package/lib/services/team.js +1 -295
- package/lib/services/team.js.map +1 -1
- package/lib/services/tooling.d.ts +2 -5
- package/lib/services/tooling.d.ts.map +1 -1
- package/lib/services/tooling.js +1 -33
- package/lib/services/tooling.js.map +1 -1
- package/lib/services/usergroups.d.ts +7 -31
- package/lib/services/usergroups.d.ts.map +1 -1
- package/lib/services/usergroups.js +1 -151
- package/lib/services/usergroups.js.map +1 -1
- package/lib/services/users.d.ts +14 -48
- package/lib/services/users.d.ts.map +1 -1
- package/lib/services/users.js +1 -255
- package/lib/services/users.js.map +1 -1
- package/lib/services/views.d.ts +4 -14
- package/lib/services/views.d.ts.map +1 -1
- package/lib/services/views.js +1 -78
- package/lib/services/views.js.map +1 -1
- package/lib/services/workflows.d.ts +8 -51
- package/lib/services/workflows.d.ts.map +1 -1
- package/lib/services/workflows.js +1 -193
- package/lib/services/workflows.js.map +1 -1
- package/lib/services.lazy/admin.js +3 -0
- package/lib/services.lazy/agents.js +1 -0
- package/lib/services.lazy/api.js +1 -0
- package/lib/services.lazy/apps.js +3 -0
- package/lib/services.lazy/assistant.js +1 -0
- package/lib/services.lazy/auth.js +1 -0
- package/lib/services.lazy/blocks.js +1 -0
- package/lib/services.lazy/bookmarks.js +1 -0
- package/lib/services.lazy/bots.js +1 -0
- package/lib/services.lazy/calls.js +1 -0
- package/lib/services.lazy/canvases.js +1 -0
- package/lib/services.lazy/chat.js +1 -0
- package/lib/services.lazy/conversations.js +3 -0
- package/lib/services.lazy/dialog.js +1 -0
- package/lib/services.lazy/dnd.js +1 -0
- package/lib/services.lazy/emoji.js +1 -0
- package/lib/services.lazy/entity.js +1 -0
- package/lib/services.lazy/files.js +1 -0
- package/lib/services.lazy/functions.js +1 -0
- package/lib/services.lazy/index.js +3 -0
- package/lib/services.lazy/lists.js +1 -0
- package/lib/services.lazy/migration.js +1 -0
- package/lib/services.lazy/oauth.js +1 -0
- package/lib/services.lazy/openid.js +1 -0
- package/lib/services.lazy/pins.js +1 -0
- package/lib/services.lazy/reactions.js +1 -0
- package/lib/services.lazy/reminders.js +1 -0
- package/lib/services.lazy/rtm.js +1 -0
- package/lib/services.lazy/search.js +1 -0
- package/lib/services.lazy/stars.js +1 -0
- package/lib/services.lazy/team.js +1 -0
- package/lib/services.lazy/tooling.js +1 -0
- package/lib/services.lazy/usergroups.js +1 -0
- package/lib/services.lazy/users.js +1 -0
- package/lib/services.lazy/views.js +1 -0
- package/lib/services.lazy/workflows.js +1 -0
- package/lib/traits.d.ts +1 -1
- package/lib/traits.js +1 -12
- package/package.json +10 -8
- package/src/credentials.ts +20 -21
- package/src/errors.ts +31 -27
- package/src/index.ts +1 -1
- package/src/pagination.ts +2 -2
- package/src/protocol.ts +30 -29
- package/src/retry.ts +6 -6
- package/src/services/admin.ts +2717 -3451
- package/src/services/agents.ts +380 -370
- package/src/services/api.ts +31 -21
- package/src/services/apps.ts +569 -621
- package/src/services/assistant.ts +235 -270
- package/src/services/auth.ts +118 -100
- package/src/services/blocks.ts +33 -29
- package/src/services/bookmarks.ts +101 -83
- package/src/services/bots.ts +74 -67
- package/src/services/calls.ts +118 -124
- package/src/services/canvases.ts +171 -178
- package/src/services/chat.ts +428 -496
- package/src/services/conversations.ts +675 -761
- package/src/services/dialog.ts +30 -17
- package/src/services/dnd.ts +125 -99
- package/src/services/emoji.ts +46 -42
- package/src/services/entity.ts +94 -92
- package/src/services/files.ts +536 -531
- package/src/services/functions.ts +209 -274
- package/src/services/lists.ts +289 -304
- package/src/services/migration.ts +39 -37
- package/src/services/oauth.ts +345 -361
- package/src/services/openid.ts +137 -122
- package/src/services/pins.ts +83 -70
- package/src/services/reactions.ts +119 -103
- package/src/services/reminders.ts +112 -90
- package/src/services/rtm.ts +73 -65
- package/src/services/search.ts +193 -244
- package/src/services/stars.ts +101 -160
- package/src/services/team.ts +333 -369
- package/src/services/tooling.ts +43 -30
- package/src/services/usergroups.ts +175 -179
- package/src/services/users.ts +301 -268
- package/src/services/views.ts +85 -80
- package/src/services/workflows.ts +184 -269
- package/src/traits.ts +1 -1
- package/lib/credentials.js.map +0 -1
- package/lib/errors.js.map +0 -1
- package/lib/pagination.js.map +0 -1
- package/lib/protocol.js.map +0 -1
- package/lib/protocol.test.d.ts +0 -2
- package/lib/protocol.test.d.ts.map +0 -1
- package/lib/protocol.test.js +0 -288
- package/lib/protocol.test.js.map +0 -1
- package/lib/retry.js.map +0 -1
- package/lib/services/index.js.map +0 -1
- package/lib/traits.js.map +0 -1
- package/src/protocol.test.ts +0 -372
- /package/lib/{index.js.map → index.lazy.js.map} +0 -0
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import * as API from "@distilled.cloud/core/api";
|
|
2
2
|
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
3
|
-
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as S from "@distilled.cloud/core/schema-lite";
|
|
4
|
+
import * as __L from "@distilled.cloud/core/schema-lite";
|
|
4
5
|
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
5
6
|
import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
6
7
|
import * as Retry from "../retry.ts";
|
|
7
8
|
import * as T from "../traits.ts";
|
|
9
|
+
// Schema table, filled on first reach (see __S at the end).
|
|
10
|
+
const __s: any[] = [];
|
|
8
11
|
|
|
9
12
|
export type { SlackOpError, SlackOpContext };
|
|
10
13
|
|
|
11
14
|
/** The level that we are setting the file's permission to (read or write) */
|
|
12
15
|
export type AddBookmarkRequestAccessLevel = "read" | "write";
|
|
13
|
-
export const AddBookmarkRequestAccessLevel = S.String;
|
|
14
|
-
|
|
15
16
|
export interface AddBookmarkRequest {
|
|
16
17
|
/** Channel to add bookmark in. Required for public channels. */
|
|
17
18
|
channel_id?: string;
|
|
@@ -30,31 +31,11 @@ export interface AddBookmarkRequest {
|
|
|
30
31
|
/** Id of this bookmark's parent */
|
|
31
32
|
parent_id?: string;
|
|
32
33
|
}
|
|
33
|
-
export const AddBookmarkRequest = /*@__PURE__*/ S.suspend(() =>
|
|
34
|
-
S.Struct({
|
|
35
|
-
channel_id: S.optional(S.String),
|
|
36
|
-
title: S.String,
|
|
37
|
-
link: S.optional(S.String),
|
|
38
|
-
type: S.String,
|
|
39
|
-
emoji: S.optional(S.String),
|
|
40
|
-
entity_id: S.optional(S.String),
|
|
41
|
-
access_level: S.optional(AddBookmarkRequestAccessLevel),
|
|
42
|
-
parent_id: S.optional(S.String),
|
|
43
|
-
}).pipe(T.Http({ method: "POST", uri: "/bookmarks.add", code: 200 })),
|
|
44
|
-
).annotate({ identifier: "AddBookmarkRequest" }) as any as S.Schema<AddBookmarkRequest>;
|
|
45
|
-
|
|
46
34
|
export interface AddBookmarkResponse {
|
|
47
35
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
48
36
|
ok: boolean;
|
|
49
37
|
bookmark: unknown;
|
|
50
38
|
}
|
|
51
|
-
export const AddBookmarkResponse = /*@__PURE__*/ S.suspend(() =>
|
|
52
|
-
S.Struct({
|
|
53
|
-
ok: S.Boolean,
|
|
54
|
-
bookmark: S.Unknown,
|
|
55
|
-
}),
|
|
56
|
-
).annotate({ identifier: "AddBookmarkResponse" }) as any as S.Schema<AddBookmarkResponse>;
|
|
57
|
-
|
|
58
39
|
export interface EditBookmarkRequest {
|
|
59
40
|
/** Channel to update bookmark in. Required for public channels. */
|
|
60
41
|
channel_id?: string;
|
|
@@ -67,55 +48,21 @@ export interface EditBookmarkRequest {
|
|
|
67
48
|
/** Emoji tag to apply to the link. */
|
|
68
49
|
emoji?: string;
|
|
69
50
|
}
|
|
70
|
-
export const EditBookmarkRequest = /*@__PURE__*/ S.suspend(() =>
|
|
71
|
-
S.Struct({
|
|
72
|
-
channel_id: S.optional(S.String),
|
|
73
|
-
bookmark_id: S.optional(S.String),
|
|
74
|
-
title: S.optional(S.String),
|
|
75
|
-
link: S.optional(S.String),
|
|
76
|
-
emoji: S.optional(S.String),
|
|
77
|
-
}).pipe(T.Http({ method: "POST", uri: "/bookmarks.edit", code: 200 })),
|
|
78
|
-
).annotate({ identifier: "EditBookmarkRequest" }) as any as S.Schema<EditBookmarkRequest>;
|
|
79
|
-
|
|
80
51
|
export interface EditBookmarkResponse {
|
|
81
52
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
82
53
|
ok: boolean;
|
|
83
54
|
bookmark: unknown;
|
|
84
55
|
}
|
|
85
|
-
export const EditBookmarkResponse = /*@__PURE__*/ S.suspend(() =>
|
|
86
|
-
S.Struct({
|
|
87
|
-
ok: S.Boolean,
|
|
88
|
-
bookmark: S.Unknown,
|
|
89
|
-
}),
|
|
90
|
-
).annotate({ identifier: "EditBookmarkResponse" }) as any as S.Schema<EditBookmarkResponse>;
|
|
91
|
-
|
|
92
56
|
export interface ListBookmarksRequest {
|
|
93
57
|
/** Channel to list bookmarks in. Required for public channels. */
|
|
94
58
|
channel_id?: string;
|
|
95
59
|
}
|
|
96
|
-
export const ListBookmarksRequest = /*@__PURE__*/ S.suspend(() =>
|
|
97
|
-
S.Struct({
|
|
98
|
-
channel_id: S.optional(S.String),
|
|
99
|
-
}).pipe(T.Http({ method: "POST", uri: "/bookmarks.list", code: 200 })),
|
|
100
|
-
).annotate({ identifier: "ListBookmarksRequest" }) as any as S.Schema<ListBookmarksRequest>;
|
|
101
|
-
|
|
102
60
|
export type ListBookmarksResponseBookmarksList = Array<unknown>;
|
|
103
|
-
export const ListBookmarksResponseBookmarksList = /*@__PURE__*/ S.Array(
|
|
104
|
-
S.Unknown,
|
|
105
|
-
) as any as S.Schema<ListBookmarksResponseBookmarksList>;
|
|
106
|
-
|
|
107
61
|
export interface ListBookmarksResponse {
|
|
108
62
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
109
63
|
ok: boolean;
|
|
110
64
|
bookmarks: ListBookmarksResponseBookmarksList;
|
|
111
65
|
}
|
|
112
|
-
export const ListBookmarksResponse = /*@__PURE__*/ S.suspend(() =>
|
|
113
|
-
S.Struct({
|
|
114
|
-
ok: S.Boolean,
|
|
115
|
-
bookmarks: ListBookmarksResponseBookmarksList,
|
|
116
|
-
}),
|
|
117
|
-
).annotate({ identifier: "ListBookmarksResponse" }) as any as S.Schema<ListBookmarksResponse>;
|
|
118
|
-
|
|
119
66
|
export interface RemoveBookmarkRequest {
|
|
120
67
|
/** Channel to remove bookmark. Required for public channels. */
|
|
121
68
|
channel_id?: string;
|
|
@@ -124,80 +71,151 @@ export interface RemoveBookmarkRequest {
|
|
|
124
71
|
/** Quip section ID to unbookmark */
|
|
125
72
|
quip_section_id?: string;
|
|
126
73
|
}
|
|
127
|
-
export const RemoveBookmarkRequest = /*@__PURE__*/ S.suspend(() =>
|
|
128
|
-
S.Struct({
|
|
129
|
-
channel_id: S.optional(S.String),
|
|
130
|
-
bookmark_id: S.optional(S.String),
|
|
131
|
-
quip_section_id: S.optional(S.String),
|
|
132
|
-
}).pipe(T.Http({ method: "POST", uri: "/bookmarks.remove", code: 200 })),
|
|
133
|
-
).annotate({ identifier: "RemoveBookmarkRequest" }) as any as S.Schema<RemoveBookmarkRequest>;
|
|
134
|
-
|
|
135
74
|
export interface RemoveBookmarkResponse {
|
|
136
75
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
137
76
|
ok: boolean;
|
|
138
77
|
}
|
|
139
|
-
export const RemoveBookmarkResponse = /*@__PURE__*/ S.suspend(() =>
|
|
140
|
-
S.Struct({
|
|
141
|
-
ok: S.Boolean,
|
|
142
|
-
}),
|
|
143
|
-
).annotate({ identifier: "RemoveBookmarkResponse" }) as any as S.Schema<RemoveBookmarkResponse>;
|
|
144
|
-
|
|
145
78
|
export type AddBookmarkError = SlackOpError;
|
|
146
|
-
/** Add bookmark to a channel. Required scopes
|
|
79
|
+
/** Add bookmark to a channel. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- Actor lacks access to the requested resource. - `cannot_bookmark_from_external_org` -- File is an external file and cannot be bookmarked. - `cannot_bookmark_restricted_sharing_enabled` -- File has restricted sharing enabled and cannot be bookmarked. - `channel_not_found` -- Channel cannot be found. - `file_already_added` -- The file has already been added to the folder. - `file_not_found` -- File cannot be found. - `invalid_bookmark_type` -- Bookmark type is not valid. - `invalid_app_action_type` -- App action type is not valid. - `invalid_shortcut_type` -- Shortcut type is not valid. - `invalid_child_type` -- Child type is not valid. - `invalid_emoji` -- Invalid emoji, does not follow the pattern of a valid emoji name. - `invalid_entity_id` -- Invalid entity_id, file or message type bookmark should have original file or message ID. - `invalid_link` -- Invalid link, link should begin with either http:// or https://. - `invalid_parent_type` -- Parent type is not valid. - `not_implemented` -- bookmarking not available for the user. - `parent_bookmark_disabled` -- Parent bookmark feature flag is off. - `parent_with_link` -- Parent bookmark should not have link. - `permission_denied` -- No permission to perform this operation. - `restricted_action` -- Members from an external organization cannot add workflow bookmarks to this channel. - `slack_connect_file_upload_sharing_blocked` -- Admin has disabled File uploads in all Slack Connect communications - `slack_connect_clip_sharing_blocked` -- Admin has disabled Clip sharing in Slack Connect channels - `slack_connect_blocked_file_type` -- Files with certain extensions are blocked from being uploaded in all Slack Connect communications - `too_many_bookmarks` -- Bookmark limit reached for channel. - `too_many_tabs` -- tab limit reached for channel. - `too_many_requests` -- Too many concurrent requests. Please retry. See https://docs.slack.dev/reference/methods/bookmarks.add */
|
|
147
80
|
export const addBookmark: API.OperationMethod<
|
|
148
81
|
AddBookmarkRequest,
|
|
149
82
|
AddBookmarkResponse,
|
|
150
83
|
AddBookmarkError,
|
|
151
84
|
SlackOpContext
|
|
152
85
|
> = /*@__PURE__*/ API.make(() => ({
|
|
153
|
-
input: AddBookmarkRequest
|
|
154
|
-
output: AddBookmarkResponse
|
|
86
|
+
input: __S(0, __c0, 0) as any as S.Schema<AddBookmarkRequest>,
|
|
87
|
+
output: __S(4, __c1, 0) as any as S.Schema<AddBookmarkResponse>,
|
|
155
88
|
errors: [SlackError, SlackRateLimited],
|
|
156
89
|
protocol: SlackProtocol,
|
|
157
90
|
retry: Retry.Retry,
|
|
158
91
|
}));
|
|
159
92
|
|
|
160
93
|
export type EditBookmarkError = SlackOpError;
|
|
161
|
-
/** Edit bookmark. Required scopes
|
|
94
|
+
/** Edit bookmark. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- Actor lacks access to the requested resource. - `channel_not_found` -- Channel cannot be found. - `invalid_bookmark_type` -- Bookmark type is not valid. - `invalid_emoji` -- Invalid emoji, does not follow the pattern of a valid emoji name. - `invalid_link` -- Invalid link, link should begin with either http:// or https://. - `not_found` -- Bookmark cannot be found. - `not_implemented` -- bookmarking not available for the user. - `parent_with_link` -- Parent bookmark should not have link. - `permission_denied` -- No permission to perform this operation. - `restricted_action` -- Members from an external organization cannot edit workflow bookmarks in this channel. - `slack_connect_file_upload_sharing_blocked` -- Admin has disabled File uploads in all Slack Connect communications - `slack_connect_clip_sharing_blocked` -- Admin has disabled Clip sharing in Slack Connect channels - `slack_connect_blocked_file_type` -- Files with certain extensions are blocked from being uploaded in all Slack Connect communications See https://docs.slack.dev/reference/methods/bookmarks.edit */
|
|
162
95
|
export const editBookmark: API.OperationMethod<
|
|
163
96
|
EditBookmarkRequest,
|
|
164
97
|
EditBookmarkResponse,
|
|
165
98
|
EditBookmarkError,
|
|
166
99
|
SlackOpContext
|
|
167
100
|
> = /*@__PURE__*/ API.make(() => ({
|
|
168
|
-
input: EditBookmarkRequest
|
|
169
|
-
output: EditBookmarkResponse
|
|
101
|
+
input: __S(8, __c2, 0) as any as S.Schema<EditBookmarkRequest>,
|
|
102
|
+
output: __S(4, __c1, 0) as any as S.Schema<EditBookmarkResponse>,
|
|
170
103
|
errors: [SlackError, SlackRateLimited],
|
|
171
104
|
protocol: SlackProtocol,
|
|
172
105
|
retry: Retry.Retry,
|
|
173
106
|
}));
|
|
174
107
|
|
|
175
108
|
export type ListBookmarksError = SlackOpError;
|
|
176
|
-
/** List bookmark for the channel. Required scopes
|
|
109
|
+
/** List bookmark for the channel. Required scopes -- bot: `bookmarks:read`; user: `bookmarks:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- Actor lacks access to the requested resource. - `channel_not_found` -- Channel cannot be found. - `not_implemented` -- bookmarking not available for the user. See https://docs.slack.dev/reference/methods/bookmarks.list */
|
|
177
110
|
export const listBookmarks: API.OperationMethod<
|
|
178
111
|
ListBookmarksRequest,
|
|
179
112
|
ListBookmarksResponse,
|
|
180
113
|
ListBookmarksError,
|
|
181
114
|
SlackOpContext
|
|
182
115
|
> = /*@__PURE__*/ API.make(() => ({
|
|
183
|
-
input: ListBookmarksRequest
|
|
184
|
-
output: ListBookmarksResponse
|
|
116
|
+
input: __S(12, __c3, 0) as any as S.Schema<ListBookmarksRequest>,
|
|
117
|
+
output: __S(14, __c3, 2) as any as S.Schema<ListBookmarksResponse>,
|
|
185
118
|
errors: [SlackError, SlackRateLimited],
|
|
186
119
|
protocol: SlackProtocol,
|
|
187
120
|
retry: Retry.Retry,
|
|
188
121
|
}));
|
|
189
122
|
|
|
190
123
|
export type RemoveBookmarkError = SlackOpError;
|
|
191
|
-
/** Remove bookmark from the channel. Required scopes
|
|
124
|
+
/** Remove bookmark from the channel. Required scopes -- bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `access_denied` -- Actor lacks access to the requested resource. - `channel_not_found` -- Channel cannot be found. - `user_not_found` -- User cannot be found. - `invalid_bookmark_type` -- Bookmark type is not valid. - `not_found` -- Bookmark cannot be found. - `not_implemented` -- bookmarking not available for the user. - `permission_denied` -- No permission to perform this operation. - `restricted_action` -- Members from an external organization cannot remove workflow bookmarks from this channel. See https://docs.slack.dev/reference/methods/bookmarks.remove */
|
|
192
125
|
export const removeBookmark: API.OperationMethod<
|
|
193
126
|
RemoveBookmarkRequest,
|
|
194
127
|
RemoveBookmarkResponse,
|
|
195
128
|
RemoveBookmarkError,
|
|
196
129
|
SlackOpContext
|
|
197
130
|
> = /*@__PURE__*/ API.make(() => ({
|
|
198
|
-
input: RemoveBookmarkRequest
|
|
199
|
-
output: RemoveBookmarkResponse
|
|
131
|
+
input: __S(16, __c4, 0) as any as S.Schema<RemoveBookmarkRequest>,
|
|
132
|
+
output: __S(17, __c4, 1) as any as S.Schema<RemoveBookmarkResponse>,
|
|
200
133
|
errors: [SlackError, SlackRateLimited],
|
|
201
134
|
protocol: SlackProtocol,
|
|
202
135
|
retry: Retry.Retry,
|
|
203
136
|
}));
|
|
137
|
+
|
|
138
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
139
|
+
function __c0(j: number): any {
|
|
140
|
+
switch (j) {
|
|
141
|
+
case 0:
|
|
142
|
+
return S.suspend(() =>
|
|
143
|
+
S.Struct({
|
|
144
|
+
channel_id: S.optional(S.String),
|
|
145
|
+
title: S.String,
|
|
146
|
+
link: S.optional(S.String),
|
|
147
|
+
type: S.String,
|
|
148
|
+
emoji: S.optional(S.String),
|
|
149
|
+
entity_id: S.optional(S.String),
|
|
150
|
+
access_level: S.optional(S.String),
|
|
151
|
+
parent_id: S.optional(S.String),
|
|
152
|
+
}).pipe(T.Http({ method: "POST", uri: "/bookmarks.add", code: 200 })),
|
|
153
|
+
).annotate({ identifier: "AddBookmarkRequest" });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function __c1(j: number): any {
|
|
157
|
+
switch (j) {
|
|
158
|
+
case 0:
|
|
159
|
+
return S.suspend(() =>
|
|
160
|
+
S.Struct({
|
|
161
|
+
ok: S.Boolean,
|
|
162
|
+
bookmark: S.Unknown,
|
|
163
|
+
}),
|
|
164
|
+
).annotate({ identifier: "AddBookmarkResponse" });
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
function __c2(j: number): any {
|
|
168
|
+
switch (j) {
|
|
169
|
+
case 0:
|
|
170
|
+
return S.suspend(() =>
|
|
171
|
+
S.Struct({
|
|
172
|
+
channel_id: S.optional(S.String),
|
|
173
|
+
bookmark_id: S.optional(S.String),
|
|
174
|
+
title: S.optional(S.String),
|
|
175
|
+
link: S.optional(S.String),
|
|
176
|
+
emoji: S.optional(S.String),
|
|
177
|
+
}).pipe(T.Http({ method: "POST", uri: "/bookmarks.edit", code: 200 })),
|
|
178
|
+
).annotate({ identifier: "EditBookmarkRequest" });
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function __c3(j: number): any {
|
|
182
|
+
switch (j) {
|
|
183
|
+
case 0:
|
|
184
|
+
return S.suspend(() =>
|
|
185
|
+
S.Struct({
|
|
186
|
+
channel_id: S.optional(S.String),
|
|
187
|
+
}).pipe(T.Http({ method: "POST", uri: "/bookmarks.list", code: 200 })),
|
|
188
|
+
).annotate({ identifier: "ListBookmarksRequest" });
|
|
189
|
+
case 1:
|
|
190
|
+
return S.Array(S.Unknown);
|
|
191
|
+
case 2:
|
|
192
|
+
return S.suspend(() =>
|
|
193
|
+
S.Struct({
|
|
194
|
+
ok: S.Boolean,
|
|
195
|
+
bookmarks: __S(13, __c3, 1),
|
|
196
|
+
}),
|
|
197
|
+
).annotate({ identifier: "ListBookmarksResponse" });
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
function __c4(j: number): any {
|
|
201
|
+
switch (j) {
|
|
202
|
+
case 0:
|
|
203
|
+
return S.suspend(() =>
|
|
204
|
+
S.Struct({
|
|
205
|
+
channel_id: S.optional(S.String),
|
|
206
|
+
bookmark_id: S.optional(S.String),
|
|
207
|
+
quip_section_id: S.optional(S.String),
|
|
208
|
+
}).pipe(T.Http({ method: "POST", uri: "/bookmarks.remove", code: 200 })),
|
|
209
|
+
).annotate({ identifier: "RemoveBookmarkRequest" });
|
|
210
|
+
case 1:
|
|
211
|
+
return S.suspend(() =>
|
|
212
|
+
S.Struct({
|
|
213
|
+
ok: S.Boolean,
|
|
214
|
+
}),
|
|
215
|
+
).annotate({ identifier: "RemoveBookmarkResponse" });
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
219
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
220
|
+
return (__s[i] ??= __L.at(f, j));
|
|
221
|
+
}
|
package/src/services/bots.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import * as API from "@distilled.cloud/core/api";
|
|
2
2
|
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
3
|
-
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as S from "@distilled.cloud/core/schema-lite";
|
|
4
|
+
import * as __L from "@distilled.cloud/core/schema-lite";
|
|
4
5
|
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
5
6
|
import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
6
7
|
import * as Retry from "../retry.ts";
|
|
7
8
|
import * as T from "../traits.ts";
|
|
9
|
+
// Schema table, filled on first reach (see __S at the end).
|
|
10
|
+
const __s: any[] = [];
|
|
8
11
|
|
|
9
12
|
export type { SlackOpError, SlackOpContext };
|
|
10
13
|
|
|
@@ -14,13 +17,6 @@ export interface BotsInfoRequest {
|
|
|
14
17
|
/** encoded team id or enterprise id where the bot exists, required if org token is used */
|
|
15
18
|
team_id?: string;
|
|
16
19
|
}
|
|
17
|
-
export const BotsInfoRequest = /*@__PURE__*/ S.suspend(() =>
|
|
18
|
-
S.Struct({
|
|
19
|
-
bot: S.optional(S.String.pipe(T.Query())),
|
|
20
|
-
team_id: S.optional(S.String.pipe(T.Query())),
|
|
21
|
-
}).pipe(T.Http({ method: "GET", uri: "/bots.info", code: 200 })),
|
|
22
|
-
).annotate({ identifier: "BotsInfoRequest" }) as any as S.Schema<BotsInfoRequest>;
|
|
23
|
-
|
|
24
20
|
export interface BotsInfoResponseBotsItemIcons {
|
|
25
21
|
emoji?: string;
|
|
26
22
|
image_36?: string;
|
|
@@ -28,18 +24,6 @@ export interface BotsInfoResponseBotsItemIcons {
|
|
|
28
24
|
image_64?: string;
|
|
29
25
|
image_72?: string;
|
|
30
26
|
}
|
|
31
|
-
export const BotsInfoResponseBotsItemIcons = /*@__PURE__*/ S.suspend(() =>
|
|
32
|
-
S.Struct({
|
|
33
|
-
emoji: S.optional(S.String),
|
|
34
|
-
image_36: S.optional(S.String),
|
|
35
|
-
image_48: S.optional(S.String),
|
|
36
|
-
image_64: S.optional(S.String),
|
|
37
|
-
image_72: S.optional(S.String),
|
|
38
|
-
}),
|
|
39
|
-
).annotate({
|
|
40
|
-
identifier: "BotsInfoResponseBotsItemIcons",
|
|
41
|
-
}) as any as S.Schema<BotsInfoResponseBotsItemIcons>;
|
|
42
|
-
|
|
43
27
|
export interface BotsInfoResponseBotsItem {
|
|
44
28
|
updated: number;
|
|
45
29
|
name?: string;
|
|
@@ -52,29 +36,8 @@ export interface BotsInfoResponseBotsItem {
|
|
|
52
36
|
is_legacy_workflow_bot?: boolean;
|
|
53
37
|
user_id?: string;
|
|
54
38
|
}
|
|
55
|
-
export const BotsInfoResponseBotsItem = /*@__PURE__*/ S.suspend(() =>
|
|
56
|
-
S.Struct({
|
|
57
|
-
updated: S.Number,
|
|
58
|
-
name: S.optional(S.String),
|
|
59
|
-
icons: S.optional(BotsInfoResponseBotsItemIcons),
|
|
60
|
-
deleted: S.Boolean,
|
|
61
|
-
app_id: S.optional(S.String),
|
|
62
|
-
id: S.String,
|
|
63
|
-
is_workflow_bot: S.optional(S.Boolean),
|
|
64
|
-
is_connector_bot: S.optional(S.Boolean),
|
|
65
|
-
is_legacy_workflow_bot: S.optional(S.Boolean),
|
|
66
|
-
user_id: S.optional(S.String),
|
|
67
|
-
}),
|
|
68
|
-
).annotate({ identifier: "BotsInfoResponseBotsItem" }) as any as S.Schema<BotsInfoResponseBotsItem>;
|
|
69
|
-
|
|
70
39
|
export type BotsInfoResponseBotsList = Array<BotsInfoResponseBotsItem>;
|
|
71
|
-
export const BotsInfoResponseBotsList = /*@__PURE__*/ S.Array(
|
|
72
|
-
BotsInfoResponseBotsItem,
|
|
73
|
-
) as any as S.Schema<BotsInfoResponseBotsList>;
|
|
74
|
-
|
|
75
40
|
export type BotsInfoResponseBotIcons = BotsInfoResponseBotsItemIcons;
|
|
76
|
-
export const BotsInfoResponseBotIcons = BotsInfoResponseBotsItemIcons;
|
|
77
|
-
|
|
78
41
|
export interface BotsInfoResponseBot {
|
|
79
42
|
updated: number;
|
|
80
43
|
user_id?: string;
|
|
@@ -87,46 +50,90 @@ export interface BotsInfoResponseBot {
|
|
|
87
50
|
is_connector_bot?: boolean;
|
|
88
51
|
is_legacy_workflow_bot?: boolean;
|
|
89
52
|
}
|
|
90
|
-
export const BotsInfoResponseBot = /*@__PURE__*/ S.suspend(() =>
|
|
91
|
-
S.Struct({
|
|
92
|
-
updated: S.Number,
|
|
93
|
-
user_id: S.optional(S.String),
|
|
94
|
-
name: S.optional(S.String),
|
|
95
|
-
icons: S.optional(BotsInfoResponseBotsItemIcons),
|
|
96
|
-
deleted: S.Boolean,
|
|
97
|
-
app_id: S.optional(S.String),
|
|
98
|
-
id: S.String,
|
|
99
|
-
is_workflow_bot: S.optional(S.Boolean),
|
|
100
|
-
is_connector_bot: S.optional(S.Boolean),
|
|
101
|
-
is_legacy_workflow_bot: S.optional(S.Boolean),
|
|
102
|
-
}),
|
|
103
|
-
).annotate({ identifier: "BotsInfoResponseBot" }) as any as S.Schema<BotsInfoResponseBot>;
|
|
104
|
-
|
|
105
53
|
export interface BotsInfoResponse {
|
|
106
54
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
107
55
|
ok: boolean;
|
|
108
56
|
bots?: BotsInfoResponseBotsList;
|
|
109
57
|
bot?: BotsInfoResponseBot;
|
|
110
58
|
}
|
|
111
|
-
export const BotsInfoResponse = /*@__PURE__*/ S.suspend(() =>
|
|
112
|
-
S.Struct({
|
|
113
|
-
ok: S.Boolean,
|
|
114
|
-
bots: S.optional(BotsInfoResponseBotsList),
|
|
115
|
-
bot: S.optional(BotsInfoResponseBot),
|
|
116
|
-
}),
|
|
117
|
-
).annotate({ identifier: "BotsInfoResponse" }) as any as S.Schema<BotsInfoResponse>;
|
|
118
|
-
|
|
119
59
|
export type BotsInfoError = SlackOpError;
|
|
120
|
-
/** Gets information about a bot user. Required scopes
|
|
60
|
+
/** Gets information about a bot user. Required scopes -- bot: `users:read`; user: `users:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `bot_not_found` -- Value passed for `bot` was invalid. - `bots_not_found` -- At least one value passed for `bots` was invalid. - `missing_argument` -- A required argument is missing. - `team_not_found` -- Value passed for `team_id` was invalid. See https://docs.slack.dev/reference/methods/bots.info */
|
|
121
61
|
export const botsInfo: API.OperationMethod<
|
|
122
62
|
BotsInfoRequest,
|
|
123
63
|
BotsInfoResponse,
|
|
124
64
|
BotsInfoError,
|
|
125
65
|
SlackOpContext
|
|
126
66
|
> = /*@__PURE__*/ API.make(() => ({
|
|
127
|
-
input: BotsInfoRequest
|
|
128
|
-
output: BotsInfoResponse
|
|
67
|
+
input: __S(0, __c0, 0) as any as S.Schema<BotsInfoRequest>,
|
|
68
|
+
output: __S(5, __c0, 5) as any as S.Schema<BotsInfoResponse>,
|
|
129
69
|
errors: [SlackError, SlackRateLimited],
|
|
130
70
|
protocol: SlackProtocol,
|
|
131
71
|
retry: Retry.Retry,
|
|
132
72
|
}));
|
|
73
|
+
|
|
74
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
75
|
+
function __c0(j: number): any {
|
|
76
|
+
switch (j) {
|
|
77
|
+
case 0:
|
|
78
|
+
return S.suspend(() =>
|
|
79
|
+
S.Struct({
|
|
80
|
+
bot: S.optional(S.String.pipe(T.Query())),
|
|
81
|
+
team_id: S.optional(S.String.pipe(T.Query())),
|
|
82
|
+
}).pipe(T.Http({ method: "GET", uri: "/bots.info", code: 200 })),
|
|
83
|
+
).annotate({ identifier: "BotsInfoRequest" });
|
|
84
|
+
case 1:
|
|
85
|
+
return S.suspend(() =>
|
|
86
|
+
S.Struct({
|
|
87
|
+
emoji: S.optional(S.String),
|
|
88
|
+
image_36: S.optional(S.String),
|
|
89
|
+
image_48: S.optional(S.String),
|
|
90
|
+
image_64: S.optional(S.String),
|
|
91
|
+
image_72: S.optional(S.String),
|
|
92
|
+
}),
|
|
93
|
+
).annotate({ identifier: "BotsInfoResponseBotsItemIcons" });
|
|
94
|
+
case 2:
|
|
95
|
+
return S.suspend(() =>
|
|
96
|
+
S.Struct({
|
|
97
|
+
updated: S.Number,
|
|
98
|
+
name: S.optional(S.String),
|
|
99
|
+
icons: S.optional(__S(1, __c0, 1)),
|
|
100
|
+
deleted: S.Boolean,
|
|
101
|
+
app_id: S.optional(S.String),
|
|
102
|
+
id: S.String,
|
|
103
|
+
is_workflow_bot: S.optional(S.Boolean),
|
|
104
|
+
is_connector_bot: S.optional(S.Boolean),
|
|
105
|
+
is_legacy_workflow_bot: S.optional(S.Boolean),
|
|
106
|
+
user_id: S.optional(S.String),
|
|
107
|
+
}),
|
|
108
|
+
).annotate({ identifier: "BotsInfoResponseBotsItem" });
|
|
109
|
+
case 3:
|
|
110
|
+
return S.Array(__S(2, __c0, 2));
|
|
111
|
+
case 4:
|
|
112
|
+
return S.suspend(() =>
|
|
113
|
+
S.Struct({
|
|
114
|
+
updated: S.Number,
|
|
115
|
+
user_id: S.optional(S.String),
|
|
116
|
+
name: S.optional(S.String),
|
|
117
|
+
icons: S.optional(__S(1, __c0, 1)),
|
|
118
|
+
deleted: S.Boolean,
|
|
119
|
+
app_id: S.optional(S.String),
|
|
120
|
+
id: S.String,
|
|
121
|
+
is_workflow_bot: S.optional(S.Boolean),
|
|
122
|
+
is_connector_bot: S.optional(S.Boolean),
|
|
123
|
+
is_legacy_workflow_bot: S.optional(S.Boolean),
|
|
124
|
+
}),
|
|
125
|
+
).annotate({ identifier: "BotsInfoResponseBot" });
|
|
126
|
+
case 5:
|
|
127
|
+
return S.suspend(() =>
|
|
128
|
+
S.Struct({
|
|
129
|
+
ok: S.Boolean,
|
|
130
|
+
bots: S.optional(__S(3, __c0, 3)),
|
|
131
|
+
bot: S.optional(__S(4, __c0, 4)),
|
|
132
|
+
}),
|
|
133
|
+
).annotate({ identifier: "BotsInfoResponse" });
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
137
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
138
|
+
return (__s[i] ??= __L.at(f, j));
|
|
139
|
+
}
|