@distilled.cloud/slack 0.0.0 → 1.0.0-rc.11
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/LICENSE +201 -0
- package/lib/credentials.d.ts +27 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +53 -0
- package/lib/credentials.js.map +1 -0
- package/lib/errors.d.ts +83 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +59 -0
- package/lib/errors.js.map +1 -0
- package/lib/index.d.ts +17 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +17 -0
- package/lib/index.js.map +1 -0
- package/lib/pagination.d.ts +31 -0
- package/lib/pagination.d.ts.map +1 -0
- package/lib/pagination.js +31 -0
- package/lib/pagination.js.map +1 -0
- package/lib/protocol.d.ts +18 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +230 -0
- package/lib/protocol.js.map +1 -0
- package/lib/retry.d.ts +52 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +45 -0
- package/lib/retry.js.map +1 -0
- package/lib/services/admin.d.ts +2796 -0
- package/lib/services/admin.d.ts.map +1 -0
- package/lib/services/admin.js +3217 -0
- package/lib/services/admin.js.map +1 -0
- package/lib/services/api.d.ts +23 -0
- package/lib/services/api.d.ts.map +1 -0
- package/lib/services/api.js +26 -0
- package/lib/services/api.js.map +1 -0
- package/lib/services/apps.d.ts +568 -0
- package/lib/services/apps.d.ts.map +1 -0
- package/lib/services/apps.js +584 -0
- package/lib/services/apps.js.map +1 -0
- package/lib/services/assistant.d.ts +290 -0
- package/lib/services/assistant.d.ts.map +1 -0
- package/lib/services/assistant.js +232 -0
- package/lib/services/assistant.js.map +1 -0
- package/lib/services/auth.d.ts +90 -0
- package/lib/services/auth.d.ts.map +1 -0
- package/lib/services/auth.js +114 -0
- package/lib/services/auth.js.map +1 -0
- package/lib/services/blocks.d.ts +31 -0
- package/lib/services/blocks.d.ts.map +1 -0
- package/lib/services/blocks.js +31 -0
- package/lib/services/blocks.js.map +1 -0
- package/lib/services/bookmarks.d.ts +91 -0
- package/lib/services/bookmarks.d.ts.map +1 -0
- package/lib/services/bookmarks.js +98 -0
- package/lib/services/bookmarks.js.map +1 -0
- package/lib/services/bots.d.ts +60 -0
- package/lib/services/bots.d.ts.map +1 -0
- package/lib/services/bots.js +68 -0
- package/lib/services/bots.js.map +1 -0
- package/lib/services/calls.d.ts +124 -0
- package/lib/services/calls.d.ts.map +1 -0
- package/lib/services/calls.js +136 -0
- package/lib/services/calls.js.map +1 -0
- package/lib/services/canvases.d.ts +152 -0
- package/lib/services/canvases.d.ts.map +1 -0
- package/lib/services/canvases.js +152 -0
- package/lib/services/canvases.js.map +1 -0
- package/lib/services/chat.d.ts +525 -0
- package/lib/services/chat.d.ts.map +1 -0
- package/lib/services/chat.js +436 -0
- package/lib/services/chat.js.map +1 -0
- package/lib/services/conversations.d.ts +642 -0
- package/lib/services/conversations.d.ts.map +1 -0
- package/lib/services/conversations.js +769 -0
- package/lib/services/conversations.js.map +1 -0
- package/lib/services/dialog.d.ts +20 -0
- package/lib/services/dialog.d.ts.map +1 -0
- package/lib/services/dialog.js +27 -0
- package/lib/services/dialog.js.map +1 -0
- package/lib/services/dnd.d.ts +94 -0
- package/lib/services/dnd.d.ts.map +1 -0
- package/lib/services/dnd.js +111 -0
- package/lib/services/dnd.js.map +1 -0
- package/lib/services/emoji.d.ts +35 -0
- package/lib/services/emoji.d.ts.map +1 -0
- package/lib/services/emoji.js +40 -0
- package/lib/services/emoji.js.map +1 -0
- package/lib/services/entity.d.ts +93 -0
- package/lib/services/entity.d.ts.map +1 -0
- package/lib/services/entity.js +89 -0
- package/lib/services/entity.js.map +1 -0
- package/lib/services/files.d.ts +473 -0
- package/lib/services/files.d.ts.map +1 -0
- package/lib/services/files.js +510 -0
- package/lib/services/files.js.map +1 -0
- package/lib/services/functions.d.ts +235 -0
- package/lib/services/functions.d.ts.map +1 -0
- package/lib/services/functions.js +256 -0
- package/lib/services/functions.js.map +1 -0
- package/lib/services/index.d.ts +35 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +36 -0
- package/lib/services/index.js.map +1 -0
- package/lib/services/lists.d.ts +300 -0
- package/lib/services/lists.d.ts.map +1 -0
- package/lib/services/lists.js +366 -0
- package/lib/services/lists.js.map +1 -0
- package/lib/services/migration.d.ts +34 -0
- package/lib/services/migration.d.ts.map +1 -0
- package/lib/services/migration.js +36 -0
- package/lib/services/migration.js.map +1 -0
- package/lib/services/oauth.d.ts +307 -0
- package/lib/services/oauth.d.ts.map +1 -0
- package/lib/services/oauth.js +278 -0
- package/lib/services/oauth.js.map +1 -0
- package/lib/services/openid.d.ts +86 -0
- package/lib/services/openid.d.ts.map +1 -0
- package/lib/services/openid.js +93 -0
- package/lib/services/openid.js.map +1 -0
- package/lib/services/pins.d.ts +64 -0
- package/lib/services/pins.d.ts.map +1 -0
- package/lib/services/pins.js +75 -0
- package/lib/services/pins.js.map +1 -0
- package/lib/services/reactions.d.ts +108 -0
- package/lib/services/reactions.d.ts.map +1 -0
- package/lib/services/reactions.js +119 -0
- package/lib/services/reactions.js.map +1 -0
- package/lib/services/reminders.d.ts +89 -0
- package/lib/services/reminders.d.ts.map +1 -0
- package/lib/services/reminders.js +109 -0
- package/lib/services/reminders.js.map +1 -0
- package/lib/services/rtm.d.ts +68 -0
- package/lib/services/rtm.d.ts.map +1 -0
- package/lib/services/rtm.js +74 -0
- package/lib/services/rtm.js.map +1 -0
- package/lib/services/search.d.ts +239 -0
- package/lib/services/search.d.ts.map +1 -0
- package/lib/services/search.js +190 -0
- package/lib/services/search.js.map +1 -0
- package/lib/services/stars.d.ts +126 -0
- package/lib/services/stars.d.ts.map +1 -0
- package/lib/services/stars.js +145 -0
- package/lib/services/stars.js.map +1 -0
- package/lib/services/team.d.ts +309 -0
- package/lib/services/team.d.ts.map +1 -0
- package/lib/services/team.js +333 -0
- package/lib/services/team.js.map +1 -0
- package/lib/services/tooling.d.ts +31 -0
- package/lib/services/tooling.d.ts.map +1 -0
- package/lib/services/tooling.js +38 -0
- package/lib/services/tooling.js.map +1 -0
- package/lib/services/usergroups.d.ts +183 -0
- package/lib/services/usergroups.d.ts.map +1 -0
- package/lib/services/usergroups.js +180 -0
- package/lib/services/usergroups.js.map +1 -0
- package/lib/services/users.d.ts +246 -0
- package/lib/services/users.d.ts.map +1 -0
- package/lib/services/users.js +309 -0
- package/lib/services/users.js.map +1 -0
- package/lib/services/views.d.ts +84 -0
- package/lib/services/views.d.ts.map +1 -0
- package/lib/services/views.js +95 -0
- package/lib/services/views.js.map +1 -0
- package/lib/services/workflows.d.ts +231 -0
- package/lib/services/workflows.d.ts.map +1 -0
- package/lib/services/workflows.js +238 -0
- package/lib/services/workflows.js.map +1 -0
- package/lib/traits.d.ts +11 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +12 -0
- package/lib/traits.js.map +1 -0
- package/package.json +82 -4
- package/src/credentials.ts +86 -0
- package/src/errors.ts +101 -0
- package/src/index.ts +20 -0
- package/src/pagination.ts +35 -0
- package/src/protocol.ts +326 -0
- package/src/retry.ts +76 -0
- package/src/services/admin.ts +7722 -0
- package/src/services/api.ts +58 -0
- package/src/services/apps.ts +1441 -0
- package/src/services/assistant.ts +639 -0
- package/src/services/auth.ts +241 -0
- package/src/services/blocks.ts +80 -0
- package/src/services/bookmarks.ts +223 -0
- package/src/services/bots.ts +144 -0
- package/src/services/calls.ts +318 -0
- package/src/services/canvases.ts +392 -0
- package/src/services/chat.ts +1191 -0
- package/src/services/conversations.ts +1754 -0
- package/src/services/dialog.ts +55 -0
- package/src/services/dnd.ts +246 -0
- package/src/services/emoji.ts +91 -0
- package/src/services/entity.ts +225 -0
- package/src/services/files.ts +1192 -0
- package/src/services/functions.ts +642 -0
- package/src/services/index.ts +35 -0
- package/src/services/lists.ts +832 -0
- package/src/services/migration.ts +85 -0
- package/src/services/oauth.ts +658 -0
- package/src/services/openid.ts +243 -0
- package/src/services/pins.ts +167 -0
- package/src/services/reactions.ts +272 -0
- package/src/services/reminders.ts +240 -0
- package/src/services/rtm.ts +162 -0
- package/src/services/search.ts +507 -0
- package/src/services/stars.ts +323 -0
- package/src/services/team.ts +834 -0
- package/src/services/tooling.ts +78 -0
- package/src/services/usergroups.ts +441 -0
- package/src/services/users.ts +685 -0
- package/src/services/views.ts +212 -0
- package/src/services/workflows.ts +605 -0
- package/src/traits.ts +45 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// AUTO-GENERATED by scripts/generate.ts from .generated-specs (docs.slack.dev JSON twins). Do not edit.
|
|
2
|
+
import * as S from "@distilled.cloud/core/schema";
|
|
3
|
+
import * as API from "@distilled.cloud/core/api";
|
|
4
|
+
import * as T from "../traits.ts";
|
|
5
|
+
import {
|
|
6
|
+
SlackProtocol,
|
|
7
|
+
type SlackOpError,
|
|
8
|
+
type SlackOpContext,
|
|
9
|
+
} from "../protocol.ts";
|
|
10
|
+
import { SlackError, SlackRateLimited } from "../errors.ts";
|
|
11
|
+
import * as Retry from "../retry.ts";
|
|
12
|
+
|
|
13
|
+
export type { SlackOpError, SlackOpContext };
|
|
14
|
+
|
|
15
|
+
export type MigrationExchangeRequestUsersList = Array<string>;
|
|
16
|
+
export const MigrationExchangeRequestUsersList = /*@__PURE__*/ S.Array(
|
|
17
|
+
S.String,
|
|
18
|
+
) as any as S.Schema<MigrationExchangeRequestUsersList>;
|
|
19
|
+
|
|
20
|
+
export interface MigrationExchangeRequest {
|
|
21
|
+
/** A comma-separated list of user ids, up to 400 per request */
|
|
22
|
+
users: MigrationExchangeRequestUsersList;
|
|
23
|
+
/** Specify team_id starts with `T` in case of Org Token */
|
|
24
|
+
team_id?: string;
|
|
25
|
+
/** Specify `true` to convert `W` global user IDs to workspace-specific `U` IDs. Defaults to `false`. */
|
|
26
|
+
to_old?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export const MigrationExchangeRequest = /*@__PURE__*/ S.suspend(() =>
|
|
29
|
+
S.Struct({
|
|
30
|
+
users: MigrationExchangeRequestUsersList.pipe(T.Query()),
|
|
31
|
+
team_id: S.optional(S.String.pipe(T.Query())),
|
|
32
|
+
to_old: S.optional(S.Boolean.pipe(T.Query())),
|
|
33
|
+
}).pipe(T.Http({ method: "GET", uri: "/migration.exchange", code: 200 })),
|
|
34
|
+
).annotate({
|
|
35
|
+
identifier: "MigrationExchangeRequest",
|
|
36
|
+
}) as any as S.Schema<MigrationExchangeRequest>;
|
|
37
|
+
|
|
38
|
+
export type MigrationExchangeResponseUserIdMapMap = {
|
|
39
|
+
[key: string]: unknown | undefined;
|
|
40
|
+
};
|
|
41
|
+
export const MigrationExchangeResponseUserIdMapMap = /*@__PURE__*/ S.Record(
|
|
42
|
+
S.String,
|
|
43
|
+
S.Unknown,
|
|
44
|
+
) as any as S.Schema<MigrationExchangeResponseUserIdMapMap>;
|
|
45
|
+
|
|
46
|
+
export type MigrationExchangeResponseInvalidUserIdsList = Array<string>;
|
|
47
|
+
export const MigrationExchangeResponseInvalidUserIdsList =
|
|
48
|
+
/*@__PURE__*/ S.Array(
|
|
49
|
+
S.String,
|
|
50
|
+
) as any as S.Schema<MigrationExchangeResponseInvalidUserIdsList>;
|
|
51
|
+
|
|
52
|
+
export interface MigrationExchangeResponse {
|
|
53
|
+
/** Always `true` (a failed call raises a typed error instead). */
|
|
54
|
+
ok: boolean;
|
|
55
|
+
team_id: string;
|
|
56
|
+
enterprise_id: string;
|
|
57
|
+
user_id_map: MigrationExchangeResponseUserIdMapMap;
|
|
58
|
+
invalid_user_ids?: MigrationExchangeResponseInvalidUserIdsList;
|
|
59
|
+
}
|
|
60
|
+
export const MigrationExchangeResponse = /*@__PURE__*/ S.suspend(() =>
|
|
61
|
+
S.Struct({
|
|
62
|
+
ok: S.Boolean,
|
|
63
|
+
team_id: S.String,
|
|
64
|
+
enterprise_id: S.String,
|
|
65
|
+
user_id_map: MigrationExchangeResponseUserIdMapMap,
|
|
66
|
+
invalid_user_ids: S.optional(MigrationExchangeResponseInvalidUserIdsList),
|
|
67
|
+
}),
|
|
68
|
+
).annotate({
|
|
69
|
+
identifier: "MigrationExchangeResponse",
|
|
70
|
+
}) as any as S.Schema<MigrationExchangeResponse>;
|
|
71
|
+
|
|
72
|
+
export type MigrationExchangeError = SlackOpError;
|
|
73
|
+
/** For Enterprise organization workspaces, map local user IDs to global user IDs Required scopes — bot: `tokens.basic`; user: `tokens.basic` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `not_enterprise_team` — The workspace associated with the token is not part of an Enterprise organization. User IDs have not changed and there is nothing to map. - `too_many_users` — Too many user IDs provided in `users`. Up to 400 user IDs are allowed per request. See https://docs.slack.dev/reference/methods/migration.exchange */
|
|
74
|
+
export const migrationExchange: API.OperationMethod<
|
|
75
|
+
MigrationExchangeRequest,
|
|
76
|
+
MigrationExchangeResponse,
|
|
77
|
+
MigrationExchangeError,
|
|
78
|
+
SlackOpContext
|
|
79
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
80
|
+
input: MigrationExchangeRequest,
|
|
81
|
+
output: MigrationExchangeResponse,
|
|
82
|
+
errors: [SlackError, SlackRateLimited],
|
|
83
|
+
protocol: SlackProtocol,
|
|
84
|
+
retry: Retry.Retry,
|
|
85
|
+
}));
|