@distilled.cloud/slack 1.0.0-rc.15 → 1.0.0-rc.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/credentials.d.ts +1 -1
- package/lib/credentials.d.ts.map +1 -1
- package/lib/credentials.js +39 -34
- package/lib/credentials.js.map +1 -1
- package/lib/errors.d.ts +31 -31
- package/lib/errors.d.ts.map +1 -1
- package/lib/errors.js +41 -41
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +9 -9
- package/lib/pagination.d.ts +2 -2
- package/lib/pagination.js +28 -28
- package/lib/protocol.d.ts.map +1 -1
- package/lib/protocol.js +61 -59
- package/lib/protocol.js.map +1 -1
- package/lib/retry.d.ts +2 -2
- package/lib/retry.d.ts.map +1 -1
- package/lib/retry.js +34 -33
- package/lib/retry.js.map +1 -1
- package/lib/services/admin.d.ts +123 -575
- package/lib/services/admin.d.ts.map +1 -1
- package/lib/services/admin.js +304 -2878
- package/lib/services/agents.d.ts +13 -55
- package/lib/services/agents.d.ts.map +1 -1
- package/lib/services/agents.js +48 -309
- package/lib/services/api.d.ts +0 -4
- package/lib/services/api.d.ts.map +1 -1
- package/lib/services/api.js +16 -18
- package/lib/services/apps.d.ts +25 -106
- package/lib/services/apps.d.ts.map +1 -1
- package/lib/services/apps.js +84 -509
- package/lib/services/assistant.d.ts +6 -40
- package/lib/services/assistant.d.ts.map +1 -1
- package/lib/services/assistant.js +33 -204
- package/lib/services/auth.d.ts +4 -15
- package/lib/services/auth.d.ts.map +1 -1
- package/lib/services/auth.js +22 -90
- package/lib/services/blocks.d.ts +1 -7
- package/lib/services/blocks.d.ts.map +1 -1
- package/lib/services/blocks.js +16 -21
- package/lib/services/bookmarks.d.ts +4 -15
- package/lib/services/bookmarks.d.ts.map +1 -1
- package/lib/services/bookmarks.js +27 -76
- package/lib/services/bots.d.ts +1 -9
- package/lib/services/bots.d.ts.map +1 -1
- package/lib/services/bots.js +17 -54
- package/lib/services/calls.d.ts +6 -22
- package/lib/services/calls.d.ts.map +1 -1
- package/lib/services/calls.js +35 -110
- package/lib/services/canvases.d.ts +7 -35
- package/lib/services/canvases.d.ts.map +1 -1
- package/lib/services/canvases.js +39 -135
- package/lib/services/chat.d.ts +14 -83
- package/lib/services/chat.d.ts.map +1 -1
- package/lib/services/chat.js +59 -381
- package/lib/services/conversations.d.ts +31 -116
- package/lib/services/conversations.d.ts.map +1 -1
- package/lib/services/conversations.js +94 -690
- package/lib/services/dialog.d.ts +1 -4
- package/lib/services/dialog.d.ts.map +1 -1
- package/lib/services/dialog.js +13 -17
- package/lib/services/dnd.d.ts +5 -17
- package/lib/services/dnd.d.ts.map +1 -1
- package/lib/services/dnd.js +26 -91
- package/lib/services/emoji.d.ts +1 -8
- package/lib/services/emoji.d.ts.map +1 -1
- package/lib/services/emoji.js +18 -29
- package/lib/services/entity.d.ts +4 -16
- package/lib/services/entity.d.ts.map +1 -1
- package/lib/services/entity.js +29 -71
- package/lib/services/files.d.ts +16 -80
- package/lib/services/files.d.ts.map +1 -1
- package/lib/services/files.js +75 -433
- package/lib/services/functions.d.ts +8 -49
- package/lib/services/functions.d.ts.map +1 -1
- package/lib/services/functions.js +45 -203
- package/lib/services/lists.d.ts +13 -55
- package/lib/services/lists.d.ts.map +1 -1
- package/lib/services/lists.js +53 -248
- package/lib/services/migration.d.ts +1 -7
- package/lib/services/migration.d.ts.map +1 -1
- package/lib/services/migration.js +18 -27
- package/lib/services/oauth.d.ts +7 -43
- package/lib/services/oauth.d.ts.map +1 -1
- package/lib/services/oauth.js +34 -289
- package/lib/services/openid.d.ts +3 -10
- package/lib/services/openid.d.ts.map +1 -1
- package/lib/services/openid.js +19 -79
- package/lib/services/pins.d.ts +3 -13
- package/lib/services/pins.d.ts.map +1 -1
- package/lib/services/pins.js +27 -61
- package/lib/services/reactions.d.ts +5 -17
- package/lib/services/reactions.d.ts.map +1 -1
- package/lib/services/reactions.js +30 -96
- package/lib/services/reminders.d.ts +5 -17
- package/lib/services/reminders.d.ts.map +1 -1
- package/lib/services/reminders.js +33 -83
- package/lib/services/rtm.d.ts +2 -11
- package/lib/services/rtm.d.ts.map +1 -1
- package/lib/services/rtm.js +22 -56
- package/lib/services/search.d.ts +4 -35
- package/lib/services/search.d.ts.map +1 -1
- package/lib/services/search.js +28 -167
- package/lib/services/stars.d.ts +4 -26
- package/lib/services/stars.d.ts.map +1 -1
- package/lib/services/stars.js +28 -128
- package/lib/services/team.d.ts +11 -63
- package/lib/services/team.d.ts.map +1 -1
- package/lib/services/team.js +45 -289
- package/lib/services/tooling.d.ts +2 -5
- package/lib/services/tooling.d.ts.map +1 -1
- package/lib/services/tooling.js +15 -28
- package/lib/services/usergroups.d.ts +7 -31
- package/lib/services/usergroups.d.ts.map +1 -1
- package/lib/services/usergroups.js +40 -146
- package/lib/services/users.d.ts +14 -48
- package/lib/services/users.d.ts.map +1 -1
- package/lib/services/users.js +54 -249
- package/lib/services/views.d.ts +4 -14
- package/lib/services/views.d.ts.map +1 -1
- package/lib/services/views.js +28 -73
- package/lib/services/workflows.d.ts +8 -51
- package/lib/services/workflows.d.ts.map +1 -1
- package/lib/services/workflows.js +37 -188
- package/lib/traits.d.ts +1 -1
- package/lib/traits.js +8 -8
- package/package.json +14 -10
- package/src/credentials.ts +20 -21
- package/src/errors.ts +31 -27
- package/src/index.ts +1 -1
- package/src/pagination.ts +2 -2
- package/src/protocol.ts +30 -29
- package/src/retry.ts +6 -6
- package/src/services/admin.ts +2717 -3451
- package/src/services/agents.ts +380 -370
- package/src/services/api.ts +31 -21
- package/src/services/apps.ts +569 -621
- package/src/services/assistant.ts +235 -270
- package/src/services/auth.ts +118 -100
- package/src/services/blocks.ts +33 -29
- package/src/services/bookmarks.ts +101 -83
- package/src/services/bots.ts +74 -67
- package/src/services/calls.ts +118 -124
- package/src/services/canvases.ts +171 -178
- package/src/services/chat.ts +428 -496
- package/src/services/conversations.ts +675 -761
- package/src/services/dialog.ts +30 -17
- package/src/services/dnd.ts +125 -99
- package/src/services/emoji.ts +46 -42
- package/src/services/entity.ts +94 -92
- package/src/services/files.ts +536 -531
- package/src/services/functions.ts +209 -274
- package/src/services/lists.ts +289 -304
- package/src/services/migration.ts +39 -37
- package/src/services/oauth.ts +345 -361
- package/src/services/openid.ts +137 -122
- package/src/services/pins.ts +83 -70
- package/src/services/reactions.ts +119 -103
- package/src/services/reminders.ts +112 -90
- package/src/services/rtm.ts +73 -65
- package/src/services/search.ts +193 -244
- package/src/services/stars.ts +101 -160
- package/src/services/team.ts +333 -369
- package/src/services/tooling.ts +43 -30
- package/src/services/usergroups.ts +175 -179
- package/src/services/users.ts +301 -268
- package/src/services/views.ts +85 -80
- package/src/services/workflows.ts +184 -269
- package/src/traits.ts +1 -1
- package/lib/protocol.test.d.ts +0 -2
- package/lib/protocol.test.d.ts.map +0 -1
- package/lib/protocol.test.js +0 -288
- package/lib/protocol.test.js.map +0 -1
- package/lib/services/admin.js.map +0 -1
- package/lib/services/agents.js.map +0 -1
- package/lib/services/api.js.map +0 -1
- package/lib/services/apps.js.map +0 -1
- package/lib/services/assistant.js.map +0 -1
- package/lib/services/auth.js.map +0 -1
- package/lib/services/blocks.js.map +0 -1
- package/lib/services/bookmarks.js.map +0 -1
- package/lib/services/bots.js.map +0 -1
- package/lib/services/calls.js.map +0 -1
- package/lib/services/canvases.js.map +0 -1
- package/lib/services/chat.js.map +0 -1
- package/lib/services/conversations.js.map +0 -1
- package/lib/services/dialog.js.map +0 -1
- package/lib/services/dnd.js.map +0 -1
- package/lib/services/emoji.js.map +0 -1
- package/lib/services/entity.js.map +0 -1
- package/lib/services/files.js.map +0 -1
- package/lib/services/functions.js.map +0 -1
- package/lib/services/lists.js.map +0 -1
- package/lib/services/migration.js.map +0 -1
- package/lib/services/oauth.js.map +0 -1
- package/lib/services/openid.js.map +0 -1
- package/lib/services/pins.js.map +0 -1
- package/lib/services/reactions.js.map +0 -1
- package/lib/services/reminders.js.map +0 -1
- package/lib/services/rtm.js.map +0 -1
- package/lib/services/search.js.map +0 -1
- package/lib/services/stars.js.map +0 -1
- package/lib/services/team.js.map +0 -1
- package/lib/services/tooling.js.map +0 -1
- package/lib/services/usergroups.js.map +0 -1
- package/lib/services/users.js.map +0 -1
- package/lib/services/views.js.map +0 -1
- package/lib/services/workflows.js.map +0 -1
- package/src/protocol.test.ts +0 -372
package/src/services/views.ts
CHANGED
|
@@ -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
|
|
|
@@ -17,27 +20,11 @@ export interface PublishViewRequest {
|
|
|
17
20
|
hash?: string;
|
|
18
21
|
interactivity_pointer?: string;
|
|
19
22
|
}
|
|
20
|
-
export const PublishViewRequest = /*@__PURE__*/ S.suspend(() =>
|
|
21
|
-
S.Struct({
|
|
22
|
-
user_id: S.String,
|
|
23
|
-
view: S.Unknown,
|
|
24
|
-
hash: S.optional(S.String),
|
|
25
|
-
interactivity_pointer: S.optional(S.String),
|
|
26
|
-
}).pipe(T.Http({ method: "POST", uri: "/views.publish", code: 200 })),
|
|
27
|
-
).annotate({ identifier: "PublishViewRequest" }) as any as S.Schema<PublishViewRequest>;
|
|
28
|
-
|
|
29
23
|
export interface PublishViewResponse {
|
|
30
24
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
31
25
|
ok: boolean;
|
|
32
26
|
view: unknown;
|
|
33
27
|
}
|
|
34
|
-
export const PublishViewResponse = /*@__PURE__*/ S.suspend(() =>
|
|
35
|
-
S.Struct({
|
|
36
|
-
ok: S.Boolean,
|
|
37
|
-
view: S.Unknown,
|
|
38
|
-
}),
|
|
39
|
-
).annotate({ identifier: "PublishViewResponse" }) as any as S.Schema<PublishViewResponse>;
|
|
40
|
-
|
|
41
28
|
export interface UpdateViewRequest {
|
|
42
29
|
/** A unique identifier of the view to be updated. Either `view_id` or `external_id` is required. */
|
|
43
30
|
view_id?: string;
|
|
@@ -48,33 +35,12 @@ export interface UpdateViewRequest {
|
|
|
48
35
|
/** A string that represents view state to protect against possible race conditions. */
|
|
49
36
|
hash?: string;
|
|
50
37
|
}
|
|
51
|
-
export const UpdateViewRequest = /*@__PURE__*/ S.suspend(() =>
|
|
52
|
-
S.Struct({
|
|
53
|
-
view_id: S.optional(S.String),
|
|
54
|
-
external_id: S.optional(S.String),
|
|
55
|
-
view: S.Unknown,
|
|
56
|
-
hash: S.optional(S.String),
|
|
57
|
-
}).pipe(T.Http({ method: "POST", uri: "/views.update", code: 200 })),
|
|
58
|
-
).annotate({ identifier: "UpdateViewRequest" }) as any as S.Schema<UpdateViewRequest>;
|
|
59
|
-
|
|
60
38
|
export interface UpdateViewResponse {
|
|
61
39
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
62
40
|
ok: boolean;
|
|
63
41
|
view: unknown;
|
|
64
42
|
}
|
|
65
|
-
export const UpdateViewResponse = /*@__PURE__*/ S.suspend(() =>
|
|
66
|
-
S.Struct({
|
|
67
|
-
ok: S.Boolean,
|
|
68
|
-
view: S.Unknown,
|
|
69
|
-
}),
|
|
70
|
-
).annotate({ identifier: "UpdateViewResponse" }) as any as S.Schema<UpdateViewResponse>;
|
|
71
|
-
|
|
72
43
|
export type ViewsOpenRequestViewMap = { [key: string]: unknown | undefined };
|
|
73
|
-
export const ViewsOpenRequestViewMap = /*@__PURE__*/ S.Record(
|
|
74
|
-
S.String,
|
|
75
|
-
S.Unknown,
|
|
76
|
-
) as any as S.Schema<ViewsOpenRequestViewMap>;
|
|
77
|
-
|
|
78
44
|
export interface ViewsOpenRequest {
|
|
79
45
|
/** Exchange a trigger to post to the user. */
|
|
80
46
|
trigger_id?: string | null;
|
|
@@ -83,26 +49,11 @@ export interface ViewsOpenRequest {
|
|
|
83
49
|
/** A [view payload](/reference/views). This must be a JSON-encoded string. */
|
|
84
50
|
view: ViewsOpenRequestViewMap;
|
|
85
51
|
}
|
|
86
|
-
export const ViewsOpenRequest = /*@__PURE__*/ S.suspend(() =>
|
|
87
|
-
S.Struct({
|
|
88
|
-
trigger_id: S.optional(S.NullOr(S.String)),
|
|
89
|
-
interactivity_pointer: S.optional(S.NullOr(S.String)),
|
|
90
|
-
view: ViewsOpenRequestViewMap,
|
|
91
|
-
}).pipe(T.Http({ method: "POST", uri: "/views.open", code: 200 })),
|
|
92
|
-
).annotate({ identifier: "ViewsOpenRequest" }) as any as S.Schema<ViewsOpenRequest>;
|
|
93
|
-
|
|
94
52
|
export interface ViewsOpenResponse {
|
|
95
53
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
96
54
|
ok: boolean;
|
|
97
55
|
view: unknown;
|
|
98
56
|
}
|
|
99
|
-
export const ViewsOpenResponse = /*@__PURE__*/ S.suspend(() =>
|
|
100
|
-
S.Struct({
|
|
101
|
-
ok: S.Boolean,
|
|
102
|
-
view: S.Unknown,
|
|
103
|
-
}),
|
|
104
|
-
).annotate({ identifier: "ViewsOpenResponse" }) as any as S.Schema<ViewsOpenResponse>;
|
|
105
|
-
|
|
106
57
|
export interface ViewsPushRequest {
|
|
107
58
|
/** Exchange a trigger to post to the user. */
|
|
108
59
|
trigger_id?: string | null;
|
|
@@ -111,82 +62,136 @@ export interface ViewsPushRequest {
|
|
|
111
62
|
/** A [view payload](/reference/views). This must be a JSON-encoded string. */
|
|
112
63
|
view: unknown;
|
|
113
64
|
}
|
|
114
|
-
export const ViewsPushRequest = /*@__PURE__*/ S.suspend(() =>
|
|
115
|
-
S.Struct({
|
|
116
|
-
trigger_id: S.optional(S.NullOr(S.String)),
|
|
117
|
-
interactivity_pointer: S.optional(S.NullOr(S.String)),
|
|
118
|
-
view: S.Unknown,
|
|
119
|
-
}).pipe(T.Http({ method: "POST", uri: "/views.push", code: 200 })),
|
|
120
|
-
).annotate({ identifier: "ViewsPushRequest" }) as any as S.Schema<ViewsPushRequest>;
|
|
121
|
-
|
|
122
65
|
export interface ViewsPushResponse {
|
|
123
66
|
/** Always `true` (a failed call raises a typed error instead). */
|
|
124
67
|
ok: boolean;
|
|
125
68
|
view: unknown;
|
|
126
69
|
}
|
|
127
|
-
export const ViewsPushResponse = /*@__PURE__*/ S.suspend(() =>
|
|
128
|
-
S.Struct({
|
|
129
|
-
ok: S.Boolean,
|
|
130
|
-
view: S.Unknown,
|
|
131
|
-
}),
|
|
132
|
-
).annotate({ identifier: "ViewsPushResponse" }) as any as S.Schema<ViewsPushResponse>;
|
|
133
|
-
|
|
134
70
|
export type PublishViewError = SlackOpError;
|
|
135
|
-
/** Publish a static view for a User. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `duplicate_external_id`
|
|
71
|
+
/** Publish a static view for a User. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `duplicate_external_id` -- Error returned when the given `external_id` has already be used. - `hash_conflict` -- Error returned when the provided `hash` doesn't match the current stored value. - `missing_profile_id` -- A profile id was not provided when trying to publish a view of type profile. - `not_allowed_token_type` -- The type of token your app used when requesting this method is not allowed. - `not_enabled` -- Error returned if a `home` view is published but the Home tab isn't enabled for the app. - `not_implemented` -- The profile view experiment is not enabled for this user. - `view_too_large` -- Error returned if the provided view is greater than 250kb. See https://docs.slack.dev/reference/methods/views.publish */
|
|
136
72
|
export const publishView: API.OperationMethod<
|
|
137
73
|
PublishViewRequest,
|
|
138
74
|
PublishViewResponse,
|
|
139
75
|
PublishViewError,
|
|
140
76
|
SlackOpContext
|
|
141
77
|
> = /*@__PURE__*/ API.make(() => ({
|
|
142
|
-
input: PublishViewRequest
|
|
143
|
-
output: PublishViewResponse
|
|
78
|
+
input: __S(0, __c0, 0) as any as S.Schema<PublishViewRequest>,
|
|
79
|
+
output: __S(2, __c1, 0) as any as S.Schema<PublishViewResponse>,
|
|
144
80
|
errors: [SlackError, SlackRateLimited],
|
|
145
81
|
protocol: SlackProtocol,
|
|
146
82
|
retry: Retry.Retry,
|
|
147
83
|
}));
|
|
148
84
|
|
|
149
85
|
export type UpdateViewError = SlackOpError;
|
|
150
|
-
/** Update an existing view. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `duplicate_external_id`
|
|
86
|
+
/** Update an existing view. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `duplicate_external_id` -- Error returned when the given `external_id` has already be used. - `hash_conflict` -- Error returned when the provided `hash` doesn't match the current stored value. - `not_found` -- Error returned when the given `view_id` or `external_id` doesn't exist. - `view_too_large` -- Error returned if the provided view is greater than 250kb. See https://docs.slack.dev/reference/methods/views.update */
|
|
151
87
|
export const updateView: API.OperationMethod<
|
|
152
88
|
UpdateViewRequest,
|
|
153
89
|
UpdateViewResponse,
|
|
154
90
|
UpdateViewError,
|
|
155
91
|
SlackOpContext
|
|
156
92
|
> = /*@__PURE__*/ API.make(() => ({
|
|
157
|
-
input: UpdateViewRequest
|
|
158
|
-
output: UpdateViewResponse
|
|
93
|
+
input: __S(4, __c2, 0) as any as S.Schema<UpdateViewRequest>,
|
|
94
|
+
output: __S(2, __c1, 0) as any as S.Schema<UpdateViewResponse>,
|
|
159
95
|
errors: [SlackError, SlackRateLimited],
|
|
160
96
|
protocol: SlackProtocol,
|
|
161
97
|
retry: Retry.Retry,
|
|
162
98
|
}));
|
|
163
99
|
|
|
164
100
|
export type ViewsOpenError = SlackOpError;
|
|
165
|
-
/** Open a view for a user. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `duplicate_external_id`
|
|
101
|
+
/** Open a view for a user. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `duplicate_external_id` -- Error returned when the given `external_id` has already be used. - `exchanged_trigger_id` -- The trigger_id was already exchanged in a previous call. - `expired_trigger_id` -- The trigger_id is expired. - `invalid_trigger_id` -- The trigger_id is invalid. The expected format for the trigger_id argument is "132456.7890123.abcdef". - `view_too_large` -- Error returned if the provided view is greater than 250kb. See https://docs.slack.dev/reference/methods/views.open */
|
|
166
102
|
export const viewsOpen: API.OperationMethod<
|
|
167
103
|
ViewsOpenRequest,
|
|
168
104
|
ViewsOpenResponse,
|
|
169
105
|
ViewsOpenError,
|
|
170
106
|
SlackOpContext
|
|
171
107
|
> = /*@__PURE__*/ API.make(() => ({
|
|
172
|
-
input: ViewsOpenRequest
|
|
173
|
-
output: ViewsOpenResponse
|
|
108
|
+
input: __S(7, __c3, 1) as any as S.Schema<ViewsOpenRequest>,
|
|
109
|
+
output: __S(2, __c1, 0) as any as S.Schema<ViewsOpenResponse>,
|
|
174
110
|
errors: [SlackError, SlackRateLimited],
|
|
175
111
|
protocol: SlackProtocol,
|
|
176
112
|
retry: Retry.Retry,
|
|
177
113
|
}));
|
|
178
114
|
|
|
179
115
|
export type ViewsPushError = SlackOpError;
|
|
180
|
-
/** Push a view onto the stack of a root view. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `duplicate_external_id`
|
|
116
|
+
/** Push a view onto the stack of a root view. Rate limit tier: 4 Method-specific errors (the `error` slug on the SlackError): - `duplicate_external_id` -- Error returned when the given `external_id` has already be used. - `exchanged_trigger_id` -- The trigger_id was already exchanged in a previous call. - `expired_trigger_id` -- The trigger_id is expired. - `invalid_trigger_id` -- The trigger_id is invalid. The expected format for the trigger_id argument is "132456.7890123.abcdef". - `not_found` -- Error returned when the requested view can't be found. - `push_limit_reached` -- Error returned when the max push limit has been reached for views. Currently the limit is 3. - `view_too_large` -- Error returned if the provided view is greater than 250kb. See https://docs.slack.dev/reference/methods/views.push */
|
|
181
117
|
export const viewsPush: API.OperationMethod<
|
|
182
118
|
ViewsPushRequest,
|
|
183
119
|
ViewsPushResponse,
|
|
184
120
|
ViewsPushError,
|
|
185
121
|
SlackOpContext
|
|
186
122
|
> = /*@__PURE__*/ API.make(() => ({
|
|
187
|
-
input: ViewsPushRequest
|
|
188
|
-
output: ViewsPushResponse
|
|
123
|
+
input: __S(8, __c4, 0) as any as S.Schema<ViewsPushRequest>,
|
|
124
|
+
output: __S(2, __c1, 0) as any as S.Schema<ViewsPushResponse>,
|
|
189
125
|
errors: [SlackError, SlackRateLimited],
|
|
190
126
|
protocol: SlackProtocol,
|
|
191
127
|
retry: Retry.Retry,
|
|
192
128
|
}));
|
|
129
|
+
|
|
130
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
131
|
+
function __c0(j: number): any {
|
|
132
|
+
switch (j) {
|
|
133
|
+
case 0:
|
|
134
|
+
return S.suspend(() =>
|
|
135
|
+
S.Struct({
|
|
136
|
+
user_id: S.String,
|
|
137
|
+
view: S.Unknown,
|
|
138
|
+
hash: S.optional(S.String),
|
|
139
|
+
interactivity_pointer: S.optional(S.String),
|
|
140
|
+
}).pipe(T.Http({ method: "POST", uri: "/views.publish", code: 200 })),
|
|
141
|
+
).annotate({ identifier: "PublishViewRequest" });
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function __c1(j: number): any {
|
|
145
|
+
switch (j) {
|
|
146
|
+
case 0:
|
|
147
|
+
return S.suspend(() =>
|
|
148
|
+
S.Struct({
|
|
149
|
+
ok: S.Boolean,
|
|
150
|
+
view: S.Unknown,
|
|
151
|
+
}),
|
|
152
|
+
).annotate({ identifier: "PublishViewResponse" });
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
function __c2(j: number): any {
|
|
156
|
+
switch (j) {
|
|
157
|
+
case 0:
|
|
158
|
+
return S.suspend(() =>
|
|
159
|
+
S.Struct({
|
|
160
|
+
view_id: S.optional(S.String),
|
|
161
|
+
external_id: S.optional(S.String),
|
|
162
|
+
view: S.Unknown,
|
|
163
|
+
hash: S.optional(S.String),
|
|
164
|
+
}).pipe(T.Http({ method: "POST", uri: "/views.update", code: 200 })),
|
|
165
|
+
).annotate({ identifier: "UpdateViewRequest" });
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
function __c3(j: number): any {
|
|
169
|
+
switch (j) {
|
|
170
|
+
case 0:
|
|
171
|
+
return S.Record(S.String, S.Unknown);
|
|
172
|
+
case 1:
|
|
173
|
+
return S.suspend(() =>
|
|
174
|
+
S.Struct({
|
|
175
|
+
trigger_id: S.optional(S.NullOr(S.String)),
|
|
176
|
+
interactivity_pointer: S.optional(S.NullOr(S.String)),
|
|
177
|
+
view: __S(6, __c3, 0),
|
|
178
|
+
}).pipe(T.Http({ method: "POST", uri: "/views.open", code: 200 })),
|
|
179
|
+
).annotate({ identifier: "ViewsOpenRequest" });
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function __c4(j: number): any {
|
|
183
|
+
switch (j) {
|
|
184
|
+
case 0:
|
|
185
|
+
return S.suspend(() =>
|
|
186
|
+
S.Struct({
|
|
187
|
+
trigger_id: S.optional(S.NullOr(S.String)),
|
|
188
|
+
interactivity_pointer: S.optional(S.NullOr(S.String)),
|
|
189
|
+
view: S.Unknown,
|
|
190
|
+
}).pipe(T.Http({ method: "POST", uri: "/views.push", code: 200 })),
|
|
191
|
+
).annotate({ identifier: "ViewsPushRequest" });
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
195
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
196
|
+
return (__s[i] ??= __L.at(f, j));
|
|
197
|
+
}
|