@distilled.cloud/slack 1.0.0-rc.15 → 1.0.0-rc.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/credentials.d.ts +1 -1
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +39 -34
- package/lib/credentials.js.map +1 -1
- package/lib/errors.d.ts +31 -31
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +41 -41
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +9 -9
- package/lib/pagination.d.ts +2 -2
- package/lib/pagination.js +28 -28
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +61 -59
- package/lib/protocol.js.map +1 -1
- package/lib/retry.d.ts +2 -2
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +34 -33
- package/lib/retry.js.map +1 -1
- package/lib/services/admin.d.ts +123 -575
- package/lib/services/admin.d.ts.map +1 -1
- package/lib/services/admin.js +304 -2878
- package/lib/services/agents.d.ts +13 -55
- package/lib/services/agents.d.ts.map +1 -1
- package/lib/services/agents.js +48 -309
- package/lib/services/api.d.ts +0 -4
- package/lib/services/api.d.ts.map +1 -1
- package/lib/services/api.js +16 -18
- package/lib/services/apps.d.ts +25 -106
- package/lib/services/apps.d.ts.map +1 -1
- package/lib/services/apps.js +84 -509
- package/lib/services/assistant.d.ts +6 -40
- package/lib/services/assistant.d.ts.map +1 -1
- package/lib/services/assistant.js +33 -204
- package/lib/services/auth.d.ts +4 -15
- package/lib/services/auth.d.ts.map +1 -1
- package/lib/services/auth.js +22 -90
- package/lib/services/blocks.d.ts +1 -7
- package/lib/services/blocks.d.ts.map +1 -1
- package/lib/services/blocks.js +16 -21
- package/lib/services/bookmarks.d.ts +4 -15
- package/lib/services/bookmarks.d.ts.map +1 -1
- package/lib/services/bookmarks.js +27 -76
- package/lib/services/bots.d.ts +1 -9
- package/lib/services/bots.d.ts.map +1 -1
- package/lib/services/bots.js +17 -54
- package/lib/services/calls.d.ts +6 -22
- package/lib/services/calls.d.ts.map +1 -1
- package/lib/services/calls.js +35 -110
- package/lib/services/canvases.d.ts +7 -35
- package/lib/services/canvases.d.ts.map +1 -1
- package/lib/services/canvases.js +39 -135
- package/lib/services/chat.d.ts +14 -83
- package/lib/services/chat.d.ts.map +1 -1
- package/lib/services/chat.js +59 -381
- package/lib/services/conversations.d.ts +31 -116
- package/lib/services/conversations.d.ts.map +1 -1
- package/lib/services/conversations.js +94 -690
- package/lib/services/dialog.d.ts +1 -4
- package/lib/services/dialog.d.ts.map +1 -1
- package/lib/services/dialog.js +13 -17
- package/lib/services/dnd.d.ts +5 -17
- package/lib/services/dnd.d.ts.map +1 -1
- package/lib/services/dnd.js +26 -91
- package/lib/services/emoji.d.ts +1 -8
- package/lib/services/emoji.d.ts.map +1 -1
- package/lib/services/emoji.js +18 -29
- package/lib/services/entity.d.ts +4 -16
- package/lib/services/entity.d.ts.map +1 -1
- package/lib/services/entity.js +29 -71
- package/lib/services/files.d.ts +16 -80
- package/lib/services/files.d.ts.map +1 -1
- package/lib/services/files.js +75 -433
- package/lib/services/functions.d.ts +8 -49
- package/lib/services/functions.d.ts.map +1 -1
- package/lib/services/functions.js +45 -203
- package/lib/services/lists.d.ts +13 -55
- package/lib/services/lists.d.ts.map +1 -1
- package/lib/services/lists.js +53 -248
- package/lib/services/migration.d.ts +1 -7
- package/lib/services/migration.d.ts.map +1 -1
- package/lib/services/migration.js +18 -27
- package/lib/services/oauth.d.ts +7 -43
- package/lib/services/oauth.d.ts.map +1 -1
- package/lib/services/oauth.js +34 -289
- package/lib/services/openid.d.ts +3 -10
- package/lib/services/openid.d.ts.map +1 -1
- package/lib/services/openid.js +19 -79
- package/lib/services/pins.d.ts +3 -13
- package/lib/services/pins.d.ts.map +1 -1
- package/lib/services/pins.js +27 -61
- package/lib/services/reactions.d.ts +5 -17
- package/lib/services/reactions.d.ts.map +1 -1
- package/lib/services/reactions.js +30 -96
- package/lib/services/reminders.d.ts +5 -17
- package/lib/services/reminders.d.ts.map +1 -1
- package/lib/services/reminders.js +33 -83
- package/lib/services/rtm.d.ts +2 -11
- package/lib/services/rtm.d.ts.map +1 -1
- package/lib/services/rtm.js +22 -56
- package/lib/services/search.d.ts +4 -35
- package/lib/services/search.d.ts.map +1 -1
- package/lib/services/search.js +28 -167
- package/lib/services/stars.d.ts +4 -26
- package/lib/services/stars.d.ts.map +1 -1
- package/lib/services/stars.js +28 -128
- package/lib/services/team.d.ts +11 -63
- package/lib/services/team.d.ts.map +1 -1
- package/lib/services/team.js +45 -289
- package/lib/services/tooling.d.ts +2 -5
- package/lib/services/tooling.d.ts.map +1 -1
- package/lib/services/tooling.js +15 -28
- package/lib/services/usergroups.d.ts +7 -31
- package/lib/services/usergroups.d.ts.map +1 -1
- package/lib/services/usergroups.js +40 -146
- package/lib/services/users.d.ts +14 -48
- package/lib/services/users.d.ts.map +1 -1
- package/lib/services/users.js +54 -249
- package/lib/services/views.d.ts +4 -14
- package/lib/services/views.d.ts.map +1 -1
- package/lib/services/views.js +28 -73
- package/lib/services/workflows.d.ts +8 -51
- package/lib/services/workflows.d.ts.map +1 -1
- package/lib/services/workflows.js +37 -188
- package/lib/traits.d.ts +1 -1
- package/lib/traits.js +8 -8
- package/package.json +14 -10
- 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/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/services/admin.js.map +0 -1
- package/lib/services/agents.js.map +0 -1
- package/lib/services/api.js.map +0 -1
- package/lib/services/apps.js.map +0 -1
- package/lib/services/assistant.js.map +0 -1
- package/lib/services/auth.js.map +0 -1
- package/lib/services/blocks.js.map +0 -1
- package/lib/services/bookmarks.js.map +0 -1
- package/lib/services/bots.js.map +0 -1
- package/lib/services/calls.js.map +0 -1
- package/lib/services/canvases.js.map +0 -1
- package/lib/services/chat.js.map +0 -1
- package/lib/services/conversations.js.map +0 -1
- package/lib/services/dialog.js.map +0 -1
- package/lib/services/dnd.js.map +0 -1
- package/lib/services/emoji.js.map +0 -1
- package/lib/services/entity.js.map +0 -1
- package/lib/services/files.js.map +0 -1
- package/lib/services/functions.js.map +0 -1
- package/lib/services/lists.js.map +0 -1
- package/lib/services/migration.js.map +0 -1
- package/lib/services/oauth.js.map +0 -1
- package/lib/services/openid.js.map +0 -1
- package/lib/services/pins.js.map +0 -1
- package/lib/services/reactions.js.map +0 -1
- package/lib/services/reminders.js.map +0 -1
- package/lib/services/rtm.js.map +0 -1
- package/lib/services/search.js.map +0 -1
- package/lib/services/stars.js.map +0 -1
- package/lib/services/team.js.map +0 -1
- package/lib/services/tooling.js.map +0 -1
- package/lib/services/usergroups.js.map +0 -1
- package/lib/services/users.js.map +0 -1
- package/lib/services/views.js.map +0 -1
- package/lib/services/workflows.js.map +0 -1
- package/src/protocol.test.ts +0 -372
package/src/services/canvases.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
|
|
|
@@ -16,39 +19,16 @@ export interface CreateCanvaseRequest {
|
|
|
16
19
|
/** Channel ID of the channel the canvas will be tabbed in. This is a required field for free teams. */
|
|
17
20
|
channel_id?: string;
|
|
18
21
|
}
|
|
19
|
-
export const CreateCanvaseRequest = /*@__PURE__*/ S.suspend(() =>
|
|
20
|
-
S.Struct({
|
|
21
|
-
title: S.optional(S.String),
|
|
22
|
-
document_content: S.optional(S.Unknown),
|
|
23
|
-
channel_id: S.optional(S.String),
|
|
24
|
-
}).pipe(T.Http({ method: "POST", uri: "/canvases.create", code: 200 })),
|
|
25
|
-
).annotate({ identifier: "CreateCanvaseRequest" }) as any as S.Schema<CreateCanvaseRequest>;
|
|
26
|
-
|
|
27
22
|
export interface CreateCanvaseResponse {
|
|
28
23
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
29
24
|
ok: boolean;
|
|
30
25
|
/** Encoded ID of the canvas */
|
|
31
26
|
canvas_id: string;
|
|
32
27
|
}
|
|
33
|
-
export const CreateCanvaseResponse = /*@__PURE__*/ S.suspend(() =>
|
|
34
|
-
S.Struct({
|
|
35
|
-
ok: S.Boolean,
|
|
36
|
-
canvas_id: S.String,
|
|
37
|
-
}),
|
|
38
|
-
).annotate({ identifier: "CreateCanvaseResponse" }) as any as S.Schema<CreateCanvaseResponse>;
|
|
39
|
-
|
|
40
28
|
/** List of channels you wish to update access for */
|
|
41
29
|
export type DeleteAccessRequestChannelIdsList = Array<string>;
|
|
42
|
-
export const DeleteAccessRequestChannelIdsList = /*@__PURE__*/ S.Array(
|
|
43
|
-
S.String,
|
|
44
|
-
) as any as S.Schema<DeleteAccessRequestChannelIdsList>;
|
|
45
|
-
|
|
46
30
|
/** List of users you wish to update access for */
|
|
47
31
|
export type DeleteAccessRequestUserIdsList = Array<string>;
|
|
48
|
-
export const DeleteAccessRequestUserIdsList = /*@__PURE__*/ S.Array(
|
|
49
|
-
S.String,
|
|
50
|
-
) as any as S.Schema<DeleteAccessRequestUserIdsList>;
|
|
51
|
-
|
|
52
32
|
export interface DeleteAccessRequest {
|
|
53
33
|
/** Encoded ID of the canvas */
|
|
54
34
|
canvas_id: string;
|
|
@@ -57,26 +37,10 @@ export interface DeleteAccessRequest {
|
|
|
57
37
|
/** List of users you wish to update access for */
|
|
58
38
|
user_ids?: DeleteAccessRequestUserIdsList;
|
|
59
39
|
}
|
|
60
|
-
export const DeleteAccessRequest = /*@__PURE__*/ S.suspend(() =>
|
|
61
|
-
S.Struct({
|
|
62
|
-
canvas_id: S.String,
|
|
63
|
-
channel_ids: S.optional(DeleteAccessRequestChannelIdsList),
|
|
64
|
-
user_ids: S.optional(DeleteAccessRequestUserIdsList),
|
|
65
|
-
}).pipe(T.Http({ method: "POST", uri: "/canvases.access.delete", code: 200 })),
|
|
66
|
-
).annotate({ identifier: "DeleteAccessRequest" }) as any as S.Schema<DeleteAccessRequest>;
|
|
67
|
-
|
|
68
40
|
/** The channel IDs that could not be updated */
|
|
69
41
|
export type DeleteAccessResponseFailedToUpdateChannelIdsList = Array<string>;
|
|
70
|
-
export const DeleteAccessResponseFailedToUpdateChannelIdsList = /*@__PURE__*/ S.Array(
|
|
71
|
-
S.String,
|
|
72
|
-
) as any as S.Schema<DeleteAccessResponseFailedToUpdateChannelIdsList>;
|
|
73
|
-
|
|
74
42
|
/** The user IDs that could not be updated */
|
|
75
43
|
export type DeleteAccessResponseFailedToUpdateUserIdsList = Array<string>;
|
|
76
|
-
export const DeleteAccessResponseFailedToUpdateUserIdsList = /*@__PURE__*/ S.Array(
|
|
77
|
-
S.String,
|
|
78
|
-
) as any as S.Schema<DeleteAccessResponseFailedToUpdateUserIdsList>;
|
|
79
|
-
|
|
80
44
|
export interface DeleteAccessResponse {
|
|
81
45
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
82
46
|
ok: boolean;
|
|
@@ -85,157 +49,65 @@ export interface DeleteAccessResponse {
|
|
|
85
49
|
/** The user IDs that could not be updated */
|
|
86
50
|
failed_to_update_user_ids?: DeleteAccessResponseFailedToUpdateUserIdsList;
|
|
87
51
|
}
|
|
88
|
-
export const DeleteAccessResponse = /*@__PURE__*/ S.suspend(() =>
|
|
89
|
-
S.Struct({
|
|
90
|
-
ok: S.Boolean,
|
|
91
|
-
failed_to_update_channel_ids: S.optional(DeleteAccessResponseFailedToUpdateChannelIdsList),
|
|
92
|
-
failed_to_update_user_ids: S.optional(DeleteAccessResponseFailedToUpdateUserIdsList),
|
|
93
|
-
}),
|
|
94
|
-
).annotate({ identifier: "DeleteAccessResponse" }) as any as S.Schema<DeleteAccessResponse>;
|
|
95
|
-
|
|
96
52
|
export interface DeleteCanvaseRequest {
|
|
97
53
|
/** Encoded ID of the canvas */
|
|
98
54
|
canvas_id: string;
|
|
99
55
|
}
|
|
100
|
-
export const DeleteCanvaseRequest = /*@__PURE__*/ S.suspend(() =>
|
|
101
|
-
S.Struct({
|
|
102
|
-
canvas_id: S.String,
|
|
103
|
-
}).pipe(T.Http({ method: "POST", uri: "/canvases.delete", code: 200 })),
|
|
104
|
-
).annotate({ identifier: "DeleteCanvaseRequest" }) as any as S.Schema<DeleteCanvaseRequest>;
|
|
105
|
-
|
|
106
56
|
export interface DeleteCanvaseResponse {
|
|
107
57
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
108
58
|
ok: boolean;
|
|
109
59
|
}
|
|
110
|
-
export const DeleteCanvaseResponse = /*@__PURE__*/ S.suspend(() =>
|
|
111
|
-
S.Struct({
|
|
112
|
-
ok: S.Boolean,
|
|
113
|
-
}),
|
|
114
|
-
).annotate({ identifier: "DeleteCanvaseResponse" }) as any as S.Schema<DeleteCanvaseResponse>;
|
|
115
|
-
|
|
116
60
|
/** List of changes to apply on the specified canvas. The markdown content of each change is limited to 1 MiB (1,048,576 characters). */
|
|
117
61
|
export type EditCanvaseRequestChangesList = Array<unknown>;
|
|
118
|
-
export const EditCanvaseRequestChangesList = /*@__PURE__*/ S.Array(
|
|
119
|
-
S.Unknown,
|
|
120
|
-
) as any as S.Schema<EditCanvaseRequestChangesList>;
|
|
121
|
-
|
|
122
62
|
export interface EditCanvaseRequest {
|
|
123
63
|
/** Encoded ID of the canvas */
|
|
124
64
|
canvas_id: string;
|
|
125
65
|
/** List of changes to apply on the specified canvas. The markdown content of each change is limited to 1 MiB (1,048,576 characters). */
|
|
126
66
|
changes: EditCanvaseRequestChangesList;
|
|
127
67
|
}
|
|
128
|
-
export const EditCanvaseRequest = /*@__PURE__*/ S.suspend(() =>
|
|
129
|
-
S.Struct({
|
|
130
|
-
canvas_id: S.String,
|
|
131
|
-
changes: EditCanvaseRequestChangesList,
|
|
132
|
-
}).pipe(T.Http({ method: "POST", uri: "/canvases.edit", code: 200 })),
|
|
133
|
-
).annotate({ identifier: "EditCanvaseRequest" }) as any as S.Schema<EditCanvaseRequest>;
|
|
134
|
-
|
|
135
68
|
export interface EditCanvaseResponse {
|
|
136
69
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
137
70
|
ok: boolean;
|
|
138
71
|
}
|
|
139
|
-
export const EditCanvaseResponse = /*@__PURE__*/ S.suspend(() =>
|
|
140
|
-
S.Struct({
|
|
141
|
-
ok: S.Boolean,
|
|
142
|
-
}),
|
|
143
|
-
).annotate({ identifier: "EditCanvaseResponse" }) as any as S.Schema<EditCanvaseResponse>;
|
|
144
|
-
|
|
145
72
|
/** Format in which to return the canvas content. Defaults to markdown. */
|
|
146
73
|
export type GetContentRequestContentType = "html" | "markdown";
|
|
147
|
-
export const GetContentRequestContentType = S.String;
|
|
148
|
-
|
|
149
74
|
export interface GetContentRequest {
|
|
150
75
|
/** Encoded ID of the canvas */
|
|
151
76
|
canvas_id: string;
|
|
152
77
|
/** Format in which to return the canvas content. Defaults to markdown. */
|
|
153
78
|
content_type?: GetContentRequestContentType | (string & {});
|
|
154
79
|
}
|
|
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
80
|
export interface GetContentResponse {
|
|
163
81
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
164
82
|
ok: boolean;
|
|
165
83
|
/** The content of the canvas in the requested content_type. */
|
|
166
84
|
content: string;
|
|
167
85
|
}
|
|
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>;
|
|
174
|
-
|
|
175
86
|
export interface LookupSectionRequest {
|
|
176
87
|
/** Encoded ID of the canvas */
|
|
177
88
|
canvas_id: string;
|
|
178
89
|
/** Filtering criteria */
|
|
179
90
|
criteria: unknown;
|
|
180
91
|
}
|
|
181
|
-
export const LookupSectionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
182
|
-
S.Struct({
|
|
183
|
-
canvas_id: S.String,
|
|
184
|
-
criteria: S.Unknown,
|
|
185
|
-
}).pipe(T.Http({ method: "POST", uri: "/canvases.sections.lookup", code: 200 })),
|
|
186
|
-
).annotate({ identifier: "LookupSectionRequest" }) as any as S.Schema<LookupSectionRequest>;
|
|
187
|
-
|
|
188
92
|
/** IDs of child sections within a layout container (blockquote, callout, flexbox, or table). */
|
|
189
93
|
export type LookupSectionResponseSectionsItemChildSectionIdsList = Array<string>;
|
|
190
|
-
export const LookupSectionResponseSectionsItemChildSectionIdsList = /*@__PURE__*/ S.Array(
|
|
191
|
-
S.String,
|
|
192
|
-
) as any as S.Schema<LookupSectionResponseSectionsItemChildSectionIdsList>;
|
|
193
|
-
|
|
194
94
|
export interface LookupSectionResponseSectionsItem {
|
|
195
95
|
id: string;
|
|
196
96
|
/** IDs of child sections within a layout container (blockquote, callout, flexbox, or table). */
|
|
197
97
|
child_section_ids?: LookupSectionResponseSectionsItemChildSectionIdsList;
|
|
198
98
|
}
|
|
199
|
-
export const LookupSectionResponseSectionsItem = /*@__PURE__*/ S.suspend(() =>
|
|
200
|
-
S.Struct({
|
|
201
|
-
id: S.String,
|
|
202
|
-
child_section_ids: S.optional(LookupSectionResponseSectionsItemChildSectionIdsList),
|
|
203
|
-
}),
|
|
204
|
-
).annotate({
|
|
205
|
-
identifier: "LookupSectionResponseSectionsItem",
|
|
206
|
-
}) as any as S.Schema<LookupSectionResponseSectionsItem>;
|
|
207
|
-
|
|
208
99
|
/** Sections in the canvas that match the provided criteria */
|
|
209
100
|
export type LookupSectionResponseSectionsList = Array<LookupSectionResponseSectionsItem>;
|
|
210
|
-
export const LookupSectionResponseSectionsList = /*@__PURE__*/ S.Array(
|
|
211
|
-
LookupSectionResponseSectionsItem,
|
|
212
|
-
) as any as S.Schema<LookupSectionResponseSectionsList>;
|
|
213
|
-
|
|
214
101
|
export interface LookupSectionResponse {
|
|
215
102
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
216
103
|
ok: boolean;
|
|
217
104
|
/** Sections in the canvas that match the provided criteria */
|
|
218
105
|
sections: LookupSectionResponseSectionsList;
|
|
219
106
|
}
|
|
220
|
-
export const LookupSectionResponse = /*@__PURE__*/ S.suspend(() =>
|
|
221
|
-
S.Struct({
|
|
222
|
-
ok: S.Boolean,
|
|
223
|
-
sections: LookupSectionResponseSectionsList,
|
|
224
|
-
}),
|
|
225
|
-
).annotate({ identifier: "LookupSectionResponse" }) as any as S.Schema<LookupSectionResponse>;
|
|
226
|
-
|
|
227
107
|
/** List of channels you wish to update access for. Can only be used if user_ids is not provided. */
|
|
228
108
|
export type SetAccessRequestChannelIdsList = Array<string>;
|
|
229
|
-
export const SetAccessRequestChannelIdsList = /*@__PURE__*/ S.Array(
|
|
230
|
-
S.String,
|
|
231
|
-
) as any as S.Schema<SetAccessRequestChannelIdsList>;
|
|
232
|
-
|
|
233
109
|
/** List of users you wish to update access for. Can only be used if channel_ids is not provided. */
|
|
234
110
|
export type SetAccessRequestUserIdsList = Array<string>;
|
|
235
|
-
export const SetAccessRequestUserIdsList = /*@__PURE__*/ S.Array(
|
|
236
|
-
S.String,
|
|
237
|
-
) as any as S.Schema<SetAccessRequestUserIdsList>;
|
|
238
|
-
|
|
239
111
|
export interface SetAccessRequest {
|
|
240
112
|
/** Encoded ID of the canvas */
|
|
241
113
|
canvas_id: string;
|
|
@@ -246,27 +118,10 @@ export interface SetAccessRequest {
|
|
|
246
118
|
/** List of users you wish to update access for. Can only be used if channel_ids is not provided. */
|
|
247
119
|
user_ids?: SetAccessRequestUserIdsList;
|
|
248
120
|
}
|
|
249
|
-
export const SetAccessRequest = /*@__PURE__*/ S.suspend(() =>
|
|
250
|
-
S.Struct({
|
|
251
|
-
canvas_id: S.String,
|
|
252
|
-
access_level: S.String,
|
|
253
|
-
channel_ids: S.optional(SetAccessRequestChannelIdsList),
|
|
254
|
-
user_ids: S.optional(SetAccessRequestUserIdsList),
|
|
255
|
-
}).pipe(T.Http({ method: "POST", uri: "/canvases.access.set", code: 200 })),
|
|
256
|
-
).annotate({ identifier: "SetAccessRequest" }) as any as S.Schema<SetAccessRequest>;
|
|
257
|
-
|
|
258
121
|
/** The channel IDs that could not be updated */
|
|
259
122
|
export type SetAccessResponseFailedToUpdateChannelIdsList = Array<string>;
|
|
260
|
-
export const SetAccessResponseFailedToUpdateChannelIdsList = /*@__PURE__*/ S.Array(
|
|
261
|
-
S.String,
|
|
262
|
-
) as any as S.Schema<SetAccessResponseFailedToUpdateChannelIdsList>;
|
|
263
|
-
|
|
264
123
|
/** The user IDs that could not be updated */
|
|
265
124
|
export type SetAccessResponseFailedToUpdateUserIdsList = Array<string>;
|
|
266
|
-
export const SetAccessResponseFailedToUpdateUserIdsList = /*@__PURE__*/ S.Array(
|
|
267
|
-
S.String,
|
|
268
|
-
) as any as S.Schema<SetAccessResponseFailedToUpdateUserIdsList>;
|
|
269
|
-
|
|
270
125
|
export interface SetAccessResponse {
|
|
271
126
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
272
127
|
ok: boolean;
|
|
@@ -275,115 +130,253 @@ export interface SetAccessResponse {
|
|
|
275
130
|
/** The user IDs that could not be updated */
|
|
276
131
|
failed_to_update_user_ids?: SetAccessResponseFailedToUpdateUserIdsList;
|
|
277
132
|
}
|
|
278
|
-
export const SetAccessResponse = /*@__PURE__*/ S.suspend(() =>
|
|
279
|
-
S.Struct({
|
|
280
|
-
ok: S.Boolean,
|
|
281
|
-
failed_to_update_channel_ids: S.optional(SetAccessResponseFailedToUpdateChannelIdsList),
|
|
282
|
-
failed_to_update_user_ids: S.optional(SetAccessResponseFailedToUpdateUserIdsList),
|
|
283
|
-
}),
|
|
284
|
-
).annotate({ identifier: "SetAccessResponse" }) as any as S.Schema<SetAccessResponse>;
|
|
285
|
-
|
|
286
133
|
export type CreateCanvaseError = SlackOpError;
|
|
287
|
-
/** Create canvas for a user Required scopes
|
|
134
|
+
/** 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 */
|
|
288
135
|
export const createCanvase: API.OperationMethod<
|
|
289
136
|
CreateCanvaseRequest,
|
|
290
137
|
CreateCanvaseResponse,
|
|
291
138
|
CreateCanvaseError,
|
|
292
139
|
SlackOpContext
|
|
293
140
|
> = /*@__PURE__*/ API.make(() => ({
|
|
294
|
-
input: CreateCanvaseRequest
|
|
295
|
-
output: CreateCanvaseResponse
|
|
141
|
+
input: __S(0, __c0, 0) as any as S.Schema<CreateCanvaseRequest>,
|
|
142
|
+
output: __S(1, __c0, 1) as any as S.Schema<CreateCanvaseResponse>,
|
|
296
143
|
errors: [SlackError, SlackRateLimited],
|
|
297
144
|
protocol: SlackProtocol,
|
|
298
145
|
retry: Retry.Retry,
|
|
299
146
|
}));
|
|
300
147
|
|
|
301
148
|
export type DeleteAccessError = SlackOpError;
|
|
302
|
-
/** Remove access to a canvas for specified entities Required scopes
|
|
149
|
+
/** Remove access to a canvas for specified entities Required scopes -- bot: `canvases:write`; user: `canvases:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `canvas_not_found` -- The canvas you wish to revoke permissions for is not available. - `restricted_action` -- User does not have permission to perform this action. - `canvas_disabled_user_team` -- Canvas is disabled on user's team. - `invalid_parameters` -- One of user_ids and channel_ids must be defined. - `channel_not_found` -- A channel could not be found. - `user_not_found` -- A user could not be found. See https://docs.slack.dev/reference/methods/canvases.access.delete */
|
|
303
150
|
export const deleteAccess: API.OperationMethod<
|
|
304
151
|
DeleteAccessRequest,
|
|
305
152
|
DeleteAccessResponse,
|
|
306
153
|
DeleteAccessError,
|
|
307
154
|
SlackOpContext
|
|
308
155
|
> = /*@__PURE__*/ API.make(() => ({
|
|
309
|
-
input: DeleteAccessRequest
|
|
310
|
-
output: DeleteAccessResponse
|
|
156
|
+
input: __S(4, __c1, 0) as any as S.Schema<DeleteAccessRequest>,
|
|
157
|
+
output: __S(12, __c3, 0) as any as S.Schema<DeleteAccessResponse>,
|
|
311
158
|
errors: [SlackError, SlackRateLimited],
|
|
312
159
|
protocol: SlackProtocol,
|
|
313
160
|
retry: Retry.Retry,
|
|
314
161
|
}));
|
|
315
162
|
|
|
316
163
|
export type DeleteCanvaseError = SlackOpError;
|
|
317
|
-
/** Deletes a canvas Required scopes
|
|
164
|
+
/** Deletes a canvas Required scopes -- bot: `canvases:write`; user: `canvases:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `canvas_deleting_disabled` -- This functionality is disabled. - `canvas_not_found` -- The canvas does not exist, or is not visible to the calling user. - `restricted_action` -- User does not have permission to perform this action. See https://docs.slack.dev/reference/methods/canvases.delete */
|
|
318
165
|
export const deleteCanvase: API.OperationMethod<
|
|
319
166
|
DeleteCanvaseRequest,
|
|
320
167
|
DeleteCanvaseResponse,
|
|
321
168
|
DeleteCanvaseError,
|
|
322
169
|
SlackOpContext
|
|
323
170
|
> = /*@__PURE__*/ API.make(() => ({
|
|
324
|
-
input: DeleteCanvaseRequest
|
|
325
|
-
output: DeleteCanvaseResponse
|
|
171
|
+
input: __S(16, __c4, 0) as any as S.Schema<DeleteCanvaseRequest>,
|
|
172
|
+
output: __S(20, __c5, 0) as any as S.Schema<DeleteCanvaseResponse>,
|
|
326
173
|
errors: [SlackError, SlackRateLimited],
|
|
327
174
|
protocol: SlackProtocol,
|
|
328
175
|
retry: Retry.Retry,
|
|
329
176
|
}));
|
|
330
177
|
|
|
331
178
|
export type EditCanvaseError = SlackOpError;
|
|
332
|
-
/** Update an existing canvas Required scopes
|
|
179
|
+
/** Update an existing canvas Required scopes -- bot: `canvases:write`; user: `canvases:write`; seamless_user: `seamless.user` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `canvas_not_found` -- The canvas you wish to apply changes to is not available. - `canvas_disabled_user_team` -- Canvas is disabled on user's team - `free_teams_cannot_edit_standalone_canvases` -- Free teams cannot edit standalone canvases - `restricted_action` -- User does not have permission to perform this action. - `canvas_editing_failed` -- The changes to the canvas failed to be applied. - `canvas_editing_locked` -- Another edit to this canvas is currently in progress. Please retry after a short delay. - `canvas_too_large` -- The canvas is too large to apply the requested changes. Reduce the size of the canvas or the edit and try again. See https://docs.slack.dev/reference/methods/canvases.edit */
|
|
333
180
|
export const editCanvase: API.OperationMethod<
|
|
334
181
|
EditCanvaseRequest,
|
|
335
182
|
EditCanvaseResponse,
|
|
336
183
|
EditCanvaseError,
|
|
337
184
|
SlackOpContext
|
|
338
185
|
> = /*@__PURE__*/ API.make(() => ({
|
|
339
|
-
input: EditCanvaseRequest
|
|
340
|
-
output: EditCanvaseResponse
|
|
186
|
+
input: __S(25, __c6, 1) as any as S.Schema<EditCanvaseRequest>,
|
|
187
|
+
output: __S(20, __c5, 0) as any as S.Schema<EditCanvaseResponse>,
|
|
341
188
|
errors: [SlackError, SlackRateLimited],
|
|
342
189
|
protocol: SlackProtocol,
|
|
343
190
|
retry: Retry.Retry,
|
|
344
191
|
}));
|
|
345
192
|
|
|
346
193
|
export type GetContentError = SlackOpError;
|
|
347
|
-
/** Get the content of a canvas as markdown (default) or HTML. Required scopes
|
|
194
|
+
/** 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
195
|
export const getContent: API.OperationMethod<
|
|
349
196
|
GetContentRequest,
|
|
350
197
|
GetContentResponse,
|
|
351
198
|
GetContentError,
|
|
352
199
|
SlackOpContext
|
|
353
200
|
> = /*@__PURE__*/ API.make(() => ({
|
|
354
|
-
input: GetContentRequest
|
|
355
|
-
output: GetContentResponse
|
|
201
|
+
input: __S(28, __c7, 0) as any as S.Schema<GetContentRequest>,
|
|
202
|
+
output: __S(29, __c7, 1) as any as S.Schema<GetContentResponse>,
|
|
356
203
|
errors: [SlackError, SlackRateLimited],
|
|
357
204
|
protocol: SlackProtocol,
|
|
358
205
|
retry: Retry.Retry,
|
|
359
206
|
}));
|
|
360
207
|
|
|
361
208
|
export type LookupSectionError = SlackOpError;
|
|
362
|
-
/** Find sections matching the provided criteria Required scopes
|
|
209
|
+
/** 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 */
|
|
363
210
|
export const lookupSection: API.OperationMethod<
|
|
364
211
|
LookupSectionRequest,
|
|
365
212
|
LookupSectionResponse,
|
|
366
213
|
LookupSectionError,
|
|
367
214
|
SlackOpContext
|
|
368
215
|
> = /*@__PURE__*/ API.make(() => ({
|
|
369
|
-
input: LookupSectionRequest
|
|
370
|
-
output: LookupSectionResponse
|
|
216
|
+
input: __S(32, __c8, 0) as any as S.Schema<LookupSectionRequest>,
|
|
217
|
+
output: __S(35, __c8, 3) as any as S.Schema<LookupSectionResponse>,
|
|
371
218
|
errors: [SlackError, SlackRateLimited],
|
|
372
219
|
protocol: SlackProtocol,
|
|
373
220
|
retry: Retry.Retry,
|
|
374
221
|
}));
|
|
375
222
|
|
|
376
223
|
export type SetAccessError = SlackOpError;
|
|
377
|
-
/** Sets the access level to a canvas for specified entities Required scopes
|
|
224
|
+
/** Sets the access level to a canvas for specified entities Required scopes -- bot: `canvases:write`; user: `canvases:write` 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 you wish to update permissions for is not available. - `channel_not_found` -- A channel could not be found. - `failed_to_update_user_ids` -- Failed to update the specified user_ids. - `invalid_parameters` -- One of user_ids or channel_ids must be defined, but not both. - `restricted_action` -- User does not have permission to perform this action. - `user_not_found` -- A user could not be found. See https://docs.slack.dev/reference/methods/canvases.access.set */
|
|
378
225
|
export const setAccess: API.OperationMethod<
|
|
379
226
|
SetAccessRequest,
|
|
380
227
|
SetAccessResponse,
|
|
381
228
|
SetAccessError,
|
|
382
229
|
SlackOpContext
|
|
383
230
|
> = /*@__PURE__*/ API.make(() => ({
|
|
384
|
-
input: SetAccessRequest
|
|
385
|
-
output: SetAccessResponse
|
|
231
|
+
input: __S(36, __c9, 0) as any as S.Schema<SetAccessRequest>,
|
|
232
|
+
output: __S(12, __c3, 0) as any as S.Schema<SetAccessResponse>,
|
|
386
233
|
errors: [SlackError, SlackRateLimited],
|
|
387
234
|
protocol: SlackProtocol,
|
|
388
235
|
retry: Retry.Retry,
|
|
389
236
|
}));
|
|
237
|
+
|
|
238
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
239
|
+
function __c0(j: number): any {
|
|
240
|
+
switch (j) {
|
|
241
|
+
case 0:
|
|
242
|
+
return S.suspend(() =>
|
|
243
|
+
S.Struct({
|
|
244
|
+
title: S.optional(S.String),
|
|
245
|
+
document_content: S.optional(S.Unknown),
|
|
246
|
+
channel_id: S.optional(S.String),
|
|
247
|
+
}).pipe(T.Http({ method: "POST", uri: "/canvases.create", code: 200 })),
|
|
248
|
+
).annotate({ identifier: "CreateCanvaseRequest" });
|
|
249
|
+
case 1:
|
|
250
|
+
return S.suspend(() =>
|
|
251
|
+
S.Struct({
|
|
252
|
+
ok: S.Boolean,
|
|
253
|
+
canvas_id: S.String,
|
|
254
|
+
}),
|
|
255
|
+
).annotate({ identifier: "CreateCanvaseResponse" });
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
function __c1(j: number): any {
|
|
259
|
+
switch (j) {
|
|
260
|
+
case 0:
|
|
261
|
+
return S.suspend(() =>
|
|
262
|
+
S.Struct({
|
|
263
|
+
canvas_id: S.String,
|
|
264
|
+
channel_ids: S.optional(__S(8, __c2, 0)),
|
|
265
|
+
user_ids: S.optional(__S(8, __c2, 0)),
|
|
266
|
+
}).pipe(T.Http({ method: "POST", uri: "/canvases.access.delete", code: 200 })),
|
|
267
|
+
).annotate({ identifier: "DeleteAccessRequest" });
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
function __c2(j: number): any {
|
|
271
|
+
switch (j) {
|
|
272
|
+
case 0:
|
|
273
|
+
return S.Array(S.String);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
function __c3(j: number): any {
|
|
277
|
+
switch (j) {
|
|
278
|
+
case 0:
|
|
279
|
+
return S.suspend(() =>
|
|
280
|
+
S.Struct({
|
|
281
|
+
ok: S.Boolean,
|
|
282
|
+
failed_to_update_channel_ids: S.optional(__S(8, __c2, 0)),
|
|
283
|
+
failed_to_update_user_ids: S.optional(__S(8, __c2, 0)),
|
|
284
|
+
}),
|
|
285
|
+
).annotate({ identifier: "DeleteAccessResponse" });
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
function __c4(j: number): any {
|
|
289
|
+
switch (j) {
|
|
290
|
+
case 0:
|
|
291
|
+
return S.suspend(() =>
|
|
292
|
+
S.Struct({
|
|
293
|
+
canvas_id: S.String,
|
|
294
|
+
}).pipe(T.Http({ method: "POST", uri: "/canvases.delete", code: 200 })),
|
|
295
|
+
).annotate({ identifier: "DeleteCanvaseRequest" });
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
function __c5(j: number): any {
|
|
299
|
+
switch (j) {
|
|
300
|
+
case 0:
|
|
301
|
+
return S.suspend(() =>
|
|
302
|
+
S.Struct({
|
|
303
|
+
ok: S.Boolean,
|
|
304
|
+
}),
|
|
305
|
+
).annotate({ identifier: "DeleteCanvaseResponse" });
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
function __c6(j: number): any {
|
|
309
|
+
switch (j) {
|
|
310
|
+
case 0:
|
|
311
|
+
return S.Array(S.Unknown);
|
|
312
|
+
case 1:
|
|
313
|
+
return S.suspend(() =>
|
|
314
|
+
S.Struct({
|
|
315
|
+
canvas_id: S.String,
|
|
316
|
+
changes: __S(24, __c6, 0),
|
|
317
|
+
}).pipe(T.Http({ method: "POST", uri: "/canvases.edit", code: 200 })),
|
|
318
|
+
).annotate({ identifier: "EditCanvaseRequest" });
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
function __c7(j: number): any {
|
|
322
|
+
switch (j) {
|
|
323
|
+
case 0:
|
|
324
|
+
return S.suspend(() =>
|
|
325
|
+
S.Struct({
|
|
326
|
+
canvas_id: S.String,
|
|
327
|
+
content_type: S.optional(S.String),
|
|
328
|
+
}).pipe(T.Http({ method: "POST", uri: "/canvases.getContent", code: 200 })),
|
|
329
|
+
).annotate({ identifier: "GetContentRequest" });
|
|
330
|
+
case 1:
|
|
331
|
+
return S.suspend(() =>
|
|
332
|
+
S.Struct({
|
|
333
|
+
ok: S.Boolean,
|
|
334
|
+
content: S.String,
|
|
335
|
+
}),
|
|
336
|
+
).annotate({ identifier: "GetContentResponse" });
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
function __c8(j: number): any {
|
|
340
|
+
switch (j) {
|
|
341
|
+
case 0:
|
|
342
|
+
return S.suspend(() =>
|
|
343
|
+
S.Struct({
|
|
344
|
+
canvas_id: S.String,
|
|
345
|
+
criteria: S.Unknown,
|
|
346
|
+
}).pipe(T.Http({ method: "POST", uri: "/canvases.sections.lookup", code: 200 })),
|
|
347
|
+
).annotate({ identifier: "LookupSectionRequest" });
|
|
348
|
+
case 1:
|
|
349
|
+
return S.suspend(() =>
|
|
350
|
+
S.Struct({
|
|
351
|
+
id: S.String,
|
|
352
|
+
child_section_ids: S.optional(__S(8, __c2, 0)),
|
|
353
|
+
}),
|
|
354
|
+
).annotate({ identifier: "LookupSectionResponseSectionsItem" });
|
|
355
|
+
case 2:
|
|
356
|
+
return S.Array(__S(33, __c8, 1));
|
|
357
|
+
case 3:
|
|
358
|
+
return S.suspend(() =>
|
|
359
|
+
S.Struct({
|
|
360
|
+
ok: S.Boolean,
|
|
361
|
+
sections: __S(34, __c8, 2),
|
|
362
|
+
}),
|
|
363
|
+
).annotate({ identifier: "LookupSectionResponse" });
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
function __c9(j: number): any {
|
|
367
|
+
switch (j) {
|
|
368
|
+
case 0:
|
|
369
|
+
return S.suspend(() =>
|
|
370
|
+
S.Struct({
|
|
371
|
+
canvas_id: S.String,
|
|
372
|
+
access_level: S.String,
|
|
373
|
+
channel_ids: S.optional(__S(8, __c2, 0)),
|
|
374
|
+
user_ids: S.optional(__S(8, __c2, 0)),
|
|
375
|
+
}).pipe(T.Http({ method: "POST", uri: "/canvases.access.set", code: 200 })),
|
|
376
|
+
).annotate({ identifier: "SetAccessRequest" });
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
380
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
381
|
+
return (__s[i] ??= __L.at(f, j));
|
|
382
|
+
}
|