@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/search.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
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
|
export type SearchAllRequestSortDir = "asc" | "desc";
|
|
12
|
-
export const SearchAllRequestSortDir = S.String;
|
|
13
|
-
|
|
14
15
|
export interface SearchAllRequest {
|
|
15
16
|
count?: number;
|
|
16
17
|
/** Pass a value of `true` to enable query highlight markers (see below). */
|
|
@@ -25,18 +26,6 @@ export interface SearchAllRequest {
|
|
|
25
26
|
/** encoded team id to search in, required if org token is used */
|
|
26
27
|
team_id?: string;
|
|
27
28
|
}
|
|
28
|
-
export const SearchAllRequest = /*@__PURE__*/ S.suspend(() =>
|
|
29
|
-
S.Struct({
|
|
30
|
-
count: S.optional(S.Number.pipe(T.Query())),
|
|
31
|
-
highlight: S.optional(S.Boolean.pipe(T.Query())),
|
|
32
|
-
page: S.optional(S.Number.pipe(T.Query())),
|
|
33
|
-
query: S.String.pipe(T.Query()),
|
|
34
|
-
sort: S.optional(S.String.pipe(T.Query())),
|
|
35
|
-
sort_dir: S.optional(SearchAllRequestSortDir.pipe(T.Query())),
|
|
36
|
-
team_id: S.optional(S.String.pipe(T.Query())),
|
|
37
|
-
}).pipe(T.Http({ method: "GET", uri: "/search.all", code: 200 })),
|
|
38
|
-
).annotate({ identifier: "SearchAllRequest" }) as any as S.Schema<SearchAllRequest>;
|
|
39
|
-
|
|
40
29
|
export interface SearchAllResponse {
|
|
41
30
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
42
31
|
ok: boolean;
|
|
@@ -47,20 +36,7 @@ export interface SearchAllResponse {
|
|
|
47
36
|
/** Search query. */
|
|
48
37
|
query?: string;
|
|
49
38
|
}
|
|
50
|
-
export const SearchAllResponse = /*@__PURE__*/ S.suspend(() =>
|
|
51
|
-
S.Struct({
|
|
52
|
-
ok: S.Boolean,
|
|
53
|
-
files: S.optional(S.Unknown),
|
|
54
|
-
callstack: S.optional(S.String),
|
|
55
|
-
messages: S.optional(S.Unknown),
|
|
56
|
-
posts: S.optional(S.Unknown),
|
|
57
|
-
query: S.optional(S.String),
|
|
58
|
-
}),
|
|
59
|
-
).annotate({ identifier: "SearchAllResponse" }) as any as S.Schema<SearchAllResponse>;
|
|
60
|
-
|
|
61
39
|
export type SearchFilesRequestSortDir = "asc" | "desc";
|
|
62
|
-
export const SearchFilesRequestSortDir = S.String;
|
|
63
|
-
|
|
64
40
|
export interface SearchFilesRequest {
|
|
65
41
|
count?: number;
|
|
66
42
|
/** Pass a value of `true` to enable query highlight markers (see below). */
|
|
@@ -75,23 +51,7 @@ export interface SearchFilesRequest {
|
|
|
75
51
|
/** encoded team id to search in, required if org token is used */
|
|
76
52
|
team_id?: string;
|
|
77
53
|
}
|
|
78
|
-
export const SearchFilesRequest = /*@__PURE__*/ S.suspend(() =>
|
|
79
|
-
S.Struct({
|
|
80
|
-
count: S.optional(S.Number.pipe(T.Query())),
|
|
81
|
-
highlight: S.optional(S.Boolean.pipe(T.Query())),
|
|
82
|
-
page: S.optional(S.Number.pipe(T.Query())),
|
|
83
|
-
query: S.String.pipe(T.Query()),
|
|
84
|
-
sort: S.optional(S.String.pipe(T.Query())),
|
|
85
|
-
sort_dir: S.optional(SearchFilesRequestSortDir.pipe(T.Query())),
|
|
86
|
-
team_id: S.optional(S.String.pipe(T.Query())),
|
|
87
|
-
}).pipe(T.Http({ method: "GET", uri: "/search.files", code: 200 })),
|
|
88
|
-
).annotate({ identifier: "SearchFilesRequest" }) as any as S.Schema<SearchFilesRequest>;
|
|
89
|
-
|
|
90
54
|
export type SearchFilesResponseFilesPaginationWarningsList = Array<string>;
|
|
91
|
-
export const SearchFilesResponseFilesPaginationWarningsList = /*@__PURE__*/ S.Array(
|
|
92
|
-
S.String,
|
|
93
|
-
) as any as S.Schema<SearchFilesResponseFilesPaginationWarningsList>;
|
|
94
|
-
|
|
95
55
|
export interface SearchFilesResponseFilesPagination {
|
|
96
56
|
/** Last result id */
|
|
97
57
|
last?: number;
|
|
@@ -107,30 +67,8 @@ export interface SearchFilesResponseFilesPagination {
|
|
|
107
67
|
/** First result id */
|
|
108
68
|
first?: number;
|
|
109
69
|
}
|
|
110
|
-
export const SearchFilesResponseFilesPagination = /*@__PURE__*/ S.suspend(() =>
|
|
111
|
-
S.Struct({
|
|
112
|
-
last: S.optional(S.Number),
|
|
113
|
-
warnings: S.optional(SearchFilesResponseFilesPaginationWarningsList),
|
|
114
|
-
total_count: S.optional(S.Number),
|
|
115
|
-
page_count: S.optional(S.Number),
|
|
116
|
-
per_page: S.optional(S.Number),
|
|
117
|
-
page: S.optional(S.Number),
|
|
118
|
-
first: S.optional(S.Number),
|
|
119
|
-
}),
|
|
120
|
-
).annotate({
|
|
121
|
-
identifier: "SearchFilesResponseFilesPagination",
|
|
122
|
-
}) as any as S.Schema<SearchFilesResponseFilesPagination>;
|
|
123
|
-
|
|
124
70
|
export type SearchFilesResponseFilesMatchesList = Array<unknown>;
|
|
125
|
-
export const SearchFilesResponseFilesMatchesList = /*@__PURE__*/ S.Array(
|
|
126
|
-
S.Unknown,
|
|
127
|
-
) as any as S.Schema<SearchFilesResponseFilesMatchesList>;
|
|
128
|
-
|
|
129
71
|
export type SearchFilesResponseFilesPagingWarningsList = Array<string>;
|
|
130
|
-
export const SearchFilesResponseFilesPagingWarningsList = /*@__PURE__*/ S.Array(
|
|
131
|
-
S.String,
|
|
132
|
-
) as any as S.Schema<SearchFilesResponseFilesPagingWarningsList>;
|
|
133
|
-
|
|
134
72
|
export interface SearchFilesResponseFilesPaging {
|
|
135
73
|
/** Number of results per page */
|
|
136
74
|
count?: number;
|
|
@@ -142,18 +80,6 @@ export interface SearchFilesResponseFilesPaging {
|
|
|
142
80
|
page?: number;
|
|
143
81
|
warnings?: SearchFilesResponseFilesPagingWarningsList;
|
|
144
82
|
}
|
|
145
|
-
export const SearchFilesResponseFilesPaging = /*@__PURE__*/ S.suspend(() =>
|
|
146
|
-
S.Struct({
|
|
147
|
-
count: S.optional(S.Number),
|
|
148
|
-
pages: S.optional(S.Number),
|
|
149
|
-
total: S.optional(S.Number),
|
|
150
|
-
page: S.optional(S.Number),
|
|
151
|
-
warnings: S.optional(SearchFilesResponseFilesPagingWarningsList),
|
|
152
|
-
}),
|
|
153
|
-
).annotate({
|
|
154
|
-
identifier: "SearchFilesResponseFilesPaging",
|
|
155
|
-
}) as any as S.Schema<SearchFilesResponseFilesPaging>;
|
|
156
|
-
|
|
157
83
|
export interface SearchFilesResponseFiles {
|
|
158
84
|
pagination?: SearchFilesResponseFilesPagination;
|
|
159
85
|
matches?: SearchFilesResponseFilesMatchesList;
|
|
@@ -163,47 +89,11 @@ export interface SearchFilesResponseFiles {
|
|
|
163
89
|
total?: number;
|
|
164
90
|
query_too_long?: boolean;
|
|
165
91
|
}
|
|
166
|
-
export const SearchFilesResponseFiles = /*@__PURE__*/ S.suspend(() =>
|
|
167
|
-
S.Struct({
|
|
168
|
-
pagination: S.optional(SearchFilesResponseFilesPagination),
|
|
169
|
-
matches: S.optional(SearchFilesResponseFilesMatchesList),
|
|
170
|
-
paging: S.optional(SearchFilesResponseFilesPaging),
|
|
171
|
-
all_stop_words: S.optional(S.Boolean),
|
|
172
|
-
total: S.optional(S.Number),
|
|
173
|
-
query_too_long: S.optional(S.Boolean),
|
|
174
|
-
}),
|
|
175
|
-
).annotate({ identifier: "SearchFilesResponseFiles" }) as any as S.Schema<SearchFilesResponseFiles>;
|
|
176
|
-
|
|
177
92
|
export type SearchFilesResponseUsersMap = { [key: string]: unknown | undefined };
|
|
178
|
-
export const SearchFilesResponseUsersMap = /*@__PURE__*/ S.Record(
|
|
179
|
-
S.String,
|
|
180
|
-
S.Unknown,
|
|
181
|
-
) as any as S.Schema<SearchFilesResponseUsersMap>;
|
|
182
|
-
|
|
183
93
|
export type SearchFilesResponseTeamsMap = { [key: string]: unknown | undefined };
|
|
184
|
-
export const SearchFilesResponseTeamsMap = /*@__PURE__*/ S.Record(
|
|
185
|
-
S.String,
|
|
186
|
-
S.Unknown,
|
|
187
|
-
) as any as S.Schema<SearchFilesResponseTeamsMap>;
|
|
188
|
-
|
|
189
94
|
export type SearchFilesResponseChannelsMap = { [key: string]: unknown | undefined };
|
|
190
|
-
export const SearchFilesResponseChannelsMap = /*@__PURE__*/ S.Record(
|
|
191
|
-
S.String,
|
|
192
|
-
S.Unknown,
|
|
193
|
-
) as any as S.Schema<SearchFilesResponseChannelsMap>;
|
|
194
|
-
|
|
195
95
|
export type SearchFilesResponseImsMap = { [key: string]: unknown | undefined };
|
|
196
|
-
export const SearchFilesResponseImsMap = /*@__PURE__*/ S.Record(
|
|
197
|
-
S.String,
|
|
198
|
-
S.Unknown,
|
|
199
|
-
) as any as S.Schema<SearchFilesResponseImsMap>;
|
|
200
|
-
|
|
201
96
|
export type SearchFilesResponseGroupsMap = { [key: string]: unknown | undefined };
|
|
202
|
-
export const SearchFilesResponseGroupsMap = /*@__PURE__*/ S.Record(
|
|
203
|
-
S.String,
|
|
204
|
-
S.Unknown,
|
|
205
|
-
) as any as S.Schema<SearchFilesResponseGroupsMap>;
|
|
206
|
-
|
|
207
97
|
export interface SearchFilesResponse {
|
|
208
98
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
209
99
|
ok: boolean;
|
|
@@ -218,24 +108,7 @@ export interface SearchFilesResponse {
|
|
|
218
108
|
query?: string;
|
|
219
109
|
ignored_exclude_bots_pref?: boolean;
|
|
220
110
|
}
|
|
221
|
-
export const SearchFilesResponse = /*@__PURE__*/ S.suspend(() =>
|
|
222
|
-
S.Struct({
|
|
223
|
-
ok: S.Boolean,
|
|
224
|
-
files: S.optional(SearchFilesResponseFiles),
|
|
225
|
-
callstack: S.optional(S.String),
|
|
226
|
-
users: S.optional(SearchFilesResponseUsersMap),
|
|
227
|
-
teams: S.optional(SearchFilesResponseTeamsMap),
|
|
228
|
-
channels: S.optional(SearchFilesResponseChannelsMap),
|
|
229
|
-
ims: S.optional(SearchFilesResponseImsMap),
|
|
230
|
-
groups: S.optional(SearchFilesResponseGroupsMap),
|
|
231
|
-
query: S.optional(S.String),
|
|
232
|
-
ignored_exclude_bots_pref: S.optional(S.Boolean),
|
|
233
|
-
}),
|
|
234
|
-
).annotate({ identifier: "SearchFilesResponse" }) as any as S.Schema<SearchFilesResponse>;
|
|
235
|
-
|
|
236
111
|
export type SearchMessagesRequestSortDir = "asc" | "desc" | "";
|
|
237
|
-
export const SearchMessagesRequestSortDir = S.String;
|
|
238
|
-
|
|
239
112
|
export interface SearchMessagesRequest {
|
|
240
113
|
/** Pass the number of results you want per "page". Maximum of `100`. */
|
|
241
114
|
count?: number;
|
|
@@ -253,35 +126,9 @@ export interface SearchMessagesRequest {
|
|
|
253
126
|
/** encoded team id to search in, required if org token is used */
|
|
254
127
|
team_id?: string;
|
|
255
128
|
}
|
|
256
|
-
export const SearchMessagesRequest = /*@__PURE__*/ S.suspend(() =>
|
|
257
|
-
S.Struct({
|
|
258
|
-
count: S.optional(S.Number.pipe(T.Query())),
|
|
259
|
-
highlight: S.optional(S.Boolean.pipe(T.Query())),
|
|
260
|
-
page: S.optional(S.Number.pipe(T.Query())),
|
|
261
|
-
cursor: S.optional(S.String.pipe(T.Query())),
|
|
262
|
-
query: S.String.pipe(T.Query()),
|
|
263
|
-
sort: S.optional(S.String.pipe(T.Query())),
|
|
264
|
-
sort_dir: S.optional(SearchMessagesRequestSortDir.pipe(T.Query())),
|
|
265
|
-
team_id: S.optional(S.String.pipe(T.Query())),
|
|
266
|
-
}).pipe(T.Http({ method: "GET", uri: "/search.messages", code: 200 })),
|
|
267
|
-
).annotate({ identifier: "SearchMessagesRequest" }) as any as S.Schema<SearchMessagesRequest>;
|
|
268
|
-
|
|
269
129
|
export type SearchMessagesResponseUsersMap = { [key: string]: unknown | undefined };
|
|
270
|
-
export const SearchMessagesResponseUsersMap = /*@__PURE__*/ S.Record(
|
|
271
|
-
S.String,
|
|
272
|
-
S.Unknown,
|
|
273
|
-
) as any as S.Schema<SearchMessagesResponseUsersMap>;
|
|
274
|
-
|
|
275
130
|
export type SearchMessagesResponseMessagesMatchesList = Array<unknown>;
|
|
276
|
-
export const SearchMessagesResponseMessagesMatchesList = /*@__PURE__*/ S.Array(
|
|
277
|
-
S.Unknown,
|
|
278
|
-
) as any as S.Schema<SearchMessagesResponseMessagesMatchesList>;
|
|
279
|
-
|
|
280
131
|
export type SearchMessagesResponseMessagesPaginationWarningsList = Array<string>;
|
|
281
|
-
export const SearchMessagesResponseMessagesPaginationWarningsList = /*@__PURE__*/ S.Array(
|
|
282
|
-
S.String,
|
|
283
|
-
) as any as S.Schema<SearchMessagesResponseMessagesPaginationWarningsList>;
|
|
284
|
-
|
|
285
132
|
export interface SearchMessagesResponseMessagesPagination {
|
|
286
133
|
/** Last result id */
|
|
287
134
|
last?: number;
|
|
@@ -299,26 +146,7 @@ export interface SearchMessagesResponseMessagesPagination {
|
|
|
299
146
|
/** value of next cursor to be passed when using cursormark pagination */
|
|
300
147
|
next_cursor?: string;
|
|
301
148
|
}
|
|
302
|
-
export const SearchMessagesResponseMessagesPagination = /*@__PURE__*/ S.suspend(() =>
|
|
303
|
-
S.Struct({
|
|
304
|
-
last: S.optional(S.Number),
|
|
305
|
-
warnings: S.optional(SearchMessagesResponseMessagesPaginationWarningsList),
|
|
306
|
-
total_count: S.optional(S.Number),
|
|
307
|
-
page_count: S.optional(S.Number),
|
|
308
|
-
per_page: S.optional(S.Number),
|
|
309
|
-
page: S.optional(S.Number),
|
|
310
|
-
first: S.optional(S.Number),
|
|
311
|
-
next_cursor: S.optional(S.String),
|
|
312
|
-
}),
|
|
313
|
-
).annotate({
|
|
314
|
-
identifier: "SearchMessagesResponseMessagesPagination",
|
|
315
|
-
}) as any as S.Schema<SearchMessagesResponseMessagesPagination>;
|
|
316
|
-
|
|
317
149
|
export type SearchMessagesResponseMessagesPagingWarningsList = Array<string>;
|
|
318
|
-
export const SearchMessagesResponseMessagesPagingWarningsList = /*@__PURE__*/ S.Array(
|
|
319
|
-
S.String,
|
|
320
|
-
) as any as S.Schema<SearchMessagesResponseMessagesPagingWarningsList>;
|
|
321
|
-
|
|
322
150
|
export interface SearchMessagesResponseMessagesPaging {
|
|
323
151
|
/** Number of results per page */
|
|
324
152
|
count?: number;
|
|
@@ -332,19 +160,6 @@ export interface SearchMessagesResponseMessagesPaging {
|
|
|
332
160
|
/** next cursor to be passed to the method for next set of results using cursor pagination */
|
|
333
161
|
next_cursor?: string;
|
|
334
162
|
}
|
|
335
|
-
export const SearchMessagesResponseMessagesPaging = /*@__PURE__*/ S.suspend(() =>
|
|
336
|
-
S.Struct({
|
|
337
|
-
count: S.optional(S.Number),
|
|
338
|
-
total: S.optional(S.Number),
|
|
339
|
-
pages: S.optional(S.Number),
|
|
340
|
-
page: S.optional(S.Number),
|
|
341
|
-
warnings: S.optional(SearchMessagesResponseMessagesPagingWarningsList),
|
|
342
|
-
next_cursor: S.optional(S.String),
|
|
343
|
-
}),
|
|
344
|
-
).annotate({
|
|
345
|
-
identifier: "SearchMessagesResponseMessagesPaging",
|
|
346
|
-
}) as any as S.Schema<SearchMessagesResponseMessagesPaging>;
|
|
347
|
-
|
|
348
163
|
export interface SearchMessagesResponseMessages {
|
|
349
164
|
matches?: SearchMessagesResponseMessagesMatchesList;
|
|
350
165
|
pagination?: SearchMessagesResponseMessagesPagination;
|
|
@@ -353,43 +168,13 @@ export interface SearchMessagesResponseMessages {
|
|
|
353
168
|
all_stop_words?: boolean;
|
|
354
169
|
paging?: SearchMessagesResponseMessagesPaging;
|
|
355
170
|
}
|
|
356
|
-
export const SearchMessagesResponseMessages = /*@__PURE__*/ S.suspend(() =>
|
|
357
|
-
S.Struct({
|
|
358
|
-
matches: S.optional(SearchMessagesResponseMessagesMatchesList),
|
|
359
|
-
pagination: S.optional(SearchMessagesResponseMessagesPagination),
|
|
360
|
-
total: S.optional(S.Number),
|
|
361
|
-
all_stop_words: S.optional(S.Boolean),
|
|
362
|
-
paging: S.optional(SearchMessagesResponseMessagesPaging),
|
|
363
|
-
}),
|
|
364
|
-
).annotate({
|
|
365
|
-
identifier: "SearchMessagesResponseMessages",
|
|
366
|
-
}) as any as S.Schema<SearchMessagesResponseMessages>;
|
|
367
|
-
|
|
368
171
|
export type SearchMessagesResponseTeamsMap = { [key: string]: unknown | undefined };
|
|
369
|
-
export const SearchMessagesResponseTeamsMap = /*@__PURE__*/ S.Record(
|
|
370
|
-
S.String,
|
|
371
|
-
S.Unknown,
|
|
372
|
-
) as any as S.Schema<SearchMessagesResponseTeamsMap>;
|
|
373
|
-
|
|
374
172
|
export type SearchMessagesResponseBotsMap = { [key: string]: unknown | undefined };
|
|
375
|
-
export const SearchMessagesResponseBotsMap = /*@__PURE__*/ S.Record(
|
|
376
|
-
S.String,
|
|
377
|
-
S.Unknown,
|
|
378
|
-
) as any as S.Schema<SearchMessagesResponseBotsMap>;
|
|
379
|
-
|
|
380
173
|
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
381
174
|
export interface SearchMessagesResponseResponseMetadata {
|
|
382
|
-
/** Cursor for the next page
|
|
175
|
+
/** Cursor for the next page -- pass as `cursor` on the next call. */
|
|
383
176
|
next_cursor?: string;
|
|
384
177
|
}
|
|
385
|
-
export const SearchMessagesResponseResponseMetadata = /*@__PURE__*/ S.suspend(() =>
|
|
386
|
-
S.Struct({
|
|
387
|
-
next_cursor: S.optional(S.String),
|
|
388
|
-
}),
|
|
389
|
-
).annotate({
|
|
390
|
-
identifier: "SearchMessagesResponseResponseMetadata",
|
|
391
|
-
}) as any as S.Schema<SearchMessagesResponseResponseMetadata>;
|
|
392
|
-
|
|
393
178
|
export interface SearchMessagesResponse {
|
|
394
179
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
395
180
|
ok: boolean;
|
|
@@ -405,62 +190,226 @@ export interface SearchMessagesResponse {
|
|
|
405
190
|
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
406
191
|
response_metadata?: SearchMessagesResponseResponseMetadata;
|
|
407
192
|
}
|
|
408
|
-
export const SearchMessagesResponse = /*@__PURE__*/ S.suspend(() =>
|
|
409
|
-
S.Struct({
|
|
410
|
-
ok: S.Boolean,
|
|
411
|
-
callstack: S.optional(S.String),
|
|
412
|
-
users: S.optional(SearchMessagesResponseUsersMap),
|
|
413
|
-
messages: S.optional(SearchMessagesResponseMessages),
|
|
414
|
-
show_feedback: S.optional(S.Boolean),
|
|
415
|
-
teams: S.optional(SearchMessagesResponseTeamsMap),
|
|
416
|
-
query: S.optional(S.String),
|
|
417
|
-
bots: S.optional(SearchMessagesResponseBotsMap),
|
|
418
|
-
ignored_exclude_bots_pref: S.optional(S.Boolean),
|
|
419
|
-
response_metadata: S.optional(SearchMessagesResponseResponseMetadata),
|
|
420
|
-
}),
|
|
421
|
-
).annotate({ identifier: "SearchMessagesResponse" }) as any as S.Schema<SearchMessagesResponse>;
|
|
422
|
-
|
|
423
193
|
export type SearchAllError = SlackOpError;
|
|
424
|
-
/** Searches for messages and files matching a query. Required scopes
|
|
194
|
+
/** Searches for messages and files matching a query. Required scopes -- user: `search:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `no_query` -- No query was provided. See https://docs.slack.dev/reference/methods/search.all */
|
|
425
195
|
export const searchAll: API.OperationMethod<
|
|
426
196
|
SearchAllRequest,
|
|
427
197
|
SearchAllResponse,
|
|
428
198
|
SearchAllError,
|
|
429
199
|
SlackOpContext
|
|
430
200
|
> = /*@__PURE__*/ API.make(() => ({
|
|
431
|
-
input: SearchAllRequest
|
|
432
|
-
output: SearchAllResponse
|
|
201
|
+
input: __S(0, __c0, 0) as any as S.Schema<SearchAllRequest>,
|
|
202
|
+
output: __S(1, __c0, 1) as any as S.Schema<SearchAllResponse>,
|
|
433
203
|
errors: [SlackError, SlackRateLimited],
|
|
434
204
|
protocol: SlackProtocol,
|
|
435
205
|
retry: Retry.Retry,
|
|
436
206
|
}));
|
|
437
207
|
|
|
438
208
|
export type SearchFilesError = SlackOpError;
|
|
439
|
-
/** Searches for files matching a query. Required scopes
|
|
209
|
+
/** Searches for files matching a query. Required scopes -- user: `search:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `no_query` -- No query was provided. See https://docs.slack.dev/reference/methods/search.files */
|
|
440
210
|
export const searchFiles: API.OperationMethod<
|
|
441
211
|
SearchFilesRequest,
|
|
442
212
|
SearchFilesResponse,
|
|
443
213
|
SearchFilesError,
|
|
444
214
|
SlackOpContext
|
|
445
215
|
> = /*@__PURE__*/ API.make(() => ({
|
|
446
|
-
input: SearchFilesRequest
|
|
447
|
-
output: SearchFilesResponse
|
|
216
|
+
input: __S(8, __c1, 0) as any as S.Schema<SearchFilesRequest>,
|
|
217
|
+
output: __S(12, __c1, 4) as any as S.Schema<SearchFilesResponse>,
|
|
448
218
|
errors: [SlackError, SlackRateLimited],
|
|
449
219
|
protocol: SlackProtocol,
|
|
450
220
|
retry: Retry.Retry,
|
|
451
221
|
}));
|
|
452
222
|
|
|
453
223
|
export type SearchMessagesError = SlackOpError;
|
|
454
|
-
/** Searches for messages matching a query. Required scopes
|
|
224
|
+
/** Searches for messages matching a query. Required scopes -- user: `search:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `no_query` -- No query was provided. See https://docs.slack.dev/reference/methods/search.messages */
|
|
455
225
|
export const searchMessages: API.OperationMethod<
|
|
456
226
|
SearchMessagesRequest,
|
|
457
227
|
SearchMessagesResponse,
|
|
458
228
|
SearchMessagesError,
|
|
459
229
|
SlackOpContext
|
|
460
230
|
> = /*@__PURE__*/ API.make(() => ({
|
|
461
|
-
input: SearchMessagesRequest
|
|
462
|
-
output: SearchMessagesResponse
|
|
231
|
+
input: __S(24, __c3, 0) as any as S.Schema<SearchMessagesRequest>,
|
|
232
|
+
output: __S(29, __c3, 5) as any as S.Schema<SearchMessagesResponse>,
|
|
463
233
|
errors: [SlackError, SlackRateLimited],
|
|
464
234
|
protocol: SlackProtocol,
|
|
465
235
|
retry: Retry.Retry,
|
|
466
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
|
+
count: S.optional(S.Number.pipe(T.Query())),
|
|
245
|
+
highlight: S.optional(S.Boolean.pipe(T.Query())),
|
|
246
|
+
page: S.optional(S.Number.pipe(T.Query())),
|
|
247
|
+
query: S.String.pipe(T.Query()),
|
|
248
|
+
sort: S.optional(S.String.pipe(T.Query())),
|
|
249
|
+
sort_dir: S.optional(S.String.pipe(T.Query())),
|
|
250
|
+
team_id: S.optional(S.String.pipe(T.Query())),
|
|
251
|
+
}).pipe(T.Http({ method: "GET", uri: "/search.all", code: 200 })),
|
|
252
|
+
).annotate({ identifier: "SearchAllRequest" });
|
|
253
|
+
case 1:
|
|
254
|
+
return S.suspend(() =>
|
|
255
|
+
S.Struct({
|
|
256
|
+
ok: S.Boolean,
|
|
257
|
+
files: S.optional(S.Unknown),
|
|
258
|
+
callstack: S.optional(S.String),
|
|
259
|
+
messages: S.optional(S.Unknown),
|
|
260
|
+
posts: S.optional(S.Unknown),
|
|
261
|
+
query: S.optional(S.String),
|
|
262
|
+
}),
|
|
263
|
+
).annotate({ identifier: "SearchAllResponse" });
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
function __c1(j: number): any {
|
|
267
|
+
switch (j) {
|
|
268
|
+
case 0:
|
|
269
|
+
return S.suspend(() =>
|
|
270
|
+
S.Struct({
|
|
271
|
+
count: S.optional(S.Number.pipe(T.Query())),
|
|
272
|
+
highlight: S.optional(S.Boolean.pipe(T.Query())),
|
|
273
|
+
page: S.optional(S.Number.pipe(T.Query())),
|
|
274
|
+
query: S.String.pipe(T.Query()),
|
|
275
|
+
sort: S.optional(S.String.pipe(T.Query())),
|
|
276
|
+
sort_dir: S.optional(S.String.pipe(T.Query())),
|
|
277
|
+
team_id: S.optional(S.String.pipe(T.Query())),
|
|
278
|
+
}).pipe(T.Http({ method: "GET", uri: "/search.files", code: 200 })),
|
|
279
|
+
).annotate({ identifier: "SearchFilesRequest" });
|
|
280
|
+
case 1:
|
|
281
|
+
return S.suspend(() =>
|
|
282
|
+
S.Struct({
|
|
283
|
+
last: S.optional(S.Number),
|
|
284
|
+
warnings: S.optional(__S(16, __c2, 0)),
|
|
285
|
+
total_count: S.optional(S.Number),
|
|
286
|
+
page_count: S.optional(S.Number),
|
|
287
|
+
per_page: S.optional(S.Number),
|
|
288
|
+
page: S.optional(S.Number),
|
|
289
|
+
first: S.optional(S.Number),
|
|
290
|
+
}),
|
|
291
|
+
).annotate({ identifier: "SearchFilesResponseFilesPagination" });
|
|
292
|
+
case 2:
|
|
293
|
+
return S.suspend(() =>
|
|
294
|
+
S.Struct({
|
|
295
|
+
count: S.optional(S.Number),
|
|
296
|
+
pages: S.optional(S.Number),
|
|
297
|
+
total: S.optional(S.Number),
|
|
298
|
+
page: S.optional(S.Number),
|
|
299
|
+
warnings: S.optional(__S(16, __c2, 0)),
|
|
300
|
+
}),
|
|
301
|
+
).annotate({ identifier: "SearchFilesResponseFilesPaging" });
|
|
302
|
+
case 3:
|
|
303
|
+
return S.suspend(() =>
|
|
304
|
+
S.Struct({
|
|
305
|
+
pagination: S.optional(__S(9, __c1, 1)),
|
|
306
|
+
matches: S.optional(__S(17, __c2, 1)),
|
|
307
|
+
paging: S.optional(__S(10, __c1, 2)),
|
|
308
|
+
all_stop_words: S.optional(S.Boolean),
|
|
309
|
+
total: S.optional(S.Number),
|
|
310
|
+
query_too_long: S.optional(S.Boolean),
|
|
311
|
+
}),
|
|
312
|
+
).annotate({ identifier: "SearchFilesResponseFiles" });
|
|
313
|
+
case 4:
|
|
314
|
+
return S.suspend(() =>
|
|
315
|
+
S.Struct({
|
|
316
|
+
ok: S.Boolean,
|
|
317
|
+
files: S.optional(__S(11, __c1, 3)),
|
|
318
|
+
callstack: S.optional(S.String),
|
|
319
|
+
users: S.optional(__S(18, __c2, 2)),
|
|
320
|
+
teams: S.optional(__S(18, __c2, 2)),
|
|
321
|
+
channels: S.optional(__S(18, __c2, 2)),
|
|
322
|
+
ims: S.optional(__S(18, __c2, 2)),
|
|
323
|
+
groups: S.optional(__S(18, __c2, 2)),
|
|
324
|
+
query: S.optional(S.String),
|
|
325
|
+
ignored_exclude_bots_pref: S.optional(S.Boolean),
|
|
326
|
+
}),
|
|
327
|
+
).annotate({ identifier: "SearchFilesResponse" });
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
function __c2(j: number): any {
|
|
331
|
+
switch (j) {
|
|
332
|
+
case 0:
|
|
333
|
+
return S.Array(S.String);
|
|
334
|
+
case 1:
|
|
335
|
+
return S.Array(S.Unknown);
|
|
336
|
+
case 2:
|
|
337
|
+
return S.Record(S.String, S.Unknown);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
function __c3(j: number): any {
|
|
341
|
+
switch (j) {
|
|
342
|
+
case 0:
|
|
343
|
+
return S.suspend(() =>
|
|
344
|
+
S.Struct({
|
|
345
|
+
count: S.optional(S.Number.pipe(T.Query())),
|
|
346
|
+
highlight: S.optional(S.Boolean.pipe(T.Query())),
|
|
347
|
+
page: S.optional(S.Number.pipe(T.Query())),
|
|
348
|
+
cursor: S.optional(S.String.pipe(T.Query())),
|
|
349
|
+
query: S.String.pipe(T.Query()),
|
|
350
|
+
sort: S.optional(S.String.pipe(T.Query())),
|
|
351
|
+
sort_dir: S.optional(S.String.pipe(T.Query())),
|
|
352
|
+
team_id: S.optional(S.String.pipe(T.Query())),
|
|
353
|
+
}).pipe(T.Http({ method: "GET", uri: "/search.messages", code: 200 })),
|
|
354
|
+
).annotate({ identifier: "SearchMessagesRequest" });
|
|
355
|
+
case 1:
|
|
356
|
+
return S.suspend(() =>
|
|
357
|
+
S.Struct({
|
|
358
|
+
last: S.optional(S.Number),
|
|
359
|
+
warnings: S.optional(__S(16, __c2, 0)),
|
|
360
|
+
total_count: S.optional(S.Number),
|
|
361
|
+
page_count: S.optional(S.Number),
|
|
362
|
+
per_page: S.optional(S.Number),
|
|
363
|
+
page: S.optional(S.Number),
|
|
364
|
+
first: S.optional(S.Number),
|
|
365
|
+
next_cursor: S.optional(S.String),
|
|
366
|
+
}),
|
|
367
|
+
).annotate({ identifier: "SearchMessagesResponseMessagesPagination" });
|
|
368
|
+
case 2:
|
|
369
|
+
return S.suspend(() =>
|
|
370
|
+
S.Struct({
|
|
371
|
+
count: S.optional(S.Number),
|
|
372
|
+
total: S.optional(S.Number),
|
|
373
|
+
pages: S.optional(S.Number),
|
|
374
|
+
page: S.optional(S.Number),
|
|
375
|
+
warnings: S.optional(__S(16, __c2, 0)),
|
|
376
|
+
next_cursor: S.optional(S.String),
|
|
377
|
+
}),
|
|
378
|
+
).annotate({ identifier: "SearchMessagesResponseMessagesPaging" });
|
|
379
|
+
case 3:
|
|
380
|
+
return S.suspend(() =>
|
|
381
|
+
S.Struct({
|
|
382
|
+
matches: S.optional(__S(17, __c2, 1)),
|
|
383
|
+
pagination: S.optional(__S(25, __c3, 1)),
|
|
384
|
+
total: S.optional(S.Number),
|
|
385
|
+
all_stop_words: S.optional(S.Boolean),
|
|
386
|
+
paging: S.optional(__S(26, __c3, 2)),
|
|
387
|
+
}),
|
|
388
|
+
).annotate({ identifier: "SearchMessagesResponseMessages" });
|
|
389
|
+
case 4:
|
|
390
|
+
return S.suspend(() =>
|
|
391
|
+
S.Struct({
|
|
392
|
+
next_cursor: S.optional(S.String),
|
|
393
|
+
}),
|
|
394
|
+
).annotate({ identifier: "SearchMessagesResponseResponseMetadata" });
|
|
395
|
+
case 5:
|
|
396
|
+
return S.suspend(() =>
|
|
397
|
+
S.Struct({
|
|
398
|
+
ok: S.Boolean,
|
|
399
|
+
callstack: S.optional(S.String),
|
|
400
|
+
users: S.optional(__S(18, __c2, 2)),
|
|
401
|
+
messages: S.optional(__S(27, __c3, 3)),
|
|
402
|
+
show_feedback: S.optional(S.Boolean),
|
|
403
|
+
teams: S.optional(__S(18, __c2, 2)),
|
|
404
|
+
query: S.optional(S.String),
|
|
405
|
+
bots: S.optional(__S(18, __c2, 2)),
|
|
406
|
+
ignored_exclude_bots_pref: S.optional(S.Boolean),
|
|
407
|
+
response_metadata: S.optional(__S(28, __c3, 4)),
|
|
408
|
+
}),
|
|
409
|
+
).annotate({ identifier: "SearchMessagesResponse" });
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
413
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
414
|
+
return (__s[i] ??= __L.at(f, j));
|
|
415
|
+
}
|