@distilled.cloud/slack 1.0.0-rc.12 → 1.0.0-rc.14
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/README.md +34 -0
- package/lib/credentials.d.ts +2 -2
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +3 -3
- package/lib/credentials.js.map +1 -1
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -1
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +4 -4
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -4
- package/lib/index.js.map +1 -1
- package/lib/pagination.d.ts.map +1 -1
- package/lib/pagination.js.map +1 -1
- package/lib/protocol.d.ts +3 -3
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +23 -22
- package/lib/protocol.js.map +1 -1
- package/lib/protocol.test.d.ts +2 -0
- package/lib/protocol.test.d.ts.map +1 -0
- package/lib/protocol.test.js +288 -0
- package/lib/protocol.test.js.map +1 -0
- package/lib/retry.d.ts +1 -1
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +1 -1
- package/lib/retry.js.map +1 -1
- package/lib/services/admin.d.ts +236 -29
- package/lib/services/admin.d.ts.map +1 -1
- package/lib/services/admin.js +417 -749
- package/lib/services/admin.js.map +1 -1
- package/lib/services/agents.d.ts +423 -0
- package/lib/services/agents.d.ts.map +1 -0
- package/lib/services/agents.js +315 -0
- package/lib/services/agents.js.map +1 -0
- package/lib/services/api.d.ts +1 -1
- package/lib/services/api.d.ts.map +1 -1
- package/lib/services/api.js +4 -6
- package/lib/services/api.js.map +1 -1
- package/lib/services/apps.d.ts +21 -3
- package/lib/services/apps.d.ts.map +1 -1
- package/lib/services/apps.js +65 -133
- package/lib/services/apps.js.map +1 -1
- package/lib/services/assistant.d.ts +4 -4
- package/lib/services/assistant.d.ts.map +1 -1
- package/lib/services/assistant.js +16 -38
- package/lib/services/assistant.js.map +1 -1
- package/lib/services/auth.d.ts +2 -2
- package/lib/services/auth.d.ts.map +1 -1
- package/lib/services/auth.js +11 -28
- package/lib/services/auth.js.map +1 -1
- package/lib/services/blocks.d.ts +1 -1
- package/lib/services/blocks.d.ts.map +1 -1
- package/lib/services/blocks.js +5 -9
- package/lib/services/blocks.js.map +1 -1
- package/lib/services/bookmarks.d.ts +4 -4
- package/lib/services/bookmarks.d.ts.map +1 -1
- package/lib/services/bookmarks.js +14 -30
- package/lib/services/bookmarks.js.map +1 -1
- package/lib/services/bots.d.ts +1 -1
- package/lib/services/bots.d.ts.map +1 -1
- package/lib/services/bots.js +7 -15
- package/lib/services/bots.js.map +1 -1
- package/lib/services/calls.d.ts +1 -1
- package/lib/services/calls.d.ts.map +1 -1
- package/lib/services/calls.js +13 -33
- package/lib/services/calls.js.map +1 -1
- package/lib/services/canvases.d.ts +22 -2
- package/lib/services/canvases.d.ts.map +1 -1
- package/lib/services/canvases.js +37 -48
- package/lib/services/canvases.js.map +1 -1
- package/lib/services/chat.d.ts +29 -25
- package/lib/services/chat.d.ts.map +1 -1
- package/lib/services/chat.js +47 -95
- package/lib/services/chat.js.map +1 -1
- package/lib/services/conversations.d.ts +10 -8
- package/lib/services/conversations.d.ts.map +1 -1
- package/lib/services/conversations.js +43 -115
- package/lib/services/conversations.js.map +1 -1
- package/lib/services/dialog.d.ts +1 -1
- package/lib/services/dialog.d.ts.map +1 -1
- package/lib/services/dialog.js +5 -9
- package/lib/services/dialog.js.map +1 -1
- package/lib/services/dnd.d.ts +1 -1
- package/lib/services/dnd.d.ts.map +1 -1
- package/lib/services/dnd.js +10 -24
- package/lib/services/dnd.js.map +1 -1
- package/lib/services/emoji.d.ts +1 -1
- package/lib/services/emoji.d.ts.map +1 -1
- package/lib/services/emoji.js +6 -11
- package/lib/services/emoji.js.map +1 -1
- package/lib/services/entity.d.ts +1 -1
- package/lib/services/entity.d.ts.map +1 -1
- package/lib/services/entity.js +8 -20
- package/lib/services/entity.js.map +1 -1
- package/lib/services/files.d.ts +5 -5
- package/lib/services/files.d.ts.map +1 -1
- package/lib/services/files.js +39 -109
- package/lib/services/files.js.map +1 -1
- package/lib/services/functions.d.ts +1 -1
- package/lib/services/functions.d.ts.map +1 -1
- package/lib/services/functions.js +28 -75
- package/lib/services/functions.js.map +1 -1
- package/lib/services/index.d.ts +1 -0
- package/lib/services/index.d.ts.map +1 -1
- package/lib/services/index.js +1 -0
- package/lib/services/index.js.map +1 -1
- package/lib/services/lists.d.ts +5 -1
- package/lib/services/lists.d.ts.map +1 -1
- package/lib/services/lists.js +35 -146
- package/lib/services/lists.js.map +1 -1
- package/lib/services/migration.d.ts +1 -1
- package/lib/services/migration.d.ts.map +1 -1
- package/lib/services/migration.js +5 -8
- package/lib/services/migration.js.map +1 -1
- package/lib/services/oauth.d.ts +38 -2
- package/lib/services/oauth.d.ts.map +1 -1
- package/lib/services/oauth.js +67 -50
- package/lib/services/oauth.js.map +1 -1
- package/lib/services/openid.d.ts +1 -1
- package/lib/services/openid.d.ts.map +1 -1
- package/lib/services/openid.js +7 -15
- package/lib/services/openid.js.map +1 -1
- package/lib/services/pins.d.ts +1 -1
- package/lib/services/pins.d.ts.map +1 -1
- package/lib/services/pins.js +7 -15
- package/lib/services/pins.js.map +1 -1
- package/lib/services/reactions.d.ts +2 -2
- package/lib/services/reactions.d.ts.map +1 -1
- package/lib/services/reactions.js +13 -29
- package/lib/services/reactions.js.map +1 -1
- package/lib/services/reminders.d.ts +1 -1
- package/lib/services/reminders.d.ts.map +1 -1
- package/lib/services/reminders.js +13 -33
- package/lib/services/reminders.js.map +1 -1
- package/lib/services/rtm.d.ts +1 -1
- package/lib/services/rtm.d.ts.map +1 -1
- package/lib/services/rtm.js +9 -21
- package/lib/services/rtm.js.map +1 -1
- package/lib/services/search.d.ts +1 -1
- package/lib/services/search.d.ts.map +1 -1
- package/lib/services/search.js +13 -30
- package/lib/services/search.js.map +1 -1
- package/lib/services/stars.d.ts +1 -1
- package/lib/services/stars.d.ts.map +1 -1
- package/lib/services/stars.js +10 -20
- package/lib/services/stars.js.map +1 -1
- package/lib/services/team.d.ts +1 -1
- package/lib/services/team.d.ts.map +1 -1
- package/lib/services/team.js +25 -62
- package/lib/services/team.js.map +1 -1
- package/lib/services/tooling.d.ts +1 -1
- package/lib/services/tooling.d.ts.map +1 -1
- package/lib/services/tooling.js +5 -9
- package/lib/services/tooling.js.map +1 -1
- package/lib/services/usergroups.d.ts +8 -3
- package/lib/services/usergroups.d.ts.map +1 -1
- package/lib/services/usergroups.js +23 -51
- package/lib/services/usergroups.js.map +1 -1
- package/lib/services/users.d.ts +2 -2
- package/lib/services/users.d.ts.map +1 -1
- package/lib/services/users.js +28 -81
- package/lib/services/users.js.map +1 -1
- package/lib/services/views.d.ts +1 -1
- package/lib/services/views.d.ts.map +1 -1
- package/lib/services/views.js +11 -27
- package/lib/services/views.js.map +1 -1
- package/lib/services/workflows.d.ts +1 -1
- package/lib/services/workflows.d.ts.map +1 -1
- package/lib/services/workflows.js +27 -71
- package/lib/services/workflows.js.map +1 -1
- package/package.json +16 -12
- package/src/credentials.ts +8 -10
- package/src/errors.ts +17 -31
- package/src/index.ts +4 -8
- package/src/pagination.ts +2 -5
- package/src/protocol.test.ts +372 -0
- package/src/protocol.ts +56 -72
- package/src/retry.ts +4 -9
- package/src/services/admin.ts +1241 -1557
- package/src/services/agents.ts +853 -0
- package/src/services/api.ts +4 -10
- package/src/services/apps.ts +146 -243
- package/src/services/assistant.ts +93 -144
- package/src/services/auth.ts +12 -33
- package/src/services/blocks.ts +9 -24
- package/src/services/bookmarks.ts +14 -34
- package/src/services/bots.ts +7 -19
- package/src/services/calls.ts +15 -43
- package/src/services/canvases.ts +82 -85
- package/src/services/chat.ts +134 -254
- package/src/services/conversations.ts +101 -217
- package/src/services/dialog.ts +5 -13
- package/src/services/dnd.ts +11 -31
- package/src/services/emoji.ts +9 -19
- package/src/services/entity.ts +17 -45
- package/src/services/files.ts +72 -165
- package/src/services/functions.ts +95 -168
- package/src/services/index.ts +1 -0
- package/src/services/lists.ts +65 -208
- package/src/services/migration.ts +8 -17
- package/src/services/oauth.ts +127 -60
- package/src/services/openid.ts +12 -34
- package/src/services/pins.ts +7 -19
- package/src/services/reactions.ts +19 -43
- package/src/services/reminders.ts +13 -37
- package/src/services/rtm.ts +9 -25
- package/src/services/search.ts +51 -92
- package/src/services/stars.ts +20 -31
- package/src/services/team.ts +81 -155
- package/src/services/tooling.ts +5 -13
- package/src/services/usergroups.ts +37 -68
- package/src/services/users.ts +35 -102
- package/src/services/views.ts +11 -31
- package/src/services/workflows.ts +65 -129
|
@@ -1,14 +1,10 @@
|
|
|
1
|
+
import * as API from "@distilled.cloud/core/api";
|
|
1
2
|
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
2
3
|
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
-
import * as API from "@distilled.cloud/core/api";
|
|
4
|
-
import * as T from "../traits.ts";
|
|
5
|
-
import {
|
|
6
|
-
SlackProtocol,
|
|
7
|
-
type SlackOpError,
|
|
8
|
-
type SlackOpContext,
|
|
9
|
-
} from "../protocol.ts";
|
|
10
4
|
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
5
|
+
import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
11
6
|
import * as Retry from "../retry.ts";
|
|
7
|
+
import * as T from "../traits.ts";
|
|
12
8
|
|
|
13
9
|
export type { SlackOpError, SlackOpContext };
|
|
14
10
|
|
|
@@ -45,9 +41,7 @@ export const AddBookmarkRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
45
41
|
access_level: S.optional(AddBookmarkRequestAccessLevel),
|
|
46
42
|
parent_id: S.optional(S.String),
|
|
47
43
|
}).pipe(T.Http({ method: "POST", uri: "/bookmarks.add", code: 200 })),
|
|
48
|
-
).annotate({
|
|
49
|
-
identifier: "AddBookmarkRequest",
|
|
50
|
-
}) as any as S.Schema<AddBookmarkRequest>;
|
|
44
|
+
).annotate({ identifier: "AddBookmarkRequest" }) as any as S.Schema<AddBookmarkRequest>;
|
|
51
45
|
|
|
52
46
|
export interface AddBookmarkResponse {
|
|
53
47
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -59,9 +53,7 @@ export const AddBookmarkResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
59
53
|
ok: S.Boolean,
|
|
60
54
|
bookmark: S.Unknown,
|
|
61
55
|
}),
|
|
62
|
-
).annotate({
|
|
63
|
-
identifier: "AddBookmarkResponse",
|
|
64
|
-
}) as any as S.Schema<AddBookmarkResponse>;
|
|
56
|
+
).annotate({ identifier: "AddBookmarkResponse" }) as any as S.Schema<AddBookmarkResponse>;
|
|
65
57
|
|
|
66
58
|
export interface EditBookmarkRequest {
|
|
67
59
|
/** Channel to update bookmark in. Required for public channels. */
|
|
@@ -83,9 +75,7 @@ export const EditBookmarkRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
83
75
|
link: S.optional(S.String),
|
|
84
76
|
emoji: S.optional(S.String),
|
|
85
77
|
}).pipe(T.Http({ method: "POST", uri: "/bookmarks.edit", code: 200 })),
|
|
86
|
-
).annotate({
|
|
87
|
-
identifier: "EditBookmarkRequest",
|
|
88
|
-
}) as any as S.Schema<EditBookmarkRequest>;
|
|
78
|
+
).annotate({ identifier: "EditBookmarkRequest" }) as any as S.Schema<EditBookmarkRequest>;
|
|
89
79
|
|
|
90
80
|
export interface EditBookmarkResponse {
|
|
91
81
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -97,9 +87,7 @@ export const EditBookmarkResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
97
87
|
ok: S.Boolean,
|
|
98
88
|
bookmark: S.Unknown,
|
|
99
89
|
}),
|
|
100
|
-
).annotate({
|
|
101
|
-
identifier: "EditBookmarkResponse",
|
|
102
|
-
}) as any as S.Schema<EditBookmarkResponse>;
|
|
90
|
+
).annotate({ identifier: "EditBookmarkResponse" }) as any as S.Schema<EditBookmarkResponse>;
|
|
103
91
|
|
|
104
92
|
export interface ListBookmarksRequest {
|
|
105
93
|
/** Channel to list bookmarks in. Required for public channels. */
|
|
@@ -109,9 +97,7 @@ export const ListBookmarksRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
109
97
|
S.Struct({
|
|
110
98
|
channel_id: S.optional(S.String),
|
|
111
99
|
}).pipe(T.Http({ method: "POST", uri: "/bookmarks.list", code: 200 })),
|
|
112
|
-
).annotate({
|
|
113
|
-
identifier: "ListBookmarksRequest",
|
|
114
|
-
}) as any as S.Schema<ListBookmarksRequest>;
|
|
100
|
+
).annotate({ identifier: "ListBookmarksRequest" }) as any as S.Schema<ListBookmarksRequest>;
|
|
115
101
|
|
|
116
102
|
export type ListBookmarksResponseBookmarksList = Array<unknown>;
|
|
117
103
|
export const ListBookmarksResponseBookmarksList = /*@__PURE__*/ S.Array(
|
|
@@ -128,9 +114,7 @@ export const ListBookmarksResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
128
114
|
ok: S.Boolean,
|
|
129
115
|
bookmarks: ListBookmarksResponseBookmarksList,
|
|
130
116
|
}),
|
|
131
|
-
).annotate({
|
|
132
|
-
identifier: "ListBookmarksResponse",
|
|
133
|
-
}) as any as S.Schema<ListBookmarksResponse>;
|
|
117
|
+
).annotate({ identifier: "ListBookmarksResponse" }) as any as S.Schema<ListBookmarksResponse>;
|
|
134
118
|
|
|
135
119
|
export interface RemoveBookmarkRequest {
|
|
136
120
|
/** Channel to remove bookmark. Required for public channels. */
|
|
@@ -146,9 +130,7 @@ export const RemoveBookmarkRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
146
130
|
bookmark_id: S.optional(S.String),
|
|
147
131
|
quip_section_id: S.optional(S.String),
|
|
148
132
|
}).pipe(T.Http({ method: "POST", uri: "/bookmarks.remove", code: 200 })),
|
|
149
|
-
).annotate({
|
|
150
|
-
identifier: "RemoveBookmarkRequest",
|
|
151
|
-
}) as any as S.Schema<RemoveBookmarkRequest>;
|
|
133
|
+
).annotate({ identifier: "RemoveBookmarkRequest" }) as any as S.Schema<RemoveBookmarkRequest>;
|
|
152
134
|
|
|
153
135
|
export interface RemoveBookmarkResponse {
|
|
154
136
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -158,12 +140,10 @@ export const RemoveBookmarkResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
158
140
|
S.Struct({
|
|
159
141
|
ok: S.Boolean,
|
|
160
142
|
}),
|
|
161
|
-
).annotate({
|
|
162
|
-
identifier: "RemoveBookmarkResponse",
|
|
163
|
-
}) as any as S.Schema<RemoveBookmarkResponse>;
|
|
143
|
+
).annotate({ identifier: "RemoveBookmarkResponse" }) as any as S.Schema<RemoveBookmarkResponse>;
|
|
164
144
|
|
|
165
145
|
export type AddBookmarkError = SlackOpError;
|
|
166
|
-
/** 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. - `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 */
|
|
146
|
+
/** 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 */
|
|
167
147
|
export const addBookmark: API.OperationMethod<
|
|
168
148
|
AddBookmarkRequest,
|
|
169
149
|
AddBookmarkResponse,
|
|
@@ -178,7 +158,7 @@ export const addBookmark: API.OperationMethod<
|
|
|
178
158
|
}));
|
|
179
159
|
|
|
180
160
|
export type EditBookmarkError = SlackOpError;
|
|
181
|
-
/** 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. - `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 */
|
|
161
|
+
/** 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 */
|
|
182
162
|
export const editBookmark: API.OperationMethod<
|
|
183
163
|
EditBookmarkRequest,
|
|
184
164
|
EditBookmarkResponse,
|
|
@@ -208,7 +188,7 @@ export const listBookmarks: API.OperationMethod<
|
|
|
208
188
|
}));
|
|
209
189
|
|
|
210
190
|
export type RemoveBookmarkError = SlackOpError;
|
|
211
|
-
/** 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. See https://docs.slack.dev/reference/methods/bookmarks.remove */
|
|
191
|
+
/** 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 */
|
|
212
192
|
export const removeBookmark: API.OperationMethod<
|
|
213
193
|
RemoveBookmarkRequest,
|
|
214
194
|
RemoveBookmarkResponse,
|
package/src/services/bots.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
+
import * as API from "@distilled.cloud/core/api";
|
|
1
2
|
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
2
3
|
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
-
import * as API from "@distilled.cloud/core/api";
|
|
4
|
-
import * as T from "../traits.ts";
|
|
5
|
-
import {
|
|
6
|
-
SlackProtocol,
|
|
7
|
-
type SlackOpError,
|
|
8
|
-
type SlackOpContext,
|
|
9
|
-
} from "../protocol.ts";
|
|
10
4
|
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
5
|
+
import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
11
6
|
import * as Retry from "../retry.ts";
|
|
7
|
+
import * as T from "../traits.ts";
|
|
12
8
|
|
|
13
9
|
export type { SlackOpError, SlackOpContext };
|
|
14
10
|
|
|
@@ -23,9 +19,7 @@ export const BotsInfoRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
23
19
|
bot: S.optional(S.String.pipe(T.Query())),
|
|
24
20
|
team_id: S.optional(S.String.pipe(T.Query())),
|
|
25
21
|
}).pipe(T.Http({ method: "GET", uri: "/bots.info", code: 200 })),
|
|
26
|
-
).annotate({
|
|
27
|
-
identifier: "BotsInfoRequest",
|
|
28
|
-
}) as any as S.Schema<BotsInfoRequest>;
|
|
22
|
+
).annotate({ identifier: "BotsInfoRequest" }) as any as S.Schema<BotsInfoRequest>;
|
|
29
23
|
|
|
30
24
|
export interface BotsInfoResponseBotsItemIcons {
|
|
31
25
|
emoji?: string;
|
|
@@ -71,9 +65,7 @@ export const BotsInfoResponseBotsItem = /*@__PURE__*/ S.suspend(() =>
|
|
|
71
65
|
is_legacy_workflow_bot: S.optional(S.Boolean),
|
|
72
66
|
user_id: S.optional(S.String),
|
|
73
67
|
}),
|
|
74
|
-
).annotate({
|
|
75
|
-
identifier: "BotsInfoResponseBotsItem",
|
|
76
|
-
}) as any as S.Schema<BotsInfoResponseBotsItem>;
|
|
68
|
+
).annotate({ identifier: "BotsInfoResponseBotsItem" }) as any as S.Schema<BotsInfoResponseBotsItem>;
|
|
77
69
|
|
|
78
70
|
export type BotsInfoResponseBotsList = Array<BotsInfoResponseBotsItem>;
|
|
79
71
|
export const BotsInfoResponseBotsList = /*@__PURE__*/ S.Array(
|
|
@@ -108,9 +100,7 @@ export const BotsInfoResponseBot = /*@__PURE__*/ S.suspend(() =>
|
|
|
108
100
|
is_connector_bot: S.optional(S.Boolean),
|
|
109
101
|
is_legacy_workflow_bot: S.optional(S.Boolean),
|
|
110
102
|
}),
|
|
111
|
-
).annotate({
|
|
112
|
-
identifier: "BotsInfoResponseBot",
|
|
113
|
-
}) as any as S.Schema<BotsInfoResponseBot>;
|
|
103
|
+
).annotate({ identifier: "BotsInfoResponseBot" }) as any as S.Schema<BotsInfoResponseBot>;
|
|
114
104
|
|
|
115
105
|
export interface BotsInfoResponse {
|
|
116
106
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -124,9 +114,7 @@ export const BotsInfoResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
124
114
|
bots: S.optional(BotsInfoResponseBotsList),
|
|
125
115
|
bot: S.optional(BotsInfoResponseBot),
|
|
126
116
|
}),
|
|
127
|
-
).annotate({
|
|
128
|
-
identifier: "BotsInfoResponse",
|
|
129
|
-
}) as any as S.Schema<BotsInfoResponse>;
|
|
117
|
+
).annotate({ identifier: "BotsInfoResponse" }) as any as S.Schema<BotsInfoResponse>;
|
|
130
118
|
|
|
131
119
|
export type BotsInfoError = SlackOpError;
|
|
132
120
|
/** 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 */
|
package/src/services/calls.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
+
import * as API from "@distilled.cloud/core/api";
|
|
1
2
|
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
2
3
|
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
-
import * as API from "@distilled.cloud/core/api";
|
|
4
|
-
import * as T from "../traits.ts";
|
|
5
|
-
import {
|
|
6
|
-
SlackProtocol,
|
|
7
|
-
type SlackOpError,
|
|
8
|
-
type SlackOpContext,
|
|
9
|
-
} from "../protocol.ts";
|
|
10
4
|
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
5
|
+
import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
11
6
|
import * as Retry from "../retry.ts";
|
|
7
|
+
import * as T from "../traits.ts";
|
|
12
8
|
|
|
13
9
|
export type { SlackOpError, SlackOpContext };
|
|
14
10
|
|
|
@@ -59,9 +55,7 @@ export const AddCallResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
59
55
|
ok: S.Boolean,
|
|
60
56
|
call: S.Unknown,
|
|
61
57
|
}),
|
|
62
|
-
).annotate({
|
|
63
|
-
identifier: "AddCallResponse",
|
|
64
|
-
}) as any as S.Schema<AddCallResponse>;
|
|
58
|
+
).annotate({ identifier: "AddCallResponse" }) as any as S.Schema<AddCallResponse>;
|
|
65
59
|
|
|
66
60
|
/** The list of users to add as participants in the Call. [Read more on how to specify users here](/apis/web-api/using-the-calls-api#users). */
|
|
67
61
|
export type AddParticipantRequestUsersList = Array<unknown>;
|
|
@@ -79,12 +73,8 @@ export const AddParticipantRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
79
73
|
S.Struct({
|
|
80
74
|
id: S.String,
|
|
81
75
|
users: AddParticipantRequestUsersList,
|
|
82
|
-
}).pipe(
|
|
83
|
-
|
|
84
|
-
),
|
|
85
|
-
).annotate({
|
|
86
|
-
identifier: "AddParticipantRequest",
|
|
87
|
-
}) as any as S.Schema<AddParticipantRequest>;
|
|
76
|
+
}).pipe(T.Http({ method: "POST", uri: "/calls.participants.add", code: 200 })),
|
|
77
|
+
).annotate({ identifier: "AddParticipantRequest" }) as any as S.Schema<AddParticipantRequest>;
|
|
88
78
|
|
|
89
79
|
export interface AddParticipantResponse {
|
|
90
80
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -96,9 +86,7 @@ export const AddParticipantResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
96
86
|
ok: S.Boolean,
|
|
97
87
|
call: S.Unknown,
|
|
98
88
|
}),
|
|
99
|
-
).annotate({
|
|
100
|
-
identifier: "AddParticipantResponse",
|
|
101
|
-
}) as any as S.Schema<AddParticipantResponse>;
|
|
89
|
+
).annotate({ identifier: "AddParticipantResponse" }) as any as S.Schema<AddParticipantResponse>;
|
|
102
90
|
|
|
103
91
|
export interface CallsEndRequest {
|
|
104
92
|
/** `id` returned when registering the call using the [`calls.add`](/reference/methods/calls.add) method. */
|
|
@@ -111,9 +99,7 @@ export const CallsEndRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
111
99
|
id: S.String,
|
|
112
100
|
duration: S.optional(S.Number),
|
|
113
101
|
}).pipe(T.Http({ method: "POST", uri: "/calls.end", code: 200 })),
|
|
114
|
-
).annotate({
|
|
115
|
-
identifier: "CallsEndRequest",
|
|
116
|
-
}) as any as S.Schema<CallsEndRequest>;
|
|
102
|
+
).annotate({ identifier: "CallsEndRequest" }) as any as S.Schema<CallsEndRequest>;
|
|
117
103
|
|
|
118
104
|
export interface CallsEndResponse {
|
|
119
105
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -125,9 +111,7 @@ export const CallsEndResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
125
111
|
ok: S.Boolean,
|
|
126
112
|
call: S.Unknown,
|
|
127
113
|
}),
|
|
128
|
-
).annotate({
|
|
129
|
-
identifier: "CallsEndResponse",
|
|
130
|
-
}) as any as S.Schema<CallsEndResponse>;
|
|
114
|
+
).annotate({ identifier: "CallsEndResponse" }) as any as S.Schema<CallsEndResponse>;
|
|
131
115
|
|
|
132
116
|
export interface CallsInfoRequest {
|
|
133
117
|
/** `id` of the Call returned by the [`calls.add`](/reference/methods/calls.add) method. */
|
|
@@ -137,9 +121,7 @@ export const CallsInfoRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
137
121
|
S.Struct({
|
|
138
122
|
id: S.String,
|
|
139
123
|
}).pipe(T.Http({ method: "POST", uri: "/calls.info", code: 200 })),
|
|
140
|
-
).annotate({
|
|
141
|
-
identifier: "CallsInfoRequest",
|
|
142
|
-
}) as any as S.Schema<CallsInfoRequest>;
|
|
124
|
+
).annotate({ identifier: "CallsInfoRequest" }) as any as S.Schema<CallsInfoRequest>;
|
|
143
125
|
|
|
144
126
|
export interface CallsInfoResponse {
|
|
145
127
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -151,9 +133,7 @@ export const CallsInfoResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
151
133
|
ok: S.Boolean,
|
|
152
134
|
call: S.Unknown,
|
|
153
135
|
}),
|
|
154
|
-
).annotate({
|
|
155
|
-
identifier: "CallsInfoResponse",
|
|
156
|
-
}) as any as S.Schema<CallsInfoResponse>;
|
|
136
|
+
).annotate({ identifier: "CallsInfoResponse" }) as any as S.Schema<CallsInfoResponse>;
|
|
157
137
|
|
|
158
138
|
/** The list of users to remove as participants in the Call. [Read more on how to specify users here](/apis/web-api/using-the-calls-api#users). */
|
|
159
139
|
export type RemoveParticipantRequestUsersList = Array<unknown>;
|
|
@@ -171,12 +151,8 @@ export const RemoveParticipantRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
171
151
|
S.Struct({
|
|
172
152
|
id: S.String,
|
|
173
153
|
users: RemoveParticipantRequestUsersList,
|
|
174
|
-
}).pipe(
|
|
175
|
-
|
|
176
|
-
),
|
|
177
|
-
).annotate({
|
|
178
|
-
identifier: "RemoveParticipantRequest",
|
|
179
|
-
}) as any as S.Schema<RemoveParticipantRequest>;
|
|
154
|
+
}).pipe(T.Http({ method: "POST", uri: "/calls.participants.remove", code: 200 })),
|
|
155
|
+
).annotate({ identifier: "RemoveParticipantRequest" }) as any as S.Schema<RemoveParticipantRequest>;
|
|
180
156
|
|
|
181
157
|
export interface RemoveParticipantResponse {
|
|
182
158
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -209,9 +185,7 @@ export const UpdateCallRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
209
185
|
join_url: S.optional(S.String),
|
|
210
186
|
desktop_app_join_url: S.optional(S.String),
|
|
211
187
|
}).pipe(T.Http({ method: "POST", uri: "/calls.update", code: 200 })),
|
|
212
|
-
).annotate({
|
|
213
|
-
identifier: "UpdateCallRequest",
|
|
214
|
-
}) as any as S.Schema<UpdateCallRequest>;
|
|
188
|
+
).annotate({ identifier: "UpdateCallRequest" }) as any as S.Schema<UpdateCallRequest>;
|
|
215
189
|
|
|
216
190
|
export interface UpdateCallResponse {
|
|
217
191
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -223,9 +197,7 @@ export const UpdateCallResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
223
197
|
ok: S.Boolean,
|
|
224
198
|
call: S.Unknown,
|
|
225
199
|
}),
|
|
226
|
-
).annotate({
|
|
227
|
-
identifier: "UpdateCallResponse",
|
|
228
|
-
}) as any as S.Schema<UpdateCallResponse>;
|
|
200
|
+
).annotate({ identifier: "UpdateCallResponse" }) as any as S.Schema<UpdateCallResponse>;
|
|
229
201
|
|
|
230
202
|
export type AddCallError = SlackOpError;
|
|
231
203
|
/** Registers a new Call. Required scopes — bot: `calls:write`; user: `calls:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `internal_error` — An unexpected error has occurred while trying to register the Call. - `invalid_created_by` — The `created_by` user ID is invalid. - `invalid_start_time` — The start time is invalid. - `not_authorized` — The specified user is not authorized to create a Call in this channel. - `not_implemented` — This method is not available. - `user_not_found` — A specified user wasn't found. See https://docs.slack.dev/reference/methods/calls.add */
|
package/src/services/canvases.ts
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
+
import * as API from "@distilled.cloud/core/api";
|
|
1
2
|
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
2
3
|
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
-
import * as API from "@distilled.cloud/core/api";
|
|
4
|
-
import * as T from "../traits.ts";
|
|
5
|
-
import {
|
|
6
|
-
SlackProtocol,
|
|
7
|
-
type SlackOpError,
|
|
8
|
-
type SlackOpContext,
|
|
9
|
-
} from "../protocol.ts";
|
|
10
4
|
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
5
|
+
import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
11
6
|
import * as Retry from "../retry.ts";
|
|
7
|
+
import * as T from "../traits.ts";
|
|
12
8
|
|
|
13
9
|
export type { SlackOpError, SlackOpContext };
|
|
14
10
|
|
|
@@ -26,9 +22,7 @@ export const CreateCanvaseRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
26
22
|
document_content: S.optional(S.Unknown),
|
|
27
23
|
channel_id: S.optional(S.String),
|
|
28
24
|
}).pipe(T.Http({ method: "POST", uri: "/canvases.create", code: 200 })),
|
|
29
|
-
).annotate({
|
|
30
|
-
identifier: "CreateCanvaseRequest",
|
|
31
|
-
}) as any as S.Schema<CreateCanvaseRequest>;
|
|
25
|
+
).annotate({ identifier: "CreateCanvaseRequest" }) as any as S.Schema<CreateCanvaseRequest>;
|
|
32
26
|
|
|
33
27
|
export interface CreateCanvaseResponse {
|
|
34
28
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -41,9 +35,7 @@ export const CreateCanvaseResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
41
35
|
ok: S.Boolean,
|
|
42
36
|
canvas_id: S.String,
|
|
43
37
|
}),
|
|
44
|
-
).annotate({
|
|
45
|
-
identifier: "CreateCanvaseResponse",
|
|
46
|
-
}) as any as S.Schema<CreateCanvaseResponse>;
|
|
38
|
+
).annotate({ identifier: "CreateCanvaseResponse" }) as any as S.Schema<CreateCanvaseResponse>;
|
|
47
39
|
|
|
48
40
|
/** List of channels you wish to update access for */
|
|
49
41
|
export type DeleteAccessRequestChannelIdsList = Array<string>;
|
|
@@ -70,26 +62,20 @@ export const DeleteAccessRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
70
62
|
canvas_id: S.String,
|
|
71
63
|
channel_ids: S.optional(DeleteAccessRequestChannelIdsList),
|
|
72
64
|
user_ids: S.optional(DeleteAccessRequestUserIdsList),
|
|
73
|
-
}).pipe(
|
|
74
|
-
|
|
75
|
-
),
|
|
76
|
-
).annotate({
|
|
77
|
-
identifier: "DeleteAccessRequest",
|
|
78
|
-
}) as any as S.Schema<DeleteAccessRequest>;
|
|
65
|
+
}).pipe(T.Http({ method: "POST", uri: "/canvases.access.delete", code: 200 })),
|
|
66
|
+
).annotate({ identifier: "DeleteAccessRequest" }) as any as S.Schema<DeleteAccessRequest>;
|
|
79
67
|
|
|
80
68
|
/** The channel IDs that could not be updated */
|
|
81
69
|
export type DeleteAccessResponseFailedToUpdateChannelIdsList = Array<string>;
|
|
82
|
-
export const DeleteAccessResponseFailedToUpdateChannelIdsList =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
) as any as S.Schema<DeleteAccessResponseFailedToUpdateChannelIdsList>;
|
|
70
|
+
export const DeleteAccessResponseFailedToUpdateChannelIdsList = /*@__PURE__*/ S.Array(
|
|
71
|
+
S.String,
|
|
72
|
+
) as any as S.Schema<DeleteAccessResponseFailedToUpdateChannelIdsList>;
|
|
86
73
|
|
|
87
74
|
/** The user IDs that could not be updated */
|
|
88
75
|
export type DeleteAccessResponseFailedToUpdateUserIdsList = Array<string>;
|
|
89
|
-
export const DeleteAccessResponseFailedToUpdateUserIdsList =
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
) as any as S.Schema<DeleteAccessResponseFailedToUpdateUserIdsList>;
|
|
76
|
+
export const DeleteAccessResponseFailedToUpdateUserIdsList = /*@__PURE__*/ S.Array(
|
|
77
|
+
S.String,
|
|
78
|
+
) as any as S.Schema<DeleteAccessResponseFailedToUpdateUserIdsList>;
|
|
93
79
|
|
|
94
80
|
export interface DeleteAccessResponse {
|
|
95
81
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -102,16 +88,10 @@ export interface DeleteAccessResponse {
|
|
|
102
88
|
export const DeleteAccessResponse = /*@__PURE__*/ S.suspend(() =>
|
|
103
89
|
S.Struct({
|
|
104
90
|
ok: S.Boolean,
|
|
105
|
-
failed_to_update_channel_ids: S.optional(
|
|
106
|
-
|
|
107
|
-
),
|
|
108
|
-
failed_to_update_user_ids: S.optional(
|
|
109
|
-
DeleteAccessResponseFailedToUpdateUserIdsList,
|
|
110
|
-
),
|
|
91
|
+
failed_to_update_channel_ids: S.optional(DeleteAccessResponseFailedToUpdateChannelIdsList),
|
|
92
|
+
failed_to_update_user_ids: S.optional(DeleteAccessResponseFailedToUpdateUserIdsList),
|
|
111
93
|
}),
|
|
112
|
-
).annotate({
|
|
113
|
-
identifier: "DeleteAccessResponse",
|
|
114
|
-
}) as any as S.Schema<DeleteAccessResponse>;
|
|
94
|
+
).annotate({ identifier: "DeleteAccessResponse" }) as any as S.Schema<DeleteAccessResponse>;
|
|
115
95
|
|
|
116
96
|
export interface DeleteCanvaseRequest {
|
|
117
97
|
/** Encoded ID of the canvas */
|
|
@@ -121,9 +101,7 @@ export const DeleteCanvaseRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
121
101
|
S.Struct({
|
|
122
102
|
canvas_id: S.String,
|
|
123
103
|
}).pipe(T.Http({ method: "POST", uri: "/canvases.delete", code: 200 })),
|
|
124
|
-
).annotate({
|
|
125
|
-
identifier: "DeleteCanvaseRequest",
|
|
126
|
-
}) as any as S.Schema<DeleteCanvaseRequest>;
|
|
104
|
+
).annotate({ identifier: "DeleteCanvaseRequest" }) as any as S.Schema<DeleteCanvaseRequest>;
|
|
127
105
|
|
|
128
106
|
export interface DeleteCanvaseResponse {
|
|
129
107
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -133,9 +111,7 @@ export const DeleteCanvaseResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
133
111
|
S.Struct({
|
|
134
112
|
ok: S.Boolean,
|
|
135
113
|
}),
|
|
136
|
-
).annotate({
|
|
137
|
-
identifier: "DeleteCanvaseResponse",
|
|
138
|
-
}) as any as S.Schema<DeleteCanvaseResponse>;
|
|
114
|
+
).annotate({ identifier: "DeleteCanvaseResponse" }) as any as S.Schema<DeleteCanvaseResponse>;
|
|
139
115
|
|
|
140
116
|
/** List of changes to apply on the specified canvas. The markdown content of each change is limited to 1 MiB (1,048,576 characters). */
|
|
141
117
|
export type EditCanvaseRequestChangesList = Array<unknown>;
|
|
@@ -154,9 +130,7 @@ export const EditCanvaseRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
154
130
|
canvas_id: S.String,
|
|
155
131
|
changes: EditCanvaseRequestChangesList,
|
|
156
132
|
}).pipe(T.Http({ method: "POST", uri: "/canvases.edit", code: 200 })),
|
|
157
|
-
).annotate({
|
|
158
|
-
identifier: "EditCanvaseRequest",
|
|
159
|
-
}) as any as S.Schema<EditCanvaseRequest>;
|
|
133
|
+
).annotate({ identifier: "EditCanvaseRequest" }) as any as S.Schema<EditCanvaseRequest>;
|
|
160
134
|
|
|
161
135
|
export interface EditCanvaseResponse {
|
|
162
136
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
@@ -166,9 +140,37 @@ export const EditCanvaseResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
166
140
|
S.Struct({
|
|
167
141
|
ok: S.Boolean,
|
|
168
142
|
}),
|
|
169
|
-
).annotate({
|
|
170
|
-
|
|
171
|
-
|
|
143
|
+
).annotate({ identifier: "EditCanvaseResponse" }) as any as S.Schema<EditCanvaseResponse>;
|
|
144
|
+
|
|
145
|
+
/** Format in which to return the canvas content. Defaults to markdown. */
|
|
146
|
+
export type GetContentRequestContentType = "html" | "markdown";
|
|
147
|
+
export const GetContentRequestContentType = S.String;
|
|
148
|
+
|
|
149
|
+
export interface GetContentRequest {
|
|
150
|
+
/** Encoded ID of the canvas */
|
|
151
|
+
canvas_id: string;
|
|
152
|
+
/** Format in which to return the canvas content. Defaults to markdown. */
|
|
153
|
+
content_type?: GetContentRequestContentType | (string & {});
|
|
154
|
+
}
|
|
155
|
+
export const GetContentRequest = /*@__PURE__*/ S.suspend(() =>
|
|
156
|
+
S.Struct({
|
|
157
|
+
canvas_id: S.String,
|
|
158
|
+
content_type: S.optional(GetContentRequestContentType),
|
|
159
|
+
}).pipe(T.Http({ method: "POST", uri: "/canvases.getContent", code: 200 })),
|
|
160
|
+
).annotate({ identifier: "GetContentRequest" }) as any as S.Schema<GetContentRequest>;
|
|
161
|
+
|
|
162
|
+
export interface GetContentResponse {
|
|
163
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
164
|
+
ok: boolean;
|
|
165
|
+
/** The content of the canvas in the requested content_type. */
|
|
166
|
+
content: string;
|
|
167
|
+
}
|
|
168
|
+
export const GetContentResponse = /*@__PURE__*/ S.suspend(() =>
|
|
169
|
+
S.Struct({
|
|
170
|
+
ok: S.Boolean,
|
|
171
|
+
content: S.String,
|
|
172
|
+
}),
|
|
173
|
+
).annotate({ identifier: "GetContentResponse" }) as any as S.Schema<GetContentResponse>;
|
|
172
174
|
|
|
173
175
|
export interface LookupSectionRequest {
|
|
174
176
|
/** Encoded ID of the canvas */
|
|
@@ -180,20 +182,14 @@ export const LookupSectionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
180
182
|
S.Struct({
|
|
181
183
|
canvas_id: S.String,
|
|
182
184
|
criteria: S.Unknown,
|
|
183
|
-
}).pipe(
|
|
184
|
-
|
|
185
|
-
),
|
|
186
|
-
).annotate({
|
|
187
|
-
identifier: "LookupSectionRequest",
|
|
188
|
-
}) as any as S.Schema<LookupSectionRequest>;
|
|
185
|
+
}).pipe(T.Http({ method: "POST", uri: "/canvases.sections.lookup", code: 200 })),
|
|
186
|
+
).annotate({ identifier: "LookupSectionRequest" }) as any as S.Schema<LookupSectionRequest>;
|
|
189
187
|
|
|
190
188
|
/** IDs of child sections within a layout container (blockquote, callout, flexbox, or table). */
|
|
191
|
-
export type LookupSectionResponseSectionsItemChildSectionIdsList =
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
S.String,
|
|
196
|
-
) as any as S.Schema<LookupSectionResponseSectionsItemChildSectionIdsList>;
|
|
189
|
+
export type LookupSectionResponseSectionsItemChildSectionIdsList = Array<string>;
|
|
190
|
+
export const LookupSectionResponseSectionsItemChildSectionIdsList = /*@__PURE__*/ S.Array(
|
|
191
|
+
S.String,
|
|
192
|
+
) as any as S.Schema<LookupSectionResponseSectionsItemChildSectionIdsList>;
|
|
197
193
|
|
|
198
194
|
export interface LookupSectionResponseSectionsItem {
|
|
199
195
|
id: string;
|
|
@@ -203,17 +199,14 @@ export interface LookupSectionResponseSectionsItem {
|
|
|
203
199
|
export const LookupSectionResponseSectionsItem = /*@__PURE__*/ S.suspend(() =>
|
|
204
200
|
S.Struct({
|
|
205
201
|
id: S.String,
|
|
206
|
-
child_section_ids: S.optional(
|
|
207
|
-
LookupSectionResponseSectionsItemChildSectionIdsList,
|
|
208
|
-
),
|
|
202
|
+
child_section_ids: S.optional(LookupSectionResponseSectionsItemChildSectionIdsList),
|
|
209
203
|
}),
|
|
210
204
|
).annotate({
|
|
211
205
|
identifier: "LookupSectionResponseSectionsItem",
|
|
212
206
|
}) as any as S.Schema<LookupSectionResponseSectionsItem>;
|
|
213
207
|
|
|
214
208
|
/** Sections in the canvas that match the provided criteria */
|
|
215
|
-
export type LookupSectionResponseSectionsList =
|
|
216
|
-
Array<LookupSectionResponseSectionsItem>;
|
|
209
|
+
export type LookupSectionResponseSectionsList = Array<LookupSectionResponseSectionsItem>;
|
|
217
210
|
export const LookupSectionResponseSectionsList = /*@__PURE__*/ S.Array(
|
|
218
211
|
LookupSectionResponseSectionsItem,
|
|
219
212
|
) as any as S.Schema<LookupSectionResponseSectionsList>;
|
|
@@ -229,9 +222,7 @@ export const LookupSectionResponse = /*@__PURE__*/ S.suspend(() =>
|
|
|
229
222
|
ok: S.Boolean,
|
|
230
223
|
sections: LookupSectionResponseSectionsList,
|
|
231
224
|
}),
|
|
232
|
-
).annotate({
|
|
233
|
-
identifier: "LookupSectionResponse",
|
|
234
|
-
}) as any as S.Schema<LookupSectionResponse>;
|
|
225
|
+
).annotate({ identifier: "LookupSectionResponse" }) as any as S.Schema<LookupSectionResponse>;
|
|
235
226
|
|
|
236
227
|
/** List of channels you wish to update access for. Can only be used if user_ids is not provided. */
|
|
237
228
|
export type SetAccessRequestChannelIdsList = Array<string>;
|
|
@@ -262,16 +253,13 @@ export const SetAccessRequest = /*@__PURE__*/ S.suspend(() =>
|
|
|
262
253
|
channel_ids: S.optional(SetAccessRequestChannelIdsList),
|
|
263
254
|
user_ids: S.optional(SetAccessRequestUserIdsList),
|
|
264
255
|
}).pipe(T.Http({ method: "POST", uri: "/canvases.access.set", code: 200 })),
|
|
265
|
-
).annotate({
|
|
266
|
-
identifier: "SetAccessRequest",
|
|
267
|
-
}) as any as S.Schema<SetAccessRequest>;
|
|
256
|
+
).annotate({ identifier: "SetAccessRequest" }) as any as S.Schema<SetAccessRequest>;
|
|
268
257
|
|
|
269
258
|
/** The channel IDs that could not be updated */
|
|
270
259
|
export type SetAccessResponseFailedToUpdateChannelIdsList = Array<string>;
|
|
271
|
-
export const SetAccessResponseFailedToUpdateChannelIdsList =
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
) as any as S.Schema<SetAccessResponseFailedToUpdateChannelIdsList>;
|
|
260
|
+
export const SetAccessResponseFailedToUpdateChannelIdsList = /*@__PURE__*/ S.Array(
|
|
261
|
+
S.String,
|
|
262
|
+
) as any as S.Schema<SetAccessResponseFailedToUpdateChannelIdsList>;
|
|
275
263
|
|
|
276
264
|
/** The user IDs that could not be updated */
|
|
277
265
|
export type SetAccessResponseFailedToUpdateUserIdsList = Array<string>;
|
|
@@ -290,19 +278,13 @@ export interface SetAccessResponse {
|
|
|
290
278
|
export const SetAccessResponse = /*@__PURE__*/ S.suspend(() =>
|
|
291
279
|
S.Struct({
|
|
292
280
|
ok: S.Boolean,
|
|
293
|
-
failed_to_update_channel_ids: S.optional(
|
|
294
|
-
|
|
295
|
-
),
|
|
296
|
-
failed_to_update_user_ids: S.optional(
|
|
297
|
-
SetAccessResponseFailedToUpdateUserIdsList,
|
|
298
|
-
),
|
|
281
|
+
failed_to_update_channel_ids: S.optional(SetAccessResponseFailedToUpdateChannelIdsList),
|
|
282
|
+
failed_to_update_user_ids: S.optional(SetAccessResponseFailedToUpdateUserIdsList),
|
|
299
283
|
}),
|
|
300
|
-
).annotate({
|
|
301
|
-
identifier: "SetAccessResponse",
|
|
302
|
-
}) as any as S.Schema<SetAccessResponse>;
|
|
284
|
+
).annotate({ identifier: "SetAccessResponse" }) as any as S.Schema<SetAccessResponse>;
|
|
303
285
|
|
|
304
286
|
export type CreateCanvaseError = SlackOpError;
|
|
305
|
-
/** Create canvas for a user Required scopes — bot: `canvases:write`; user: `canvases:write`; seamless_user: `seamless.user` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `canvas_disabled_user_team` — Canvas is disabled on user's team - `restricted_action` — User does not have permission to perform this action. - `canvas_creation_failed` — Canvas was unable to be created. - `
|
|
287
|
+
/** Create canvas for a user Required scopes — bot: `canvases:write`; user: `canvases:write`; seamless_user: `seamless.user` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `canvas_disabled_user_team` — Canvas is disabled on user's team - `restricted_action` — User does not have permission to perform this action. - `canvas_creation_failed` — Canvas was unable to be created. - `free_team_canvas_tab_already_exists` — Free teams are limited to one canvas tab per channel - `free_teams_cannot_create_standalone_canvases` — Free teams cannot create standalone canvases See https://docs.slack.dev/reference/methods/canvases.create */
|
|
306
288
|
export const createCanvase: API.OperationMethod<
|
|
307
289
|
CreateCanvaseRequest,
|
|
308
290
|
CreateCanvaseResponse,
|
|
@@ -361,6 +343,21 @@ export const editCanvase: API.OperationMethod<
|
|
|
361
343
|
retry: Retry.Retry,
|
|
362
344
|
}));
|
|
363
345
|
|
|
346
|
+
export type GetContentError = SlackOpError;
|
|
347
|
+
/** Get the content of a canvas as markdown (default) or HTML. Required scopes — bot: `canvases:read`; user: `canvases:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `canvas_disabled_user_team` — Canvas is disabled on user's team - `canvas_not_found` — The canvas does not exist, or is not visible to the calling user. See https://docs.slack.dev/reference/methods/canvases.getContent */
|
|
348
|
+
export const getContent: API.OperationMethod<
|
|
349
|
+
GetContentRequest,
|
|
350
|
+
GetContentResponse,
|
|
351
|
+
GetContentError,
|
|
352
|
+
SlackOpContext
|
|
353
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
354
|
+
input: GetContentRequest,
|
|
355
|
+
output: GetContentResponse,
|
|
356
|
+
errors: [SlackError, SlackRateLimited],
|
|
357
|
+
protocol: SlackProtocol,
|
|
358
|
+
retry: Retry.Retry,
|
|
359
|
+
}));
|
|
360
|
+
|
|
364
361
|
export type LookupSectionError = SlackOpError;
|
|
365
362
|
/** Find sections matching the provided criteria Required scopes — bot: `canvases:read`; user: `canvases:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `canvas_deleted` — The canvas you wish to search is not available. - `canvas_disabled_user_team` — Canvas is disabled on user's team. - `canvas_not_found` — The canvas you wish to search for is not available. - `internal_error` — Something went wrong on our end, please try again. See https://docs.slack.dev/reference/methods/canvases.sections.lookup */
|
|
366
363
|
export const lookupSection: API.OperationMethod<
|