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.
Files changed (288) hide show
  1. package/README.md +71 -5
  2. package/esm/funcs/actions-connect-profile.d.ts +1 -1
  3. package/esm/funcs/actions-connect-profile.js +1 -1
  4. package/esm/funcs/actions-edit-profile.d.ts +18 -0
  5. package/esm/funcs/actions-edit-profile.d.ts.map +1 -0
  6. package/esm/funcs/actions-edit-profile.js +97 -0
  7. package/esm/funcs/actions-edit-profile.js.map +1 -0
  8. package/esm/funcs/chat-get-conversation-summary.d.ts +18 -0
  9. package/esm/funcs/chat-get-conversation-summary.d.ts.map +1 -0
  10. package/esm/funcs/chat-get-conversation-summary.js +100 -0
  11. package/esm/funcs/chat-get-conversation-summary.js.map +1 -0
  12. package/esm/funcs/chat-list-inbox.d.ts +1 -1
  13. package/esm/funcs/chat-list-inbox.js +1 -1
  14. package/esm/funcs/chat-save-conversation-summary.d.ts +18 -0
  15. package/esm/funcs/chat-save-conversation-summary.d.ts.map +1 -0
  16. package/esm/funcs/chat-save-conversation-summary.js +97 -0
  17. package/esm/funcs/chat-save-conversation-summary.js.map +1 -0
  18. package/esm/funcs/company-pages-get-analytics.d.ts +1 -1
  19. package/esm/funcs/company-pages-get-analytics.js +1 -1
  20. package/esm/funcs/connectors-agent-snapshot.d.ts +18 -0
  21. package/esm/funcs/connectors-agent-snapshot.d.ts.map +1 -0
  22. package/esm/funcs/connectors-agent-snapshot.js +86 -0
  23. package/esm/funcs/connectors-agent-snapshot.js.map +1 -0
  24. package/esm/funcs/connectors-connector-heartbeat.d.ts +18 -0
  25. package/esm/funcs/connectors-connector-heartbeat.d.ts.map +1 -0
  26. package/esm/funcs/connectors-connector-heartbeat.js +99 -0
  27. package/esm/funcs/connectors-connector-heartbeat.js.map +1 -0
  28. package/esm/funcs/connectors-list-connectors.d.ts +18 -0
  29. package/esm/funcs/connectors-list-connectors.d.ts.map +1 -0
  30. package/esm/funcs/connectors-list-connectors.js +86 -0
  31. package/esm/funcs/connectors-list-connectors.js.map +1 -0
  32. package/esm/funcs/connectors-pull-task.d.ts +18 -0
  33. package/esm/funcs/connectors-pull-task.d.ts.map +1 -0
  34. package/esm/funcs/connectors-pull-task.js +86 -0
  35. package/esm/funcs/connectors-pull-task.js.map +1 -0
  36. package/esm/funcs/connectors-submit-task-result.d.ts +18 -0
  37. package/esm/funcs/connectors-submit-task-result.d.ts.map +1 -0
  38. package/esm/funcs/connectors-submit-task-result.js +103 -0
  39. package/esm/funcs/connectors-submit-task-result.js.map +1 -0
  40. package/esm/funcs/contacts-global-activities.d.ts +18 -0
  41. package/esm/funcs/contacts-global-activities.d.ts.map +1 -0
  42. package/esm/funcs/contacts-global-activities.js +105 -0
  43. package/esm/funcs/contacts-global-activities.js.map +1 -0
  44. package/esm/funcs/profile-create-api-token.d.ts +18 -0
  45. package/esm/funcs/profile-create-api-token.d.ts.map +1 -0
  46. package/esm/funcs/profile-create-api-token.js +99 -0
  47. package/esm/funcs/profile-create-api-token.js.map +1 -0
  48. package/esm/funcs/profile-delete-api-token.d.ts +18 -0
  49. package/esm/funcs/profile-delete-api-token.d.ts.map +1 -0
  50. package/esm/funcs/profile-delete-api-token.js +99 -0
  51. package/esm/funcs/profile-delete-api-token.js.map +1 -0
  52. package/esm/funcs/profile-get-api-token.d.ts +18 -0
  53. package/esm/funcs/profile-get-api-token.d.ts.map +1 -0
  54. package/esm/funcs/profile-get-api-token.js +100 -0
  55. package/esm/funcs/profile-get-api-token.js.map +1 -0
  56. package/esm/funcs/profile-get-my-activity.d.ts +18 -0
  57. package/esm/funcs/profile-get-my-activity.d.ts.map +1 -0
  58. package/esm/funcs/profile-get-my-activity.js +104 -0
  59. package/esm/funcs/profile-get-my-activity.js.map +1 -0
  60. package/esm/funcs/profile-get-settings.d.ts +18 -0
  61. package/esm/funcs/profile-get-settings.d.ts.map +1 -0
  62. package/esm/funcs/profile-get-settings.js +86 -0
  63. package/esm/funcs/profile-get-settings.js.map +1 -0
  64. package/esm/funcs/profile-patch-settings.d.ts +18 -0
  65. package/esm/funcs/profile-patch-settings.d.ts.map +1 -0
  66. package/esm/funcs/profile-patch-settings.js +97 -0
  67. package/esm/funcs/profile-patch-settings.js.map +1 -0
  68. package/esm/funcs/profile-revalidate-linkedin.d.ts +18 -0
  69. package/esm/funcs/profile-revalidate-linkedin.d.ts.map +1 -0
  70. package/esm/funcs/profile-revalidate-linkedin.js +86 -0
  71. package/esm/funcs/profile-revalidate-linkedin.js.map +1 -0
  72. package/esm/funcs/sales-nav-search.d.ts +1 -1
  73. package/esm/funcs/sales-nav-search.js +1 -1
  74. package/esm/funcs/scheduled-messages-review-drafts.d.ts +18 -0
  75. package/esm/funcs/scheduled-messages-review-drafts.d.ts.map +1 -0
  76. package/esm/funcs/scheduled-messages-review-drafts.js +97 -0
  77. package/esm/funcs/scheduled-messages-review-drafts.js.map +1 -0
  78. package/esm/funcs/scrapers-collect-comment-replies.d.ts +1 -1
  79. package/esm/funcs/scrapers-collect-comment-replies.js +1 -1
  80. package/esm/funcs/scrapers-collect-comments.d.ts +1 -1
  81. package/esm/funcs/scrapers-collect-comments.js +1 -1
  82. package/esm/funcs/scrapers-collect-likes.d.ts +1 -1
  83. package/esm/funcs/scrapers-collect-likes.js +1 -1
  84. package/esm/funcs/scrapers-visit-profile.d.ts +2 -0
  85. package/esm/funcs/scrapers-visit-profile.d.ts.map +1 -1
  86. package/esm/funcs/scrapers-visit-profile.js +2 -0
  87. package/esm/funcs/scrapers-visit-profile.js.map +1 -1
  88. package/esm/funcs/search-people.d.ts +2 -2
  89. package/esm/funcs/search-people.js +2 -2
  90. package/esm/funcs/search-search.d.ts +1 -1
  91. package/esm/funcs/search-search.js +1 -1
  92. package/esm/funcs/settings-get-dm-polling-settings.d.ts +18 -0
  93. package/esm/funcs/settings-get-dm-polling-settings.d.ts.map +1 -0
  94. package/esm/funcs/settings-get-dm-polling-settings.js +86 -0
  95. package/esm/funcs/settings-get-dm-polling-settings.js.map +1 -0
  96. package/esm/funcs/settings-patch-dm-polling-settings.d.ts +18 -0
  97. package/esm/funcs/settings-patch-dm-polling-settings.d.ts.map +1 -0
  98. package/esm/funcs/settings-patch-dm-polling-settings.js +97 -0
  99. package/esm/funcs/settings-patch-dm-polling-settings.js.map +1 -0
  100. package/esm/funcs/tasks-cancel-chain.d.ts +18 -0
  101. package/esm/funcs/tasks-cancel-chain.d.ts.map +1 -0
  102. package/esm/funcs/tasks-cancel-chain.js +102 -0
  103. package/esm/funcs/tasks-cancel-chain.js.map +1 -0
  104. package/esm/funcs/tasks-cancel-task.d.ts +18 -0
  105. package/esm/funcs/tasks-cancel-task.d.ts.map +1 -0
  106. package/esm/funcs/tasks-cancel-task.js +102 -0
  107. package/esm/funcs/tasks-cancel-task.js.map +1 -0
  108. package/esm/funcs/tasks-events-feed.d.ts +18 -0
  109. package/esm/funcs/tasks-events-feed.d.ts.map +1 -0
  110. package/esm/funcs/tasks-events-feed.js +101 -0
  111. package/esm/funcs/tasks-events-feed.js.map +1 -0
  112. package/esm/funcs/tasks-list-tasks.d.ts +18 -0
  113. package/esm/funcs/tasks-list-tasks.d.ts.map +1 -0
  114. package/esm/funcs/tasks-list-tasks.js +104 -0
  115. package/esm/funcs/tasks-list-tasks.js.map +1 -0
  116. package/esm/funcs/workspace-create-workspace-invite.d.ts +18 -0
  117. package/esm/funcs/workspace-create-workspace-invite.d.ts.map +1 -0
  118. package/esm/funcs/workspace-create-workspace-invite.js +97 -0
  119. package/esm/funcs/workspace-create-workspace-invite.js.map +1 -0
  120. package/esm/funcs/workspace-delete-workspace-account.d.ts +18 -0
  121. package/esm/funcs/workspace-delete-workspace-account.d.ts.map +1 -0
  122. package/esm/funcs/workspace-delete-workspace-account.js +102 -0
  123. package/esm/funcs/workspace-delete-workspace-account.js.map +1 -0
  124. package/esm/funcs/workspace-delete-workspace-invite.d.ts +18 -0
  125. package/esm/funcs/workspace-delete-workspace-invite.d.ts.map +1 -0
  126. package/esm/funcs/workspace-delete-workspace-invite.js +97 -0
  127. package/esm/funcs/workspace-delete-workspace-invite.js.map +1 -0
  128. package/esm/funcs/workspace-upgrade-workspace-account.d.ts +18 -0
  129. package/esm/funcs/workspace-upgrade-workspace-account.d.ts.map +1 -0
  130. package/esm/funcs/workspace-upgrade-workspace-account.js +97 -0
  131. package/esm/funcs/workspace-upgrade-workspace-account.js.map +1 -0
  132. package/esm/hooks/hooks.d.ts.map +1 -1
  133. package/esm/hooks/hooks.js +0 -2
  134. package/esm/hooks/hooks.js.map +1 -1
  135. package/esm/lib/config.d.ts +5 -5
  136. package/esm/lib/config.d.ts.map +1 -1
  137. package/esm/lib/config.js +6 -6
  138. package/esm/lib/config.js.map +1 -1
  139. package/esm/lib/encodings.d.ts.map +1 -1
  140. package/esm/lib/encodings.js +20 -5
  141. package/esm/lib/encodings.js.map +1 -1
  142. package/esm/lib/security.d.ts +1 -1
  143. package/esm/lib/security.d.ts.map +1 -1
  144. package/esm/lib/security.js +19 -8
  145. package/esm/lib/security.js.map +1 -1
  146. package/esm/models/operations/{search-contacts-campaign.d.ts → archive-response.d.ts} +1174 -1151
  147. package/esm/models/operations/archive-response.d.ts.map +1 -0
  148. package/esm/models/operations/{search-contacts-campaign.js → archive-response.js} +456 -461
  149. package/esm/models/operations/archive-response.js.map +1 -0
  150. package/esm/models/operations/delete-workspace-invite-response.d.ts +1374 -0
  151. package/esm/models/operations/delete-workspace-invite-response.d.ts.map +1 -0
  152. package/esm/models/operations/delete-workspace-invite-response.js +901 -0
  153. package/esm/models/operations/delete-workspace-invite-response.js.map +1 -0
  154. package/esm/models/operations/{update-schedule-response.d.ts → get-by-url-campaign.d.ts} +1629 -1291
  155. package/esm/models/operations/get-by-url-campaign.d.ts.map +1 -0
  156. package/esm/models/operations/{update-schedule-response.js → get-by-url-campaign.js} +534 -341
  157. package/esm/models/operations/get-by-url-campaign.js.map +1 -0
  158. package/esm/models/operations/index.d.ts +4 -3
  159. package/esm/models/operations/index.d.ts.map +1 -1
  160. package/esm/models/operations/index.js +4 -3
  161. package/esm/models/operations/index.js.map +1 -1
  162. package/esm/models/operations/search-companies-response.d.ts +45 -12
  163. package/esm/models/operations/search-companies-response.d.ts.map +1 -1
  164. package/esm/models/operations/search-companies-response.js +10 -2
  165. package/esm/models/operations/search-companies-response.js.map +1 -1
  166. package/esm/models/operations/{update-account-response.d.ts → update-account-proxy-config-response.d.ts} +70 -38
  167. package/esm/models/operations/update-account-proxy-config-response.d.ts.map +1 -0
  168. package/esm/models/operations/{update-account-response.js → update-account-proxy-config-response.js} +27 -28
  169. package/esm/models/operations/update-account-proxy-config-response.js.map +1 -0
  170. package/esm/sdk/actions.d.ts +8 -1
  171. package/esm/sdk/actions.d.ts.map +1 -1
  172. package/esm/sdk/actions.js +11 -1
  173. package/esm/sdk/actions.js.map +1 -1
  174. package/esm/sdk/chat.d.ts +15 -1
  175. package/esm/sdk/chat.d.ts.map +1 -1
  176. package/esm/sdk/chat.js +21 -1
  177. package/esm/sdk/chat.js.map +1 -1
  178. package/esm/sdk/company-pages.d.ts +1 -1
  179. package/esm/sdk/company-pages.js +1 -1
  180. package/esm/sdk/connectors.d.ts +40 -0
  181. package/esm/sdk/connectors.d.ts.map +1 -0
  182. package/esm/sdk/connectors.js +58 -0
  183. package/esm/sdk/connectors.js.map +1 -0
  184. package/esm/sdk/contacts.d.ts +7 -0
  185. package/esm/sdk/contacts.d.ts.map +1 -1
  186. package/esm/sdk/contacts.js +10 -0
  187. package/esm/sdk/contacts.js.map +1 -1
  188. package/esm/sdk/profile.d.ts +49 -0
  189. package/esm/sdk/profile.d.ts.map +1 -1
  190. package/esm/sdk/profile.js +70 -0
  191. package/esm/sdk/profile.js.map +1 -1
  192. package/esm/sdk/sales-nav.d.ts +1 -1
  193. package/esm/sdk/sales-nav.js +1 -1
  194. package/esm/sdk/scheduled-messages.d.ts +7 -0
  195. package/esm/sdk/scheduled-messages.d.ts.map +1 -1
  196. package/esm/sdk/scheduled-messages.js +10 -0
  197. package/esm/sdk/scheduled-messages.js.map +1 -1
  198. package/esm/sdk/scrapers.d.ts +5 -3
  199. package/esm/sdk/scrapers.d.ts.map +1 -1
  200. package/esm/sdk/scrapers.js +5 -3
  201. package/esm/sdk/scrapers.js.map +1 -1
  202. package/esm/sdk/sdk.d.ts +12 -0
  203. package/esm/sdk/sdk.d.ts.map +1 -1
  204. package/esm/sdk/sdk.js +20 -0
  205. package/esm/sdk/sdk.js.map +1 -1
  206. package/esm/sdk/search.d.ts +3 -3
  207. package/esm/sdk/search.js +3 -3
  208. package/esm/sdk/settings.d.ts +19 -0
  209. package/esm/sdk/settings.d.ts.map +1 -0
  210. package/esm/sdk/settings.js +28 -0
  211. package/esm/sdk/settings.js.map +1 -0
  212. package/esm/sdk/tasks.d.ts +33 -0
  213. package/esm/sdk/tasks.d.ts.map +1 -0
  214. package/esm/sdk/tasks.js +48 -0
  215. package/esm/sdk/tasks.js.map +1 -0
  216. package/esm/sdk/workspace.d.ts +33 -0
  217. package/esm/sdk/workspace.d.ts.map +1 -0
  218. package/esm/sdk/workspace.js +48 -0
  219. package/esm/sdk/workspace.js.map +1 -0
  220. package/jsr.json +1 -1
  221. package/package.json +1 -1
  222. package/src/funcs/actions-connect-profile.ts +1 -1
  223. package/src/funcs/actions-edit-profile.ts +224 -0
  224. package/src/funcs/chat-get-conversation-summary.ts +229 -0
  225. package/src/funcs/chat-list-inbox.ts +1 -1
  226. package/src/funcs/chat-save-conversation-summary.ts +225 -0
  227. package/src/funcs/company-pages-get-analytics.ts +1 -1
  228. package/src/funcs/connectors-agent-snapshot.ts +205 -0
  229. package/src/funcs/connectors-connector-heartbeat.ts +230 -0
  230. package/src/funcs/connectors-list-connectors.ts +205 -0
  231. package/src/funcs/connectors-pull-task.ts +205 -0
  232. package/src/funcs/connectors-submit-task-result.ts +231 -0
  233. package/src/funcs/contacts-global-activities.ts +237 -0
  234. package/src/funcs/profile-create-api-token.ts +230 -0
  235. package/src/funcs/profile-delete-api-token.ts +230 -0
  236. package/src/funcs/profile-get-api-token.ts +229 -0
  237. package/src/funcs/profile-get-my-activity.ts +236 -0
  238. package/src/funcs/profile-get-settings.ts +205 -0
  239. package/src/funcs/profile-patch-settings.ts +224 -0
  240. package/src/funcs/profile-revalidate-linkedin.ts +205 -0
  241. package/src/funcs/sales-nav-search.ts +1 -1
  242. package/src/funcs/scheduled-messages-review-drafts.ts +224 -0
  243. package/src/funcs/scrapers-collect-comment-replies.ts +1 -1
  244. package/src/funcs/scrapers-collect-comments.ts +1 -1
  245. package/src/funcs/scrapers-collect-likes.ts +1 -1
  246. package/src/funcs/scrapers-visit-profile.ts +2 -0
  247. package/src/funcs/search-people.ts +2 -2
  248. package/src/funcs/search-search.ts +1 -1
  249. package/src/funcs/settings-get-dm-polling-settings.ts +205 -0
  250. package/src/funcs/settings-patch-dm-polling-settings.ts +225 -0
  251. package/src/funcs/tasks-cancel-chain.ts +229 -0
  252. package/src/funcs/tasks-cancel-task.ts +229 -0
  253. package/src/funcs/tasks-events-feed.ts +230 -0
  254. package/src/funcs/tasks-list-tasks.ts +233 -0
  255. package/src/funcs/workspace-create-workspace-invite.ts +225 -0
  256. package/src/funcs/workspace-delete-workspace-account.ts +230 -0
  257. package/src/funcs/workspace-delete-workspace-invite.ts +225 -0
  258. package/src/funcs/workspace-upgrade-workspace-account.ts +225 -0
  259. package/src/hooks/hooks.ts +0 -3
  260. package/src/lib/config.ts +6 -6
  261. package/src/lib/encodings.ts +23 -4
  262. package/src/lib/security.ts +14 -2
  263. package/src/models/operations/{search-contacts-campaign.ts → archive-response.ts} +2503 -2362
  264. package/src/models/operations/delete-workspace-invite-response.ts +2783 -0
  265. package/src/models/operations/{update-schedule-response.ts → get-by-url-campaign.ts} +3591 -2939
  266. package/src/models/operations/index.ts +4 -3
  267. package/src/models/operations/search-companies-response.ts +55 -14
  268. package/src/models/operations/{update-account-response.ts → update-account-proxy-config-response.ts} +112 -84
  269. package/src/sdk/actions.ts +19 -1
  270. package/src/sdk/chat.ts +37 -1
  271. package/src/sdk/company-pages.ts +1 -1
  272. package/src/sdk/connectors.ts +93 -0
  273. package/src/sdk/contacts.ts +18 -0
  274. package/src/sdk/profile.ts +122 -0
  275. package/src/sdk/sales-nav.ts +1 -1
  276. package/src/sdk/scheduled-messages.ts +18 -0
  277. package/src/sdk/scrapers.ts +5 -3
  278. package/src/sdk/sdk.ts +24 -0
  279. package/src/sdk/search.ts +3 -3
  280. package/src/sdk/settings.ts +43 -0
  281. package/src/sdk/tasks.ts +81 -0
  282. package/src/sdk/workspace.ts +81 -0
  283. package/esm/models/operations/search-contacts-campaign.d.ts.map +0 -1
  284. package/esm/models/operations/search-contacts-campaign.js.map +0 -1
  285. package/esm/models/operations/update-account-response.d.ts.map +0 -1
  286. package/esm/models/operations/update-account-response.js.map +0 -1
  287. package/esm/models/operations/update-schedule-response.d.ts.map +0 -1
  288. 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
+ }