@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/users.ts
CHANGED
|
@@ -1,39 +1,26 @@
|
|
|
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
|
|
|
12
15
|
export interface DeletePhotoRequest {}
|
|
13
|
-
export const DeletePhotoRequest = /*@__PURE__*/ S.suspend(() =>
|
|
14
|
-
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/users.deletePhoto", code: 200 })),
|
|
15
|
-
).annotate({ identifier: "DeletePhotoRequest" }) as any as S.Schema<DeletePhotoRequest>;
|
|
16
|
-
|
|
17
16
|
export interface DeletePhotoResponse {
|
|
18
17
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
19
18
|
ok: boolean;
|
|
20
19
|
}
|
|
21
|
-
export const DeletePhotoResponse = /*@__PURE__*/ S.suspend(() =>
|
|
22
|
-
S.Struct({
|
|
23
|
-
ok: S.Boolean,
|
|
24
|
-
}),
|
|
25
|
-
).annotate({ identifier: "DeletePhotoResponse" }) as any as S.Schema<DeletePhotoResponse>;
|
|
26
|
-
|
|
27
20
|
export interface GetPresenceRequest {
|
|
28
21
|
/** User to get presence info on. Defaults to the authed user. */
|
|
29
22
|
user?: string;
|
|
30
23
|
}
|
|
31
|
-
export const GetPresenceRequest = /*@__PURE__*/ S.suspend(() =>
|
|
32
|
-
S.Struct({
|
|
33
|
-
user: S.optional(S.String.pipe(T.Query())),
|
|
34
|
-
}).pipe(T.Http({ method: "GET", uri: "/users.getPresence", code: 200 })),
|
|
35
|
-
).annotate({ identifier: "GetPresenceRequest" }) as any as S.Schema<GetPresenceRequest>;
|
|
36
|
-
|
|
37
24
|
export interface GetPresenceResponse {
|
|
38
25
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
39
26
|
ok: boolean;
|
|
@@ -44,43 +31,17 @@ export interface GetPresenceResponse {
|
|
|
44
31
|
connection_count?: number;
|
|
45
32
|
auto_away?: boolean;
|
|
46
33
|
}
|
|
47
|
-
export const GetPresenceResponse = /*@__PURE__*/ S.suspend(() =>
|
|
48
|
-
S.Struct({
|
|
49
|
-
ok: S.Boolean,
|
|
50
|
-
last_activity: S.optional(S.Number),
|
|
51
|
-
manual_away: S.optional(S.Boolean),
|
|
52
|
-
presence: S.String,
|
|
53
|
-
online: S.optional(S.Boolean),
|
|
54
|
-
connection_count: S.optional(S.Number),
|
|
55
|
-
auto_away: S.optional(S.Boolean),
|
|
56
|
-
}),
|
|
57
|
-
).annotate({ identifier: "GetPresenceResponse" }) as any as S.Schema<GetPresenceResponse>;
|
|
58
|
-
|
|
59
34
|
export interface GetProfileRequest {
|
|
60
35
|
/** Include labels for each ID in custom profile fields. Using this parameter will heavily rate-limit your requests and is not recommended. */
|
|
61
36
|
include_labels?: boolean;
|
|
62
37
|
/** User to retrieve profile info for */
|
|
63
38
|
user?: string;
|
|
64
39
|
}
|
|
65
|
-
export const GetProfileRequest = /*@__PURE__*/ S.suspend(() =>
|
|
66
|
-
S.Struct({
|
|
67
|
-
include_labels: S.optional(S.Boolean.pipe(T.Query())),
|
|
68
|
-
user: S.optional(S.String.pipe(T.Query())),
|
|
69
|
-
}).pipe(T.Http({ method: "GET", uri: "/users.profile.get", code: 200 })),
|
|
70
|
-
).annotate({ identifier: "GetProfileRequest" }) as any as S.Schema<GetProfileRequest>;
|
|
71
|
-
|
|
72
40
|
export interface GetProfileResponse {
|
|
73
41
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
74
42
|
ok: boolean;
|
|
75
43
|
profile: unknown;
|
|
76
44
|
}
|
|
77
|
-
export const GetProfileResponse = /*@__PURE__*/ S.suspend(() =>
|
|
78
|
-
S.Struct({
|
|
79
|
-
ok: S.Boolean,
|
|
80
|
-
profile: S.Unknown,
|
|
81
|
-
}),
|
|
82
|
-
).annotate({ identifier: "GetProfileResponse" }) as any as S.Schema<GetProfileResponse>;
|
|
83
|
-
|
|
84
45
|
export interface ListUsersRequest {
|
|
85
46
|
/** Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/apis/web-api/pagination) for more detail. */
|
|
86
47
|
cursor?: string;
|
|
@@ -91,33 +52,12 @@ export interface ListUsersRequest {
|
|
|
91
52
|
/** encoded team id to list users in, required if org token is used */
|
|
92
53
|
team_id?: string;
|
|
93
54
|
}
|
|
94
|
-
export const ListUsersRequest = /*@__PURE__*/ S.suspend(() =>
|
|
95
|
-
S.Struct({
|
|
96
|
-
cursor: S.optional(S.String.pipe(T.Query())),
|
|
97
|
-
include_locale: S.optional(S.Boolean.pipe(T.Query())),
|
|
98
|
-
limit: S.optional(S.Number.pipe(T.Query())),
|
|
99
|
-
team_id: S.optional(S.String.pipe(T.Query())),
|
|
100
|
-
}).pipe(T.Http({ method: "GET", uri: "/users.list", code: 200 })),
|
|
101
|
-
).annotate({ identifier: "ListUsersRequest" }) as any as S.Schema<ListUsersRequest>;
|
|
102
|
-
|
|
103
55
|
export type ListUsersResponseMembersList = Array<unknown>;
|
|
104
|
-
export const ListUsersResponseMembersList = /*@__PURE__*/ S.Array(
|
|
105
|
-
S.Unknown,
|
|
106
|
-
) as any as S.Schema<ListUsersResponseMembersList>;
|
|
107
|
-
|
|
108
56
|
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
109
57
|
export interface ListUsersResponseResponseMetadata {
|
|
110
|
-
/** Cursor for the next page
|
|
58
|
+
/** Cursor for the next page -- pass as `cursor` on the next call. */
|
|
111
59
|
next_cursor?: string;
|
|
112
60
|
}
|
|
113
|
-
export const ListUsersResponseResponseMetadata = /*@__PURE__*/ S.suspend(() =>
|
|
114
|
-
S.Struct({
|
|
115
|
-
next_cursor: S.optional(S.String),
|
|
116
|
-
}),
|
|
117
|
-
).annotate({
|
|
118
|
-
identifier: "ListUsersResponseResponseMetadata",
|
|
119
|
-
}) as any as S.Schema<ListUsersResponseResponseMetadata>;
|
|
120
|
-
|
|
121
61
|
export interface ListUsersResponse {
|
|
122
62
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
123
63
|
ok: boolean;
|
|
@@ -127,78 +67,28 @@ export interface ListUsersResponse {
|
|
|
127
67
|
response_metadata?: ListUsersResponseResponseMetadata;
|
|
128
68
|
offset?: string;
|
|
129
69
|
}
|
|
130
|
-
export const ListUsersResponse = /*@__PURE__*/ S.suspend(() =>
|
|
131
|
-
S.Struct({
|
|
132
|
-
ok: S.Boolean,
|
|
133
|
-
members: ListUsersResponseMembersList,
|
|
134
|
-
cache_ts: S.Number,
|
|
135
|
-
response_metadata: S.optional(ListUsersResponseResponseMetadata),
|
|
136
|
-
offset: S.optional(S.String),
|
|
137
|
-
}),
|
|
138
|
-
).annotate({ identifier: "ListUsersResponse" }) as any as S.Schema<ListUsersResponse>;
|
|
139
|
-
|
|
140
70
|
export interface LookupByEmailRequest {
|
|
141
71
|
/** An email address belonging to a user in the workspace */
|
|
142
72
|
email: string;
|
|
143
73
|
}
|
|
144
|
-
export const LookupByEmailRequest = /*@__PURE__*/ S.suspend(() =>
|
|
145
|
-
S.Struct({
|
|
146
|
-
email: S.String.pipe(T.Query()),
|
|
147
|
-
}).pipe(T.Http({ method: "GET", uri: "/users.lookupByEmail", code: 200 })),
|
|
148
|
-
).annotate({ identifier: "LookupByEmailRequest" }) as any as S.Schema<LookupByEmailRequest>;
|
|
149
|
-
|
|
150
74
|
export interface LookupByEmailResponse {
|
|
151
75
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
152
76
|
ok: boolean;
|
|
153
77
|
user: unknown;
|
|
154
78
|
}
|
|
155
|
-
export const LookupByEmailResponse = /*@__PURE__*/ S.suspend(() =>
|
|
156
|
-
S.Struct({
|
|
157
|
-
ok: S.Boolean,
|
|
158
|
-
user: S.Unknown,
|
|
159
|
-
}),
|
|
160
|
-
).annotate({ identifier: "LookupByEmailResponse" }) as any as S.Schema<LookupByEmailResponse>;
|
|
161
|
-
|
|
162
79
|
export interface LookupDiscoverableContactRequest {
|
|
163
80
|
email: string;
|
|
164
81
|
}
|
|
165
|
-
export const LookupDiscoverableContactRequest = /*@__PURE__*/ S.suspend(() =>
|
|
166
|
-
S.Struct({
|
|
167
|
-
email: S.String,
|
|
168
|
-
}).pipe(T.Http({ method: "POST", uri: "/users.discoverableContacts.lookup", code: 200 })),
|
|
169
|
-
).annotate({
|
|
170
|
-
identifier: "LookupDiscoverableContactRequest",
|
|
171
|
-
}) as any as S.Schema<LookupDiscoverableContactRequest>;
|
|
172
|
-
|
|
173
82
|
export interface LookupDiscoverableContactResponse {
|
|
174
83
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
175
84
|
ok: boolean;
|
|
176
85
|
is_discoverable: boolean;
|
|
177
86
|
}
|
|
178
|
-
export const LookupDiscoverableContactResponse = /*@__PURE__*/ S.suspend(() =>
|
|
179
|
-
S.Struct({
|
|
180
|
-
ok: S.Boolean,
|
|
181
|
-
is_discoverable: S.Boolean,
|
|
182
|
-
}),
|
|
183
|
-
).annotate({
|
|
184
|
-
identifier: "LookupDiscoverableContactResponse",
|
|
185
|
-
}) as any as S.Schema<LookupDiscoverableContactResponse>;
|
|
186
|
-
|
|
187
87
|
export interface SetActiveRequest {}
|
|
188
|
-
export const SetActiveRequest = /*@__PURE__*/ S.suspend(() =>
|
|
189
|
-
S.Struct({}).pipe(T.Http({ method: "POST", uri: "/users.setActive", code: 200 })),
|
|
190
|
-
).annotate({ identifier: "SetActiveRequest" }) as any as S.Schema<SetActiveRequest>;
|
|
191
|
-
|
|
192
88
|
export interface SetActiveResponse {
|
|
193
89
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
194
90
|
ok: boolean;
|
|
195
91
|
}
|
|
196
|
-
export const SetActiveResponse = /*@__PURE__*/ S.suspend(() =>
|
|
197
|
-
S.Struct({
|
|
198
|
-
ok: S.Boolean,
|
|
199
|
-
}),
|
|
200
|
-
).annotate({ identifier: "SetActiveResponse" }) as any as S.Schema<SetActiveResponse>;
|
|
201
|
-
|
|
202
92
|
export interface SetPhotoRequest {
|
|
203
93
|
/** Width/height of crop box (always square) */
|
|
204
94
|
crop_w?: string;
|
|
@@ -209,59 +99,22 @@ export interface SetPhotoRequest {
|
|
|
209
99
|
/** File contents via `multipart/form-data`. */
|
|
210
100
|
image?: unknown;
|
|
211
101
|
}
|
|
212
|
-
export const SetPhotoRequest = /*@__PURE__*/ S.suspend(() =>
|
|
213
|
-
S.Struct({
|
|
214
|
-
crop_w: S.optional(S.String),
|
|
215
|
-
crop_x: S.optional(S.String),
|
|
216
|
-
crop_y: S.optional(S.String),
|
|
217
|
-
image: S.optional(S.Unknown),
|
|
218
|
-
}).pipe(
|
|
219
|
-
T.Http({ method: "POST", uri: "/users.setPhoto", code: 200, contentType: "form-urlencoded" }),
|
|
220
|
-
),
|
|
221
|
-
).annotate({ identifier: "SetPhotoRequest" }) as any as S.Schema<SetPhotoRequest>;
|
|
222
|
-
|
|
223
102
|
export type SetPhotoResponseProfileMap = { [key: string]: unknown | undefined };
|
|
224
|
-
export const SetPhotoResponseProfileMap = /*@__PURE__*/ S.Record(
|
|
225
|
-
S.String,
|
|
226
|
-
S.Unknown,
|
|
227
|
-
) as any as S.Schema<SetPhotoResponseProfileMap>;
|
|
228
|
-
|
|
229
103
|
export interface SetPhotoResponse {
|
|
230
104
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
231
105
|
ok: boolean;
|
|
232
106
|
profile: SetPhotoResponseProfileMap;
|
|
233
107
|
}
|
|
234
|
-
export const SetPhotoResponse = /*@__PURE__*/ S.suspend(() =>
|
|
235
|
-
S.Struct({
|
|
236
|
-
ok: S.Boolean,
|
|
237
|
-
profile: SetPhotoResponseProfileMap,
|
|
238
|
-
}),
|
|
239
|
-
).annotate({ identifier: "SetPhotoResponse" }) as any as S.Schema<SetPhotoResponse>;
|
|
240
|
-
|
|
241
108
|
/** Either `auto` or `away` */
|
|
242
109
|
export type SetPresenceRequestPresence = "auto" | "away";
|
|
243
|
-
export const SetPresenceRequestPresence = S.String;
|
|
244
|
-
|
|
245
110
|
export interface SetPresenceRequest {
|
|
246
111
|
/** Either `auto` or `away` */
|
|
247
112
|
presence: SetPresenceRequestPresence | (string & {});
|
|
248
113
|
}
|
|
249
|
-
export const SetPresenceRequest = /*@__PURE__*/ S.suspend(() =>
|
|
250
|
-
S.Struct({
|
|
251
|
-
presence: SetPresenceRequestPresence,
|
|
252
|
-
}).pipe(T.Http({ method: "POST", uri: "/users.setPresence", code: 200 })),
|
|
253
|
-
).annotate({ identifier: "SetPresenceRequest" }) as any as S.Schema<SetPresenceRequest>;
|
|
254
|
-
|
|
255
114
|
export interface SetPresenceResponse {
|
|
256
115
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
257
116
|
ok: boolean;
|
|
258
117
|
}
|
|
259
|
-
export const SetPresenceResponse = /*@__PURE__*/ S.suspend(() =>
|
|
260
|
-
S.Struct({
|
|
261
|
-
ok: S.Boolean,
|
|
262
|
-
}),
|
|
263
|
-
).annotate({ identifier: "SetPresenceResponse" }) as any as S.Schema<SetPresenceResponse>;
|
|
264
|
-
|
|
265
118
|
export interface SetProfileRequest {
|
|
266
119
|
/** Name of a single key to set. Usable only if `profile` is not passed. */
|
|
267
120
|
name?: string;
|
|
@@ -272,15 +125,6 @@ export interface SetProfileRequest {
|
|
|
272
125
|
/** Value to set a single key to. Usable only if `profile` is not passed. */
|
|
273
126
|
value?: string;
|
|
274
127
|
}
|
|
275
|
-
export const SetProfileRequest = /*@__PURE__*/ S.suspend(() =>
|
|
276
|
-
S.Struct({
|
|
277
|
-
name: S.optional(S.String),
|
|
278
|
-
profile: S.optional(S.String),
|
|
279
|
-
user: S.optional(S.String),
|
|
280
|
-
value: S.optional(S.String),
|
|
281
|
-
}).pipe(T.Http({ method: "POST", uri: "/users.profile.set", code: 200 })),
|
|
282
|
-
).annotate({ identifier: "SetProfileRequest" }) as any as S.Schema<SetProfileRequest>;
|
|
283
|
-
|
|
284
128
|
export interface SetProfileResponse {
|
|
285
129
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
286
130
|
ok: boolean;
|
|
@@ -288,15 +132,6 @@ export interface SetProfileResponse {
|
|
|
288
132
|
profile: unknown;
|
|
289
133
|
email_pending?: string;
|
|
290
134
|
}
|
|
291
|
-
export const SetProfileResponse = /*@__PURE__*/ S.suspend(() =>
|
|
292
|
-
S.Struct({
|
|
293
|
-
ok: S.Boolean,
|
|
294
|
-
username: S.String,
|
|
295
|
-
profile: S.Unknown,
|
|
296
|
-
email_pending: S.optional(S.String),
|
|
297
|
-
}),
|
|
298
|
-
).annotate({ identifier: "SetProfileResponse" }) as any as S.Schema<SetProfileResponse>;
|
|
299
|
-
|
|
300
135
|
export interface UsersConversationsRequest {
|
|
301
136
|
/** Paginate through collections of data by setting the `cursor` parameter to a `next_cursor` attribute returned by a previous request's `response_metadata`. Default value fetches the first "page" of the collection. See [pagination](/apis/web-api/pagination) for more detail. */
|
|
302
137
|
cursor?: string;
|
|
@@ -313,29 +148,9 @@ export interface UsersConversationsRequest {
|
|
|
313
148
|
/** Browse conversations by a specific user ID's membership. Non-public channels are restricted to those where the calling user shares membership. */
|
|
314
149
|
user?: string;
|
|
315
150
|
}
|
|
316
|
-
export const UsersConversationsRequest = /*@__PURE__*/ S.suspend(() =>
|
|
317
|
-
S.Struct({
|
|
318
|
-
cursor: S.optional(S.String.pipe(T.Query())),
|
|
319
|
-
exclude_archived: S.optional(S.Boolean.pipe(T.Query())),
|
|
320
|
-
exclude_muted: S.optional(S.Boolean.pipe(T.Query())),
|
|
321
|
-
limit: S.optional(S.Number.pipe(T.Query())),
|
|
322
|
-
team_id: S.optional(S.String.pipe(T.Query())),
|
|
323
|
-
types: S.optional(S.String.pipe(T.Query())),
|
|
324
|
-
user: S.optional(S.String.pipe(T.Query())),
|
|
325
|
-
}).pipe(T.Http({ method: "GET", uri: "/users.conversations", code: 200 })),
|
|
326
|
-
).annotate({
|
|
327
|
-
identifier: "UsersConversationsRequest",
|
|
328
|
-
}) as any as S.Schema<UsersConversationsRequest>;
|
|
329
|
-
|
|
330
151
|
export type UsersConversationsResponseChannelsList = Array<unknown>;
|
|
331
|
-
export const UsersConversationsResponseChannelsList = /*@__PURE__*/ S.Array(
|
|
332
|
-
S.Unknown,
|
|
333
|
-
) as any as S.Schema<UsersConversationsResponseChannelsList>;
|
|
334
|
-
|
|
335
152
|
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
336
153
|
export type UsersConversationsResponseResponseMetadata = ListUsersResponseResponseMetadata;
|
|
337
|
-
export const UsersConversationsResponseResponseMetadata = ListUsersResponseResponseMetadata;
|
|
338
|
-
|
|
339
154
|
export interface UsersConversationsResponse {
|
|
340
155
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
341
156
|
ok: boolean;
|
|
@@ -343,110 +158,71 @@ export interface UsersConversationsResponse {
|
|
|
343
158
|
/** Pagination metadata. An empty `next_cursor` means the last page. */
|
|
344
159
|
response_metadata?: ListUsersResponseResponseMetadata;
|
|
345
160
|
}
|
|
346
|
-
export const UsersConversationsResponse = /*@__PURE__*/ S.suspend(() =>
|
|
347
|
-
S.Struct({
|
|
348
|
-
ok: S.Boolean,
|
|
349
|
-
channels: UsersConversationsResponseChannelsList,
|
|
350
|
-
response_metadata: S.optional(ListUsersResponseResponseMetadata),
|
|
351
|
-
}),
|
|
352
|
-
).annotate({
|
|
353
|
-
identifier: "UsersConversationsResponse",
|
|
354
|
-
}) as any as S.Schema<UsersConversationsResponse>;
|
|
355
|
-
|
|
356
161
|
export interface UsersIdentityRequest {}
|
|
357
|
-
export const UsersIdentityRequest = /*@__PURE__*/ S.suspend(() =>
|
|
358
|
-
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/users.identity", code: 200 })),
|
|
359
|
-
).annotate({ identifier: "UsersIdentityRequest" }) as any as S.Schema<UsersIdentityRequest>;
|
|
360
|
-
|
|
361
162
|
export interface UsersIdentityResponse {
|
|
362
163
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
363
164
|
ok: boolean;
|
|
364
165
|
}
|
|
365
|
-
export const UsersIdentityResponse = /*@__PURE__*/ S.suspend(() =>
|
|
366
|
-
S.Struct({
|
|
367
|
-
ok: S.Boolean,
|
|
368
|
-
}),
|
|
369
|
-
).annotate({ identifier: "UsersIdentityResponse" }) as any as S.Schema<UsersIdentityResponse>;
|
|
370
|
-
|
|
371
166
|
export interface UsersInfoRequest {
|
|
372
167
|
/** Set this to `true` to receive the locale for this user. Defaults to `false` */
|
|
373
168
|
include_locale?: boolean;
|
|
374
169
|
/** User to get info on */
|
|
375
170
|
user?: string;
|
|
376
171
|
}
|
|
377
|
-
export const UsersInfoRequest = /*@__PURE__*/ S.suspend(() =>
|
|
378
|
-
S.Struct({
|
|
379
|
-
include_locale: S.optional(S.Boolean.pipe(T.Query())),
|
|
380
|
-
user: S.optional(S.String.pipe(T.Query())),
|
|
381
|
-
}).pipe(T.Http({ method: "GET", uri: "/users.info", code: 200 })),
|
|
382
|
-
).annotate({ identifier: "UsersInfoRequest" }) as any as S.Schema<UsersInfoRequest>;
|
|
383
|
-
|
|
384
172
|
export type UsersInfoResponseUsersList = Array<unknown>;
|
|
385
|
-
export const UsersInfoResponseUsersList = /*@__PURE__*/ S.Array(
|
|
386
|
-
S.Unknown,
|
|
387
|
-
) as any as S.Schema<UsersInfoResponseUsersList>;
|
|
388
|
-
|
|
389
173
|
export interface UsersInfoResponse {
|
|
390
174
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
391
175
|
ok: boolean;
|
|
392
176
|
user?: unknown;
|
|
393
177
|
users?: UsersInfoResponseUsersList;
|
|
394
178
|
}
|
|
395
|
-
export const UsersInfoResponse = /*@__PURE__*/ S.suspend(() =>
|
|
396
|
-
S.Struct({
|
|
397
|
-
ok: S.Boolean,
|
|
398
|
-
user: S.optional(S.Unknown),
|
|
399
|
-
users: S.optional(UsersInfoResponseUsersList),
|
|
400
|
-
}),
|
|
401
|
-
).annotate({ identifier: "UsersInfoResponse" }) as any as S.Schema<UsersInfoResponse>;
|
|
402
|
-
|
|
403
179
|
export type DeletePhotoError = SlackOpError;
|
|
404
|
-
/** Delete the user profile photo Required scopes
|
|
180
|
+
/** Delete the user profile photo Required scopes -- user: `users.profile:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- An unexpected error occurred. See https://docs.slack.dev/reference/methods/users.deletePhoto */
|
|
405
181
|
export const deletePhoto: API.OperationMethod<
|
|
406
182
|
DeletePhotoRequest,
|
|
407
183
|
DeletePhotoResponse,
|
|
408
184
|
DeletePhotoError,
|
|
409
185
|
SlackOpContext
|
|
410
186
|
> = /*@__PURE__*/ API.make(() => ({
|
|
411
|
-
input: DeletePhotoRequest
|
|
412
|
-
output: DeletePhotoResponse
|
|
187
|
+
input: __S(0, __c0, 0) as any as S.Schema<DeletePhotoRequest>,
|
|
188
|
+
output: __S(4, __c1, 0) as any as S.Schema<DeletePhotoResponse>,
|
|
413
189
|
errors: [SlackError, SlackRateLimited],
|
|
414
190
|
protocol: SlackProtocol,
|
|
415
191
|
retry: Retry.Retry,
|
|
416
192
|
}));
|
|
417
193
|
|
|
418
194
|
export type GetPresenceError = SlackOpError;
|
|
419
|
-
/** Gets user presence information. Required scopes
|
|
195
|
+
/** Gets user presence information. Required scopes -- bot: `users:read`; user: `users:read` Rate limit tier: 3 See https://docs.slack.dev/reference/methods/users.getPresence */
|
|
420
196
|
export const getPresence: API.OperationMethod<
|
|
421
197
|
GetPresenceRequest,
|
|
422
198
|
GetPresenceResponse,
|
|
423
199
|
GetPresenceError,
|
|
424
200
|
SlackOpContext
|
|
425
201
|
> = /*@__PURE__*/ API.make(() => ({
|
|
426
|
-
input: GetPresenceRequest
|
|
427
|
-
output: GetPresenceResponse
|
|
202
|
+
input: __S(8, __c2, 0) as any as S.Schema<GetPresenceRequest>,
|
|
203
|
+
output: __S(9, __c2, 1) as any as S.Schema<GetPresenceResponse>,
|
|
428
204
|
errors: [SlackError, SlackRateLimited],
|
|
429
205
|
protocol: SlackProtocol,
|
|
430
206
|
retry: Retry.Retry,
|
|
431
207
|
}));
|
|
432
208
|
|
|
433
209
|
export type GetProfileError = SlackOpError;
|
|
434
|
-
/** Retrieve a user's profile information, including their custom status. Required scopes
|
|
210
|
+
/** Retrieve a user's profile information, including their custom status. Required scopes -- bot: `users.profile:read`; user: `users.profile:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `user_not_found` -- Value passed for `user` was invalid. - `token_revoked` -- The token being used is not valid. - `ratelimited` -- You are attempting to call this method too frequently. See https://docs.slack.dev/reference/methods/users.profile.get */
|
|
435
211
|
export const getProfile: API.OperationMethod<
|
|
436
212
|
GetProfileRequest,
|
|
437
213
|
GetProfileResponse,
|
|
438
214
|
GetProfileError,
|
|
439
215
|
SlackOpContext
|
|
440
216
|
> = /*@__PURE__*/ API.make(() => ({
|
|
441
|
-
input: GetProfileRequest
|
|
442
|
-
output: GetProfileResponse
|
|
217
|
+
input: __S(24, __c6, 0) as any as S.Schema<GetProfileRequest>,
|
|
218
|
+
output: __S(25, __c6, 1) as any as S.Schema<GetProfileResponse>,
|
|
443
219
|
errors: [SlackError, SlackRateLimited],
|
|
444
220
|
protocol: SlackProtocol,
|
|
445
221
|
retry: Retry.Retry,
|
|
446
222
|
}));
|
|
447
223
|
|
|
448
224
|
export type ListUsersError = SlackOpError;
|
|
449
|
-
/** Lists all users in a Slack team. Required scopes
|
|
225
|
+
/** Lists all users in a Slack team. Required scopes -- bot: `users:read`; user: `users: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. - `limit_required` -- For large teams a limit is required. - `missing_argument` -- A required argument is missing. See https://docs.slack.dev/reference/methods/users.list */
|
|
450
226
|
export const listUsers: API.PaginatedOperationMethod<
|
|
451
227
|
ListUsersRequest,
|
|
452
228
|
ListUsersResponse,
|
|
@@ -455,8 +231,8 @@ export const listUsers: API.PaginatedOperationMethod<
|
|
|
455
231
|
unknown
|
|
456
232
|
> = /*@__PURE__*/ API.makePaginated(
|
|
457
233
|
() => ({
|
|
458
|
-
input: ListUsersRequest
|
|
459
|
-
output: ListUsersResponse
|
|
234
|
+
input: __S(28, __c7, 0) as any as S.Schema<ListUsersRequest>,
|
|
235
|
+
output: __S(29, __c7, 1) as any as S.Schema<ListUsersResponse>,
|
|
460
236
|
errors: [SlackError, SlackRateLimited],
|
|
461
237
|
protocol: SlackProtocol,
|
|
462
238
|
retry: Retry.Retry,
|
|
@@ -472,97 +248,97 @@ export const listUsers: API.PaginatedOperationMethod<
|
|
|
472
248
|
) as any;
|
|
473
249
|
|
|
474
250
|
export type LookupByEmailError = SlackOpError;
|
|
475
|
-
/** Find a user with an email address. Required scopes
|
|
251
|
+
/** Find a user with an email address. Required scopes -- bot: `users:read.email`; user: `users:read.email` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `enterprise_is_restricted` -- This method was called with an inappropriate enterprise-level token. - `users_not_found` -- Value passed for `user` was invalid. See https://docs.slack.dev/reference/methods/users.lookupByEmail */
|
|
476
252
|
export const lookupByEmail: API.OperationMethod<
|
|
477
253
|
LookupByEmailRequest,
|
|
478
254
|
LookupByEmailResponse,
|
|
479
255
|
LookupByEmailError,
|
|
480
256
|
SlackOpContext
|
|
481
257
|
> = /*@__PURE__*/ API.make(() => ({
|
|
482
|
-
input: LookupByEmailRequest
|
|
483
|
-
output: LookupByEmailResponse
|
|
258
|
+
input: __S(40, __c10, 0) as any as S.Schema<LookupByEmailRequest>,
|
|
259
|
+
output: __S(41, __c10, 1) as any as S.Schema<LookupByEmailResponse>,
|
|
484
260
|
errors: [SlackError, SlackRateLimited],
|
|
485
261
|
protocol: SlackProtocol,
|
|
486
262
|
retry: Retry.Retry,
|
|
487
263
|
}));
|
|
488
264
|
|
|
489
265
|
export type LookupDiscoverableContactError = SlackOpError;
|
|
490
|
-
/** Look up an email address to see if someone is discoverable on Slack Required scopes
|
|
266
|
+
/** Look up an email address to see if someone is discoverable on Slack Required scopes -- bot: `conversations.connect:manage`, `team:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `not_allowed` -- user is not allowed to call this API - `ratelimited` -- too many attempts - `invalid_arguments` -- Invalid arguments (including exceeding character count) - `restricted_action` -- user is restricted from calling this API - `not_an_enterprise` -- The token does not belong to an enterprise. See https://docs.slack.dev/reference/methods/users.discoverableContacts.lookup */
|
|
491
267
|
export const lookupDiscoverableContact: API.OperationMethod<
|
|
492
268
|
LookupDiscoverableContactRequest,
|
|
493
269
|
LookupDiscoverableContactResponse,
|
|
494
270
|
LookupDiscoverableContactError,
|
|
495
271
|
SlackOpContext
|
|
496
272
|
> = /*@__PURE__*/ API.make(() => ({
|
|
497
|
-
input: LookupDiscoverableContactRequest
|
|
498
|
-
output: LookupDiscoverableContactResponse
|
|
273
|
+
input: __S(44, __c11, 0) as any as S.Schema<LookupDiscoverableContactRequest>,
|
|
274
|
+
output: __S(45, __c11, 1) as any as S.Schema<LookupDiscoverableContactResponse>,
|
|
499
275
|
errors: [SlackError, SlackRateLimited],
|
|
500
276
|
protocol: SlackProtocol,
|
|
501
277
|
retry: Retry.Retry,
|
|
502
278
|
}));
|
|
503
279
|
|
|
504
280
|
export type SetActiveError = SlackOpError;
|
|
505
|
-
/** Marked a user as active. Deprecated and non-functional. Required scopes
|
|
281
|
+
/** Marked a user as active. Deprecated and non-functional. Required scopes -- bot: `users:write`; user: `users:write` Rate limit tier: 2 See https://docs.slack.dev/reference/methods/users.setActive */
|
|
506
282
|
export const setActive: API.OperationMethod<
|
|
507
283
|
SetActiveRequest,
|
|
508
284
|
SetActiveResponse,
|
|
509
285
|
SetActiveError,
|
|
510
286
|
SlackOpContext
|
|
511
287
|
> = /*@__PURE__*/ API.make(() => ({
|
|
512
|
-
input: SetActiveRequest
|
|
513
|
-
output: SetActiveResponse
|
|
288
|
+
input: __S(48, __c12, 0) as any as S.Schema<SetActiveRequest>,
|
|
289
|
+
output: __S(4, __c1, 0) as any as S.Schema<SetActiveResponse>,
|
|
514
290
|
errors: [SlackError, SlackRateLimited],
|
|
515
291
|
protocol: SlackProtocol,
|
|
516
292
|
retry: Retry.Retry,
|
|
517
293
|
}));
|
|
518
294
|
|
|
519
295
|
export type SetPhotoError = SlackOpError;
|
|
520
|
-
/** Set the user profile photo Required scopes
|
|
296
|
+
/** Set the user profile photo Required scopes -- user: `users.profile:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `bad_image` -- The uploaded image could not be processed - try passing a JPEG, GIF or PNG - `internal_error` -- An unexpected error occurred. - `too_large` -- The uploaded image had excessive dimensions - `too_many_frames` -- An animated GIF with too many frames was uploaded See https://docs.slack.dev/reference/methods/users.setPhoto */
|
|
521
297
|
export const setPhoto: API.OperationMethod<
|
|
522
298
|
SetPhotoRequest,
|
|
523
299
|
SetPhotoResponse,
|
|
524
300
|
SetPhotoError,
|
|
525
301
|
SlackOpContext
|
|
526
302
|
> = /*@__PURE__*/ API.make(() => ({
|
|
527
|
-
input: SetPhotoRequest
|
|
528
|
-
output: SetPhotoResponse
|
|
303
|
+
input: __S(52, __c13, 0) as any as S.Schema<SetPhotoRequest>,
|
|
304
|
+
output: __S(54, __c13, 2) as any as S.Schema<SetPhotoResponse>,
|
|
529
305
|
errors: [SlackError, SlackRateLimited],
|
|
530
306
|
protocol: SlackProtocol,
|
|
531
307
|
retry: Retry.Retry,
|
|
532
308
|
}));
|
|
533
309
|
|
|
534
310
|
export type SetPresenceError = SlackOpError;
|
|
535
|
-
/** Manually sets user presence. Required scopes
|
|
311
|
+
/** Manually sets user presence. Required scopes -- bot: `users:write`; user: `users:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `invalid_presence` -- Value passed for `presence` was invalid. See https://docs.slack.dev/reference/methods/users.setPresence */
|
|
536
312
|
export const setPresence: API.OperationMethod<
|
|
537
313
|
SetPresenceRequest,
|
|
538
314
|
SetPresenceResponse,
|
|
539
315
|
SetPresenceError,
|
|
540
316
|
SlackOpContext
|
|
541
317
|
> = /*@__PURE__*/ API.make(() => ({
|
|
542
|
-
input: SetPresenceRequest
|
|
543
|
-
output: SetPresenceResponse
|
|
318
|
+
input: __S(56, __c14, 0) as any as S.Schema<SetPresenceRequest>,
|
|
319
|
+
output: __S(4, __c1, 0) as any as S.Schema<SetPresenceResponse>,
|
|
544
320
|
errors: [SlackError, SlackRateLimited],
|
|
545
321
|
protocol: SlackProtocol,
|
|
546
322
|
retry: Retry.Retry,
|
|
547
323
|
}));
|
|
548
324
|
|
|
549
325
|
export type SetProfileError = SlackOpError;
|
|
550
|
-
/** Set a user's profile information, including custom status. Required scopes
|
|
326
|
+
/** Set a user's profile information, including custom status. Required scopes -- user: `users.profile:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `cannot_update_admin_user` -- Only a primary owner can update the profile of an admin. - `email_taken` -- email taken - `invalid_profile` -- Profile object passed in is not valid JSON (make sure it is URL encoded!). - `must_clear_both_status_text_and_status_emoji` -- Clearing the status requires setting both `status_text` and `status_emoji` to ''. - `name_not_allowed` -- name cannot contain URL. - `not_admin` -- Only admins can update the profile of another user. Some fields, like `email` may only be updated by an admin. - `not_app_admin` -- Only team owners and selected members can update the profile of a bot user. - `partial_profile_set_failed` -- Failed to set user profile. - `profile_set_failed` -- Failed to set user profile. - `reserved_name` -- First or last name are reserved. - `sudo_required` -- Request requires sudo session. - `too_long` -- You attempted to set a custom status but it was longer than the maximum allowed, 100. - `permission_denied` -- Permission denied. - `username_same` -- Username is the same as the current username. - `invalid_emoji_not_allowed` -- Invalid emoji not allowed. - `invalid_ooo_message` -- Invalid Out of Office message. - `invalid_starts_with_at` -- Name cannot start with @. See https://docs.slack.dev/reference/methods/users.profile.set */
|
|
551
327
|
export const setProfile: API.OperationMethod<
|
|
552
328
|
SetProfileRequest,
|
|
553
329
|
SetProfileResponse,
|
|
554
330
|
SetProfileError,
|
|
555
331
|
SlackOpContext
|
|
556
332
|
> = /*@__PURE__*/ API.make(() => ({
|
|
557
|
-
input: SetProfileRequest
|
|
558
|
-
output: SetProfileResponse
|
|
333
|
+
input: __S(60, __c15, 0) as any as S.Schema<SetProfileRequest>,
|
|
334
|
+
output: __S(61, __c15, 1) as any as S.Schema<SetProfileResponse>,
|
|
559
335
|
errors: [SlackError, SlackRateLimited],
|
|
560
336
|
protocol: SlackProtocol,
|
|
561
337
|
retry: Retry.Retry,
|
|
562
338
|
}));
|
|
563
339
|
|
|
564
340
|
export type UsersConversationsError = SlackOpError;
|
|
565
|
-
/** List conversations the calling user is a member of. Required scopes
|
|
341
|
+
/** List conversations the calling user is a member of. Required scopes -- bot: `groups:read`, `im:read`, `mpim:read`, `channels:read`; user: `groups:read`, `im:read`, `mpim:read`, `channels:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `invalid_cursor` -- Value passed for `cursor` was not valid or is no longer valid. - `invalid_limit` -- Value passed for `limit` is not understood. - `invalid_types` -- Value passed for `type` could not be used based on the method's capabilities or the permission scopes granted to the used token. - `method_not_supported_for_channel_type` -- This type of conversation cannot be used with this method. - `missing_argument` -- A required argument is missing. - `missing_scope` -- The calling token is not granted the necessary scopes to complete this operation. See https://docs.slack.dev/reference/methods/users.conversations */
|
|
566
342
|
export const usersConversations: API.PaginatedOperationMethod<
|
|
567
343
|
UsersConversationsRequest,
|
|
568
344
|
UsersConversationsResponse,
|
|
@@ -571,8 +347,8 @@ export const usersConversations: API.PaginatedOperationMethod<
|
|
|
571
347
|
unknown
|
|
572
348
|
> = /*@__PURE__*/ API.makePaginated(
|
|
573
349
|
() => ({
|
|
574
|
-
input: UsersConversationsRequest
|
|
575
|
-
output: UsersConversationsResponse
|
|
350
|
+
input: __S(12, __c3, 0) as any as S.Schema<UsersConversationsRequest>,
|
|
351
|
+
output: __S(13, __c3, 1) as any as S.Schema<UsersConversationsResponse>,
|
|
576
352
|
errors: [SlackError, SlackRateLimited],
|
|
577
353
|
protocol: SlackProtocol,
|
|
578
354
|
retry: Retry.Retry,
|
|
@@ -588,31 +364,288 @@ export const usersConversations: API.PaginatedOperationMethod<
|
|
|
588
364
|
) as any;
|
|
589
365
|
|
|
590
366
|
export type UsersIdentityError = SlackOpError;
|
|
591
|
-
/** Get a user's identity. Required scopes
|
|
367
|
+
/** Get a user's identity. Required scopes -- user: `identity:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `internal_error` -- Internal error - `invalid_user_id` -- Invalid user id provided - `email_not_verified` -- user email has not been verified See https://docs.slack.dev/reference/methods/users.identity */
|
|
592
368
|
export const usersIdentity: API.OperationMethod<
|
|
593
369
|
UsersIdentityRequest,
|
|
594
370
|
UsersIdentityResponse,
|
|
595
371
|
UsersIdentityError,
|
|
596
372
|
SlackOpContext
|
|
597
373
|
> = /*@__PURE__*/ API.make(() => ({
|
|
598
|
-
input: UsersIdentityRequest
|
|
599
|
-
output: UsersIdentityResponse
|
|
374
|
+
input: __S(16, __c4, 0) as any as S.Schema<UsersIdentityRequest>,
|
|
375
|
+
output: __S(4, __c1, 0) as any as S.Schema<UsersIdentityResponse>,
|
|
600
376
|
errors: [SlackError, SlackRateLimited],
|
|
601
377
|
protocol: SlackProtocol,
|
|
602
378
|
retry: Retry.Retry,
|
|
603
379
|
}));
|
|
604
380
|
|
|
605
381
|
export type UsersInfoError = SlackOpError;
|
|
606
|
-
/** Gets information about a user. Required scopes
|
|
382
|
+
/** Gets information about a user. Required scopes -- bot: `users:read`; user: `users:read` Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `too_many_users` -- Too many users. - `user_not_found` -- Value passed for `user` was invalid. - `user_not_visible` -- The requested user is not visible to the calling user See https://docs.slack.dev/reference/methods/users.info */
|
|
607
383
|
export const usersInfo: API.OperationMethod<
|
|
608
384
|
UsersInfoRequest,
|
|
609
385
|
UsersInfoResponse,
|
|
610
386
|
UsersInfoError,
|
|
611
387
|
SlackOpContext
|
|
612
388
|
> = /*@__PURE__*/ API.make(() => ({
|
|
613
|
-
input: UsersInfoRequest
|
|
614
|
-
output: UsersInfoResponse
|
|
389
|
+
input: __S(20, __c5, 0) as any as S.Schema<UsersInfoRequest>,
|
|
390
|
+
output: __S(21, __c5, 1) as any as S.Schema<UsersInfoResponse>,
|
|
615
391
|
errors: [SlackError, SlackRateLimited],
|
|
616
392
|
protocol: SlackProtocol,
|
|
617
393
|
retry: Retry.Retry,
|
|
618
394
|
}));
|
|
395
|
+
|
|
396
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
397
|
+
function __c0(j: number): any {
|
|
398
|
+
switch (j) {
|
|
399
|
+
case 0:
|
|
400
|
+
return S.suspend(() =>
|
|
401
|
+
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/users.deletePhoto", code: 200 })),
|
|
402
|
+
).annotate({ identifier: "DeletePhotoRequest" });
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
function __c1(j: number): any {
|
|
406
|
+
switch (j) {
|
|
407
|
+
case 0:
|
|
408
|
+
return S.suspend(() =>
|
|
409
|
+
S.Struct({
|
|
410
|
+
ok: S.Boolean,
|
|
411
|
+
}),
|
|
412
|
+
).annotate({ identifier: "DeletePhotoResponse" });
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
function __c2(j: number): any {
|
|
416
|
+
switch (j) {
|
|
417
|
+
case 0:
|
|
418
|
+
return S.suspend(() =>
|
|
419
|
+
S.Struct({
|
|
420
|
+
user: S.optional(S.String.pipe(T.Query())),
|
|
421
|
+
}).pipe(T.Http({ method: "GET", uri: "/users.getPresence", code: 200 })),
|
|
422
|
+
).annotate({ identifier: "GetPresenceRequest" });
|
|
423
|
+
case 1:
|
|
424
|
+
return S.suspend(() =>
|
|
425
|
+
S.Struct({
|
|
426
|
+
ok: S.Boolean,
|
|
427
|
+
last_activity: S.optional(S.Number),
|
|
428
|
+
manual_away: S.optional(S.Boolean),
|
|
429
|
+
presence: S.String,
|
|
430
|
+
online: S.optional(S.Boolean),
|
|
431
|
+
connection_count: S.optional(S.Number),
|
|
432
|
+
auto_away: S.optional(S.Boolean),
|
|
433
|
+
}),
|
|
434
|
+
).annotate({ identifier: "GetPresenceResponse" });
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
function __c3(j: number): any {
|
|
438
|
+
switch (j) {
|
|
439
|
+
case 0:
|
|
440
|
+
return S.suspend(() =>
|
|
441
|
+
S.Struct({
|
|
442
|
+
cursor: S.optional(S.String.pipe(T.Query())),
|
|
443
|
+
exclude_archived: S.optional(S.Boolean.pipe(T.Query())),
|
|
444
|
+
exclude_muted: S.optional(S.Boolean.pipe(T.Query())),
|
|
445
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
446
|
+
team_id: S.optional(S.String.pipe(T.Query())),
|
|
447
|
+
types: S.optional(S.String.pipe(T.Query())),
|
|
448
|
+
user: S.optional(S.String.pipe(T.Query())),
|
|
449
|
+
}).pipe(T.Http({ method: "GET", uri: "/users.conversations", code: 200 })),
|
|
450
|
+
).annotate({ identifier: "UsersConversationsRequest" });
|
|
451
|
+
case 1:
|
|
452
|
+
return S.suspend(() =>
|
|
453
|
+
S.Struct({
|
|
454
|
+
ok: S.Boolean,
|
|
455
|
+
channels: __S(36, __c9, 0),
|
|
456
|
+
response_metadata: S.optional(__S(32, __c8, 0)),
|
|
457
|
+
}),
|
|
458
|
+
).annotate({ identifier: "UsersConversationsResponse" });
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
function __c4(j: number): any {
|
|
462
|
+
switch (j) {
|
|
463
|
+
case 0:
|
|
464
|
+
return S.suspend(() =>
|
|
465
|
+
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/users.identity", code: 200 })),
|
|
466
|
+
).annotate({ identifier: "UsersIdentityRequest" });
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
function __c5(j: number): any {
|
|
470
|
+
switch (j) {
|
|
471
|
+
case 0:
|
|
472
|
+
return S.suspend(() =>
|
|
473
|
+
S.Struct({
|
|
474
|
+
include_locale: S.optional(S.Boolean.pipe(T.Query())),
|
|
475
|
+
user: S.optional(S.String.pipe(T.Query())),
|
|
476
|
+
}).pipe(T.Http({ method: "GET", uri: "/users.info", code: 200 })),
|
|
477
|
+
).annotate({ identifier: "UsersInfoRequest" });
|
|
478
|
+
case 1:
|
|
479
|
+
return S.suspend(() =>
|
|
480
|
+
S.Struct({
|
|
481
|
+
ok: S.Boolean,
|
|
482
|
+
user: S.optional(S.Unknown),
|
|
483
|
+
users: S.optional(__S(36, __c9, 0)),
|
|
484
|
+
}),
|
|
485
|
+
).annotate({ identifier: "UsersInfoResponse" });
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
function __c6(j: number): any {
|
|
489
|
+
switch (j) {
|
|
490
|
+
case 0:
|
|
491
|
+
return S.suspend(() =>
|
|
492
|
+
S.Struct({
|
|
493
|
+
include_labels: S.optional(S.Boolean.pipe(T.Query())),
|
|
494
|
+
user: S.optional(S.String.pipe(T.Query())),
|
|
495
|
+
}).pipe(T.Http({ method: "GET", uri: "/users.profile.get", code: 200 })),
|
|
496
|
+
).annotate({ identifier: "GetProfileRequest" });
|
|
497
|
+
case 1:
|
|
498
|
+
return S.suspend(() =>
|
|
499
|
+
S.Struct({
|
|
500
|
+
ok: S.Boolean,
|
|
501
|
+
profile: S.Unknown,
|
|
502
|
+
}),
|
|
503
|
+
).annotate({ identifier: "GetProfileResponse" });
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
function __c7(j: number): any {
|
|
507
|
+
switch (j) {
|
|
508
|
+
case 0:
|
|
509
|
+
return S.suspend(() =>
|
|
510
|
+
S.Struct({
|
|
511
|
+
cursor: S.optional(S.String.pipe(T.Query())),
|
|
512
|
+
include_locale: S.optional(S.Boolean.pipe(T.Query())),
|
|
513
|
+
limit: S.optional(S.Number.pipe(T.Query())),
|
|
514
|
+
team_id: S.optional(S.String.pipe(T.Query())),
|
|
515
|
+
}).pipe(T.Http({ method: "GET", uri: "/users.list", code: 200 })),
|
|
516
|
+
).annotate({ identifier: "ListUsersRequest" });
|
|
517
|
+
case 1:
|
|
518
|
+
return S.suspend(() =>
|
|
519
|
+
S.Struct({
|
|
520
|
+
ok: S.Boolean,
|
|
521
|
+
members: __S(36, __c9, 0),
|
|
522
|
+
cache_ts: S.Number,
|
|
523
|
+
response_metadata: S.optional(__S(32, __c8, 0)),
|
|
524
|
+
offset: S.optional(S.String),
|
|
525
|
+
}),
|
|
526
|
+
).annotate({ identifier: "ListUsersResponse" });
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
function __c8(j: number): any {
|
|
530
|
+
switch (j) {
|
|
531
|
+
case 0:
|
|
532
|
+
return S.suspend(() =>
|
|
533
|
+
S.Struct({
|
|
534
|
+
next_cursor: S.optional(S.String),
|
|
535
|
+
}),
|
|
536
|
+
).annotate({ identifier: "ListUsersResponseResponseMetadata" });
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
function __c9(j: number): any {
|
|
540
|
+
switch (j) {
|
|
541
|
+
case 0:
|
|
542
|
+
return S.Array(S.Unknown);
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
function __c10(j: number): any {
|
|
546
|
+
switch (j) {
|
|
547
|
+
case 0:
|
|
548
|
+
return S.suspend(() =>
|
|
549
|
+
S.Struct({
|
|
550
|
+
email: S.String.pipe(T.Query()),
|
|
551
|
+
}).pipe(T.Http({ method: "GET", uri: "/users.lookupByEmail", code: 200 })),
|
|
552
|
+
).annotate({ identifier: "LookupByEmailRequest" });
|
|
553
|
+
case 1:
|
|
554
|
+
return S.suspend(() =>
|
|
555
|
+
S.Struct({
|
|
556
|
+
ok: S.Boolean,
|
|
557
|
+
user: S.Unknown,
|
|
558
|
+
}),
|
|
559
|
+
).annotate({ identifier: "LookupByEmailResponse" });
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
function __c11(j: number): any {
|
|
563
|
+
switch (j) {
|
|
564
|
+
case 0:
|
|
565
|
+
return S.suspend(() =>
|
|
566
|
+
S.Struct({
|
|
567
|
+
email: S.String,
|
|
568
|
+
}).pipe(T.Http({ method: "POST", uri: "/users.discoverableContacts.lookup", code: 200 })),
|
|
569
|
+
).annotate({ identifier: "LookupDiscoverableContactRequest" });
|
|
570
|
+
case 1:
|
|
571
|
+
return S.suspend(() =>
|
|
572
|
+
S.Struct({
|
|
573
|
+
ok: S.Boolean,
|
|
574
|
+
is_discoverable: S.Boolean,
|
|
575
|
+
}),
|
|
576
|
+
).annotate({ identifier: "LookupDiscoverableContactResponse" });
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
function __c12(j: number): any {
|
|
580
|
+
switch (j) {
|
|
581
|
+
case 0:
|
|
582
|
+
return S.suspend(() =>
|
|
583
|
+
S.Struct({}).pipe(T.Http({ method: "POST", uri: "/users.setActive", code: 200 })),
|
|
584
|
+
).annotate({ identifier: "SetActiveRequest" });
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
function __c13(j: number): any {
|
|
588
|
+
switch (j) {
|
|
589
|
+
case 0:
|
|
590
|
+
return S.suspend(() =>
|
|
591
|
+
S.Struct({
|
|
592
|
+
crop_w: S.optional(S.String),
|
|
593
|
+
crop_x: S.optional(S.String),
|
|
594
|
+
crop_y: S.optional(S.String),
|
|
595
|
+
image: S.optional(S.Unknown),
|
|
596
|
+
}).pipe(
|
|
597
|
+
T.Http({
|
|
598
|
+
method: "POST",
|
|
599
|
+
uri: "/users.setPhoto",
|
|
600
|
+
code: 200,
|
|
601
|
+
contentType: "form-urlencoded",
|
|
602
|
+
}),
|
|
603
|
+
),
|
|
604
|
+
).annotate({ identifier: "SetPhotoRequest" });
|
|
605
|
+
case 1:
|
|
606
|
+
return S.Record(S.String, S.Unknown);
|
|
607
|
+
case 2:
|
|
608
|
+
return S.suspend(() =>
|
|
609
|
+
S.Struct({
|
|
610
|
+
ok: S.Boolean,
|
|
611
|
+
profile: __S(53, __c13, 1),
|
|
612
|
+
}),
|
|
613
|
+
).annotate({ identifier: "SetPhotoResponse" });
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
function __c14(j: number): any {
|
|
617
|
+
switch (j) {
|
|
618
|
+
case 0:
|
|
619
|
+
return S.suspend(() =>
|
|
620
|
+
S.Struct({
|
|
621
|
+
presence: S.String,
|
|
622
|
+
}).pipe(T.Http({ method: "POST", uri: "/users.setPresence", code: 200 })),
|
|
623
|
+
).annotate({ identifier: "SetPresenceRequest" });
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
function __c15(j: number): any {
|
|
627
|
+
switch (j) {
|
|
628
|
+
case 0:
|
|
629
|
+
return S.suspend(() =>
|
|
630
|
+
S.Struct({
|
|
631
|
+
name: S.optional(S.String),
|
|
632
|
+
profile: S.optional(S.String),
|
|
633
|
+
user: S.optional(S.String),
|
|
634
|
+
value: S.optional(S.String),
|
|
635
|
+
}).pipe(T.Http({ method: "POST", uri: "/users.profile.set", code: 200 })),
|
|
636
|
+
).annotate({ identifier: "SetProfileRequest" });
|
|
637
|
+
case 1:
|
|
638
|
+
return S.suspend(() =>
|
|
639
|
+
S.Struct({
|
|
640
|
+
ok: S.Boolean,
|
|
641
|
+
username: S.String,
|
|
642
|
+
profile: S.Unknown,
|
|
643
|
+
email_pending: S.optional(S.String),
|
|
644
|
+
}),
|
|
645
|
+
).annotate({ identifier: "SetProfileResponse" });
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
649
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
650
|
+
return (__s[i] ??= __L.at(f, j));
|
|
651
|
+
}
|