@distilled.cloud/slack 1.0.0-rc.15 → 1.0.0-rc.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/.lazy.json +1 -0
- package/lib/_bundle/lazy.js +4 -0
- package/lib/_bundle/sdk.js +2 -0
- package/lib/_bundle/sdk.js.map +1 -0
- package/lib/credentials.d.ts +1 -1
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +1 -53
- package/lib/errors.d.ts +31 -31
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +1 -59
- package/lib/index.d.ts +1 -1
- package/lib/index.js +0 -10
- package/lib/index.lazy.js +7 -0
- package/lib/pagination.d.ts +2 -2
- package/lib/pagination.js +1 -31
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +1 -231
- package/lib/retry.d.ts +2 -2
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +1 -45
- package/lib/services/admin.d.ts +123 -575
- package/lib/services/admin.d.ts.map +1 -1
- package/lib/services/admin.js +141 -2884
- package/lib/services/admin.js.map +1 -1
- package/lib/services/agents.d.ts +13 -55
- package/lib/services/agents.d.ts.map +1 -1
- package/lib/services/agents.js +1 -314
- package/lib/services/agents.js.map +1 -1
- package/lib/services/api.d.ts +0 -4
- package/lib/services/api.d.ts.map +1 -1
- package/lib/services/api.js +1 -23
- package/lib/services/api.js.map +1 -1
- package/lib/services/apps.d.ts +25 -106
- package/lib/services/apps.d.ts.map +1 -1
- package/lib/services/apps.js +35 -515
- package/lib/services/apps.js.map +1 -1
- package/lib/services/assistant.d.ts +6 -40
- package/lib/services/assistant.d.ts.map +1 -1
- package/lib/services/assistant.js +1 -209
- package/lib/services/assistant.js.map +1 -1
- package/lib/services/auth.d.ts +4 -15
- package/lib/services/auth.d.ts.map +1 -1
- package/lib/services/auth.js +1 -96
- package/lib/services/auth.js.map +1 -1
- package/lib/services/blocks.d.ts +1 -7
- package/lib/services/blocks.d.ts.map +1 -1
- package/lib/services/blocks.js +1 -26
- package/lib/services/blocks.js.map +1 -1
- package/lib/services/bookmarks.d.ts +4 -15
- package/lib/services/bookmarks.d.ts.map +1 -1
- package/lib/services/bookmarks.js +1 -81
- package/lib/services/bookmarks.js.map +1 -1
- package/lib/services/bots.d.ts +1 -9
- package/lib/services/bots.d.ts.map +1 -1
- package/lib/services/bots.js +1 -59
- package/lib/services/bots.js.map +1 -1
- package/lib/services/calls.d.ts +6 -22
- package/lib/services/calls.d.ts.map +1 -1
- package/lib/services/calls.js +1 -115
- package/lib/services/calls.js.map +1 -1
- package/lib/services/canvases.d.ts +7 -35
- package/lib/services/canvases.d.ts.map +1 -1
- package/lib/services/canvases.js +1 -140
- package/lib/services/canvases.js.map +1 -1
- package/lib/services/chat.d.ts +14 -83
- package/lib/services/chat.d.ts.map +1 -1
- package/lib/services/chat.js +1 -387
- package/lib/services/chat.js.map +1 -1
- package/lib/services/conversations.d.ts +31 -116
- package/lib/services/conversations.d.ts.map +1 -1
- package/lib/services/conversations.js +40 -696
- package/lib/services/conversations.js.map +1 -1
- package/lib/services/dialog.d.ts +1 -4
- package/lib/services/dialog.d.ts.map +1 -1
- package/lib/services/dialog.js +1 -22
- package/lib/services/dialog.js.map +1 -1
- package/lib/services/dnd.d.ts +5 -17
- package/lib/services/dnd.d.ts.map +1 -1
- package/lib/services/dnd.js +1 -96
- package/lib/services/dnd.js.map +1 -1
- package/lib/services/emoji.d.ts +1 -8
- package/lib/services/emoji.d.ts.map +1 -1
- package/lib/services/emoji.js +1 -34
- package/lib/services/emoji.js.map +1 -1
- package/lib/services/entity.d.ts +4 -16
- package/lib/services/entity.d.ts.map +1 -1
- package/lib/services/entity.js +1 -76
- package/lib/services/entity.js.map +1 -1
- package/lib/services/files.d.ts +16 -80
- package/lib/services/files.d.ts.map +1 -1
- package/lib/services/files.js +1 -439
- package/lib/services/files.js.map +1 -1
- package/lib/services/functions.d.ts +8 -49
- package/lib/services/functions.d.ts.map +1 -1
- package/lib/services/functions.js +1 -208
- package/lib/services/functions.js.map +1 -1
- package/lib/services/index.js +0 -2
- package/lib/services/lists.d.ts +13 -55
- package/lib/services/lists.d.ts.map +1 -1
- package/lib/services/lists.js +1 -254
- package/lib/services/lists.js.map +1 -1
- package/lib/services/migration.d.ts +1 -7
- package/lib/services/migration.d.ts.map +1 -1
- package/lib/services/migration.js +1 -32
- package/lib/services/migration.js.map +1 -1
- package/lib/services/oauth.d.ts +7 -43
- package/lib/services/oauth.d.ts.map +1 -1
- package/lib/services/oauth.js +1 -294
- package/lib/services/oauth.js.map +1 -1
- package/lib/services/openid.d.ts +3 -10
- package/lib/services/openid.d.ts.map +1 -1
- package/lib/services/openid.js +1 -84
- package/lib/services/openid.js.map +1 -1
- package/lib/services/pins.d.ts +3 -13
- package/lib/services/pins.d.ts.map +1 -1
- package/lib/services/pins.js +1 -66
- package/lib/services/pins.js.map +1 -1
- package/lib/services/reactions.d.ts +5 -17
- package/lib/services/reactions.d.ts.map +1 -1
- package/lib/services/reactions.js +1 -102
- package/lib/services/reactions.js.map +1 -1
- package/lib/services/reminders.d.ts +5 -17
- package/lib/services/reminders.d.ts.map +1 -1
- package/lib/services/reminders.js +1 -88
- package/lib/services/reminders.js.map +1 -1
- package/lib/services/rtm.d.ts +2 -11
- package/lib/services/rtm.d.ts.map +1 -1
- package/lib/services/rtm.js +1 -61
- package/lib/services/rtm.js.map +1 -1
- package/lib/services/search.d.ts +4 -35
- package/lib/services/search.d.ts.map +1 -1
- package/lib/services/search.js +1 -172
- package/lib/services/search.js.map +1 -1
- package/lib/services/stars.d.ts +4 -26
- package/lib/services/stars.d.ts.map +1 -1
- package/lib/services/stars.js +1 -134
- package/lib/services/stars.js.map +1 -1
- package/lib/services/team.d.ts +11 -63
- package/lib/services/team.d.ts.map +1 -1
- package/lib/services/team.js +1 -295
- package/lib/services/team.js.map +1 -1
- package/lib/services/tooling.d.ts +2 -5
- package/lib/services/tooling.d.ts.map +1 -1
- package/lib/services/tooling.js +1 -33
- package/lib/services/tooling.js.map +1 -1
- package/lib/services/usergroups.d.ts +7 -31
- package/lib/services/usergroups.d.ts.map +1 -1
- package/lib/services/usergroups.js +1 -151
- package/lib/services/usergroups.js.map +1 -1
- package/lib/services/users.d.ts +14 -48
- package/lib/services/users.d.ts.map +1 -1
- package/lib/services/users.js +1 -255
- package/lib/services/users.js.map +1 -1
- package/lib/services/views.d.ts +4 -14
- package/lib/services/views.d.ts.map +1 -1
- package/lib/services/views.js +1 -78
- package/lib/services/views.js.map +1 -1
- package/lib/services/workflows.d.ts +8 -51
- package/lib/services/workflows.d.ts.map +1 -1
- package/lib/services/workflows.js +1 -193
- package/lib/services/workflows.js.map +1 -1
- package/lib/services.lazy/admin.js +3 -0
- package/lib/services.lazy/agents.js +1 -0
- package/lib/services.lazy/api.js +1 -0
- package/lib/services.lazy/apps.js +3 -0
- package/lib/services.lazy/assistant.js +1 -0
- package/lib/services.lazy/auth.js +1 -0
- package/lib/services.lazy/blocks.js +1 -0
- package/lib/services.lazy/bookmarks.js +1 -0
- package/lib/services.lazy/bots.js +1 -0
- package/lib/services.lazy/calls.js +1 -0
- package/lib/services.lazy/canvases.js +1 -0
- package/lib/services.lazy/chat.js +1 -0
- package/lib/services.lazy/conversations.js +3 -0
- package/lib/services.lazy/dialog.js +1 -0
- package/lib/services.lazy/dnd.js +1 -0
- package/lib/services.lazy/emoji.js +1 -0
- package/lib/services.lazy/entity.js +1 -0
- package/lib/services.lazy/files.js +1 -0
- package/lib/services.lazy/functions.js +1 -0
- package/lib/services.lazy/index.js +3 -0
- package/lib/services.lazy/lists.js +1 -0
- package/lib/services.lazy/migration.js +1 -0
- package/lib/services.lazy/oauth.js +1 -0
- package/lib/services.lazy/openid.js +1 -0
- package/lib/services.lazy/pins.js +1 -0
- package/lib/services.lazy/reactions.js +1 -0
- package/lib/services.lazy/reminders.js +1 -0
- package/lib/services.lazy/rtm.js +1 -0
- package/lib/services.lazy/search.js +1 -0
- package/lib/services.lazy/stars.js +1 -0
- package/lib/services.lazy/team.js +1 -0
- package/lib/services.lazy/tooling.js +1 -0
- package/lib/services.lazy/usergroups.js +1 -0
- package/lib/services.lazy/users.js +1 -0
- package/lib/services.lazy/views.js +1 -0
- package/lib/services.lazy/workflows.js +1 -0
- package/lib/traits.d.ts +1 -1
- package/lib/traits.js +1 -12
- package/package.json +10 -8
- package/src/credentials.ts +20 -21
- package/src/errors.ts +31 -27
- package/src/index.ts +1 -1
- package/src/pagination.ts +2 -2
- package/src/protocol.ts +30 -29
- package/src/retry.ts +6 -6
- package/src/services/admin.ts +2717 -3451
- package/src/services/agents.ts +380 -370
- package/src/services/api.ts +31 -21
- package/src/services/apps.ts +569 -621
- package/src/services/assistant.ts +235 -270
- package/src/services/auth.ts +118 -100
- package/src/services/blocks.ts +33 -29
- package/src/services/bookmarks.ts +101 -83
- package/src/services/bots.ts +74 -67
- package/src/services/calls.ts +118 -124
- package/src/services/canvases.ts +171 -178
- package/src/services/chat.ts +428 -496
- package/src/services/conversations.ts +675 -761
- package/src/services/dialog.ts +30 -17
- package/src/services/dnd.ts +125 -99
- package/src/services/emoji.ts +46 -42
- package/src/services/entity.ts +94 -92
- package/src/services/files.ts +536 -531
- package/src/services/functions.ts +209 -274
- package/src/services/lists.ts +289 -304
- package/src/services/migration.ts +39 -37
- package/src/services/oauth.ts +345 -361
- package/src/services/openid.ts +137 -122
- package/src/services/pins.ts +83 -70
- package/src/services/reactions.ts +119 -103
- package/src/services/reminders.ts +112 -90
- package/src/services/rtm.ts +73 -65
- package/src/services/search.ts +193 -244
- package/src/services/stars.ts +101 -160
- package/src/services/team.ts +333 -369
- package/src/services/tooling.ts +43 -30
- package/src/services/usergroups.ts +175 -179
- package/src/services/users.ts +301 -268
- package/src/services/views.ts +85 -80
- package/src/services/workflows.ts +184 -269
- package/src/traits.ts +1 -1
- package/lib/credentials.js.map +0 -1
- package/lib/errors.js.map +0 -1
- package/lib/pagination.js.map +0 -1
- package/lib/protocol.js.map +0 -1
- package/lib/protocol.test.d.ts +0 -2
- package/lib/protocol.test.d.ts.map +0 -1
- package/lib/protocol.test.js +0 -288
- package/lib/protocol.test.js.map +0 -1
- package/lib/retry.js.map +0 -1
- package/lib/services/index.js.map +0 -1
- package/lib/traits.js.map +0 -1
- package/src/protocol.test.ts +0 -372
- /package/lib/{index.js.map → index.lazy.js.map} +0 -0
|
@@ -1,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
|
|
|
@@ -17,24 +20,10 @@ export interface AddReactionRequest {
|
|
|
17
20
|
/** Timestamp of the message to add reaction to. */
|
|
18
21
|
timestamp: string;
|
|
19
22
|
}
|
|
20
|
-
export const AddReactionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
21
|
-
S.Struct({
|
|
22
|
-
channel: S.String,
|
|
23
|
-
name: S.String,
|
|
24
|
-
timestamp: S.String,
|
|
25
|
-
}).pipe(T.Http({ method: "POST", uri: "/reactions.add", code: 200 })),
|
|
26
|
-
).annotate({ identifier: "AddReactionRequest" }) as any as S.Schema<AddReactionRequest>;
|
|
27
|
-
|
|
28
23
|
export interface AddReactionResponse {
|
|
29
24
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
30
25
|
ok: boolean;
|
|
31
26
|
}
|
|
32
|
-
export const AddReactionResponse = /*@__PURE__*/ S.suspend(() =>
|
|
33
|
-
S.Struct({
|
|
34
|
-
ok: S.Boolean,
|
|
35
|
-
}),
|
|
36
|
-
).annotate({ identifier: "AddReactionResponse" }) as any as S.Schema<AddReactionResponse>;
|
|
37
|
-
|
|
38
27
|
export interface GetReactionRequest {
|
|
39
28
|
/** Channel where the message to get reactions for was posted. */
|
|
40
29
|
channel?: string;
|
|
@@ -47,16 +36,6 @@ export interface GetReactionRequest {
|
|
|
47
36
|
/** Timestamp of the message to get reactions for. */
|
|
48
37
|
timestamp?: string;
|
|
49
38
|
}
|
|
50
|
-
export const GetReactionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
51
|
-
S.Struct({
|
|
52
|
-
channel: S.optional(S.String.pipe(T.Query())),
|
|
53
|
-
file: S.optional(S.String.pipe(T.Query())),
|
|
54
|
-
file_comment: S.optional(S.String.pipe(T.Query())),
|
|
55
|
-
full: S.optional(S.Boolean.pipe(T.Query())),
|
|
56
|
-
timestamp: S.optional(S.String.pipe(T.Query())),
|
|
57
|
-
}).pipe(T.Http({ method: "GET", uri: "/reactions.get", code: 200 })),
|
|
58
|
-
).annotate({ identifier: "GetReactionRequest" }) as any as S.Schema<GetReactionRequest>;
|
|
59
|
-
|
|
60
39
|
export interface GetReactionResponse {
|
|
61
40
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
62
41
|
ok: boolean;
|
|
@@ -66,17 +45,6 @@ export interface GetReactionResponse {
|
|
|
66
45
|
channel?: string;
|
|
67
46
|
file?: unknown;
|
|
68
47
|
}
|
|
69
|
-
export const GetReactionResponse = /*@__PURE__*/ S.suspend(() =>
|
|
70
|
-
S.Struct({
|
|
71
|
-
ok: S.Boolean,
|
|
72
|
-
comment: S.optional(S.Unknown),
|
|
73
|
-
message: S.optional(S.Unknown),
|
|
74
|
-
type: S.String,
|
|
75
|
-
channel: S.optional(S.String),
|
|
76
|
-
file: S.optional(S.Unknown),
|
|
77
|
-
}),
|
|
78
|
-
).annotate({ identifier: "GetReactionResponse" }) as any as S.Schema<GetReactionResponse>;
|
|
79
|
-
|
|
80
48
|
export interface ListReactionsRequest {
|
|
81
49
|
/** Show reactions made by this user. Defaults to the authed user. */
|
|
82
50
|
user?: string;
|
|
@@ -91,42 +59,13 @@ export interface ListReactionsRequest {
|
|
|
91
59
|
/** encoded team id to list reactions in, required if org token is used */
|
|
92
60
|
team_id?: string;
|
|
93
61
|
}
|
|
94
|
-
export const ListReactionsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
95
|
-
S.Struct({
|
|
96
|
-
user: S.optional(S.String.pipe(T.Query())),
|
|
97
|
-
full: S.optional(S.Boolean.pipe(T.Query())),
|
|
98
|
-
count: S.optional(S.Number.pipe(T.Query())),
|
|
99
|
-
page: S.optional(S.Number.pipe(T.Query())),
|
|
100
|
-
cursor: S.optional(S.String.pipe(T.Query())),
|
|
101
|
-
limit: S.optional(S.Number.pipe(T.Query())),
|
|
102
|
-
team_id: S.optional(S.String.pipe(T.Query())),
|
|
103
|
-
}).pipe(T.Http({ method: "GET", uri: "/reactions.list", code: 200 })),
|
|
104
|
-
).annotate({ identifier: "ListReactionsRequest" }) as any as S.Schema<ListReactionsRequest>;
|
|
105
|
-
|
|
106
62
|
export type ListReactionsResponseItemsItemMap = { [key: string]: unknown | undefined };
|
|
107
|
-
export const ListReactionsResponseItemsItemMap = /*@__PURE__*/ S.Record(
|
|
108
|
-
S.String,
|
|
109
|
-
S.Unknown,
|
|
110
|
-
) as any as S.Schema<ListReactionsResponseItemsItemMap>;
|
|
111
|
-
|
|
112
63
|
export type ListReactionsResponseItemsList = Array<ListReactionsResponseItemsItemMap>;
|
|
113
|
-
export const ListReactionsResponseItemsList = /*@__PURE__*/ S.Array(
|
|
114
|
-
ListReactionsResponseItemsItemMap,
|
|
115
|
-
) as any as S.Schema<ListReactionsResponseItemsList>;
|
|
116
|
-
|
|
117
64
|
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
118
65
|
export interface ListReactionsResponseResponseMetadata {
|
|
119
|
-
/** Cursor for the next page
|
|
66
|
+
/** Cursor for the next page -- pass as `cursor` on the next call. */
|
|
120
67
|
next_cursor?: string;
|
|
121
68
|
}
|
|
122
|
-
export const ListReactionsResponseResponseMetadata = /*@__PURE__*/ S.suspend(() =>
|
|
123
|
-
S.Struct({
|
|
124
|
-
next_cursor: S.optional(S.String),
|
|
125
|
-
}),
|
|
126
|
-
).annotate({
|
|
127
|
-
identifier: "ListReactionsResponseResponseMetadata",
|
|
128
|
-
}) as any as S.Schema<ListReactionsResponseResponseMetadata>;
|
|
129
|
-
|
|
130
69
|
export interface ListReactionsResponse {
|
|
131
70
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
132
71
|
ok: boolean;
|
|
@@ -135,15 +74,6 @@ export interface ListReactionsResponse {
|
|
|
135
74
|
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
136
75
|
response_metadata?: ListReactionsResponseResponseMetadata;
|
|
137
76
|
}
|
|
138
|
-
export const ListReactionsResponse = /*@__PURE__*/ S.suspend(() =>
|
|
139
|
-
S.Struct({
|
|
140
|
-
ok: S.Boolean,
|
|
141
|
-
items: ListReactionsResponseItemsList,
|
|
142
|
-
paging: S.optional(S.Unknown),
|
|
143
|
-
response_metadata: S.optional(ListReactionsResponseResponseMetadata),
|
|
144
|
-
}),
|
|
145
|
-
).annotate({ identifier: "ListReactionsResponse" }) as any as S.Schema<ListReactionsResponse>;
|
|
146
|
-
|
|
147
77
|
export interface RemoveReactionRequest {
|
|
148
78
|
/** Reaction (emoji) name. */
|
|
149
79
|
name: string;
|
|
@@ -156,58 +86,42 @@ export interface RemoveReactionRequest {
|
|
|
156
86
|
/** Timestamp of the message to remove reaction from. */
|
|
157
87
|
timestamp?: string;
|
|
158
88
|
}
|
|
159
|
-
export const RemoveReactionRequest = /*@__PURE__*/ S.suspend(() =>
|
|
160
|
-
S.Struct({
|
|
161
|
-
name: S.String,
|
|
162
|
-
file: S.optional(S.String),
|
|
163
|
-
file_comment: S.optional(S.String),
|
|
164
|
-
channel: S.optional(S.String),
|
|
165
|
-
timestamp: S.optional(S.String),
|
|
166
|
-
}).pipe(T.Http({ method: "POST", uri: "/reactions.remove", code: 200 })),
|
|
167
|
-
).annotate({ identifier: "RemoveReactionRequest" }) as any as S.Schema<RemoveReactionRequest>;
|
|
168
|
-
|
|
169
89
|
export interface RemoveReactionResponse {
|
|
170
90
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
171
91
|
ok: boolean;
|
|
172
92
|
}
|
|
173
|
-
export const RemoveReactionResponse = /*@__PURE__*/ S.suspend(() =>
|
|
174
|
-
S.Struct({
|
|
175
|
-
ok: S.Boolean,
|
|
176
|
-
}),
|
|
177
|
-
).annotate({ identifier: "RemoveReactionResponse" }) as any as S.Schema<RemoveReactionResponse>;
|
|
178
|
-
|
|
179
93
|
export type AddReactionError = SlackOpError;
|
|
180
|
-
/** Adds a reaction to an item. Required scopes
|
|
94
|
+
/** Adds a reaction to an item. Required scopes -- bot: `reactions:write`; user: `reactions:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `already_reacted` -- The specified item already has the user/reaction combination. - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- Value passed for `channel` is invalid. - `external_channel_migrating` -- The channel is in the process of being migrated. - `invalid_name` -- Value passed for `name` was invalid. - `is_archived` -- Channel specified has been archived. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- combination of `channel` and `timestamp` was not specified. - `not_reactable` -- Whatever you passed in, like a `file` or `file_comment`, can't be reacted to anymore. Your app can react to messages though. - `thread_locked` -- Reactions are disabled as the specified message is part of a locked thread. - `too_many_emoji` -- The limit for distinct reactions (i.e emoji) on the item has been reached. - `too_many_reactions` -- The limit for reactions a person may add to the item has been reached. - `no_access` -- User does not have access to react to this canvas. See https://docs.slack.dev/reference/methods/reactions.add */
|
|
181
95
|
export const addReaction: API.OperationMethod<
|
|
182
96
|
AddReactionRequest,
|
|
183
97
|
AddReactionResponse,
|
|
184
98
|
AddReactionError,
|
|
185
99
|
SlackOpContext
|
|
186
100
|
> = /*@__PURE__*/ API.make(() => ({
|
|
187
|
-
input: AddReactionRequest
|
|
188
|
-
output: AddReactionResponse
|
|
101
|
+
input: __S(0, __c0, 0) as any as S.Schema<AddReactionRequest>,
|
|
102
|
+
output: __S(8, __c1, 0) as any as S.Schema<AddReactionResponse>,
|
|
189
103
|
errors: [SlackError, SlackRateLimited],
|
|
190
104
|
protocol: SlackProtocol,
|
|
191
105
|
retry: Retry.Retry,
|
|
192
106
|
}));
|
|
193
107
|
|
|
194
108
|
export type GetReactionError = SlackOpError;
|
|
195
|
-
/** Gets reactions for an item. Required scopes
|
|
109
|
+
/** Gets reactions for an item. Required scopes -- bot: `reactions:read`; user: `reactions:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `bad_timestamp` -- Value passed for `timestamp` was invalid. - `channel_not_found` -- Value passed for `channel` was invalid. - `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`, or combination of `channel` and `timestamp` was not specified. See https://docs.slack.dev/reference/methods/reactions.get */
|
|
196
110
|
export const getReaction: API.OperationMethod<
|
|
197
111
|
GetReactionRequest,
|
|
198
112
|
GetReactionResponse,
|
|
199
113
|
GetReactionError,
|
|
200
114
|
SlackOpContext
|
|
201
115
|
> = /*@__PURE__*/ API.make(() => ({
|
|
202
|
-
input: GetReactionRequest
|
|
203
|
-
output: GetReactionResponse
|
|
116
|
+
input: __S(16, __c2, 0) as any as S.Schema<GetReactionRequest>,
|
|
117
|
+
output: __S(17, __c2, 1) as any as S.Schema<GetReactionResponse>,
|
|
204
118
|
errors: [SlackError, SlackRateLimited],
|
|
205
119
|
protocol: SlackProtocol,
|
|
206
120
|
retry: Retry.Retry,
|
|
207
121
|
}));
|
|
208
122
|
|
|
209
123
|
export type ListReactionsError = SlackOpError;
|
|
210
|
-
/** Lists reactions made by a user. Required scopes
|
|
124
|
+
/** Lists reactions made by a user. Required scopes -- bot: `reactions:read`; user: `reactions:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `user_not_found` -- Value passed for `user` was invalid. See https://docs.slack.dev/reference/methods/reactions.list */
|
|
211
125
|
export const listReactions: API.PaginatedOperationMethod<
|
|
212
126
|
ListReactionsRequest,
|
|
213
127
|
ListReactionsResponse,
|
|
@@ -216,8 +130,8 @@ export const listReactions: API.PaginatedOperationMethod<
|
|
|
216
130
|
ListReactionsResponseItemsItemMap
|
|
217
131
|
> = /*@__PURE__*/ API.makePaginated(
|
|
218
132
|
() => ({
|
|
219
|
-
input: ListReactionsRequest
|
|
220
|
-
output: ListReactionsResponse
|
|
133
|
+
input: __S(24, __c3, 0) as any as S.Schema<ListReactionsRequest>,
|
|
134
|
+
output: __S(28, __c3, 4) as any as S.Schema<ListReactionsResponse>,
|
|
221
135
|
errors: [SlackError, SlackRateLimited],
|
|
222
136
|
protocol: SlackProtocol,
|
|
223
137
|
retry: Retry.Retry,
|
|
@@ -233,16 +147,118 @@ export const listReactions: API.PaginatedOperationMethod<
|
|
|
233
147
|
) as any;
|
|
234
148
|
|
|
235
149
|
export type RemoveReactionError = SlackOpError;
|
|
236
|
-
/** Removes a reaction from an item. Required scopes
|
|
150
|
+
/** Removes a reaction from an item. Required scopes -- bot: `reactions:write`; user: `reactions: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` -- The specified channel was not found. - `external_channel_migrating` -- The reaction is in a channel that is being migrated - `file_not_found` -- File specified by `file` does not exist. - `file_comment_not_found` -- File comment specified by `file_comment` does not exist. - `invalid_name` -- Value passed for `name` was invalid. - `message_not_found` -- Message specified by `channel` and `timestamp` does not exist. - `no_item_specified` -- `file`, `file_comment`, or combination of `channel` and `timestamp` was not specified. - `no_access` -- The requestor does not have permission to perform this action on the specified item. - `no_reaction` -- The specified reaction does not exist, or the requestor is not the original reaction author. - `thread_locked` -- Reactions are disabled as the specified message is part of a locked thread. See https://docs.slack.dev/reference/methods/reactions.remove */
|
|
237
151
|
export const removeReaction: API.OperationMethod<
|
|
238
152
|
RemoveReactionRequest,
|
|
239
153
|
RemoveReactionResponse,
|
|
240
154
|
RemoveReactionError,
|
|
241
155
|
SlackOpContext
|
|
242
156
|
> = /*@__PURE__*/ API.make(() => ({
|
|
243
|
-
input: RemoveReactionRequest
|
|
244
|
-
output: RemoveReactionResponse
|
|
157
|
+
input: __S(32, __c4, 0) as any as S.Schema<RemoveReactionRequest>,
|
|
158
|
+
output: __S(8, __c1, 0) as any as S.Schema<RemoveReactionResponse>,
|
|
245
159
|
errors: [SlackError, SlackRateLimited],
|
|
246
160
|
protocol: SlackProtocol,
|
|
247
161
|
retry: Retry.Retry,
|
|
248
162
|
}));
|
|
163
|
+
|
|
164
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
165
|
+
function __c0(j: number): any {
|
|
166
|
+
switch (j) {
|
|
167
|
+
case 0:
|
|
168
|
+
return S.suspend(() =>
|
|
169
|
+
S.Struct({
|
|
170
|
+
channel: S.String,
|
|
171
|
+
name: S.String,
|
|
172
|
+
timestamp: S.String,
|
|
173
|
+
}).pipe(T.Http({ method: "POST", uri: "/reactions.add", code: 200 })),
|
|
174
|
+
).annotate({ identifier: "AddReactionRequest" });
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
function __c1(j: number): any {
|
|
178
|
+
switch (j) {
|
|
179
|
+
case 0:
|
|
180
|
+
return S.suspend(() =>
|
|
181
|
+
S.Struct({
|
|
182
|
+
ok: S.Boolean,
|
|
183
|
+
}),
|
|
184
|
+
).annotate({ identifier: "AddReactionResponse" });
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function __c2(j: number): any {
|
|
188
|
+
switch (j) {
|
|
189
|
+
case 0:
|
|
190
|
+
return S.suspend(() =>
|
|
191
|
+
S.Struct({
|
|
192
|
+
channel: S.optional(S.String.pipe(T.Query())),
|
|
193
|
+
file: S.optional(S.String.pipe(T.Query())),
|
|
194
|
+
file_comment: S.optional(S.String.pipe(T.Query())),
|
|
195
|
+
full: S.optional(S.Boolean.pipe(T.Query())),
|
|
196
|
+
timestamp: S.optional(S.String.pipe(T.Query())),
|
|
197
|
+
}).pipe(T.Http({ method: "GET", uri: "/reactions.get", code: 200 })),
|
|
198
|
+
).annotate({ identifier: "GetReactionRequest" });
|
|
199
|
+
case 1:
|
|
200
|
+
return S.suspend(() =>
|
|
201
|
+
S.Struct({
|
|
202
|
+
ok: S.Boolean,
|
|
203
|
+
comment: S.optional(S.Unknown),
|
|
204
|
+
message: S.optional(S.Unknown),
|
|
205
|
+
type: S.String,
|
|
206
|
+
channel: S.optional(S.String),
|
|
207
|
+
file: S.optional(S.Unknown),
|
|
208
|
+
}),
|
|
209
|
+
).annotate({ identifier: "GetReactionResponse" });
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
function __c3(j: number): any {
|
|
213
|
+
switch (j) {
|
|
214
|
+
case 0:
|
|
215
|
+
return S.suspend(() =>
|
|
216
|
+
S.Struct({
|
|
217
|
+
user: S.optional(S.String.pipe(T.Query())),
|
|
218
|
+
full: S.optional(S.Boolean.pipe(T.Query())),
|
|
219
|
+
count: S.optional(S.Number.pipe(T.Query())),
|
|
220
|
+
page: S.optional(S.Number.pipe(T.Query())),
|
|
221
|
+
cursor: S.optional(S.String.pipe(T.Query())),
|
|
222
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
223
|
+
team_id: S.optional(S.String.pipe(T.Query())),
|
|
224
|
+
}).pipe(T.Http({ method: "GET", uri: "/reactions.list", code: 200 })),
|
|
225
|
+
).annotate({ identifier: "ListReactionsRequest" });
|
|
226
|
+
case 1:
|
|
227
|
+
return S.Record(S.String, S.Unknown);
|
|
228
|
+
case 2:
|
|
229
|
+
return S.Array(__S(25, __c3, 1));
|
|
230
|
+
case 3:
|
|
231
|
+
return S.suspend(() =>
|
|
232
|
+
S.Struct({
|
|
233
|
+
next_cursor: S.optional(S.String),
|
|
234
|
+
}),
|
|
235
|
+
).annotate({ identifier: "ListReactionsResponseResponseMetadata" });
|
|
236
|
+
case 4:
|
|
237
|
+
return S.suspend(() =>
|
|
238
|
+
S.Struct({
|
|
239
|
+
ok: S.Boolean,
|
|
240
|
+
items: __S(26, __c3, 2),
|
|
241
|
+
paging: S.optional(S.Unknown),
|
|
242
|
+
response_metadata: S.optional(__S(27, __c3, 3)),
|
|
243
|
+
}),
|
|
244
|
+
).annotate({ identifier: "ListReactionsResponse" });
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
function __c4(j: number): any {
|
|
248
|
+
switch (j) {
|
|
249
|
+
case 0:
|
|
250
|
+
return S.suspend(() =>
|
|
251
|
+
S.Struct({
|
|
252
|
+
name: S.String,
|
|
253
|
+
file: S.optional(S.String),
|
|
254
|
+
file_comment: S.optional(S.String),
|
|
255
|
+
channel: S.optional(S.String),
|
|
256
|
+
timestamp: S.optional(S.String),
|
|
257
|
+
}).pipe(T.Http({ method: "POST", uri: "/reactions.remove", code: 200 })),
|
|
258
|
+
).annotate({ identifier: "RemoveReactionRequest" });
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
262
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
263
|
+
return (__s[i] ??= __L.at(f, j));
|
|
264
|
+
}
|
|
@@ -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
|
|
|
@@ -20,197 +23,216 @@ export interface AddReminderRequest {
|
|
|
20
23
|
/** Specify the repeating behavior of a reminder. Available options: `daily`, `weekly`, `monthly`, or `yearly`. If `weekly`, may further specify the days of the week. */
|
|
21
24
|
recurrence?: unknown;
|
|
22
25
|
}
|
|
23
|
-
export const AddReminderRequest = /*@__PURE__*/ S.suspend(() =>
|
|
24
|
-
S.Struct({
|
|
25
|
-
text: S.String,
|
|
26
|
-
time: S.String,
|
|
27
|
-
user: S.optional(S.String),
|
|
28
|
-
team_id: S.optional(S.String),
|
|
29
|
-
recurrence: S.optional(S.Unknown),
|
|
30
|
-
}).pipe(T.Http({ method: "POST", uri: "/reminders.add", code: 200 })),
|
|
31
|
-
).annotate({ identifier: "AddReminderRequest" }) as any as S.Schema<AddReminderRequest>;
|
|
32
|
-
|
|
33
26
|
export interface AddReminderResponse {
|
|
34
27
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
35
28
|
ok: boolean;
|
|
36
29
|
reminder: unknown;
|
|
37
30
|
}
|
|
38
|
-
export const AddReminderResponse = /*@__PURE__*/ S.suspend(() =>
|
|
39
|
-
S.Struct({
|
|
40
|
-
ok: S.Boolean,
|
|
41
|
-
reminder: S.Unknown,
|
|
42
|
-
}),
|
|
43
|
-
).annotate({ identifier: "AddReminderResponse" }) as any as S.Schema<AddReminderResponse>;
|
|
44
|
-
|
|
45
31
|
export interface CompleteReminderRequest {
|
|
46
32
|
/** The ID of the reminder to be marked as complete */
|
|
47
33
|
reminder: string;
|
|
48
34
|
/** Encoded team id, required if org token is used */
|
|
49
35
|
team_id?: string;
|
|
50
36
|
}
|
|
51
|
-
export const CompleteReminderRequest = /*@__PURE__*/ S.suspend(() =>
|
|
52
|
-
S.Struct({
|
|
53
|
-
reminder: S.String,
|
|
54
|
-
team_id: S.optional(S.String),
|
|
55
|
-
}).pipe(T.Http({ method: "POST", uri: "/reminders.complete", code: 200 })),
|
|
56
|
-
).annotate({ identifier: "CompleteReminderRequest" }) as any as S.Schema<CompleteReminderRequest>;
|
|
57
|
-
|
|
58
37
|
export interface CompleteReminderResponse {
|
|
59
38
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
60
39
|
ok: boolean;
|
|
61
40
|
}
|
|
62
|
-
export const CompleteReminderResponse = /*@__PURE__*/ S.suspend(() =>
|
|
63
|
-
S.Struct({
|
|
64
|
-
ok: S.Boolean,
|
|
65
|
-
}),
|
|
66
|
-
).annotate({ identifier: "CompleteReminderResponse" }) as any as S.Schema<CompleteReminderResponse>;
|
|
67
|
-
|
|
68
41
|
export interface DeleteReminderRequest {
|
|
69
42
|
/** The ID of the reminder */
|
|
70
43
|
reminder: string;
|
|
71
44
|
/** Encoded team id, required if org token is used */
|
|
72
45
|
team_id?: string;
|
|
73
46
|
}
|
|
74
|
-
export const DeleteReminderRequest = /*@__PURE__*/ S.suspend(() =>
|
|
75
|
-
S.Struct({
|
|
76
|
-
reminder: S.String,
|
|
77
|
-
team_id: S.optional(S.String),
|
|
78
|
-
}).pipe(T.Http({ method: "POST", uri: "/reminders.delete", code: 200 })),
|
|
79
|
-
).annotate({ identifier: "DeleteReminderRequest" }) as any as S.Schema<DeleteReminderRequest>;
|
|
80
|
-
|
|
81
47
|
export interface DeleteReminderResponse {
|
|
82
48
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
83
49
|
ok: boolean;
|
|
84
50
|
}
|
|
85
|
-
export const DeleteReminderResponse = /*@__PURE__*/ S.suspend(() =>
|
|
86
|
-
S.Struct({
|
|
87
|
-
ok: S.Boolean,
|
|
88
|
-
}),
|
|
89
|
-
).annotate({ identifier: "DeleteReminderResponse" }) as any as S.Schema<DeleteReminderResponse>;
|
|
90
|
-
|
|
91
51
|
export interface ListRemindersRequest {
|
|
92
52
|
/** Encoded team id, required if org token is passed */
|
|
93
53
|
team_id?: string;
|
|
94
54
|
}
|
|
95
|
-
export const ListRemindersRequest = /*@__PURE__*/ S.suspend(() =>
|
|
96
|
-
S.Struct({
|
|
97
|
-
team_id: S.optional(S.String.pipe(T.Query())),
|
|
98
|
-
}).pipe(T.Http({ method: "GET", uri: "/reminders.list", code: 200 })),
|
|
99
|
-
).annotate({ identifier: "ListRemindersRequest" }) as any as S.Schema<ListRemindersRequest>;
|
|
100
|
-
|
|
101
55
|
export type ListRemindersResponseRemindersList = Array<unknown>;
|
|
102
|
-
export const ListRemindersResponseRemindersList = /*@__PURE__*/ S.Array(
|
|
103
|
-
S.Unknown,
|
|
104
|
-
) as any as S.Schema<ListRemindersResponseRemindersList>;
|
|
105
|
-
|
|
106
56
|
export interface ListRemindersResponse {
|
|
107
57
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
108
58
|
ok: boolean;
|
|
109
59
|
reminders?: ListRemindersResponseRemindersList;
|
|
110
60
|
}
|
|
111
|
-
export const ListRemindersResponse = /*@__PURE__*/ S.suspend(() =>
|
|
112
|
-
S.Struct({
|
|
113
|
-
ok: S.Boolean,
|
|
114
|
-
reminders: S.optional(ListRemindersResponseRemindersList),
|
|
115
|
-
}),
|
|
116
|
-
).annotate({ identifier: "ListRemindersResponse" }) as any as S.Schema<ListRemindersResponse>;
|
|
117
|
-
|
|
118
61
|
export interface RemindersInfoRequest {
|
|
119
62
|
/** The ID of the reminder */
|
|
120
63
|
reminder: string;
|
|
121
64
|
/** Encoded team id, required if org token is passed */
|
|
122
65
|
team_id?: string;
|
|
123
66
|
}
|
|
124
|
-
export const RemindersInfoRequest = /*@__PURE__*/ S.suspend(() =>
|
|
125
|
-
S.Struct({
|
|
126
|
-
reminder: S.String.pipe(T.Query()),
|
|
127
|
-
team_id: S.optional(S.String.pipe(T.Query())),
|
|
128
|
-
}).pipe(T.Http({ method: "GET", uri: "/reminders.info", code: 200 })),
|
|
129
|
-
).annotate({ identifier: "RemindersInfoRequest" }) as any as S.Schema<RemindersInfoRequest>;
|
|
130
|
-
|
|
131
67
|
export interface RemindersInfoResponse {
|
|
132
68
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
133
69
|
ok: boolean;
|
|
134
70
|
reminder: unknown;
|
|
135
71
|
}
|
|
136
|
-
export const RemindersInfoResponse = /*@__PURE__*/ S.suspend(() =>
|
|
137
|
-
S.Struct({
|
|
138
|
-
ok: S.Boolean,
|
|
139
|
-
reminder: S.Unknown,
|
|
140
|
-
}),
|
|
141
|
-
).annotate({ identifier: "RemindersInfoResponse" }) as any as S.Schema<RemindersInfoResponse>;
|
|
142
|
-
|
|
143
72
|
export type AddReminderError = SlackOpError;
|
|
144
|
-
/** Creates a reminder. Required scopes
|
|
73
|
+
/** Creates a reminder. Required scopes -- user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_add_bot` -- Reminders can't be sent to bots. - `cannot_add_others` -- Guests can't set reminders for other team members. - `cannot_add_others_recurring` -- Recurring reminders can't be set for other team members. - `cannot_add_profile_only_user` -- Reminders can't be sent to profile only users. - `cannot_add_slackbot` -- Reminders can't be sent to Slackbot. - `cannot_parse` -- The phrasing of the timing for this reminder is unclear. You must include a complete time description. Some examples that work: `1458678068`, `20`, `in 5 minutes`, `tomorrow`, `at 3:30pm`, `on Tuesday`, or `next week`. - `missing_argument` -- An argument is missing. - `user_not_found` -- That user can't be found. See https://docs.slack.dev/reference/methods/reminders.add */
|
|
145
74
|
export const addReminder: API.OperationMethod<
|
|
146
75
|
AddReminderRequest,
|
|
147
76
|
AddReminderResponse,
|
|
148
77
|
AddReminderError,
|
|
149
78
|
SlackOpContext
|
|
150
79
|
> = /*@__PURE__*/ API.make(() => ({
|
|
151
|
-
input: AddReminderRequest
|
|
152
|
-
output: AddReminderResponse
|
|
80
|
+
input: __S(0, __c0, 0) as any as S.Schema<AddReminderRequest>,
|
|
81
|
+
output: __S(4, __c1, 0) as any as S.Schema<AddReminderResponse>,
|
|
153
82
|
errors: [SlackError, SlackRateLimited],
|
|
154
83
|
protocol: SlackProtocol,
|
|
155
84
|
retry: Retry.Retry,
|
|
156
85
|
}));
|
|
157
86
|
|
|
158
87
|
export type CompleteReminderError = SlackOpError;
|
|
159
|
-
/** Marks a reminder as complete. Required scopes
|
|
88
|
+
/** Marks a reminder as complete. Required scopes -- user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `cannot_complete_others` -- Reminders for other team members can't be marked complete. - `cannot_complete_recurring` -- Recurring reminders can't be marked complete. - `missing_argument` -- An argument is missing. - `not_found` -- That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.complete */
|
|
160
89
|
export const completeReminder: API.OperationMethod<
|
|
161
90
|
CompleteReminderRequest,
|
|
162
91
|
CompleteReminderResponse,
|
|
163
92
|
CompleteReminderError,
|
|
164
93
|
SlackOpContext
|
|
165
94
|
> = /*@__PURE__*/ API.make(() => ({
|
|
166
|
-
input: CompleteReminderRequest
|
|
167
|
-
output: CompleteReminderResponse
|
|
95
|
+
input: __S(8, __c2, 0) as any as S.Schema<CompleteReminderRequest>,
|
|
96
|
+
output: __S(12, __c3, 0) as any as S.Schema<CompleteReminderResponse>,
|
|
168
97
|
errors: [SlackError, SlackRateLimited],
|
|
169
98
|
protocol: SlackProtocol,
|
|
170
99
|
retry: Retry.Retry,
|
|
171
100
|
}));
|
|
172
101
|
|
|
173
102
|
export type DeleteReminderError = SlackOpError;
|
|
174
|
-
/** Deletes a reminder. Required scopes
|
|
103
|
+
/** Deletes a reminder. Required scopes -- user: `reminders:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- An argument is missing. - `not_found` -- That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.delete */
|
|
175
104
|
export const deleteReminder: API.OperationMethod<
|
|
176
105
|
DeleteReminderRequest,
|
|
177
106
|
DeleteReminderResponse,
|
|
178
107
|
DeleteReminderError,
|
|
179
108
|
SlackOpContext
|
|
180
109
|
> = /*@__PURE__*/ API.make(() => ({
|
|
181
|
-
input: DeleteReminderRequest
|
|
182
|
-
output: DeleteReminderResponse
|
|
110
|
+
input: __S(16, __c4, 0) as any as S.Schema<DeleteReminderRequest>,
|
|
111
|
+
output: __S(12, __c3, 0) as any as S.Schema<DeleteReminderResponse>,
|
|
183
112
|
errors: [SlackError, SlackRateLimited],
|
|
184
113
|
protocol: SlackProtocol,
|
|
185
114
|
retry: Retry.Retry,
|
|
186
115
|
}));
|
|
187
116
|
|
|
188
117
|
export type ListRemindersError = SlackOpError;
|
|
189
|
-
/** Lists all reminders created by or for a given user. Required scopes
|
|
118
|
+
/** Lists all reminders created by or for a given user. Required scopes -- user: `reminders:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- An argument is missing. See https://docs.slack.dev/reference/methods/reminders.list */
|
|
190
119
|
export const listReminders: API.OperationMethod<
|
|
191
120
|
ListRemindersRequest,
|
|
192
121
|
ListRemindersResponse,
|
|
193
122
|
ListRemindersError,
|
|
194
123
|
SlackOpContext
|
|
195
124
|
> = /*@__PURE__*/ API.make(() => ({
|
|
196
|
-
input: ListRemindersRequest
|
|
197
|
-
output: ListRemindersResponse
|
|
125
|
+
input: __S(20, __c5, 0) as any as S.Schema<ListRemindersRequest>,
|
|
126
|
+
output: __S(22, __c5, 2) as any as S.Schema<ListRemindersResponse>,
|
|
198
127
|
errors: [SlackError, SlackRateLimited],
|
|
199
128
|
protocol: SlackProtocol,
|
|
200
129
|
retry: Retry.Retry,
|
|
201
130
|
}));
|
|
202
131
|
|
|
203
132
|
export type RemindersInfoError = SlackOpError;
|
|
204
|
-
/** Gets information about a reminder. Required scopes
|
|
133
|
+
/** Gets information about a reminder. Required scopes -- user: `reminders:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `missing_argument` -- An argument is missing. - `not_found` -- That reminder can't be found. See https://docs.slack.dev/reference/methods/reminders.info */
|
|
205
134
|
export const remindersInfo: API.OperationMethod<
|
|
206
135
|
RemindersInfoRequest,
|
|
207
136
|
RemindersInfoResponse,
|
|
208
137
|
RemindersInfoError,
|
|
209
138
|
SlackOpContext
|
|
210
139
|
> = /*@__PURE__*/ API.make(() => ({
|
|
211
|
-
input: RemindersInfoRequest
|
|
212
|
-
output: RemindersInfoResponse
|
|
140
|
+
input: __S(24, __c6, 0) as any as S.Schema<RemindersInfoRequest>,
|
|
141
|
+
output: __S(4, __c1, 0) as any as S.Schema<RemindersInfoResponse>,
|
|
213
142
|
errors: [SlackError, SlackRateLimited],
|
|
214
143
|
protocol: SlackProtocol,
|
|
215
144
|
retry: Retry.Retry,
|
|
216
145
|
}));
|
|
146
|
+
|
|
147
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
148
|
+
function __c0(j: number): any {
|
|
149
|
+
switch (j) {
|
|
150
|
+
case 0:
|
|
151
|
+
return S.suspend(() =>
|
|
152
|
+
S.Struct({
|
|
153
|
+
text: S.String,
|
|
154
|
+
time: S.String,
|
|
155
|
+
user: S.optional(S.String),
|
|
156
|
+
team_id: S.optional(S.String),
|
|
157
|
+
recurrence: S.optional(S.Unknown),
|
|
158
|
+
}).pipe(T.Http({ method: "POST", uri: "/reminders.add", code: 200 })),
|
|
159
|
+
).annotate({ identifier: "AddReminderRequest" });
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
function __c1(j: number): any {
|
|
163
|
+
switch (j) {
|
|
164
|
+
case 0:
|
|
165
|
+
return S.suspend(() =>
|
|
166
|
+
S.Struct({
|
|
167
|
+
ok: S.Boolean,
|
|
168
|
+
reminder: S.Unknown,
|
|
169
|
+
}),
|
|
170
|
+
).annotate({ identifier: "AddReminderResponse" });
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function __c2(j: number): any {
|
|
174
|
+
switch (j) {
|
|
175
|
+
case 0:
|
|
176
|
+
return S.suspend(() =>
|
|
177
|
+
S.Struct({
|
|
178
|
+
reminder: S.String,
|
|
179
|
+
team_id: S.optional(S.String),
|
|
180
|
+
}).pipe(T.Http({ method: "POST", uri: "/reminders.complete", code: 200 })),
|
|
181
|
+
).annotate({ identifier: "CompleteReminderRequest" });
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
function __c3(j: number): any {
|
|
185
|
+
switch (j) {
|
|
186
|
+
case 0:
|
|
187
|
+
return S.suspend(() =>
|
|
188
|
+
S.Struct({
|
|
189
|
+
ok: S.Boolean,
|
|
190
|
+
}),
|
|
191
|
+
).annotate({ identifier: "CompleteReminderResponse" });
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
function __c4(j: number): any {
|
|
195
|
+
switch (j) {
|
|
196
|
+
case 0:
|
|
197
|
+
return S.suspend(() =>
|
|
198
|
+
S.Struct({
|
|
199
|
+
reminder: S.String,
|
|
200
|
+
team_id: S.optional(S.String),
|
|
201
|
+
}).pipe(T.Http({ method: "POST", uri: "/reminders.delete", code: 200 })),
|
|
202
|
+
).annotate({ identifier: "DeleteReminderRequest" });
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function __c5(j: number): any {
|
|
206
|
+
switch (j) {
|
|
207
|
+
case 0:
|
|
208
|
+
return S.suspend(() =>
|
|
209
|
+
S.Struct({
|
|
210
|
+
team_id: S.optional(S.String.pipe(T.Query())),
|
|
211
|
+
}).pipe(T.Http({ method: "GET", uri: "/reminders.list", code: 200 })),
|
|
212
|
+
).annotate({ identifier: "ListRemindersRequest" });
|
|
213
|
+
case 1:
|
|
214
|
+
return S.Array(S.Unknown);
|
|
215
|
+
case 2:
|
|
216
|
+
return S.suspend(() =>
|
|
217
|
+
S.Struct({
|
|
218
|
+
ok: S.Boolean,
|
|
219
|
+
reminders: S.optional(__S(21, __c5, 1)),
|
|
220
|
+
}),
|
|
221
|
+
).annotate({ identifier: "ListRemindersResponse" });
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function __c6(j: number): any {
|
|
225
|
+
switch (j) {
|
|
226
|
+
case 0:
|
|
227
|
+
return S.suspend(() =>
|
|
228
|
+
S.Struct({
|
|
229
|
+
reminder: S.String.pipe(T.Query()),
|
|
230
|
+
team_id: S.optional(S.String.pipe(T.Query())),
|
|
231
|
+
}).pipe(T.Http({ method: "GET", uri: "/reminders.info", code: 200 })),
|
|
232
|
+
).annotate({ identifier: "RemindersInfoRequest" });
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
236
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
237
|
+
return (__s[i] ??= __L.at(f, j));
|
|
238
|
+
}
|