@distilled.cloud/slack 1.0.0-rc.14 → 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/stars.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
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 { slackPaginate } from "../pagination.ts";
|
|
6
7
|
import { SlackProtocol, type SlackOpError, type SlackOpContext } from "../protocol.ts";
|
|
7
8
|
import * as Retry from "../retry.ts";
|
|
8
9
|
import * as T from "../traits.ts";
|
|
10
|
+
// Schema table, filled on first reach (see __S at the end).
|
|
11
|
+
const __s: any[] = [];
|
|
9
12
|
|
|
10
13
|
export type { SlackOpError, SlackOpContext };
|
|
11
14
|
|
|
@@ -19,25 +22,10 @@ export interface AddStarRequest {
|
|
|
19
22
|
/** Timestamp of the message to add star to. */
|
|
20
23
|
timestamp?: string;
|
|
21
24
|
}
|
|
22
|
-
export const AddStarRequest = /*@__PURE__*/ S.suspend(() =>
|
|
23
|
-
S.Struct({
|
|
24
|
-
channel: S.optional(S.String),
|
|
25
|
-
file: S.optional(S.String),
|
|
26
|
-
file_comment: S.optional(S.String),
|
|
27
|
-
timestamp: S.optional(S.String),
|
|
28
|
-
}).pipe(T.Http({ method: "POST", uri: "/stars.add", code: 200 })),
|
|
29
|
-
).annotate({ identifier: "AddStarRequest" }) as any as S.Schema<AddStarRequest>;
|
|
30
|
-
|
|
31
25
|
export interface AddStarResponse {
|
|
32
26
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
33
27
|
ok: boolean;
|
|
34
28
|
}
|
|
35
|
-
export const AddStarResponse = /*@__PURE__*/ S.suspend(() =>
|
|
36
|
-
S.Struct({
|
|
37
|
-
ok: S.Boolean,
|
|
38
|
-
}),
|
|
39
|
-
).annotate({ identifier: "AddStarResponse" }) as any as S.Schema<AddStarResponse>;
|
|
40
|
-
|
|
41
29
|
export interface ListStarsRequest {
|
|
42
30
|
count?: number;
|
|
43
31
|
/** Parameter for pagination. Set `cursor` equal to the `next_cursor` attribute returned by the previous request's `response_metadata`. This parameter is optional, but pagination is mandatory: the default value simply fetches the first "page" of the collection. See [pagination](/apis/web-api/pagination) for more details. */
|
|
@@ -48,128 +36,44 @@ export interface ListStarsRequest {
|
|
|
48
36
|
/** encoded team id to list stars in, required if org token is used */
|
|
49
37
|
team_id?: string;
|
|
50
38
|
}
|
|
51
|
-
export const ListStarsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
52
|
-
S.Struct({
|
|
53
|
-
count: S.optional(S.Number.pipe(T.Query())),
|
|
54
|
-
cursor: S.optional(S.String.pipe(T.Query())),
|
|
55
|
-
limit: S.optional(S.Number.pipe(T.Query())),
|
|
56
|
-
page: S.optional(S.Number.pipe(T.Query())),
|
|
57
|
-
team_id: S.optional(S.String.pipe(T.Query())),
|
|
58
|
-
}).pipe(T.Http({ method: "GET", uri: "/stars.list", code: 200 })),
|
|
59
|
-
).annotate({ identifier: "ListStarsRequest" }) as any as S.Schema<ListStarsRequest>;
|
|
60
|
-
|
|
61
39
|
export type ListStarsResponseItemsItemCase0Type = "message";
|
|
62
|
-
export const ListStarsResponseItemsItemCase0Type = S.String;
|
|
63
|
-
|
|
64
40
|
export interface ListStarsResponseItemsItemCase0 {
|
|
65
41
|
type: ListStarsResponseItemsItemCase0Type;
|
|
66
42
|
channel: string;
|
|
67
43
|
message: unknown;
|
|
68
44
|
date_create: number;
|
|
69
45
|
}
|
|
70
|
-
export const ListStarsResponseItemsItemCase0 = /*@__PURE__*/ S.suspend(() =>
|
|
71
|
-
S.Struct({
|
|
72
|
-
type: ListStarsResponseItemsItemCase0Type,
|
|
73
|
-
channel: S.String,
|
|
74
|
-
message: S.Unknown,
|
|
75
|
-
date_create: S.Number,
|
|
76
|
-
}),
|
|
77
|
-
).annotate({
|
|
78
|
-
identifier: "ListStarsResponseItemsItemCase0",
|
|
79
|
-
}) as any as S.Schema<ListStarsResponseItemsItemCase0>;
|
|
80
|
-
|
|
81
46
|
export type ListStarsResponseItemsItemCase1Type = "file";
|
|
82
|
-
export const ListStarsResponseItemsItemCase1Type = S.String;
|
|
83
|
-
|
|
84
47
|
export interface ListStarsResponseItemsItemCase1 {
|
|
85
48
|
type: ListStarsResponseItemsItemCase1Type;
|
|
86
49
|
file: unknown;
|
|
87
50
|
date_create: number;
|
|
88
51
|
}
|
|
89
|
-
export const ListStarsResponseItemsItemCase1 = /*@__PURE__*/ S.suspend(() =>
|
|
90
|
-
S.Struct({
|
|
91
|
-
type: ListStarsResponseItemsItemCase1Type,
|
|
92
|
-
file: S.Unknown,
|
|
93
|
-
date_create: S.Number,
|
|
94
|
-
}),
|
|
95
|
-
).annotate({
|
|
96
|
-
identifier: "ListStarsResponseItemsItemCase1",
|
|
97
|
-
}) as any as S.Schema<ListStarsResponseItemsItemCase1>;
|
|
98
|
-
|
|
99
52
|
export type ListStarsResponseItemsItemCase2Type = "file_comment";
|
|
100
|
-
export const ListStarsResponseItemsItemCase2Type = S.String;
|
|
101
|
-
|
|
102
53
|
export interface ListStarsResponseItemsItemCase2 {
|
|
103
54
|
type: ListStarsResponseItemsItemCase2Type;
|
|
104
55
|
file: unknown;
|
|
105
56
|
comment: unknown;
|
|
106
57
|
date_create: number;
|
|
107
58
|
}
|
|
108
|
-
export const ListStarsResponseItemsItemCase2 = /*@__PURE__*/ S.suspend(() =>
|
|
109
|
-
S.Struct({
|
|
110
|
-
type: ListStarsResponseItemsItemCase2Type,
|
|
111
|
-
file: S.Unknown,
|
|
112
|
-
comment: S.Unknown,
|
|
113
|
-
date_create: S.Number,
|
|
114
|
-
}),
|
|
115
|
-
).annotate({
|
|
116
|
-
identifier: "ListStarsResponseItemsItemCase2",
|
|
117
|
-
}) as any as S.Schema<ListStarsResponseItemsItemCase2>;
|
|
118
|
-
|
|
119
59
|
export type ListStarsResponseItemsItemCase3Type = "channel";
|
|
120
|
-
export const ListStarsResponseItemsItemCase3Type = S.String;
|
|
121
|
-
|
|
122
60
|
export interface ListStarsResponseItemsItemCase3 {
|
|
123
61
|
type: ListStarsResponseItemsItemCase3Type;
|
|
124
62
|
channel: string;
|
|
125
63
|
date_create: number;
|
|
126
64
|
}
|
|
127
|
-
export const ListStarsResponseItemsItemCase3 = /*@__PURE__*/ S.suspend(() =>
|
|
128
|
-
S.Struct({
|
|
129
|
-
type: ListStarsResponseItemsItemCase3Type,
|
|
130
|
-
channel: S.String,
|
|
131
|
-
date_create: S.Number,
|
|
132
|
-
}),
|
|
133
|
-
).annotate({
|
|
134
|
-
identifier: "ListStarsResponseItemsItemCase3",
|
|
135
|
-
}) as any as S.Schema<ListStarsResponseItemsItemCase3>;
|
|
136
|
-
|
|
137
65
|
export type ListStarsResponseItemsItemCase4Type = "im";
|
|
138
|
-
export const ListStarsResponseItemsItemCase4Type = S.String;
|
|
139
|
-
|
|
140
66
|
export interface ListStarsResponseItemsItemCase4 {
|
|
141
67
|
type: ListStarsResponseItemsItemCase4Type;
|
|
142
68
|
channel: string;
|
|
143
69
|
date_create: number;
|
|
144
70
|
}
|
|
145
|
-
export const ListStarsResponseItemsItemCase4 = /*@__PURE__*/ S.suspend(() =>
|
|
146
|
-
S.Struct({
|
|
147
|
-
type: ListStarsResponseItemsItemCase4Type,
|
|
148
|
-
channel: S.String,
|
|
149
|
-
date_create: S.Number,
|
|
150
|
-
}),
|
|
151
|
-
).annotate({
|
|
152
|
-
identifier: "ListStarsResponseItemsItemCase4",
|
|
153
|
-
}) as any as S.Schema<ListStarsResponseItemsItemCase4>;
|
|
154
|
-
|
|
155
71
|
export type ListStarsResponseItemsItemCase5Type = "group";
|
|
156
|
-
export const ListStarsResponseItemsItemCase5Type = S.String;
|
|
157
|
-
|
|
158
72
|
export interface ListStarsResponseItemsItemCase5 {
|
|
159
73
|
type: ListStarsResponseItemsItemCase5Type;
|
|
160
74
|
channel: string;
|
|
161
75
|
date_create: number;
|
|
162
76
|
}
|
|
163
|
-
export const ListStarsResponseItemsItemCase5 = /*@__PURE__*/ S.suspend(() =>
|
|
164
|
-
S.Struct({
|
|
165
|
-
type: ListStarsResponseItemsItemCase5Type,
|
|
166
|
-
channel: S.String,
|
|
167
|
-
date_create: S.Number,
|
|
168
|
-
}),
|
|
169
|
-
).annotate({
|
|
170
|
-
identifier: "ListStarsResponseItemsItemCase5",
|
|
171
|
-
}) as any as S.Schema<ListStarsResponseItemsItemCase5>;
|
|
172
|
-
|
|
173
77
|
export type ListStarsResponseItemsItem =
|
|
174
78
|
| ListStarsResponseItemsItemCase0
|
|
175
79
|
| ListStarsResponseItemsItemCase1
|
|
@@ -177,38 +81,12 @@ export type ListStarsResponseItemsItem =
|
|
|
177
81
|
| ListStarsResponseItemsItemCase3
|
|
178
82
|
| ListStarsResponseItemsItemCase4
|
|
179
83
|
| ListStarsResponseItemsItemCase5;
|
|
180
|
-
export const ListStarsResponseItemsItem = /*@__PURE__*/ S.Unknown.pipe(
|
|
181
|
-
T.UnionCases(
|
|
182
|
-
[
|
|
183
|
-
["type", "channel", "message", "date_create"],
|
|
184
|
-
["type", "file", "date_create"],
|
|
185
|
-
["type", "file", "comment", "date_create"],
|
|
186
|
-
["type", "channel", "date_create"],
|
|
187
|
-
["type", "channel", "date_create"],
|
|
188
|
-
["type", "channel", "date_create"],
|
|
189
|
-
],
|
|
190
|
-
{ key: "type", values: ["message", "file", "file_comment", "channel", "im", "group"] },
|
|
191
|
-
),
|
|
192
|
-
);
|
|
193
|
-
|
|
194
84
|
export type ListStarsResponseItemsList = Array<ListStarsResponseItemsItem>;
|
|
195
|
-
export const ListStarsResponseItemsList = /*@__PURE__*/ S.Array(
|
|
196
|
-
ListStarsResponseItemsItem,
|
|
197
|
-
) as any as S.Schema<ListStarsResponseItemsList>;
|
|
198
|
-
|
|
199
85
|
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
200
86
|
export interface ListStarsResponseResponseMetadata {
|
|
201
|
-
/** Cursor for the next page
|
|
87
|
+
/** Cursor for the next page -- pass as `cursor` on the next call. */
|
|
202
88
|
next_cursor?: string;
|
|
203
89
|
}
|
|
204
|
-
export const ListStarsResponseResponseMetadata = /*@__PURE__*/ S.suspend(() =>
|
|
205
|
-
S.Struct({
|
|
206
|
-
next_cursor: S.optional(S.String),
|
|
207
|
-
}),
|
|
208
|
-
).annotate({
|
|
209
|
-
identifier: "ListStarsResponseResponseMetadata",
|
|
210
|
-
}) as any as S.Schema<ListStarsResponseResponseMetadata>;
|
|
211
|
-
|
|
212
90
|
export interface ListStarsResponse {
|
|
213
91
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
214
92
|
ok: boolean;
|
|
@@ -217,15 +95,6 @@ export interface ListStarsResponse {
|
|
|
217
95
|
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
218
96
|
response_metadata?: ListStarsResponseResponseMetadata;
|
|
219
97
|
}
|
|
220
|
-
export const ListStarsResponse = /*@__PURE__*/ S.suspend(() =>
|
|
221
|
-
S.Struct({
|
|
222
|
-
ok: S.Boolean,
|
|
223
|
-
items: ListStarsResponseItemsList,
|
|
224
|
-
paging: S.optional(S.Unknown),
|
|
225
|
-
response_metadata: S.optional(ListStarsResponseResponseMetadata),
|
|
226
|
-
}),
|
|
227
|
-
).annotate({ identifier: "ListStarsResponse" }) as any as S.Schema<ListStarsResponse>;
|
|
228
|
-
|
|
229
98
|
export interface RemoveStarRequest {
|
|
230
99
|
/** Channel to remove star from, or channel where the message to remove star from was posted (used with `timestamp`). */
|
|
231
100
|
channel?: string;
|
|
@@ -236,42 +105,27 @@ export interface RemoveStarRequest {
|
|
|
236
105
|
/** Timestamp of the message to remove star from. */
|
|
237
106
|
timestamp?: string;
|
|
238
107
|
}
|
|
239
|
-
export const RemoveStarRequest = /*@__PURE__*/ S.suspend(() =>
|
|
240
|
-
S.Struct({
|
|
241
|
-
channel: S.optional(S.String),
|
|
242
|
-
file: S.optional(S.String),
|
|
243
|
-
file_comment: S.optional(S.String),
|
|
244
|
-
timestamp: S.optional(S.String),
|
|
245
|
-
}).pipe(T.Http({ method: "POST", uri: "/stars.remove", code: 200 })),
|
|
246
|
-
).annotate({ identifier: "RemoveStarRequest" }) as any as S.Schema<RemoveStarRequest>;
|
|
247
|
-
|
|
248
108
|
export interface RemoveStarResponse {
|
|
249
109
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
250
110
|
ok: boolean;
|
|
251
111
|
}
|
|
252
|
-
export const RemoveStarResponse = /*@__PURE__*/ S.suspend(() =>
|
|
253
|
-
S.Struct({
|
|
254
|
-
ok: S.Boolean,
|
|
255
|
-
}),
|
|
256
|
-
).annotate({ identifier: "RemoveStarResponse" }) as any as S.Schema<RemoveStarResponse>;
|
|
257
|
-
|
|
258
112
|
export type AddStarError = SlackOpError;
|
|
259
|
-
/** Save an item for later. Formerly known as adding a star. Required scopes
|
|
113
|
+
/** Save an item for later. Formerly known as adding a star. Required scopes -- user: `stars:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `already_starred` -- The specified item has already been starred by the authenticated user. - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- Channel, private group, or DM specified by `channel` does not exist - `external_channel_migrating` -- Channel is undergoing active migration - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `file_not_found` -- File specified by `file` does not exist. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- `file`, `file_comment`, `channel` and `timestamp` was not specified. See https://docs.slack.dev/reference/methods/stars.add */
|
|
260
114
|
export const addStar: API.OperationMethod<
|
|
261
115
|
AddStarRequest,
|
|
262
116
|
AddStarResponse,
|
|
263
117
|
AddStarError,
|
|
264
118
|
SlackOpContext
|
|
265
119
|
> = /*@__PURE__*/ API.make(() => ({
|
|
266
|
-
input: AddStarRequest
|
|
267
|
-
output: AddStarResponse
|
|
120
|
+
input: __S(0, __c0, 0) as any as S.Schema<AddStarRequest>,
|
|
121
|
+
output: __S(8, __c1, 0) as any as S.Schema<AddStarResponse>,
|
|
268
122
|
errors: [SlackError, SlackRateLimited],
|
|
269
123
|
protocol: SlackProtocol,
|
|
270
124
|
retry: Retry.Retry,
|
|
271
125
|
}));
|
|
272
126
|
|
|
273
127
|
export type ListStarsError = SlackOpError;
|
|
274
|
-
/** (Deprecated) Listed a user's saved items, formerly known as stars. Required scopes
|
|
128
|
+
/** (Deprecated) Listed a user's saved items, formerly known as stars. Required scopes -- user: `stars:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- A required argument is missing. See https://docs.slack.dev/reference/methods/stars.list */
|
|
275
129
|
export const listStars: API.PaginatedOperationMethod<
|
|
276
130
|
ListStarsRequest,
|
|
277
131
|
ListStarsResponse,
|
|
@@ -280,8 +134,8 @@ export const listStars: API.PaginatedOperationMethod<
|
|
|
280
134
|
ListStarsResponseItemsItem
|
|
281
135
|
> = /*@__PURE__*/ API.makePaginated(
|
|
282
136
|
() => ({
|
|
283
|
-
input: ListStarsRequest
|
|
284
|
-
output: ListStarsResponse
|
|
137
|
+
input: __S(16, __c2, 0) as any as S.Schema<ListStarsRequest>,
|
|
138
|
+
output: __S(20, __c2, 4) as any as S.Schema<ListStarsResponse>,
|
|
285
139
|
errors: [SlackError, SlackRateLimited],
|
|
286
140
|
protocol: SlackProtocol,
|
|
287
141
|
retry: Retry.Retry,
|
|
@@ -297,16 +151,103 @@ export const listStars: API.PaginatedOperationMethod<
|
|
|
297
151
|
) as any;
|
|
298
152
|
|
|
299
153
|
export type RemoveStarError = SlackOpError;
|
|
300
|
-
/** Removes a saved item (star) from an item. Required scopes
|
|
154
|
+
/** Removes a saved item (star) from an item. Required scopes -- user: `stars:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- Channel, private group, or DM specified by `channel` does not exist - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `file_not_found` -- File specified by `file` does not exist. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- `file`, `file_comment`, `channel` and `timestamp` was not specified. - `not_starred` -- The specified item is not currently starred by the authenticated user. See https://docs.slack.dev/reference/methods/stars.remove */
|
|
301
155
|
export const removeStar: API.OperationMethod<
|
|
302
156
|
RemoveStarRequest,
|
|
303
157
|
RemoveStarResponse,
|
|
304
158
|
RemoveStarError,
|
|
305
159
|
SlackOpContext
|
|
306
160
|
> = /*@__PURE__*/ API.make(() => ({
|
|
307
|
-
input: RemoveStarRequest
|
|
308
|
-
output: RemoveStarResponse
|
|
161
|
+
input: __S(24, __c3, 0) as any as S.Schema<RemoveStarRequest>,
|
|
162
|
+
output: __S(8, __c1, 0) as any as S.Schema<RemoveStarResponse>,
|
|
309
163
|
errors: [SlackError, SlackRateLimited],
|
|
310
164
|
protocol: SlackProtocol,
|
|
311
165
|
retry: Retry.Retry,
|
|
312
166
|
}));
|
|
167
|
+
|
|
168
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
169
|
+
function __c0(j: number): any {
|
|
170
|
+
switch (j) {
|
|
171
|
+
case 0:
|
|
172
|
+
return S.suspend(() =>
|
|
173
|
+
S.Struct({
|
|
174
|
+
channel: S.optional(S.String),
|
|
175
|
+
file: S.optional(S.String),
|
|
176
|
+
file_comment: S.optional(S.String),
|
|
177
|
+
timestamp: S.optional(S.String),
|
|
178
|
+
}).pipe(T.Http({ method: "POST", uri: "/stars.add", code: 200 })),
|
|
179
|
+
).annotate({ identifier: "AddStarRequest" });
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function __c1(j: number): any {
|
|
183
|
+
switch (j) {
|
|
184
|
+
case 0:
|
|
185
|
+
return S.suspend(() =>
|
|
186
|
+
S.Struct({
|
|
187
|
+
ok: S.Boolean,
|
|
188
|
+
}),
|
|
189
|
+
).annotate({ identifier: "AddStarResponse" });
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
function __c2(j: number): any {
|
|
193
|
+
switch (j) {
|
|
194
|
+
case 0:
|
|
195
|
+
return S.suspend(() =>
|
|
196
|
+
S.Struct({
|
|
197
|
+
count: S.optional(S.Number.pipe(T.Query())),
|
|
198
|
+
cursor: S.optional(S.String.pipe(T.Query())),
|
|
199
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
200
|
+
page: S.optional(S.Number.pipe(T.Query())),
|
|
201
|
+
team_id: S.optional(S.String.pipe(T.Query())),
|
|
202
|
+
}).pipe(T.Http({ method: "GET", uri: "/stars.list", code: 200 })),
|
|
203
|
+
).annotate({ identifier: "ListStarsRequest" });
|
|
204
|
+
case 1:
|
|
205
|
+
return S.Unknown.pipe(
|
|
206
|
+
/*@__PURE__*/ T.UnionCases(
|
|
207
|
+
[
|
|
208
|
+
["type", "channel", "message", "date_create"],
|
|
209
|
+
["type", "file", "date_create"],
|
|
210
|
+
["type", "file", "comment", "date_create"],
|
|
211
|
+
["type", "channel", "date_create"],
|
|
212
|
+
["type", "channel", "date_create"],
|
|
213
|
+
["type", "channel", "date_create"],
|
|
214
|
+
],
|
|
215
|
+
{ key: "type", values: ["message", "file", "file_comment", "channel", "im", "group"] },
|
|
216
|
+
),
|
|
217
|
+
);
|
|
218
|
+
case 2:
|
|
219
|
+
return S.Array(__S(17, __c2, 1));
|
|
220
|
+
case 3:
|
|
221
|
+
return S.suspend(() =>
|
|
222
|
+
S.Struct({
|
|
223
|
+
next_cursor: S.optional(S.String),
|
|
224
|
+
}),
|
|
225
|
+
).annotate({ identifier: "ListStarsResponseResponseMetadata" });
|
|
226
|
+
case 4:
|
|
227
|
+
return S.suspend(() =>
|
|
228
|
+
S.Struct({
|
|
229
|
+
ok: S.Boolean,
|
|
230
|
+
items: __S(18, __c2, 2),
|
|
231
|
+
paging: S.optional(S.Unknown),
|
|
232
|
+
response_metadata: S.optional(__S(19, __c2, 3)),
|
|
233
|
+
}),
|
|
234
|
+
).annotate({ identifier: "ListStarsResponse" });
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
function __c3(j: number): any {
|
|
238
|
+
switch (j) {
|
|
239
|
+
case 0:
|
|
240
|
+
return S.suspend(() =>
|
|
241
|
+
S.Struct({
|
|
242
|
+
channel: S.optional(S.String),
|
|
243
|
+
file: S.optional(S.String),
|
|
244
|
+
file_comment: S.optional(S.String),
|
|
245
|
+
timestamp: S.optional(S.String),
|
|
246
|
+
}).pipe(T.Http({ method: "POST", uri: "/stars.remove", code: 200 })),
|
|
247
|
+
).annotate({ identifier: "RemoveStarRequest" });
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
251
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
252
|
+
return (__s[i] ??= __L.at(f, j));
|
|
253
|
+
}
|