bereach 1.4.2 → 1.5.0
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/README.md +71 -5
- package/esm/funcs/actions-connect-profile.d.ts +1 -1
- package/esm/funcs/actions-connect-profile.js +1 -1
- package/esm/funcs/actions-edit-profile.d.ts +18 -0
- package/esm/funcs/actions-edit-profile.d.ts.map +1 -0
- package/esm/funcs/actions-edit-profile.js +97 -0
- package/esm/funcs/actions-edit-profile.js.map +1 -0
- package/esm/funcs/chat-get-conversation-summary.d.ts +18 -0
- package/esm/funcs/chat-get-conversation-summary.d.ts.map +1 -0
- package/esm/funcs/chat-get-conversation-summary.js +100 -0
- package/esm/funcs/chat-get-conversation-summary.js.map +1 -0
- package/esm/funcs/chat-list-inbox.d.ts +1 -1
- package/esm/funcs/chat-list-inbox.js +1 -1
- package/esm/funcs/chat-save-conversation-summary.d.ts +18 -0
- package/esm/funcs/chat-save-conversation-summary.d.ts.map +1 -0
- package/esm/funcs/chat-save-conversation-summary.js +97 -0
- package/esm/funcs/chat-save-conversation-summary.js.map +1 -0
- package/esm/funcs/company-pages-get-analytics.d.ts +1 -1
- package/esm/funcs/company-pages-get-analytics.js +1 -1
- package/esm/funcs/connectors-agent-snapshot.d.ts +18 -0
- package/esm/funcs/connectors-agent-snapshot.d.ts.map +1 -0
- package/esm/funcs/connectors-agent-snapshot.js +86 -0
- package/esm/funcs/connectors-agent-snapshot.js.map +1 -0
- package/esm/funcs/connectors-connector-heartbeat.d.ts +18 -0
- package/esm/funcs/connectors-connector-heartbeat.d.ts.map +1 -0
- package/esm/funcs/connectors-connector-heartbeat.js +99 -0
- package/esm/funcs/connectors-connector-heartbeat.js.map +1 -0
- package/esm/funcs/connectors-list-connectors.d.ts +18 -0
- package/esm/funcs/connectors-list-connectors.d.ts.map +1 -0
- package/esm/funcs/connectors-list-connectors.js +86 -0
- package/esm/funcs/connectors-list-connectors.js.map +1 -0
- package/esm/funcs/connectors-pull-task.d.ts +18 -0
- package/esm/funcs/connectors-pull-task.d.ts.map +1 -0
- package/esm/funcs/connectors-pull-task.js +86 -0
- package/esm/funcs/connectors-pull-task.js.map +1 -0
- package/esm/funcs/connectors-submit-task-result.d.ts +18 -0
- package/esm/funcs/connectors-submit-task-result.d.ts.map +1 -0
- package/esm/funcs/connectors-submit-task-result.js +103 -0
- package/esm/funcs/connectors-submit-task-result.js.map +1 -0
- package/esm/funcs/contacts-global-activities.d.ts +18 -0
- package/esm/funcs/contacts-global-activities.d.ts.map +1 -0
- package/esm/funcs/contacts-global-activities.js +105 -0
- package/esm/funcs/contacts-global-activities.js.map +1 -0
- package/esm/funcs/profile-create-api-token.d.ts +18 -0
- package/esm/funcs/profile-create-api-token.d.ts.map +1 -0
- package/esm/funcs/profile-create-api-token.js +99 -0
- package/esm/funcs/profile-create-api-token.js.map +1 -0
- package/esm/funcs/profile-delete-api-token.d.ts +18 -0
- package/esm/funcs/profile-delete-api-token.d.ts.map +1 -0
- package/esm/funcs/profile-delete-api-token.js +99 -0
- package/esm/funcs/profile-delete-api-token.js.map +1 -0
- package/esm/funcs/profile-get-api-token.d.ts +18 -0
- package/esm/funcs/profile-get-api-token.d.ts.map +1 -0
- package/esm/funcs/profile-get-api-token.js +100 -0
- package/esm/funcs/profile-get-api-token.js.map +1 -0
- package/esm/funcs/profile-get-my-activity.d.ts +18 -0
- package/esm/funcs/profile-get-my-activity.d.ts.map +1 -0
- package/esm/funcs/profile-get-my-activity.js +104 -0
- package/esm/funcs/profile-get-my-activity.js.map +1 -0
- package/esm/funcs/profile-get-settings.d.ts +18 -0
- package/esm/funcs/profile-get-settings.d.ts.map +1 -0
- package/esm/funcs/profile-get-settings.js +86 -0
- package/esm/funcs/profile-get-settings.js.map +1 -0
- package/esm/funcs/profile-patch-settings.d.ts +18 -0
- package/esm/funcs/profile-patch-settings.d.ts.map +1 -0
- package/esm/funcs/profile-patch-settings.js +97 -0
- package/esm/funcs/profile-patch-settings.js.map +1 -0
- package/esm/funcs/profile-revalidate-linkedin.d.ts +18 -0
- package/esm/funcs/profile-revalidate-linkedin.d.ts.map +1 -0
- package/esm/funcs/profile-revalidate-linkedin.js +86 -0
- package/esm/funcs/profile-revalidate-linkedin.js.map +1 -0
- package/esm/funcs/sales-nav-search.d.ts +1 -1
- package/esm/funcs/sales-nav-search.js +1 -1
- package/esm/funcs/scheduled-messages-review-drafts.d.ts +18 -0
- package/esm/funcs/scheduled-messages-review-drafts.d.ts.map +1 -0
- package/esm/funcs/scheduled-messages-review-drafts.js +97 -0
- package/esm/funcs/scheduled-messages-review-drafts.js.map +1 -0
- package/esm/funcs/scrapers-collect-comment-replies.d.ts +1 -1
- package/esm/funcs/scrapers-collect-comment-replies.js +1 -1
- package/esm/funcs/scrapers-collect-comments.d.ts +1 -1
- package/esm/funcs/scrapers-collect-comments.js +1 -1
- package/esm/funcs/scrapers-collect-likes.d.ts +1 -1
- package/esm/funcs/scrapers-collect-likes.js +1 -1
- package/esm/funcs/scrapers-visit-profile.d.ts +2 -0
- package/esm/funcs/scrapers-visit-profile.d.ts.map +1 -1
- package/esm/funcs/scrapers-visit-profile.js +2 -0
- package/esm/funcs/scrapers-visit-profile.js.map +1 -1
- package/esm/funcs/search-people.d.ts +2 -2
- package/esm/funcs/search-people.js +2 -2
- package/esm/funcs/search-search.d.ts +1 -1
- package/esm/funcs/search-search.js +1 -1
- package/esm/funcs/settings-get-dm-polling-settings.d.ts +18 -0
- package/esm/funcs/settings-get-dm-polling-settings.d.ts.map +1 -0
- package/esm/funcs/settings-get-dm-polling-settings.js +86 -0
- package/esm/funcs/settings-get-dm-polling-settings.js.map +1 -0
- package/esm/funcs/settings-patch-dm-polling-settings.d.ts +18 -0
- package/esm/funcs/settings-patch-dm-polling-settings.d.ts.map +1 -0
- package/esm/funcs/settings-patch-dm-polling-settings.js +97 -0
- package/esm/funcs/settings-patch-dm-polling-settings.js.map +1 -0
- package/esm/funcs/tasks-cancel-chain.d.ts +18 -0
- package/esm/funcs/tasks-cancel-chain.d.ts.map +1 -0
- package/esm/funcs/tasks-cancel-chain.js +102 -0
- package/esm/funcs/tasks-cancel-chain.js.map +1 -0
- package/esm/funcs/tasks-cancel-task.d.ts +18 -0
- package/esm/funcs/tasks-cancel-task.d.ts.map +1 -0
- package/esm/funcs/tasks-cancel-task.js +102 -0
- package/esm/funcs/tasks-cancel-task.js.map +1 -0
- package/esm/funcs/tasks-events-feed.d.ts +18 -0
- package/esm/funcs/tasks-events-feed.d.ts.map +1 -0
- package/esm/funcs/tasks-events-feed.js +101 -0
- package/esm/funcs/tasks-events-feed.js.map +1 -0
- package/esm/funcs/tasks-list-tasks.d.ts +18 -0
- package/esm/funcs/tasks-list-tasks.d.ts.map +1 -0
- package/esm/funcs/tasks-list-tasks.js +104 -0
- package/esm/funcs/tasks-list-tasks.js.map +1 -0
- package/esm/funcs/workspace-create-workspace-invite.d.ts +18 -0
- package/esm/funcs/workspace-create-workspace-invite.d.ts.map +1 -0
- package/esm/funcs/workspace-create-workspace-invite.js +97 -0
- package/esm/funcs/workspace-create-workspace-invite.js.map +1 -0
- package/esm/funcs/workspace-delete-workspace-account.d.ts +18 -0
- package/esm/funcs/workspace-delete-workspace-account.d.ts.map +1 -0
- package/esm/funcs/workspace-delete-workspace-account.js +102 -0
- package/esm/funcs/workspace-delete-workspace-account.js.map +1 -0
- package/esm/funcs/workspace-delete-workspace-invite.d.ts +18 -0
- package/esm/funcs/workspace-delete-workspace-invite.d.ts.map +1 -0
- package/esm/funcs/workspace-delete-workspace-invite.js +97 -0
- package/esm/funcs/workspace-delete-workspace-invite.js.map +1 -0
- package/esm/funcs/workspace-upgrade-workspace-account.d.ts +18 -0
- package/esm/funcs/workspace-upgrade-workspace-account.d.ts.map +1 -0
- package/esm/funcs/workspace-upgrade-workspace-account.js +97 -0
- package/esm/funcs/workspace-upgrade-workspace-account.js.map +1 -0
- package/esm/hooks/hooks.d.ts.map +1 -1
- package/esm/hooks/hooks.js +0 -2
- package/esm/hooks/hooks.js.map +1 -1
- package/esm/lib/config.d.ts +5 -5
- package/esm/lib/config.d.ts.map +1 -1
- package/esm/lib/config.js +6 -6
- package/esm/lib/config.js.map +1 -1
- package/esm/lib/encodings.d.ts.map +1 -1
- package/esm/lib/encodings.js +20 -5
- package/esm/lib/encodings.js.map +1 -1
- package/esm/lib/security.d.ts +1 -1
- package/esm/lib/security.d.ts.map +1 -1
- package/esm/lib/security.js +19 -8
- package/esm/lib/security.js.map +1 -1
- package/esm/models/operations/{search-contacts-campaign.d.ts → archive-response.d.ts} +1174 -1151
- package/esm/models/operations/archive-response.d.ts.map +1 -0
- package/esm/models/operations/{search-contacts-campaign.js → archive-response.js} +456 -461
- package/esm/models/operations/archive-response.js.map +1 -0
- package/esm/models/operations/delete-workspace-invite-response.d.ts +1374 -0
- package/esm/models/operations/delete-workspace-invite-response.d.ts.map +1 -0
- package/esm/models/operations/delete-workspace-invite-response.js +901 -0
- package/esm/models/operations/delete-workspace-invite-response.js.map +1 -0
- package/esm/models/operations/{update-schedule-response.d.ts → get-by-url-campaign.d.ts} +1629 -1291
- package/esm/models/operations/get-by-url-campaign.d.ts.map +1 -0
- package/esm/models/operations/{update-schedule-response.js → get-by-url-campaign.js} +534 -341
- package/esm/models/operations/get-by-url-campaign.js.map +1 -0
- package/esm/models/operations/index.d.ts +4 -3
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +4 -3
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/search-companies-response.d.ts +45 -12
- package/esm/models/operations/search-companies-response.d.ts.map +1 -1
- package/esm/models/operations/search-companies-response.js +10 -2
- package/esm/models/operations/search-companies-response.js.map +1 -1
- package/esm/models/operations/{update-account-response.d.ts → update-account-proxy-config-response.d.ts} +70 -38
- package/esm/models/operations/update-account-proxy-config-response.d.ts.map +1 -0
- package/esm/models/operations/{update-account-response.js → update-account-proxy-config-response.js} +27 -28
- package/esm/models/operations/update-account-proxy-config-response.js.map +1 -0
- package/esm/sdk/actions.d.ts +8 -1
- package/esm/sdk/actions.d.ts.map +1 -1
- package/esm/sdk/actions.js +11 -1
- package/esm/sdk/actions.js.map +1 -1
- package/esm/sdk/chat.d.ts +15 -1
- package/esm/sdk/chat.d.ts.map +1 -1
- package/esm/sdk/chat.js +21 -1
- package/esm/sdk/chat.js.map +1 -1
- package/esm/sdk/company-pages.d.ts +1 -1
- package/esm/sdk/company-pages.js +1 -1
- package/esm/sdk/connectors.d.ts +40 -0
- package/esm/sdk/connectors.d.ts.map +1 -0
- package/esm/sdk/connectors.js +58 -0
- package/esm/sdk/connectors.js.map +1 -0
- package/esm/sdk/contacts.d.ts +7 -0
- package/esm/sdk/contacts.d.ts.map +1 -1
- package/esm/sdk/contacts.js +10 -0
- package/esm/sdk/contacts.js.map +1 -1
- package/esm/sdk/profile.d.ts +49 -0
- package/esm/sdk/profile.d.ts.map +1 -1
- package/esm/sdk/profile.js +70 -0
- package/esm/sdk/profile.js.map +1 -1
- package/esm/sdk/sales-nav.d.ts +1 -1
- package/esm/sdk/sales-nav.js +1 -1
- package/esm/sdk/scheduled-messages.d.ts +7 -0
- package/esm/sdk/scheduled-messages.d.ts.map +1 -1
- package/esm/sdk/scheduled-messages.js +10 -0
- package/esm/sdk/scheduled-messages.js.map +1 -1
- package/esm/sdk/scrapers.d.ts +5 -3
- package/esm/sdk/scrapers.d.ts.map +1 -1
- package/esm/sdk/scrapers.js +5 -3
- package/esm/sdk/scrapers.js.map +1 -1
- package/esm/sdk/sdk.d.ts +12 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +20 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/esm/sdk/search.d.ts +3 -3
- package/esm/sdk/search.js +3 -3
- package/esm/sdk/settings.d.ts +19 -0
- package/esm/sdk/settings.d.ts.map +1 -0
- package/esm/sdk/settings.js +28 -0
- package/esm/sdk/settings.js.map +1 -0
- package/esm/sdk/tasks.d.ts +33 -0
- package/esm/sdk/tasks.d.ts.map +1 -0
- package/esm/sdk/tasks.js +48 -0
- package/esm/sdk/tasks.js.map +1 -0
- package/esm/sdk/workspace.d.ts +33 -0
- package/esm/sdk/workspace.d.ts.map +1 -0
- package/esm/sdk/workspace.js +48 -0
- package/esm/sdk/workspace.js.map +1 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/actions-connect-profile.ts +1 -1
- package/src/funcs/actions-edit-profile.ts +224 -0
- package/src/funcs/chat-get-conversation-summary.ts +229 -0
- package/src/funcs/chat-list-inbox.ts +1 -1
- package/src/funcs/chat-save-conversation-summary.ts +225 -0
- package/src/funcs/company-pages-get-analytics.ts +1 -1
- package/src/funcs/connectors-agent-snapshot.ts +205 -0
- package/src/funcs/connectors-connector-heartbeat.ts +230 -0
- package/src/funcs/connectors-list-connectors.ts +205 -0
- package/src/funcs/connectors-pull-task.ts +205 -0
- package/src/funcs/connectors-submit-task-result.ts +231 -0
- package/src/funcs/contacts-global-activities.ts +237 -0
- package/src/funcs/profile-create-api-token.ts +230 -0
- package/src/funcs/profile-delete-api-token.ts +230 -0
- package/src/funcs/profile-get-api-token.ts +229 -0
- package/src/funcs/profile-get-my-activity.ts +236 -0
- package/src/funcs/profile-get-settings.ts +205 -0
- package/src/funcs/profile-patch-settings.ts +224 -0
- package/src/funcs/profile-revalidate-linkedin.ts +205 -0
- package/src/funcs/sales-nav-search.ts +1 -1
- package/src/funcs/scheduled-messages-review-drafts.ts +224 -0
- package/src/funcs/scrapers-collect-comment-replies.ts +1 -1
- package/src/funcs/scrapers-collect-comments.ts +1 -1
- package/src/funcs/scrapers-collect-likes.ts +1 -1
- package/src/funcs/scrapers-visit-profile.ts +2 -0
- package/src/funcs/search-people.ts +2 -2
- package/src/funcs/search-search.ts +1 -1
- package/src/funcs/settings-get-dm-polling-settings.ts +205 -0
- package/src/funcs/settings-patch-dm-polling-settings.ts +225 -0
- package/src/funcs/tasks-cancel-chain.ts +229 -0
- package/src/funcs/tasks-cancel-task.ts +229 -0
- package/src/funcs/tasks-events-feed.ts +230 -0
- package/src/funcs/tasks-list-tasks.ts +233 -0
- package/src/funcs/workspace-create-workspace-invite.ts +225 -0
- package/src/funcs/workspace-delete-workspace-account.ts +230 -0
- package/src/funcs/workspace-delete-workspace-invite.ts +225 -0
- package/src/funcs/workspace-upgrade-workspace-account.ts +225 -0
- package/src/hooks/hooks.ts +0 -3
- package/src/lib/config.ts +6 -6
- package/src/lib/encodings.ts +23 -4
- package/src/lib/security.ts +14 -2
- package/src/models/operations/{search-contacts-campaign.ts → archive-response.ts} +2503 -2362
- package/src/models/operations/delete-workspace-invite-response.ts +2783 -0
- package/src/models/operations/{update-schedule-response.ts → get-by-url-campaign.ts} +3591 -2939
- package/src/models/operations/index.ts +4 -3
- package/src/models/operations/search-companies-response.ts +55 -14
- package/src/models/operations/{update-account-response.ts → update-account-proxy-config-response.ts} +112 -84
- package/src/sdk/actions.ts +19 -1
- package/src/sdk/chat.ts +37 -1
- package/src/sdk/company-pages.ts +1 -1
- package/src/sdk/connectors.ts +93 -0
- package/src/sdk/contacts.ts +18 -0
- package/src/sdk/profile.ts +122 -0
- package/src/sdk/sales-nav.ts +1 -1
- package/src/sdk/scheduled-messages.ts +18 -0
- package/src/sdk/scrapers.ts +5 -3
- package/src/sdk/sdk.ts +24 -0
- package/src/sdk/search.ts +3 -3
- package/src/sdk/settings.ts +43 -0
- package/src/sdk/tasks.ts +81 -0
- package/src/sdk/workspace.ts +81 -0
- package/esm/models/operations/search-contacts-campaign.d.ts.map +0 -1
- package/esm/models/operations/search-contacts-campaign.js.map +0 -1
- package/esm/models/operations/update-account-response.d.ts.map +0 -1
- package/esm/models/operations/update-account-response.js.map +0 -1
- package/esm/models/operations/update-schedule-response.d.ts.map +0 -1
- package/esm/models/operations/update-schedule-response.js.map +0 -1
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { BereachCore } from "../core.js";
|
|
7
|
+
import { encodeJSON } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import { BereachError } from "../models/errors/bereach-error.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/http-client-errors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Update DM polling settings
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Enable/disable DM or connection polling and set webhook URL. 0 credits.
|
|
34
|
+
*/
|
|
35
|
+
export function settingsPatchDmPollingSettings(
|
|
36
|
+
client: BereachCore,
|
|
37
|
+
request: operations.PatchDmPollingSettingsRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
operations.PatchDmPollingSettingsResponse,
|
|
42
|
+
| errors.BadRequestError
|
|
43
|
+
| errors.UnauthorizedError
|
|
44
|
+
| errors.ForbiddenError
|
|
45
|
+
| errors.NotFoundError
|
|
46
|
+
| errors.ConflictError
|
|
47
|
+
| errors.GoneError
|
|
48
|
+
| errors.UnprocessableEntityError
|
|
49
|
+
| errors.TooManyRequestsError
|
|
50
|
+
| errors.InternalServerError
|
|
51
|
+
| errors.BadGatewayError
|
|
52
|
+
| errors.ServiceUnavailableError
|
|
53
|
+
| BereachError
|
|
54
|
+
| ResponseValidationError
|
|
55
|
+
| ConnectionError
|
|
56
|
+
| RequestAbortedError
|
|
57
|
+
| RequestTimeoutError
|
|
58
|
+
| InvalidRequestError
|
|
59
|
+
| UnexpectedClientError
|
|
60
|
+
| SDKValidationError
|
|
61
|
+
>
|
|
62
|
+
> {
|
|
63
|
+
return new APIPromise($do(
|
|
64
|
+
client,
|
|
65
|
+
request,
|
|
66
|
+
options,
|
|
67
|
+
));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function $do(
|
|
71
|
+
client: BereachCore,
|
|
72
|
+
request: operations.PatchDmPollingSettingsRequest,
|
|
73
|
+
options?: RequestOptions,
|
|
74
|
+
): Promise<
|
|
75
|
+
[
|
|
76
|
+
Result<
|
|
77
|
+
operations.PatchDmPollingSettingsResponse,
|
|
78
|
+
| errors.BadRequestError
|
|
79
|
+
| errors.UnauthorizedError
|
|
80
|
+
| errors.ForbiddenError
|
|
81
|
+
| errors.NotFoundError
|
|
82
|
+
| errors.ConflictError
|
|
83
|
+
| errors.GoneError
|
|
84
|
+
| errors.UnprocessableEntityError
|
|
85
|
+
| errors.TooManyRequestsError
|
|
86
|
+
| errors.InternalServerError
|
|
87
|
+
| errors.BadGatewayError
|
|
88
|
+
| errors.ServiceUnavailableError
|
|
89
|
+
| BereachError
|
|
90
|
+
| ResponseValidationError
|
|
91
|
+
| ConnectionError
|
|
92
|
+
| RequestAbortedError
|
|
93
|
+
| RequestTimeoutError
|
|
94
|
+
| InvalidRequestError
|
|
95
|
+
| UnexpectedClientError
|
|
96
|
+
| SDKValidationError
|
|
97
|
+
>,
|
|
98
|
+
APICall,
|
|
99
|
+
]
|
|
100
|
+
> {
|
|
101
|
+
const parsed = safeParse(
|
|
102
|
+
request,
|
|
103
|
+
(value) =>
|
|
104
|
+
z.parse(operations.PatchDmPollingSettingsRequest$outboundSchema, value),
|
|
105
|
+
"Input validation failed",
|
|
106
|
+
);
|
|
107
|
+
if (!parsed.ok) {
|
|
108
|
+
return [parsed, { status: "invalid" }];
|
|
109
|
+
}
|
|
110
|
+
const payload = parsed.value;
|
|
111
|
+
const body = encodeJSON("body", payload, { explode: true });
|
|
112
|
+
|
|
113
|
+
const path = pathToFunc("/settings/dm-polling")();
|
|
114
|
+
|
|
115
|
+
const headers = new Headers(compactMap({
|
|
116
|
+
"Content-Type": "application/json",
|
|
117
|
+
Accept: "application/json",
|
|
118
|
+
}));
|
|
119
|
+
|
|
120
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
121
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
122
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
123
|
+
|
|
124
|
+
const context = {
|
|
125
|
+
options: client._options,
|
|
126
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
127
|
+
operationID: "patchDmPollingSettings",
|
|
128
|
+
oAuth2Scopes: null,
|
|
129
|
+
|
|
130
|
+
resolvedSecurity: requestSecurity,
|
|
131
|
+
|
|
132
|
+
securitySource: client._options.token,
|
|
133
|
+
retryConfig: options?.retries
|
|
134
|
+
|| client._options.retryConfig
|
|
135
|
+
|| { strategy: "none" },
|
|
136
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const requestRes = client._createRequest(context, {
|
|
140
|
+
security: requestSecurity,
|
|
141
|
+
method: "PATCH",
|
|
142
|
+
baseURL: options?.serverURL,
|
|
143
|
+
path: path,
|
|
144
|
+
headers: headers,
|
|
145
|
+
body: body,
|
|
146
|
+
userAgent: client._options.userAgent,
|
|
147
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
148
|
+
}, options);
|
|
149
|
+
if (!requestRes.ok) {
|
|
150
|
+
return [requestRes, { status: "invalid" }];
|
|
151
|
+
}
|
|
152
|
+
const req = requestRes.value;
|
|
153
|
+
|
|
154
|
+
const doResult = await client._do(req, {
|
|
155
|
+
context,
|
|
156
|
+
errorCodes: [
|
|
157
|
+
"400",
|
|
158
|
+
"401",
|
|
159
|
+
"403",
|
|
160
|
+
"404",
|
|
161
|
+
"409",
|
|
162
|
+
"410",
|
|
163
|
+
"422",
|
|
164
|
+
"429",
|
|
165
|
+
"4XX",
|
|
166
|
+
"500",
|
|
167
|
+
"502",
|
|
168
|
+
"503",
|
|
169
|
+
"5XX",
|
|
170
|
+
],
|
|
171
|
+
retryConfig: context.retryConfig,
|
|
172
|
+
retryCodes: context.retryCodes,
|
|
173
|
+
});
|
|
174
|
+
if (!doResult.ok) {
|
|
175
|
+
return [doResult, { status: "request-error", request: req }];
|
|
176
|
+
}
|
|
177
|
+
const response = doResult.value;
|
|
178
|
+
|
|
179
|
+
const responseFields = {
|
|
180
|
+
HttpMeta: { Response: response, Request: req },
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const [result] = await M.match<
|
|
184
|
+
operations.PatchDmPollingSettingsResponse,
|
|
185
|
+
| errors.BadRequestError
|
|
186
|
+
| errors.UnauthorizedError
|
|
187
|
+
| errors.ForbiddenError
|
|
188
|
+
| errors.NotFoundError
|
|
189
|
+
| errors.ConflictError
|
|
190
|
+
| errors.GoneError
|
|
191
|
+
| errors.UnprocessableEntityError
|
|
192
|
+
| errors.TooManyRequestsError
|
|
193
|
+
| errors.InternalServerError
|
|
194
|
+
| errors.BadGatewayError
|
|
195
|
+
| errors.ServiceUnavailableError
|
|
196
|
+
| BereachError
|
|
197
|
+
| ResponseValidationError
|
|
198
|
+
| ConnectionError
|
|
199
|
+
| RequestAbortedError
|
|
200
|
+
| RequestTimeoutError
|
|
201
|
+
| InvalidRequestError
|
|
202
|
+
| UnexpectedClientError
|
|
203
|
+
| SDKValidationError
|
|
204
|
+
>(
|
|
205
|
+
M.json(200, operations.PatchDmPollingSettingsResponse$inboundSchema),
|
|
206
|
+
M.jsonErr(400, errors.BadRequestError$inboundSchema),
|
|
207
|
+
M.jsonErr(401, errors.UnauthorizedError$inboundSchema),
|
|
208
|
+
M.jsonErr(403, errors.ForbiddenError$inboundSchema),
|
|
209
|
+
M.jsonErr(404, errors.NotFoundError$inboundSchema),
|
|
210
|
+
M.jsonErr(409, errors.ConflictError$inboundSchema),
|
|
211
|
+
M.jsonErr(410, errors.GoneError$inboundSchema),
|
|
212
|
+
M.jsonErr(422, errors.UnprocessableEntityError$inboundSchema),
|
|
213
|
+
M.jsonErr(429, errors.TooManyRequestsError$inboundSchema),
|
|
214
|
+
M.jsonErr(500, errors.InternalServerError$inboundSchema),
|
|
215
|
+
M.jsonErr(502, errors.BadGatewayError$inboundSchema),
|
|
216
|
+
M.jsonErr(503, errors.ServiceUnavailableError$inboundSchema),
|
|
217
|
+
M.fail("4XX"),
|
|
218
|
+
M.fail("5XX"),
|
|
219
|
+
)(response, req, { extraFields: responseFields });
|
|
220
|
+
if (!result.ok) {
|
|
221
|
+
return [result, { status: "complete", request: req, response }];
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
return [result, { status: "complete", request: req, response }];
|
|
225
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { BereachCore } from "../core.js";
|
|
7
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import { BereachError } from "../models/errors/bereach-error.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/http-client-errors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Cancel a workflow chain
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Cancel an entire workflow chain and all its in-flight tasks. 0 credits.
|
|
34
|
+
*/
|
|
35
|
+
export function tasksCancelChain(
|
|
36
|
+
client: BereachCore,
|
|
37
|
+
request: operations.CancelChainRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
operations.CancelChainResponse,
|
|
42
|
+
| errors.BadRequestError
|
|
43
|
+
| errors.UnauthorizedError
|
|
44
|
+
| errors.ForbiddenError
|
|
45
|
+
| errors.NotFoundError
|
|
46
|
+
| errors.ConflictError
|
|
47
|
+
| errors.GoneError
|
|
48
|
+
| errors.UnprocessableEntityError
|
|
49
|
+
| errors.TooManyRequestsError
|
|
50
|
+
| errors.InternalServerError
|
|
51
|
+
| errors.BadGatewayError
|
|
52
|
+
| errors.ServiceUnavailableError
|
|
53
|
+
| BereachError
|
|
54
|
+
| ResponseValidationError
|
|
55
|
+
| ConnectionError
|
|
56
|
+
| RequestAbortedError
|
|
57
|
+
| RequestTimeoutError
|
|
58
|
+
| InvalidRequestError
|
|
59
|
+
| UnexpectedClientError
|
|
60
|
+
| SDKValidationError
|
|
61
|
+
>
|
|
62
|
+
> {
|
|
63
|
+
return new APIPromise($do(
|
|
64
|
+
client,
|
|
65
|
+
request,
|
|
66
|
+
options,
|
|
67
|
+
));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function $do(
|
|
71
|
+
client: BereachCore,
|
|
72
|
+
request: operations.CancelChainRequest,
|
|
73
|
+
options?: RequestOptions,
|
|
74
|
+
): Promise<
|
|
75
|
+
[
|
|
76
|
+
Result<
|
|
77
|
+
operations.CancelChainResponse,
|
|
78
|
+
| errors.BadRequestError
|
|
79
|
+
| errors.UnauthorizedError
|
|
80
|
+
| errors.ForbiddenError
|
|
81
|
+
| errors.NotFoundError
|
|
82
|
+
| errors.ConflictError
|
|
83
|
+
| errors.GoneError
|
|
84
|
+
| errors.UnprocessableEntityError
|
|
85
|
+
| errors.TooManyRequestsError
|
|
86
|
+
| errors.InternalServerError
|
|
87
|
+
| errors.BadGatewayError
|
|
88
|
+
| errors.ServiceUnavailableError
|
|
89
|
+
| BereachError
|
|
90
|
+
| ResponseValidationError
|
|
91
|
+
| ConnectionError
|
|
92
|
+
| RequestAbortedError
|
|
93
|
+
| RequestTimeoutError
|
|
94
|
+
| InvalidRequestError
|
|
95
|
+
| UnexpectedClientError
|
|
96
|
+
| SDKValidationError
|
|
97
|
+
>,
|
|
98
|
+
APICall,
|
|
99
|
+
]
|
|
100
|
+
> {
|
|
101
|
+
const parsed = safeParse(
|
|
102
|
+
request,
|
|
103
|
+
(value) => z.parse(operations.CancelChainRequest$outboundSchema, value),
|
|
104
|
+
"Input validation failed",
|
|
105
|
+
);
|
|
106
|
+
if (!parsed.ok) {
|
|
107
|
+
return [parsed, { status: "invalid" }];
|
|
108
|
+
}
|
|
109
|
+
const payload = parsed.value;
|
|
110
|
+
const body = null;
|
|
111
|
+
|
|
112
|
+
const pathParams = {
|
|
113
|
+
workflowRunId: encodeSimple("workflowRunId", payload.workflowRunId, {
|
|
114
|
+
explode: false,
|
|
115
|
+
charEncoding: "percent",
|
|
116
|
+
}),
|
|
117
|
+
};
|
|
118
|
+
const path = pathToFunc("/chains/{workflowRunId}/cancel")(pathParams);
|
|
119
|
+
|
|
120
|
+
const headers = new Headers(compactMap({
|
|
121
|
+
Accept: "application/json",
|
|
122
|
+
}));
|
|
123
|
+
|
|
124
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
125
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
126
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
127
|
+
|
|
128
|
+
const context = {
|
|
129
|
+
options: client._options,
|
|
130
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
131
|
+
operationID: "cancelChain",
|
|
132
|
+
oAuth2Scopes: null,
|
|
133
|
+
|
|
134
|
+
resolvedSecurity: requestSecurity,
|
|
135
|
+
|
|
136
|
+
securitySource: client._options.token,
|
|
137
|
+
retryConfig: options?.retries
|
|
138
|
+
|| client._options.retryConfig
|
|
139
|
+
|| { strategy: "none" },
|
|
140
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const requestRes = client._createRequest(context, {
|
|
144
|
+
security: requestSecurity,
|
|
145
|
+
method: "POST",
|
|
146
|
+
baseURL: options?.serverURL,
|
|
147
|
+
path: path,
|
|
148
|
+
headers: headers,
|
|
149
|
+
body: body,
|
|
150
|
+
userAgent: client._options.userAgent,
|
|
151
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
152
|
+
}, options);
|
|
153
|
+
if (!requestRes.ok) {
|
|
154
|
+
return [requestRes, { status: "invalid" }];
|
|
155
|
+
}
|
|
156
|
+
const req = requestRes.value;
|
|
157
|
+
|
|
158
|
+
const doResult = await client._do(req, {
|
|
159
|
+
context,
|
|
160
|
+
errorCodes: [
|
|
161
|
+
"400",
|
|
162
|
+
"401",
|
|
163
|
+
"403",
|
|
164
|
+
"404",
|
|
165
|
+
"409",
|
|
166
|
+
"410",
|
|
167
|
+
"422",
|
|
168
|
+
"429",
|
|
169
|
+
"4XX",
|
|
170
|
+
"500",
|
|
171
|
+
"502",
|
|
172
|
+
"503",
|
|
173
|
+
"5XX",
|
|
174
|
+
],
|
|
175
|
+
retryConfig: context.retryConfig,
|
|
176
|
+
retryCodes: context.retryCodes,
|
|
177
|
+
});
|
|
178
|
+
if (!doResult.ok) {
|
|
179
|
+
return [doResult, { status: "request-error", request: req }];
|
|
180
|
+
}
|
|
181
|
+
const response = doResult.value;
|
|
182
|
+
|
|
183
|
+
const responseFields = {
|
|
184
|
+
HttpMeta: { Response: response, Request: req },
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const [result] = await M.match<
|
|
188
|
+
operations.CancelChainResponse,
|
|
189
|
+
| errors.BadRequestError
|
|
190
|
+
| errors.UnauthorizedError
|
|
191
|
+
| errors.ForbiddenError
|
|
192
|
+
| errors.NotFoundError
|
|
193
|
+
| errors.ConflictError
|
|
194
|
+
| errors.GoneError
|
|
195
|
+
| errors.UnprocessableEntityError
|
|
196
|
+
| errors.TooManyRequestsError
|
|
197
|
+
| errors.InternalServerError
|
|
198
|
+
| errors.BadGatewayError
|
|
199
|
+
| errors.ServiceUnavailableError
|
|
200
|
+
| BereachError
|
|
201
|
+
| ResponseValidationError
|
|
202
|
+
| ConnectionError
|
|
203
|
+
| RequestAbortedError
|
|
204
|
+
| RequestTimeoutError
|
|
205
|
+
| InvalidRequestError
|
|
206
|
+
| UnexpectedClientError
|
|
207
|
+
| SDKValidationError
|
|
208
|
+
>(
|
|
209
|
+
M.json(200, operations.CancelChainResponse$inboundSchema),
|
|
210
|
+
M.jsonErr(400, errors.BadRequestError$inboundSchema),
|
|
211
|
+
M.jsonErr(401, errors.UnauthorizedError$inboundSchema),
|
|
212
|
+
M.jsonErr(403, errors.ForbiddenError$inboundSchema),
|
|
213
|
+
M.jsonErr(404, errors.NotFoundError$inboundSchema),
|
|
214
|
+
M.jsonErr(409, errors.ConflictError$inboundSchema),
|
|
215
|
+
M.jsonErr(410, errors.GoneError$inboundSchema),
|
|
216
|
+
M.jsonErr(422, errors.UnprocessableEntityError$inboundSchema),
|
|
217
|
+
M.jsonErr(429, errors.TooManyRequestsError$inboundSchema),
|
|
218
|
+
M.jsonErr(500, errors.InternalServerError$inboundSchema),
|
|
219
|
+
M.jsonErr(502, errors.BadGatewayError$inboundSchema),
|
|
220
|
+
M.jsonErr(503, errors.ServiceUnavailableError$inboundSchema),
|
|
221
|
+
M.fail("4XX"),
|
|
222
|
+
M.fail("5XX"),
|
|
223
|
+
)(response, req, { extraFields: responseFields });
|
|
224
|
+
if (!result.ok) {
|
|
225
|
+
return [result, { status: "complete", request: req, response }];
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return [result, { status: "complete", request: req, response }];
|
|
229
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { BereachCore } from "../core.js";
|
|
7
|
+
import { encodeSimple } from "../lib/encodings.js";
|
|
8
|
+
import * as M from "../lib/matchers.js";
|
|
9
|
+
import { compactMap } from "../lib/primitives.js";
|
|
10
|
+
import { safeParse } from "../lib/schemas.js";
|
|
11
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
13
|
+
import { pathToFunc } from "../lib/url.js";
|
|
14
|
+
import { BereachError } from "../models/errors/bereach-error.js";
|
|
15
|
+
import {
|
|
16
|
+
ConnectionError,
|
|
17
|
+
InvalidRequestError,
|
|
18
|
+
RequestAbortedError,
|
|
19
|
+
RequestTimeoutError,
|
|
20
|
+
UnexpectedClientError,
|
|
21
|
+
} from "../models/errors/http-client-errors.js";
|
|
22
|
+
import * as errors from "../models/errors/index.js";
|
|
23
|
+
import { ResponseValidationError } from "../models/errors/response-validation-error.js";
|
|
24
|
+
import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
|
|
25
|
+
import * as operations from "../models/operations/index.js";
|
|
26
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
27
|
+
import { Result } from "../types/fp.js";
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Cancel a task
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Cancel a queued or running task. If already terminal, returns current status. 0 credits.
|
|
34
|
+
*/
|
|
35
|
+
export function tasksCancelTask(
|
|
36
|
+
client: BereachCore,
|
|
37
|
+
request: operations.CancelTaskRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
operations.CancelTaskResponse,
|
|
42
|
+
| errors.BadRequestError
|
|
43
|
+
| errors.UnauthorizedError
|
|
44
|
+
| errors.ForbiddenError
|
|
45
|
+
| errors.NotFoundError
|
|
46
|
+
| errors.ConflictError
|
|
47
|
+
| errors.GoneError
|
|
48
|
+
| errors.UnprocessableEntityError
|
|
49
|
+
| errors.TooManyRequestsError
|
|
50
|
+
| errors.InternalServerError
|
|
51
|
+
| errors.BadGatewayError
|
|
52
|
+
| errors.ServiceUnavailableError
|
|
53
|
+
| BereachError
|
|
54
|
+
| ResponseValidationError
|
|
55
|
+
| ConnectionError
|
|
56
|
+
| RequestAbortedError
|
|
57
|
+
| RequestTimeoutError
|
|
58
|
+
| InvalidRequestError
|
|
59
|
+
| UnexpectedClientError
|
|
60
|
+
| SDKValidationError
|
|
61
|
+
>
|
|
62
|
+
> {
|
|
63
|
+
return new APIPromise($do(
|
|
64
|
+
client,
|
|
65
|
+
request,
|
|
66
|
+
options,
|
|
67
|
+
));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
async function $do(
|
|
71
|
+
client: BereachCore,
|
|
72
|
+
request: operations.CancelTaskRequest,
|
|
73
|
+
options?: RequestOptions,
|
|
74
|
+
): Promise<
|
|
75
|
+
[
|
|
76
|
+
Result<
|
|
77
|
+
operations.CancelTaskResponse,
|
|
78
|
+
| errors.BadRequestError
|
|
79
|
+
| errors.UnauthorizedError
|
|
80
|
+
| errors.ForbiddenError
|
|
81
|
+
| errors.NotFoundError
|
|
82
|
+
| errors.ConflictError
|
|
83
|
+
| errors.GoneError
|
|
84
|
+
| errors.UnprocessableEntityError
|
|
85
|
+
| errors.TooManyRequestsError
|
|
86
|
+
| errors.InternalServerError
|
|
87
|
+
| errors.BadGatewayError
|
|
88
|
+
| errors.ServiceUnavailableError
|
|
89
|
+
| BereachError
|
|
90
|
+
| ResponseValidationError
|
|
91
|
+
| ConnectionError
|
|
92
|
+
| RequestAbortedError
|
|
93
|
+
| RequestTimeoutError
|
|
94
|
+
| InvalidRequestError
|
|
95
|
+
| UnexpectedClientError
|
|
96
|
+
| SDKValidationError
|
|
97
|
+
>,
|
|
98
|
+
APICall,
|
|
99
|
+
]
|
|
100
|
+
> {
|
|
101
|
+
const parsed = safeParse(
|
|
102
|
+
request,
|
|
103
|
+
(value) => z.parse(operations.CancelTaskRequest$outboundSchema, value),
|
|
104
|
+
"Input validation failed",
|
|
105
|
+
);
|
|
106
|
+
if (!parsed.ok) {
|
|
107
|
+
return [parsed, { status: "invalid" }];
|
|
108
|
+
}
|
|
109
|
+
const payload = parsed.value;
|
|
110
|
+
const body = null;
|
|
111
|
+
|
|
112
|
+
const pathParams = {
|
|
113
|
+
id: encodeSimple("id", payload.id, {
|
|
114
|
+
explode: false,
|
|
115
|
+
charEncoding: "percent",
|
|
116
|
+
}),
|
|
117
|
+
};
|
|
118
|
+
const path = pathToFunc("/tasks/{id}/cancel")(pathParams);
|
|
119
|
+
|
|
120
|
+
const headers = new Headers(compactMap({
|
|
121
|
+
Accept: "application/json",
|
|
122
|
+
}));
|
|
123
|
+
|
|
124
|
+
const secConfig = await extractSecurity(client._options.token);
|
|
125
|
+
const securityInput = secConfig == null ? {} : { token: secConfig };
|
|
126
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
127
|
+
|
|
128
|
+
const context = {
|
|
129
|
+
options: client._options,
|
|
130
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
131
|
+
operationID: "cancelTask",
|
|
132
|
+
oAuth2Scopes: null,
|
|
133
|
+
|
|
134
|
+
resolvedSecurity: requestSecurity,
|
|
135
|
+
|
|
136
|
+
securitySource: client._options.token,
|
|
137
|
+
retryConfig: options?.retries
|
|
138
|
+
|| client._options.retryConfig
|
|
139
|
+
|| { strategy: "none" },
|
|
140
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
const requestRes = client._createRequest(context, {
|
|
144
|
+
security: requestSecurity,
|
|
145
|
+
method: "POST",
|
|
146
|
+
baseURL: options?.serverURL,
|
|
147
|
+
path: path,
|
|
148
|
+
headers: headers,
|
|
149
|
+
body: body,
|
|
150
|
+
userAgent: client._options.userAgent,
|
|
151
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
152
|
+
}, options);
|
|
153
|
+
if (!requestRes.ok) {
|
|
154
|
+
return [requestRes, { status: "invalid" }];
|
|
155
|
+
}
|
|
156
|
+
const req = requestRes.value;
|
|
157
|
+
|
|
158
|
+
const doResult = await client._do(req, {
|
|
159
|
+
context,
|
|
160
|
+
errorCodes: [
|
|
161
|
+
"400",
|
|
162
|
+
"401",
|
|
163
|
+
"403",
|
|
164
|
+
"404",
|
|
165
|
+
"409",
|
|
166
|
+
"410",
|
|
167
|
+
"422",
|
|
168
|
+
"429",
|
|
169
|
+
"4XX",
|
|
170
|
+
"500",
|
|
171
|
+
"502",
|
|
172
|
+
"503",
|
|
173
|
+
"5XX",
|
|
174
|
+
],
|
|
175
|
+
retryConfig: context.retryConfig,
|
|
176
|
+
retryCodes: context.retryCodes,
|
|
177
|
+
});
|
|
178
|
+
if (!doResult.ok) {
|
|
179
|
+
return [doResult, { status: "request-error", request: req }];
|
|
180
|
+
}
|
|
181
|
+
const response = doResult.value;
|
|
182
|
+
|
|
183
|
+
const responseFields = {
|
|
184
|
+
HttpMeta: { Response: response, Request: req },
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const [result] = await M.match<
|
|
188
|
+
operations.CancelTaskResponse,
|
|
189
|
+
| errors.BadRequestError
|
|
190
|
+
| errors.UnauthorizedError
|
|
191
|
+
| errors.ForbiddenError
|
|
192
|
+
| errors.NotFoundError
|
|
193
|
+
| errors.ConflictError
|
|
194
|
+
| errors.GoneError
|
|
195
|
+
| errors.UnprocessableEntityError
|
|
196
|
+
| errors.TooManyRequestsError
|
|
197
|
+
| errors.InternalServerError
|
|
198
|
+
| errors.BadGatewayError
|
|
199
|
+
| errors.ServiceUnavailableError
|
|
200
|
+
| BereachError
|
|
201
|
+
| ResponseValidationError
|
|
202
|
+
| ConnectionError
|
|
203
|
+
| RequestAbortedError
|
|
204
|
+
| RequestTimeoutError
|
|
205
|
+
| InvalidRequestError
|
|
206
|
+
| UnexpectedClientError
|
|
207
|
+
| SDKValidationError
|
|
208
|
+
>(
|
|
209
|
+
M.json(200, operations.CancelTaskResponse$inboundSchema),
|
|
210
|
+
M.jsonErr(400, errors.BadRequestError$inboundSchema),
|
|
211
|
+
M.jsonErr(401, errors.UnauthorizedError$inboundSchema),
|
|
212
|
+
M.jsonErr(403, errors.ForbiddenError$inboundSchema),
|
|
213
|
+
M.jsonErr(404, errors.NotFoundError$inboundSchema),
|
|
214
|
+
M.jsonErr(409, errors.ConflictError$inboundSchema),
|
|
215
|
+
M.jsonErr(410, errors.GoneError$inboundSchema),
|
|
216
|
+
M.jsonErr(422, errors.UnprocessableEntityError$inboundSchema),
|
|
217
|
+
M.jsonErr(429, errors.TooManyRequestsError$inboundSchema),
|
|
218
|
+
M.jsonErr(500, errors.InternalServerError$inboundSchema),
|
|
219
|
+
M.jsonErr(502, errors.BadGatewayError$inboundSchema),
|
|
220
|
+
M.jsonErr(503, errors.ServiceUnavailableError$inboundSchema),
|
|
221
|
+
M.fail("4XX"),
|
|
222
|
+
M.fail("5XX"),
|
|
223
|
+
)(response, req, { extraFields: responseFields });
|
|
224
|
+
if (!result.ok) {
|
|
225
|
+
return [result, { status: "complete", request: req, response }];
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
return [result, { status: "complete", request: req, response }];
|
|
229
|
+
}
|