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,231 @@
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, 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
+ * Submit task result (connector)
31
+ *
32
+ * @remarks
33
+ * Called by the connector or OpenClaw lifecycle hook to submit a task's result. Updates the task record and notifies the workflow chain to continue.
34
+ */
35
+ export function connectorsSubmitTaskResult(
36
+ client: BereachCore,
37
+ request: operations.SubmitTaskResultRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ operations.SubmitTaskResultResponse,
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.SubmitTaskResultRequest,
73
+ options?: RequestOptions,
74
+ ): Promise<
75
+ [
76
+ Result<
77
+ operations.SubmitTaskResultResponse,
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.SubmitTaskResultRequest$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.body, { explode: true });
112
+
113
+ const pathParams = {
114
+ id: encodeSimple("id", payload.id, {
115
+ explode: false,
116
+ charEncoding: "percent",
117
+ }),
118
+ };
119
+ const path = pathToFunc("/tasks/{id}/result")(pathParams);
120
+
121
+ const headers = new Headers(compactMap({
122
+ "Content-Type": "application/json",
123
+ Accept: "application/json",
124
+ }));
125
+
126
+ const secConfig = await extractSecurity(client._options.token);
127
+ const securityInput = secConfig == null ? {} : { token: secConfig };
128
+ const requestSecurity = resolveGlobalSecurity(securityInput);
129
+
130
+ const context = {
131
+ options: client._options,
132
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
133
+ operationID: "submitTaskResult",
134
+ oAuth2Scopes: null,
135
+
136
+ resolvedSecurity: requestSecurity,
137
+
138
+ securitySource: client._options.token,
139
+ retryConfig: options?.retries
140
+ || client._options.retryConfig
141
+ || { strategy: "none" },
142
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
143
+ };
144
+
145
+ const requestRes = client._createRequest(context, {
146
+ security: requestSecurity,
147
+ method: "POST",
148
+ baseURL: options?.serverURL,
149
+ path: path,
150
+ headers: headers,
151
+ body: body,
152
+ userAgent: client._options.userAgent,
153
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
154
+ }, options);
155
+ if (!requestRes.ok) {
156
+ return [requestRes, { status: "invalid" }];
157
+ }
158
+ const req = requestRes.value;
159
+
160
+ const doResult = await client._do(req, {
161
+ context,
162
+ errorCodes: [
163
+ "400",
164
+ "401",
165
+ "403",
166
+ "404",
167
+ "409",
168
+ "410",
169
+ "422",
170
+ "429",
171
+ "4XX",
172
+ "500",
173
+ "502",
174
+ "503",
175
+ "5XX",
176
+ ],
177
+ retryConfig: context.retryConfig,
178
+ retryCodes: context.retryCodes,
179
+ });
180
+ if (!doResult.ok) {
181
+ return [doResult, { status: "request-error", request: req }];
182
+ }
183
+ const response = doResult.value;
184
+
185
+ const responseFields = {
186
+ HttpMeta: { Response: response, Request: req },
187
+ };
188
+
189
+ const [result] = await M.match<
190
+ operations.SubmitTaskResultResponse,
191
+ | errors.BadRequestError
192
+ | errors.UnauthorizedError
193
+ | errors.ForbiddenError
194
+ | errors.NotFoundError
195
+ | errors.ConflictError
196
+ | errors.GoneError
197
+ | errors.UnprocessableEntityError
198
+ | errors.TooManyRequestsError
199
+ | errors.InternalServerError
200
+ | errors.BadGatewayError
201
+ | errors.ServiceUnavailableError
202
+ | BereachError
203
+ | ResponseValidationError
204
+ | ConnectionError
205
+ | RequestAbortedError
206
+ | RequestTimeoutError
207
+ | InvalidRequestError
208
+ | UnexpectedClientError
209
+ | SDKValidationError
210
+ >(
211
+ M.json(200, operations.SubmitTaskResultResponse$inboundSchema),
212
+ M.jsonErr(400, errors.BadRequestError$inboundSchema),
213
+ M.jsonErr(401, errors.UnauthorizedError$inboundSchema),
214
+ M.jsonErr(403, errors.ForbiddenError$inboundSchema),
215
+ M.jsonErr(404, errors.NotFoundError$inboundSchema),
216
+ M.jsonErr(409, errors.ConflictError$inboundSchema),
217
+ M.jsonErr(410, errors.GoneError$inboundSchema),
218
+ M.jsonErr(422, errors.UnprocessableEntityError$inboundSchema),
219
+ M.jsonErr(429, errors.TooManyRequestsError$inboundSchema),
220
+ M.jsonErr(500, errors.InternalServerError$inboundSchema),
221
+ M.jsonErr(502, errors.BadGatewayError$inboundSchema),
222
+ M.jsonErr(503, errors.ServiceUnavailableError$inboundSchema),
223
+ M.fail("4XX"),
224
+ M.fail("5XX"),
225
+ )(response, req, { extraFields: responseFields });
226
+ if (!result.ok) {
227
+ return [result, { status: "complete", request: req, response }];
228
+ }
229
+
230
+ return [result, { status: "complete", request: req, response }];
231
+ }
@@ -0,0 +1,237 @@
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 { encodeFormQuery } 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
+ * Global activity log
31
+ *
32
+ * @remarks
33
+ * Returns activities across all contacts for the authenticated user, most recent first. Supports filtering by type, campaign, and date range. 0 credits.
34
+ */
35
+ export function contactsGlobalActivities(
36
+ client: BereachCore,
37
+ request?: operations.GlobalActivitiesRequest | undefined,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ operations.GlobalActivitiesResponse,
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.GlobalActivitiesRequest | undefined,
73
+ options?: RequestOptions,
74
+ ): Promise<
75
+ [
76
+ Result<
77
+ operations.GlobalActivitiesResponse,
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(
105
+ z.optional(operations.GlobalActivitiesRequest$outboundSchema),
106
+ value,
107
+ ),
108
+ "Input validation failed",
109
+ );
110
+ if (!parsed.ok) {
111
+ return [parsed, { status: "invalid" }];
112
+ }
113
+ const payload = parsed.value;
114
+ const body = null;
115
+
116
+ const path = pathToFunc("/activities")();
117
+
118
+ const query = encodeFormQuery({
119
+ "campaignId": payload?.campaignId,
120
+ "from": payload?.from,
121
+ "limit": payload?.limit,
122
+ "offset": payload?.offset,
123
+ "to": payload?.to,
124
+ "type": payload?.type,
125
+ });
126
+
127
+ const headers = new Headers(compactMap({
128
+ Accept: "application/json",
129
+ }));
130
+
131
+ const secConfig = await extractSecurity(client._options.token);
132
+ const securityInput = secConfig == null ? {} : { token: secConfig };
133
+ const requestSecurity = resolveGlobalSecurity(securityInput);
134
+
135
+ const context = {
136
+ options: client._options,
137
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
138
+ operationID: "globalActivities",
139
+ oAuth2Scopes: null,
140
+
141
+ resolvedSecurity: requestSecurity,
142
+
143
+ securitySource: client._options.token,
144
+ retryConfig: options?.retries
145
+ || client._options.retryConfig
146
+ || { strategy: "none" },
147
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
148
+ };
149
+
150
+ const requestRes = client._createRequest(context, {
151
+ security: requestSecurity,
152
+ method: "GET",
153
+ baseURL: options?.serverURL,
154
+ path: path,
155
+ headers: headers,
156
+ query: query,
157
+ body: body,
158
+ userAgent: client._options.userAgent,
159
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
160
+ }, options);
161
+ if (!requestRes.ok) {
162
+ return [requestRes, { status: "invalid" }];
163
+ }
164
+ const req = requestRes.value;
165
+
166
+ const doResult = await client._do(req, {
167
+ context,
168
+ errorCodes: [
169
+ "400",
170
+ "401",
171
+ "403",
172
+ "404",
173
+ "409",
174
+ "410",
175
+ "422",
176
+ "429",
177
+ "4XX",
178
+ "500",
179
+ "502",
180
+ "503",
181
+ "5XX",
182
+ ],
183
+ retryConfig: context.retryConfig,
184
+ retryCodes: context.retryCodes,
185
+ });
186
+ if (!doResult.ok) {
187
+ return [doResult, { status: "request-error", request: req }];
188
+ }
189
+ const response = doResult.value;
190
+
191
+ const responseFields = {
192
+ HttpMeta: { Response: response, Request: req },
193
+ };
194
+
195
+ const [result] = await M.match<
196
+ operations.GlobalActivitiesResponse,
197
+ | errors.BadRequestError
198
+ | errors.UnauthorizedError
199
+ | errors.ForbiddenError
200
+ | errors.NotFoundError
201
+ | errors.ConflictError
202
+ | errors.GoneError
203
+ | errors.UnprocessableEntityError
204
+ | errors.TooManyRequestsError
205
+ | errors.InternalServerError
206
+ | errors.BadGatewayError
207
+ | errors.ServiceUnavailableError
208
+ | BereachError
209
+ | ResponseValidationError
210
+ | ConnectionError
211
+ | RequestAbortedError
212
+ | RequestTimeoutError
213
+ | InvalidRequestError
214
+ | UnexpectedClientError
215
+ | SDKValidationError
216
+ >(
217
+ M.json(200, operations.GlobalActivitiesResponse$inboundSchema),
218
+ M.jsonErr(400, errors.BadRequestError$inboundSchema),
219
+ M.jsonErr(401, errors.UnauthorizedError$inboundSchema),
220
+ M.jsonErr(403, errors.ForbiddenError$inboundSchema),
221
+ M.jsonErr(404, errors.NotFoundError$inboundSchema),
222
+ M.jsonErr(409, errors.ConflictError$inboundSchema),
223
+ M.jsonErr(410, errors.GoneError$inboundSchema),
224
+ M.jsonErr(422, errors.UnprocessableEntityError$inboundSchema),
225
+ M.jsonErr(429, errors.TooManyRequestsError$inboundSchema),
226
+ M.jsonErr(500, errors.InternalServerError$inboundSchema),
227
+ M.jsonErr(502, errors.BadGatewayError$inboundSchema),
228
+ M.jsonErr(503, errors.ServiceUnavailableError$inboundSchema),
229
+ M.fail("4XX"),
230
+ M.fail("5XX"),
231
+ )(response, req, { extraFields: responseFields });
232
+ if (!result.ok) {
233
+ return [result, { status: "complete", request: req, response }];
234
+ }
235
+
236
+ return [result, { status: "complete", request: req, response }];
237
+ }
@@ -0,0 +1,230 @@
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
+ * Create API token
31
+ *
32
+ * @remarks
33
+ * Generate a new API token scoped to a specific LinkedIn account. Only one token per account allowed.
34
+ */
35
+ export function profileCreateApiToken(
36
+ client: BereachCore,
37
+ request?: operations.CreateApiTokenRequest | undefined,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ operations.CreateApiTokenResponse,
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.CreateApiTokenRequest | undefined,
73
+ options?: RequestOptions,
74
+ ): Promise<
75
+ [
76
+ Result<
77
+ operations.CreateApiTokenResponse,
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(
105
+ z.optional(operations.CreateApiTokenRequest$outboundSchema),
106
+ value,
107
+ ),
108
+ "Input validation failed",
109
+ );
110
+ if (!parsed.ok) {
111
+ return [parsed, { status: "invalid" }];
112
+ }
113
+ const payload = parsed.value;
114
+ const body = payload === undefined
115
+ ? null
116
+ : encodeJSON("body", payload, { explode: true });
117
+
118
+ const path = pathToFunc("/api-token")();
119
+
120
+ const headers = new Headers(compactMap({
121
+ "Content-Type": "application/json",
122
+ Accept: "application/json",
123
+ }));
124
+
125
+ const secConfig = await extractSecurity(client._options.token);
126
+ const securityInput = secConfig == null ? {} : { token: secConfig };
127
+ const requestSecurity = resolveGlobalSecurity(securityInput);
128
+
129
+ const context = {
130
+ options: client._options,
131
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
132
+ operationID: "createApiToken",
133
+ oAuth2Scopes: null,
134
+
135
+ resolvedSecurity: requestSecurity,
136
+
137
+ securitySource: client._options.token,
138
+ retryConfig: options?.retries
139
+ || client._options.retryConfig
140
+ || { strategy: "none" },
141
+ retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
142
+ };
143
+
144
+ const requestRes = client._createRequest(context, {
145
+ security: requestSecurity,
146
+ method: "POST",
147
+ baseURL: options?.serverURL,
148
+ path: path,
149
+ headers: headers,
150
+ body: body,
151
+ userAgent: client._options.userAgent,
152
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
153
+ }, options);
154
+ if (!requestRes.ok) {
155
+ return [requestRes, { status: "invalid" }];
156
+ }
157
+ const req = requestRes.value;
158
+
159
+ const doResult = await client._do(req, {
160
+ context,
161
+ errorCodes: [
162
+ "400",
163
+ "401",
164
+ "403",
165
+ "404",
166
+ "409",
167
+ "410",
168
+ "422",
169
+ "429",
170
+ "4XX",
171
+ "500",
172
+ "502",
173
+ "503",
174
+ "5XX",
175
+ ],
176
+ retryConfig: context.retryConfig,
177
+ retryCodes: context.retryCodes,
178
+ });
179
+ if (!doResult.ok) {
180
+ return [doResult, { status: "request-error", request: req }];
181
+ }
182
+ const response = doResult.value;
183
+
184
+ const responseFields = {
185
+ HttpMeta: { Response: response, Request: req },
186
+ };
187
+
188
+ const [result] = await M.match<
189
+ operations.CreateApiTokenResponse,
190
+ | errors.BadRequestError
191
+ | errors.UnauthorizedError
192
+ | errors.ForbiddenError
193
+ | errors.NotFoundError
194
+ | errors.ConflictError
195
+ | errors.GoneError
196
+ | errors.UnprocessableEntityError
197
+ | errors.TooManyRequestsError
198
+ | errors.InternalServerError
199
+ | errors.BadGatewayError
200
+ | errors.ServiceUnavailableError
201
+ | BereachError
202
+ | ResponseValidationError
203
+ | ConnectionError
204
+ | RequestAbortedError
205
+ | RequestTimeoutError
206
+ | InvalidRequestError
207
+ | UnexpectedClientError
208
+ | SDKValidationError
209
+ >(
210
+ M.json(200, operations.CreateApiTokenResponse$inboundSchema),
211
+ M.jsonErr(400, errors.BadRequestError$inboundSchema),
212
+ M.jsonErr(401, errors.UnauthorizedError$inboundSchema),
213
+ M.jsonErr(403, errors.ForbiddenError$inboundSchema),
214
+ M.jsonErr(404, errors.NotFoundError$inboundSchema),
215
+ M.jsonErr(409, errors.ConflictError$inboundSchema),
216
+ M.jsonErr(410, errors.GoneError$inboundSchema),
217
+ M.jsonErr(422, errors.UnprocessableEntityError$inboundSchema),
218
+ M.jsonErr(429, errors.TooManyRequestsError$inboundSchema),
219
+ M.jsonErr(500, errors.InternalServerError$inboundSchema),
220
+ M.jsonErr(502, errors.BadGatewayError$inboundSchema),
221
+ M.jsonErr(503, errors.ServiceUnavailableError$inboundSchema),
222
+ M.fail("4XX"),
223
+ M.fail("5XX"),
224
+ )(response, req, { extraFields: responseFields });
225
+ if (!result.ok) {
226
+ return [result, { status: "complete", request: req, response }];
227
+ }
228
+
229
+ return [result, { status: "complete", request: req, response }];
230
+ }