@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
|
@@ -1,194 +1,43 @@
|
|
|
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.js";
|
|
5
6
|
import { SlackProtocol } from "../protocol.js";
|
|
6
7
|
import * as Retry from "../retry.js";
|
|
7
8
|
import * as T from "../traits.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export const
|
|
18
|
-
|
|
19
|
-
export const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export const
|
|
30
|
-
|
|
31
|
-
})).
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
});
|
|
44
|
-
export const ListFeaturedResponseFeaturedWorkflowsItemTriggersList = /*@__PURE__*/ S.Array(ListFeaturedResponseFeaturedWorkflowsItemTriggersItem);
|
|
45
|
-
export const ListFeaturedResponseFeaturedWorkflowsItem = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
46
|
-
channel_id: S.String,
|
|
47
|
-
triggers: ListFeaturedResponseFeaturedWorkflowsItemTriggersList,
|
|
48
|
-
})).annotate({
|
|
49
|
-
identifier: "ListFeaturedResponseFeaturedWorkflowsItem",
|
|
50
|
-
});
|
|
51
|
-
export const ListFeaturedResponseFeaturedWorkflowsList = /*@__PURE__*/ S.Array(ListFeaturedResponseFeaturedWorkflowsItem);
|
|
52
|
-
export const ListFeaturedResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
53
|
-
ok: S.Boolean,
|
|
54
|
-
featured_workflows: ListFeaturedResponseFeaturedWorkflowsList,
|
|
55
|
-
})).annotate({ identifier: "ListFeaturedResponse" });
|
|
56
|
-
export const ListTriggersPermissionsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
57
|
-
trigger_id: S.String,
|
|
58
|
-
}).pipe(T.Http({ method: "POST", uri: "/workflows.triggers.permissions.list", code: 200 }))).annotate({
|
|
59
|
-
identifier: "ListTriggersPermissionsRequest",
|
|
60
|
-
});
|
|
61
|
-
export const ListTriggersPermissionsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
62
|
-
ok: S.Boolean,
|
|
63
|
-
})).annotate({
|
|
64
|
-
identifier: "ListTriggersPermissionsResponse",
|
|
65
|
-
});
|
|
66
|
-
export const RemoveFeaturedRequestTriggerIdsList = /*@__PURE__*/ S.Array(S.String);
|
|
67
|
-
export const RemoveFeaturedRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
68
|
-
channel_id: S.String,
|
|
69
|
-
trigger_ids: RemoveFeaturedRequestTriggerIdsList,
|
|
70
|
-
}).pipe(T.Http({ method: "POST", uri: "/workflows.featured.remove", code: 200 }))).annotate({ identifier: "RemoveFeaturedRequest" });
|
|
71
|
-
export const RemoveFeaturedResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
72
|
-
ok: S.Boolean,
|
|
73
|
-
})).annotate({ identifier: "RemoveFeaturedResponse" });
|
|
74
|
-
export const RemoveTriggersPermissionsRequestUserIdsList = /*@__PURE__*/ S.Array(S.String);
|
|
75
|
-
export const RemoveTriggersPermissionsRequestChannelIdsList = /*@__PURE__*/ S.Array(S.String);
|
|
76
|
-
export const RemoveTriggersPermissionsRequestTeamIdsList = /*@__PURE__*/ S.Array(S.String);
|
|
77
|
-
export const RemoveTriggersPermissionsRequestOrgIdsList = /*@__PURE__*/ S.Array(S.String);
|
|
78
|
-
export const RemoveTriggersPermissionsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
79
|
-
trigger_id: S.String,
|
|
80
|
-
user_ids: S.optional(RemoveTriggersPermissionsRequestUserIdsList),
|
|
81
|
-
channel_ids: S.optional(RemoveTriggersPermissionsRequestChannelIdsList),
|
|
82
|
-
team_ids: S.optional(RemoveTriggersPermissionsRequestTeamIdsList),
|
|
83
|
-
org_ids: S.optional(RemoveTriggersPermissionsRequestOrgIdsList),
|
|
84
|
-
}).pipe(T.Http({ method: "POST", uri: "/workflows.triggers.permissions.remove", code: 200 }))).annotate({
|
|
85
|
-
identifier: "RemoveTriggersPermissionsRequest",
|
|
86
|
-
});
|
|
87
|
-
export const RemoveTriggersPermissionsResponsePermissionType = S.String;
|
|
88
|
-
export const RemoveTriggersPermissionsResponseUserIdsList = /*@__PURE__*/ S.Array(S.String);
|
|
89
|
-
export const RemoveTriggersPermissionsResponseChannelIdsList = /*@__PURE__*/ S.Array(S.String);
|
|
90
|
-
export const RemoveTriggersPermissionsResponseTeamIdsList = /*@__PURE__*/ S.Array(S.String);
|
|
91
|
-
export const RemoveTriggersPermissionsResponseOrgIdsList = /*@__PURE__*/ S.Array(S.String);
|
|
92
|
-
export const RemoveTriggersPermissionsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
93
|
-
ok: S.Boolean,
|
|
94
|
-
permission_type: RemoveTriggersPermissionsResponsePermissionType,
|
|
95
|
-
user_ids: S.optional(RemoveTriggersPermissionsResponseUserIdsList),
|
|
96
|
-
channel_ids: S.optional(RemoveTriggersPermissionsResponseChannelIdsList),
|
|
97
|
-
team_ids: S.optional(RemoveTriggersPermissionsResponseTeamIdsList),
|
|
98
|
-
org_ids: S.optional(RemoveTriggersPermissionsResponseOrgIdsList),
|
|
99
|
-
})).annotate({
|
|
100
|
-
identifier: "RemoveTriggersPermissionsResponse",
|
|
101
|
-
});
|
|
102
|
-
export const SetFeaturedRequestTriggerIdsList = /*@__PURE__*/ S.Array(S.String);
|
|
103
|
-
export const SetFeaturedRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
104
|
-
channel_id: S.String,
|
|
105
|
-
trigger_ids: SetFeaturedRequestTriggerIdsList,
|
|
106
|
-
}).pipe(T.Http({ method: "POST", uri: "/workflows.featured.set", code: 200 }))).annotate({ identifier: "SetFeaturedRequest" });
|
|
107
|
-
export const SetFeaturedResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
108
|
-
ok: S.Boolean,
|
|
109
|
-
})).annotate({ identifier: "SetFeaturedResponse" });
|
|
110
|
-
export const SetTriggersPermissionsRequestPermissionType = S.String;
|
|
111
|
-
export const SetTriggersPermissionsRequestUserIdsList = /*@__PURE__*/ S.Array(S.String);
|
|
112
|
-
export const SetTriggersPermissionsRequestChannelIdsList = /*@__PURE__*/ S.Array(S.String);
|
|
113
|
-
export const SetTriggersPermissionsRequestTeamIdsList = /*@__PURE__*/ S.Array(S.String);
|
|
114
|
-
export const SetTriggersPermissionsRequestOrgIdsList = /*@__PURE__*/ S.Array(S.String);
|
|
115
|
-
export const SetTriggersPermissionsRequest = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
116
|
-
trigger_id: S.String,
|
|
117
|
-
permission_type: SetTriggersPermissionsRequestPermissionType,
|
|
118
|
-
user_ids: S.optional(SetTriggersPermissionsRequestUserIdsList),
|
|
119
|
-
channel_ids: S.optional(SetTriggersPermissionsRequestChannelIdsList),
|
|
120
|
-
team_ids: S.optional(SetTriggersPermissionsRequestTeamIdsList),
|
|
121
|
-
org_ids: S.optional(SetTriggersPermissionsRequestOrgIdsList),
|
|
122
|
-
}).pipe(T.Http({ method: "POST", uri: "/workflows.triggers.permissions.set", code: 200 }))).annotate({
|
|
123
|
-
identifier: "SetTriggersPermissionsRequest",
|
|
124
|
-
});
|
|
125
|
-
export const SetTriggersPermissionsResponse = /*@__PURE__*/ S.suspend(() => S.Struct({
|
|
126
|
-
ok: S.Boolean,
|
|
127
|
-
})).annotate({
|
|
128
|
-
identifier: "SetTriggersPermissionsResponse",
|
|
129
|
-
});
|
|
130
|
-
/** Add featured workflows to a channel. Required scopes — bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `method_not_supported` — Method not yet supported - `restricted_action` — User does not have access to this method. - `error_modifying_workflows` — Error modifying workflows See https://docs.slack.dev/reference/methods/workflows.featured.add */
|
|
131
|
-
export const addFeatured = /*@__PURE__*/ API.make(() => ({
|
|
132
|
-
input: AddFeaturedRequest,
|
|
133
|
-
output: AddFeaturedResponse,
|
|
134
|
-
errors: [SlackError, SlackRateLimited],
|
|
135
|
-
protocol: SlackProtocol,
|
|
136
|
-
retry: Retry.Retry,
|
|
137
|
-
}));
|
|
138
|
-
/** Allows users to run a trigger that has its permission type set to named_entities Required scopes — bot: `triggers:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `access_denied` — This actor does not have access to the permissions on this resource. - `channel_not_found` — One or more of the listed channels could not be found. - `connected_org_denied` — The workspace admin does not allow connected organizations to be named_entities. - `connected_team_denied` — The workspace admin does not allow connected teams to be named_entities. - `connected_user_denied` — The workspace admin does not allow connected users to be named_entities. - `invalid_permission_type` — This trigger requires permission_type to be set as named_entities before adding users. - `no_valid_named_entities` — None of the provided named entities were valid - `org_not_connected` — One of more of the listed organizations were not connected. - `org_not_found` — One or more of the listed organizations could not be found. - `shared_channel_denied` — The workspace admin does not allow shared channels to be named_entities. - `team_not_connected` — One of more of the listed teams were not connected by org. - `team_not_found` — One or more of the listed teams could not be found. - `too_many_named_entities` — Too many named entities passed into the trigger permissions setting. - `trigger_not_found` — This trigger does not exist. - `unknown_method` — This method does not exist. - `user_not_found` — One or more of the listed users could not be found. See https://docs.slack.dev/reference/methods/workflows.triggers.permissions.add */
|
|
139
|
-
export const addTriggersPermissions = /*@__PURE__*/ API.make(() => ({
|
|
140
|
-
input: AddTriggersPermissionsRequest,
|
|
141
|
-
output: AddTriggersPermissionsResponse,
|
|
142
|
-
errors: [SlackError, SlackRateLimited],
|
|
143
|
-
protocol: SlackProtocol,
|
|
144
|
-
retry: Retry.Retry,
|
|
145
|
-
}));
|
|
146
|
-
/** List the featured workflows for specified channels. Required scopes — bot: `bookmarks:read`; user: `bookmarks:read` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `method_not_supported` — Method not yet supported - `restricted_action` — User does not have access to this method. - `channel_not_found` — Channel not found. - `error_invalid_channels` — Invalid channels provided. See https://docs.slack.dev/reference/methods/workflows.featured.list */
|
|
147
|
-
export const listFeatured = /*@__PURE__*/ API.make(() => ({
|
|
148
|
-
input: ListFeaturedRequest,
|
|
149
|
-
output: ListFeaturedResponse,
|
|
150
|
-
errors: [SlackError, SlackRateLimited],
|
|
151
|
-
protocol: SlackProtocol,
|
|
152
|
-
retry: Retry.Retry,
|
|
153
|
-
}));
|
|
154
|
-
/** Returns the permission type of a trigger and if applicable, includes the entities that have been granted access Required scopes — bot: `triggers:read` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `unknown_method` — This method does not exist. - `access_denied` — This actor does not have access to the permissions on this resource. - `trigger_not_found` — This trigger does not exist. See https://docs.slack.dev/reference/methods/workflows.triggers.permissions.list */
|
|
155
|
-
export const listTriggersPermissions = /*@__PURE__*/ API.make(() => ({
|
|
156
|
-
input: ListTriggersPermissionsRequest,
|
|
157
|
-
output: ListTriggersPermissionsResponse,
|
|
158
|
-
errors: [SlackError, SlackRateLimited],
|
|
159
|
-
protocol: SlackProtocol,
|
|
160
|
-
retry: Retry.Retry,
|
|
161
|
-
}));
|
|
162
|
-
/** Remove featured workflows from a channel. Required scopes — bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `method_not_supported` — Method not yet supported - `restricted_action` — User does not have access to this method. - `error_modifying_workflows` — Error modifying workflows See https://docs.slack.dev/reference/methods/workflows.featured.remove */
|
|
163
|
-
export const removeFeatured = /*@__PURE__*/ API.make(() => ({
|
|
164
|
-
input: RemoveFeaturedRequest,
|
|
165
|
-
output: RemoveFeaturedResponse,
|
|
166
|
-
errors: [SlackError, SlackRateLimited],
|
|
167
|
-
protocol: SlackProtocol,
|
|
168
|
-
retry: Retry.Retry,
|
|
169
|
-
}));
|
|
170
|
-
/** Revoke an entity's access to a trigger that has its permission type set to named_entities Required scopes — bot: `triggers:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `access_denied` — This actor does not have access to the permissions on this resource. - `connected_org_denied` — The workspace admin does not allow connected organizations to be named_entities. - `connected_team_denied` — The workspace admin does not allow connected teams to be named_entities. - `connected_user_denied` — The workspace admin does not allow connected users to be named_entities. - `named_entities_cannot_be_empty` — There must be at least one valid named entity - `org_not_connected` — One of more of the listed organizations were not connected. - `org_not_found` — One or more of the listed organizations could not be found. - `shared_channel_denied` — The workspace admin does not allow shared channels to be named_entities. - `trigger_not_found` — This trigger does not exist. - `invalid_permission_type` — This trigger requires permission_type to be set as named_entities before adding users. - `too_many_named_entities` — Too many named entities passed into the trigger permissions setting. - `unknown_method` — This method does not exist. See https://docs.slack.dev/reference/methods/workflows.triggers.permissions.remove */
|
|
171
|
-
export const removeTriggersPermissions = /*@__PURE__*/ API.make(() => ({
|
|
172
|
-
input: RemoveTriggersPermissionsRequest,
|
|
173
|
-
output: RemoveTriggersPermissionsResponse,
|
|
174
|
-
errors: [SlackError, SlackRateLimited],
|
|
175
|
-
protocol: SlackProtocol,
|
|
176
|
-
retry: Retry.Retry,
|
|
177
|
-
}));
|
|
178
|
-
/** Set featured workflows for a channel. Required scopes — bot: `bookmarks:write`; user: `bookmarks:write` Rate limit tier: 2 Method-specific errors (the `error` slug on the SlackError): - `method_not_supported` — Method not yet supported - `restricted_action` — User does not have access to this method. - `error_modifying_workflows` — Error modifying workflows See https://docs.slack.dev/reference/methods/workflows.featured.set */
|
|
179
|
-
export const setFeatured = /*@__PURE__*/ API.make(() => ({
|
|
180
|
-
input: SetFeaturedRequest,
|
|
181
|
-
output: SetFeaturedResponse,
|
|
182
|
-
errors: [SlackError, SlackRateLimited],
|
|
183
|
-
protocol: SlackProtocol,
|
|
184
|
-
retry: Retry.Retry,
|
|
185
|
-
}));
|
|
186
|
-
/** Set the permission type for who can run a trigger Required scopes — bot: `triggers:write` Rate limit tier: 3 Method-specific errors (the `error` slug on the SlackError): - `access_denied` — This actor does not have access to the permissions on this resource. - `channel_not_found` — One or more of the listed channels could not be found. - `connected_org_denied` — The workspace admin does not allow connected organizations to be named_entities. - `connected_team_denied` — The workspace admin does not allow connected teams to be named_entities. - `connected_user_denied` — The workspace admin does not allow connected users to be named_entities. - `external_workspace_denied` — The channel selected is not on the workflow team. - `invalid_permission_type` — This function requires permission_type to be set as named_entities before adding users. - `named_entities_cannot_be_empty` — Must pass at least one valid named entity. - `no_valid_named_entities` — None of the provided named entities were valid - `org_not_found` — One or more of the listed organizations could not be found. - `org_not_connected` — One of more of the listed organizations were not connected. - `shared_channel_denied` — The workspace admin does not allow shared channels to be named_entities. - `team_not_connected` — One of more of the listed teams were not connected by org. - `team_not_found` — One or more of the listed teams could not be found. - `too_many_named_entities` — Too many named_entities passed into the trigger permissions setting. - `trigger_not_found` — This trigger does not exist. - `unknown_method` — This method does not exist. - `user_not_found` — One or more of the listed users could not be found. See https://docs.slack.dev/reference/methods/workflows.triggers.permissions.set */
|
|
187
|
-
export const setTriggersPermissions = /*@__PURE__*/ API.make(() => ({
|
|
188
|
-
input: SetTriggersPermissionsRequest,
|
|
189
|
-
output: SetTriggersPermissionsResponse,
|
|
190
|
-
errors: [SlackError, SlackRateLimited],
|
|
191
|
-
protocol: SlackProtocol,
|
|
192
|
-
retry: Retry.Retry,
|
|
193
|
-
}));
|
|
194
|
-
//# sourceMappingURL=workflows.js.map
|
|
9
|
+
const __0 = __L.at;
|
|
10
|
+
const __1 = T.Http;
|
|
11
|
+
const __2 = S.String;
|
|
12
|
+
const __3 = S.Struct;
|
|
13
|
+
const __4 = S.suspend;
|
|
14
|
+
const __5 = S.Array;
|
|
15
|
+
const __6 = S.Boolean;
|
|
16
|
+
const __7 = S.optional;
|
|
17
|
+
|
|
18
|
+
export const addFeatured = /*@__PURE__*/ API.op((i) => i === API.D ? ['{input:#1,output:#6:0,errors:[$7,$8],protocol:$9,retry:$10};$5(>2)@"AddFeaturedRequest";$4({channel_id:$2,trigger_ids:#3:0}).pipe($1({method:"POST",uri:"/workflows.featured.add",code:200}))', [__0, __1, __2, __d0, __3, __4, __d1, SlackError, SlackRateLimited, SlackProtocol, Retry.Retry]] : API.call(addFeatured, i));
|
|
19
|
+
|
|
20
|
+
export const addTriggersPermissions = /*@__PURE__*/ API.op((i) => i === API.D ? ['{input:#1,output:#7:0,errors:[$8,$9],protocol:$10,retry:$11};$6(>2)@"AddTriggersPermissionsRequest";$5({trigger_id:$2,user_ids:$4(#3:0),channel_ids:$4(#3:0),team_ids:$4(#3:0),org_ids:$4(#3:0)}).pipe($1({method:"POST",uri:"/workflows.triggers.permissions.add",code:200}))', [__0, __1, __2, __d0, __7, __3, __4, __d1, SlackError, SlackRateLimited, SlackProtocol, Retry.Retry]] : API.call(addTriggersPermissions, i));
|
|
21
|
+
|
|
22
|
+
export const listFeatured = /*@__PURE__*/ API.op((i) => i === API.D ? API.named("ListFeaturedResponseFeaturedWorkflowsItem", '{input:#1,output:#6,errors:[$8,$9],protocol:$10,retry:$11};$4(>7)@"ListFeaturedRequest";$4(>8)@"%TriggersItem";$6(#2);$4(>9)@"%";$6(#4);$4(>10)@"ListFeaturedResponse";$3({channel_ids:#2:0}).pipe($1({method:"POST",uri:"/workflows.featured.list",code:200}));$3({id:$5,title:$5});$3({channel_id:$5,triggers:#3});$3({ok:$7,featured_workflows:#5})', [__0, __1, __d0, __3, __4, __2, __5, __6, SlackError, SlackRateLimited, SlackProtocol, Retry.Retry]) : API.call(listFeatured, i));
|
|
23
|
+
|
|
24
|
+
export const listTriggersPermissions = /*@__PURE__*/ API.op((i) => i === API.D ? ['{input:#1,output:#5:0,errors:[$6,$7],protocol:$8,retry:$9};$4(>2)@"ListTriggersPermissionsRequest";$3({trigger_id:$2}).pipe($1({method:"POST",uri:"/workflows.triggers.permissions.list",code:200}))', [__0, __1, __2, __3, __4, __d1, SlackError, SlackRateLimited, SlackProtocol, Retry.Retry]] : API.call(listTriggersPermissions, i));
|
|
25
|
+
|
|
26
|
+
export const removeFeatured = /*@__PURE__*/ API.op((i) => i === API.D ? ['{input:#1,output:#6:0,errors:[$7,$8],protocol:$9,retry:$10};$5(>2)@"RemoveFeaturedRequest";$4({channel_id:$2,trigger_ids:#3:0}).pipe($1({method:"POST",uri:"/workflows.featured.remove",code:200}))', [__0, __1, __2, __d0, __3, __4, __d1, SlackError, SlackRateLimited, SlackProtocol, Retry.Retry]] : API.call(removeFeatured, i));
|
|
27
|
+
|
|
28
|
+
export const removeTriggersPermissions = /*@__PURE__*/ API.op((i) => i === API.D ? ['{input:#1,output:#2,errors:[$8,$9],protocol:$10,retry:$11};$6(>3)@"RemoveTriggersPermissionsRequest";$6(>4)@"RemoveTriggersPermissionsResponse";$5({trigger_id:$2,user_ids:$4(#3:0),channel_ids:$4(#3:0),team_ids:$4(#3:0),org_ids:$4(#3:0)}).pipe($1({method:"POST",uri:"/workflows.triggers.permissions.remove",code:200}));$5({ok:$7,permission_type:$2,user_ids:$4(#3:0),channel_ids:$4(#3:0),team_ids:$4(#3:0),org_ids:$4(#3:0)})', [__0, __1, __2, __d0, __7, __3, __4, __6, SlackError, SlackRateLimited, SlackProtocol, Retry.Retry]] : API.call(removeTriggersPermissions, i));
|
|
29
|
+
|
|
30
|
+
export const setFeatured = /*@__PURE__*/ API.op((i) => i === API.D ? ['{input:#1,output:#6:0,errors:[$7,$8],protocol:$9,retry:$10};$5(>2)@"SetFeaturedRequest";$4({channel_id:$2,trigger_ids:#3:0}).pipe($1({method:"POST",uri:"/workflows.featured.set",code:200}))', [__0, __1, __2, __d0, __3, __4, __d1, SlackError, SlackRateLimited, SlackProtocol, Retry.Retry]] : API.call(setFeatured, i));
|
|
31
|
+
|
|
32
|
+
export const setTriggersPermissions = /*@__PURE__*/ API.op((i) => i === API.D ? ['{input:#1,output:#7:0,errors:[$8,$9],protocol:$10,retry:$11};$6(>2)@"SetTriggersPermissionsRequest";$5({trigger_id:$2,permission_type:$2,user_ids:$4(#3:0),channel_ids:$4(#3:0),team_ids:$4(#3:0),org_ids:$4(#3:0)}).pipe($1({method:"POST",uri:"/workflows.triggers.permissions.set",code:200}))', [__0, __1, __2, __d0, __7, __3, __4, __d1, SlackError, SlackRateLimited, SlackProtocol, Retry.Retry]] : API.call(setTriggersPermissions, i));
|
|
33
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
34
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
// Shared schema data (see `op` in core/api).
|
|
38
|
+
function __d0() {
|
|
39
|
+
return ['$2($1)', [__0, __2, __5]];
|
|
40
|
+
}
|
|
41
|
+
function __d1() {
|
|
42
|
+
return ['$3(>1)@"AddFeaturedResponse";$2({ok:$1})', [__0, __6, __3, __4]];
|
|
43
|
+
}
|
package/lib/traits.d.ts
CHANGED
package/lib/traits.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
9
|
export { Body, Header, Query, Label, Http, ResponseCode, HttpBody, FormDataFile, KeyDictionary, UnionCases, applyErrorMatchers, getErrorMatchers, bodySymbol, headerSymbol, querySymbol, labelSymbol, httpSymbol, responseCodeSymbol, httpBodySymbol, formDataFileSymbol, keyDictionarySymbol, unionCasesSymbol, errorMatchersSymbol, } from "@distilled.cloud/core/trait";
|
|
10
10
|
// Bearer-REST protocol traits (sensitive strings, bare-payload responses).
|
|
11
11
|
export { SensitiveValue, RawResponse, RawResponseRoot, sensitiveValueSymbol, rawResponseSymbol, rawResponseRootSymbol, } from "@distilled.cloud/core/protocol-rest";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@distilled.cloud/slack",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.16",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
"types": "./lib/index.d.ts",
|
|
19
19
|
"bun": "./src/index.ts",
|
|
20
20
|
"worker": "./src/index.ts",
|
|
21
|
-
"
|
|
21
|
+
"module": "./lib/index.full.js",
|
|
22
|
+
"module-sync": "./lib/index.js",
|
|
23
|
+
"default": "./lib/index.full.js"
|
|
22
24
|
},
|
|
23
25
|
"./Credentials": {
|
|
24
26
|
"types": "./lib/credentials.d.ts",
|
|
@@ -60,29 +62,31 @@
|
|
|
60
62
|
"types": "./lib/services/*.d.ts",
|
|
61
63
|
"bun": "./src/services/*.ts",
|
|
62
64
|
"worker": "./src/services/*.ts",
|
|
63
|
-
"
|
|
65
|
+
"module": "./lib/services.full/*.js",
|
|
66
|
+
"module-sync": "./lib/services/*.js",
|
|
67
|
+
"default": "./lib/services.full/*.js"
|
|
64
68
|
}
|
|
65
69
|
},
|
|
66
70
|
"dependencies": {
|
|
67
|
-
"@distilled.cloud/core": "1.0.0-rc.
|
|
71
|
+
"@distilled.cloud/core": "1.0.0-rc.16"
|
|
68
72
|
},
|
|
69
73
|
"devDependencies": {
|
|
70
|
-
"@effect/platform-node": "^4.0.
|
|
71
|
-
"@types/node": "26.
|
|
74
|
+
"@effect/platform-node": "^4.0.5",
|
|
75
|
+
"@types/node": "26.6.5"
|
|
72
76
|
},
|
|
73
77
|
"peerDependencies": {
|
|
74
|
-
"effect": "^4.0.
|
|
78
|
+
"effect": "^4.0.5"
|
|
75
79
|
},
|
|
76
80
|
"distilled": {
|
|
77
|
-
"generatedAt": "2026-10-
|
|
81
|
+
"generatedAt": "2026-10-09",
|
|
78
82
|
"specUpdatedAt": "2026-10-08"
|
|
79
83
|
},
|
|
80
84
|
"scripts": {
|
|
81
|
-
"build": "
|
|
85
|
+
"build": "tsrs -b",
|
|
82
86
|
"specs:fetch": "git submodule update --force --init --depth=1 specs/spec-mirror-slack",
|
|
83
87
|
"specs:update": "git submodule update --remote --force --depth=1 specs/spec-mirror-slack",
|
|
84
88
|
"convert": "node --conditions=bun scripts/convert.ts",
|
|
85
89
|
"generate": "node --conditions=bun scripts/convert.ts && node --conditions=bun scripts/generate.ts",
|
|
86
|
-
"typecheck": "
|
|
90
|
+
"typecheck": "tsrs -p tsconfig.json"
|
|
87
91
|
}
|
|
88
92
|
}
|
package/src/credentials.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
2
1
|
/**
|
|
3
|
-
* Slack credentials
|
|
2
|
+
* Slack credentials -- hand-written.
|
|
4
3
|
*
|
|
5
4
|
* The `Credentials` service resolves `{ token, apiBaseUrl }` per request; the
|
|
6
5
|
* protocol layer formats the `Authorization: Bearer <token>` header from it.
|
|
7
6
|
*
|
|
8
7
|
* Slack authorizes Web API calls with one bearer token, and the token's
|
|
9
8
|
* PREFIX carries its kind (https://docs.slack.dev/authentication/tokens):
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* * `xoxb-...` -- a bot token (what almost every integration uses)
|
|
10
|
+
* * `xoxp-...` -- a user token, for calls made on behalf of a user
|
|
11
|
+
* * `xoxe.xoxb-...` / `xoxe.xoxp-...` -- rotating (expiring) variants
|
|
12
|
+
* * `xapp-...` -- an app-level token (Socket Mode / `apps.connections.open`)
|
|
14
13
|
* The header is the same for all of them, so there is no token-type knob.
|
|
15
14
|
*
|
|
16
|
-
* The OAuth exchange methods (`oauth.v2.access`, `openid.connect.token`,
|
|
17
|
-
* authenticate with `client_id`/`client_secret` args instead of a token
|
|
15
|
+
* The OAuth exchange methods (`oauth.v2.access`, `openid.connect.token`, ...)
|
|
16
|
+
* authenticate with `client_id`/`client_secret` args instead of a token -- for
|
|
18
17
|
* those, an empty-string token is allowed and the protocol simply omits the
|
|
19
18
|
* Authorization header.
|
|
20
19
|
*/
|
|
21
|
-
import * as EffectConfig from "
|
|
20
|
+
import * as EffectConfig from "@distilled.cloud/core/config";
|
|
21
|
+
import { ConfigError } from "@distilled.cloud/core/errors";
|
|
22
22
|
import * as Context from "effect/Context";
|
|
23
23
|
import * as Effect from "effect/Effect";
|
|
24
24
|
import * as Layer from "effect/Layer";
|
|
@@ -35,31 +35,30 @@ export interface Config {
|
|
|
35
35
|
readonly apiBaseUrl: string;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
export class Credentials
|
|
39
|
-
"SlackCredentials"
|
|
40
|
-
) {}
|
|
38
|
+
export class Credentials
|
|
39
|
+
extends /*@__PURE__*/ Context.Service<Credentials, Effect.Effect<Config>>()("SlackCredentials") {}
|
|
41
40
|
|
|
42
|
-
const envConfig = EffectConfig.all({
|
|
41
|
+
const envConfig = /*@__PURE__*/ EffectConfig.all({
|
|
43
42
|
// SLACK_BOT_TOKEN is the spelling Bolt and most hosting platforms use;
|
|
44
43
|
// SLACK_TOKEN is the fallback (the node SDK's CLI convention).
|
|
45
|
-
token: EffectConfig.String("SLACK_BOT_TOKEN").pipe(
|
|
46
|
-
EffectConfig.orElse(() => EffectConfig.String("SLACK_TOKEN")),
|
|
44
|
+
token: /*@__PURE__*/ EffectConfig.String("SLACK_BOT_TOKEN").pipe(
|
|
45
|
+
/*@__PURE__*/ EffectConfig.orElse(() => EffectConfig.String("SLACK_TOKEN")),
|
|
47
46
|
),
|
|
48
|
-
apiBaseUrl: EffectConfig.String("SLACK_API_URL").pipe(
|
|
49
|
-
EffectConfig.withDefault(DEFAULT_API_BASE_URL),
|
|
47
|
+
apiBaseUrl: /*@__PURE__*/ EffectConfig.String("SLACK_API_URL").pipe(
|
|
48
|
+
/*@__PURE__*/ EffectConfig.withDefault(DEFAULT_API_BASE_URL),
|
|
50
49
|
),
|
|
51
50
|
});
|
|
52
51
|
|
|
53
|
-
export const CredentialsFromEnv = Layer.succeed(
|
|
52
|
+
export const CredentialsFromEnv = /*@__PURE__*/ Layer.succeed(
|
|
54
53
|
Credentials,
|
|
55
|
-
envConfig.pipe(
|
|
56
|
-
Effect.mapError(
|
|
54
|
+
/*@__PURE__*/ envConfig.pipe(
|
|
55
|
+
/*@__PURE__*/ Effect.mapError(
|
|
57
56
|
() =>
|
|
58
57
|
new ConfigError({
|
|
59
58
|
message: "SLACK_BOT_TOKEN (or SLACK_TOKEN) environment variable is required",
|
|
60
59
|
}),
|
|
61
60
|
),
|
|
62
|
-
Effect.map(({ token, apiBaseUrl }) => ({
|
|
61
|
+
/*@__PURE__*/ Effect.map(({ token, apiBaseUrl }) => ({
|
|
63
62
|
token: Redacted.make(token),
|
|
64
63
|
apiBaseUrl,
|
|
65
64
|
})),
|
package/src/errors.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Slack-specific error types.
|
|
3
3
|
*
|
|
4
|
-
* Slack reports failures as `{ "ok": false, "error": "<slug>" }`
|
|
5
|
-
* with HTTP 200
|
|
4
|
+
* Slack reports failures as `{ "ok": false, "error": "<slug>" }` -- usually
|
|
5
|
+
* with HTTP 200 -- so the interesting field is the machine-readable `error`
|
|
6
6
|
* slug, not the status. The protocol maps the well-known infrastructure
|
|
7
7
|
* slugs (auth, throttling, server hiccups) onto core's shared HTTP error
|
|
8
8
|
* classes and surfaces everything else as {@link SlackError} with the slug
|
|
@@ -30,49 +30,53 @@ import * as Category from "@distilled.cloud/core/category";
|
|
|
30
30
|
import { withCategory } from "@distilled.cloud/core/error-category";
|
|
31
31
|
import type { DefaultErrors as CoreDefaultErrors } from "@distilled.cloud/core/errors";
|
|
32
32
|
import { DurationSchema, RETRYABLE } from "@distilled.cloud/core/errors";
|
|
33
|
-
import * as Schema from "
|
|
33
|
+
import * as Schema from "@distilled.cloud/core/schema-lite-typed";
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* A Slack API error envelope: `ok: false` with a machine-readable slug.
|
|
37
|
-
* `code` is the slug (`channel_not_found`, `invalid_blocks`,
|
|
37
|
+
* `code` is the slug (`channel_not_found`, `invalid_blocks`, ...) -- the field
|
|
38
38
|
* to branch on; the per-method slugs are listed in each operation's doc
|
|
39
39
|
* comment. `needed`/`provided` carry scope detail on `missing_scope`;
|
|
40
40
|
* `messages` carries the envelope's `response_metadata.messages` (per-field
|
|
41
41
|
* validation detail on `invalid_arguments`).
|
|
42
42
|
*/
|
|
43
|
-
export class SlackError
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
export class SlackError
|
|
44
|
+
extends /*@__PURE__*/ Schema.TaggedError<SlackError>()("SlackError", {
|
|
45
|
+
code: Schema.String,
|
|
46
|
+
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
47
|
+
needed: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
48
|
+
provided: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
49
|
+
messages: /*@__PURE__*/ Schema.optional(/*@__PURE__*/ Schema.Array(Schema.String)),
|
|
50
|
+
}) {}
|
|
50
51
|
|
|
51
52
|
/**
|
|
52
|
-
* Slack rate limit
|
|
53
|
+
* Slack rate limit -- a 429 or the `rate_limited`/`ratelimited` slug. Slack
|
|
53
54
|
* answers with a `Retry-After` header the default retry policy honors.
|
|
54
55
|
*/
|
|
55
|
-
export class SlackRateLimited
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
export class SlackRateLimited
|
|
57
|
+
extends /*@__PURE__*/ Schema.TaggedError<SlackRateLimited>()("SlackRateLimited", {
|
|
58
|
+
code: Schema.String,
|
|
59
|
+
message: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
60
|
+
retryAfter: /*@__PURE__*/ Schema.optional(DurationSchema),
|
|
61
|
+
}).pipe(/*@__PURE__*/ withCategory(RETRYABLE), Category.withThrottlingError) {}
|
|
60
62
|
|
|
61
63
|
/**
|
|
62
|
-
* HTTP error
|
|
64
|
+
* HTTP error -- a non-2xx response without a parseable Slack error envelope
|
|
63
65
|
* (proxy pages, HTML 5xx bodies).
|
|
64
66
|
*/
|
|
65
|
-
export class SlackHttpError
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
export class SlackHttpError
|
|
68
|
+
extends /*@__PURE__*/ Schema.TaggedError<SlackHttpError>()("SlackHttpError", {
|
|
69
|
+
status: Schema.Number,
|
|
70
|
+
message: Schema.String,
|
|
71
|
+
body: /*@__PURE__*/ Schema.optional(Schema.String),
|
|
72
|
+
}) {}
|
|
70
73
|
|
|
71
74
|
/** Schema parse error wrapper. */
|
|
72
|
-
export class SlackParseError
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
export class SlackParseError
|
|
76
|
+
extends /*@__PURE__*/ Schema.TaggedError<SlackParseError>()("SlackParseError", {
|
|
77
|
+
body: Schema.Unknown,
|
|
78
|
+
cause: Schema.Unknown,
|
|
79
|
+
}).pipe(Category.withParseError) {}
|
|
76
80
|
|
|
77
81
|
/**
|
|
78
82
|
* Errors any Slack operation may surface in addition to the shared HTTP
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @distilled.cloud/slack
|
|
2
|
+
* @distilled.cloud/slack -- Slack Web API SDK for Effect.
|
|
3
3
|
*
|
|
4
4
|
* `./services` is generated by `scripts/generate.ts` from the Smithy models
|
|
5
5
|
* in `.generated-specs` (written by `scripts/convert.ts` from the JSON twins
|
package/src/pagination.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Slack pagination
|
|
2
|
+
* Slack pagination -- hand-written.
|
|
3
3
|
*
|
|
4
4
|
* Slack's cursor convention: pass `cursor` (from the previous response's
|
|
5
5
|
* `response_metadata.next_cursor`), and an EMPTY `next_cursor` means the
|
|
6
|
-
* last page
|
|
6
|
+
* last page -- which is exactly core's cursor traversal (`isTerminalToken`
|
|
7
7
|
* treats `""` as terminal). Paginated operations are compiled with this
|
|
8
8
|
* strategy by scripts/generate.ts from the `smithy.api#paginated` traits the
|
|
9
9
|
* converter stamps.
|