@b3os/sdk 0.0.0-stage → 0.0.1

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 (242) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +233 -2
  3. package/dist/cjs/core/client.d.ts +165 -0
  4. package/dist/cjs/core/client.js +825 -0
  5. package/dist/cjs/core/client.js.map +1 -0
  6. package/dist/cjs/core/errors.d.ts +101 -0
  7. package/dist/cjs/core/errors.js +249 -0
  8. package/dist/cjs/core/errors.js.map +1 -0
  9. package/dist/cjs/core/index.d.ts +12 -0
  10. package/dist/cjs/core/index.js +42 -0
  11. package/dist/cjs/core/index.js.map +1 -0
  12. package/dist/cjs/core/jobs.d.ts +31 -0
  13. package/dist/cjs/core/jobs.js +72 -0
  14. package/dist/cjs/core/jobs.js.map +1 -0
  15. package/dist/cjs/core/namespace.d.ts +7 -0
  16. package/dist/cjs/core/namespace.js +13 -0
  17. package/dist/cjs/core/namespace.js.map +1 -0
  18. package/dist/cjs/core/op.d.ts +47 -0
  19. package/dist/cjs/core/op.js +5 -0
  20. package/dist/cjs/core/op.js.map +1 -0
  21. package/dist/cjs/core/promise.d.ts +106 -0
  22. package/dist/cjs/core/promise.js +200 -0
  23. package/dist/cjs/core/promise.js.map +1 -0
  24. package/dist/cjs/core/response.d.ts +54 -0
  25. package/dist/cjs/core/response.js +92 -0
  26. package/dist/cjs/core/response.js.map +1 -0
  27. package/dist/cjs/core/sse.d.ts +79 -0
  28. package/dist/cjs/core/sse.js +291 -0
  29. package/dist/cjs/core/sse.js.map +1 -0
  30. package/dist/cjs/core/timing.d.ts +20 -0
  31. package/dist/cjs/core/timing.js +96 -0
  32. package/dist/cjs/core/timing.js.map +1 -0
  33. package/dist/cjs/core/transport.d.ts +80 -0
  34. package/dist/cjs/core/transport.js +472 -0
  35. package/dist/cjs/core/transport.js.map +1 -0
  36. package/dist/cjs/core/util.d.ts +25 -0
  37. package/dist/cjs/core/util.js +142 -0
  38. package/dist/cjs/core/util.js.map +1 -0
  39. package/dist/cjs/core/ws.d.ts +52 -0
  40. package/dist/cjs/core/ws.js +181 -0
  41. package/dist/cjs/core/ws.js.map +1 -0
  42. package/dist/cjs/generated/client.d.ts +62 -0
  43. package/dist/cjs/generated/client.js +130 -0
  44. package/dist/cjs/generated/client.js.map +1 -0
  45. package/dist/cjs/generated/errors.d.ts +4 -0
  46. package/dist/cjs/generated/errors.js +160 -0
  47. package/dist/cjs/generated/errors.js.map +1 -0
  48. package/dist/cjs/generated/ids.d.ts +114 -0
  49. package/dist/cjs/generated/ids.js +47 -0
  50. package/dist/cjs/generated/ids.js.map +1 -0
  51. package/dist/cjs/generated/jobs.d.ts +10 -0
  52. package/dist/cjs/generated/jobs.js +24 -0
  53. package/dist/cjs/generated/jobs.js.map +1 -0
  54. package/dist/cjs/generated/ns/actions.d.ts +161 -0
  55. package/dist/cjs/generated/ns/actions.js +304 -0
  56. package/dist/cjs/generated/ns/actions.js.map +1 -0
  57. package/dist/cjs/generated/ns/infer.d.ts +190 -0
  58. package/dist/cjs/generated/ns/infer.js +253 -0
  59. package/dist/cjs/generated/ns/infer.js.map +1 -0
  60. package/dist/cjs/generated/ns/keys.d.ts +76 -0
  61. package/dist/cjs/generated/ns/keys.js +144 -0
  62. package/dist/cjs/generated/ns/keys.js.map +1 -0
  63. package/dist/cjs/generated/ns/limits.d.ts +22 -0
  64. package/dist/cjs/generated/ns/limits.js +32 -0
  65. package/dist/cjs/generated/ns/limits.js.map +1 -0
  66. package/dist/cjs/generated/ns/orgs.d.ts +38 -0
  67. package/dist/cjs/generated/ns/orgs.js +68 -0
  68. package/dist/cjs/generated/ns/orgs.js.map +1 -0
  69. package/dist/cjs/generated/ns/projects.d.ts +57 -0
  70. package/dist/cjs/generated/ns/projects.js +115 -0
  71. package/dist/cjs/generated/ns/projects.js.map +1 -0
  72. package/dist/cjs/generated/ns/render.d.ts +159 -0
  73. package/dist/cjs/generated/ns/render.js +299 -0
  74. package/dist/cjs/generated/ns/render.js.map +1 -0
  75. package/dist/cjs/generated/ns/requests.d.ts +36 -0
  76. package/dist/cjs/generated/ns/requests.js +54 -0
  77. package/dist/cjs/generated/ns/requests.js.map +1 -0
  78. package/dist/cjs/generated/ns/routines.d.ts +212 -0
  79. package/dist/cjs/generated/ns/routines.js +419 -0
  80. package/dist/cjs/generated/ns/routines.js.map +1 -0
  81. package/dist/cjs/generated/ns/sandboxes.d.ts +318 -0
  82. package/dist/cjs/generated/ns/sandboxes.js +549 -0
  83. package/dist/cjs/generated/ns/sandboxes.js.map +1 -0
  84. package/dist/cjs/generated/ns/usage.d.ts +30 -0
  85. package/dist/cjs/generated/ns/usage.js +49 -0
  86. package/dist/cjs/generated/ns/usage.js.map +1 -0
  87. package/dist/cjs/generated/ns/vault.d.ts +69 -0
  88. package/dist/cjs/generated/ns/vault.js +122 -0
  89. package/dist/cjs/generated/ns/vault.js.map +1 -0
  90. package/dist/cjs/generated/ns/vision.d.ts +376 -0
  91. package/dist/cjs/generated/ns/vision.js +736 -0
  92. package/dist/cjs/generated/ns/vision.js.map +1 -0
  93. package/dist/cjs/generated/ns/webhooks.d.ts +50 -0
  94. package/dist/cjs/generated/ns/webhooks.js +91 -0
  95. package/dist/cjs/generated/ns/webhooks.js.map +1 -0
  96. package/dist/cjs/generated/types.d.ts +4613 -0
  97. package/dist/cjs/generated/types.js +4 -0
  98. package/dist/cjs/generated/types.js.map +1 -0
  99. package/dist/cjs/index.d.ts +22 -0
  100. package/dist/cjs/index.js +81 -0
  101. package/dist/cjs/index.js.map +1 -0
  102. package/dist/cjs/package.json +3 -0
  103. package/dist/cjs/webhooks.d.ts +19 -0
  104. package/dist/cjs/webhooks.js +85 -0
  105. package/dist/cjs/webhooks.js.map +1 -0
  106. package/dist/esm/core/client.d.ts +165 -0
  107. package/dist/esm/core/client.js +821 -0
  108. package/dist/esm/core/client.js.map +1 -0
  109. package/dist/esm/core/errors.d.ts +101 -0
  110. package/dist/esm/core/errors.js +239 -0
  111. package/dist/esm/core/errors.js.map +1 -0
  112. package/dist/esm/core/index.d.ts +12 -0
  113. package/dist/esm/core/index.js +15 -0
  114. package/dist/esm/core/index.js.map +1 -0
  115. package/dist/esm/core/jobs.d.ts +31 -0
  116. package/dist/esm/core/jobs.js +66 -0
  117. package/dist/esm/core/jobs.js.map +1 -0
  118. package/dist/esm/core/namespace.d.ts +7 -0
  119. package/dist/esm/core/namespace.js +9 -0
  120. package/dist/esm/core/namespace.js.map +1 -0
  121. package/dist/esm/core/op.d.ts +47 -0
  122. package/dist/esm/core/op.js +4 -0
  123. package/dist/esm/core/op.js.map +1 -0
  124. package/dist/esm/core/promise.d.ts +106 -0
  125. package/dist/esm/core/promise.js +193 -0
  126. package/dist/esm/core/promise.js.map +1 -0
  127. package/dist/esm/core/response.d.ts +54 -0
  128. package/dist/esm/core/response.js +86 -0
  129. package/dist/esm/core/response.js.map +1 -0
  130. package/dist/esm/core/sse.d.ts +79 -0
  131. package/dist/esm/core/sse.js +286 -0
  132. package/dist/esm/core/sse.js.map +1 -0
  133. package/dist/esm/core/timing.d.ts +20 -0
  134. package/dist/esm/core/timing.js +92 -0
  135. package/dist/esm/core/timing.js.map +1 -0
  136. package/dist/esm/core/transport.d.ts +80 -0
  137. package/dist/esm/core/transport.js +465 -0
  138. package/dist/esm/core/transport.js.map +1 -0
  139. package/dist/esm/core/util.d.ts +25 -0
  140. package/dist/esm/core/util.js +128 -0
  141. package/dist/esm/core/util.js.map +1 -0
  142. package/dist/esm/core/ws.d.ts +52 -0
  143. package/dist/esm/core/ws.js +175 -0
  144. package/dist/esm/core/ws.js.map +1 -0
  145. package/dist/esm/generated/client.d.ts +62 -0
  146. package/dist/esm/generated/client.js +126 -0
  147. package/dist/esm/generated/client.js.map +1 -0
  148. package/dist/esm/generated/errors.d.ts +4 -0
  149. package/dist/esm/generated/errors.js +157 -0
  150. package/dist/esm/generated/errors.js.map +1 -0
  151. package/dist/esm/generated/ids.d.ts +114 -0
  152. package/dist/esm/generated/ids.js +42 -0
  153. package/dist/esm/generated/ids.js.map +1 -0
  154. package/dist/esm/generated/jobs.d.ts +10 -0
  155. package/dist/esm/generated/jobs.js +21 -0
  156. package/dist/esm/generated/jobs.js.map +1 -0
  157. package/dist/esm/generated/ns/actions.d.ts +161 -0
  158. package/dist/esm/generated/ns/actions.js +300 -0
  159. package/dist/esm/generated/ns/actions.js.map +1 -0
  160. package/dist/esm/generated/ns/infer.d.ts +190 -0
  161. package/dist/esm/generated/ns/infer.js +249 -0
  162. package/dist/esm/generated/ns/infer.js.map +1 -0
  163. package/dist/esm/generated/ns/keys.d.ts +76 -0
  164. package/dist/esm/generated/ns/keys.js +140 -0
  165. package/dist/esm/generated/ns/keys.js.map +1 -0
  166. package/dist/esm/generated/ns/limits.d.ts +22 -0
  167. package/dist/esm/generated/ns/limits.js +28 -0
  168. package/dist/esm/generated/ns/limits.js.map +1 -0
  169. package/dist/esm/generated/ns/orgs.d.ts +38 -0
  170. package/dist/esm/generated/ns/orgs.js +64 -0
  171. package/dist/esm/generated/ns/orgs.js.map +1 -0
  172. package/dist/esm/generated/ns/projects.d.ts +57 -0
  173. package/dist/esm/generated/ns/projects.js +111 -0
  174. package/dist/esm/generated/ns/projects.js.map +1 -0
  175. package/dist/esm/generated/ns/render.d.ts +159 -0
  176. package/dist/esm/generated/ns/render.js +295 -0
  177. package/dist/esm/generated/ns/render.js.map +1 -0
  178. package/dist/esm/generated/ns/requests.d.ts +36 -0
  179. package/dist/esm/generated/ns/requests.js +50 -0
  180. package/dist/esm/generated/ns/requests.js.map +1 -0
  181. package/dist/esm/generated/ns/routines.d.ts +212 -0
  182. package/dist/esm/generated/ns/routines.js +415 -0
  183. package/dist/esm/generated/ns/routines.js.map +1 -0
  184. package/dist/esm/generated/ns/sandboxes.d.ts +318 -0
  185. package/dist/esm/generated/ns/sandboxes.js +545 -0
  186. package/dist/esm/generated/ns/sandboxes.js.map +1 -0
  187. package/dist/esm/generated/ns/usage.d.ts +30 -0
  188. package/dist/esm/generated/ns/usage.js +45 -0
  189. package/dist/esm/generated/ns/usage.js.map +1 -0
  190. package/dist/esm/generated/ns/vault.d.ts +69 -0
  191. package/dist/esm/generated/ns/vault.js +118 -0
  192. package/dist/esm/generated/ns/vault.js.map +1 -0
  193. package/dist/esm/generated/ns/vision.d.ts +376 -0
  194. package/dist/esm/generated/ns/vision.js +732 -0
  195. package/dist/esm/generated/ns/vision.js.map +1 -0
  196. package/dist/esm/generated/ns/webhooks.d.ts +50 -0
  197. package/dist/esm/generated/ns/webhooks.js +87 -0
  198. package/dist/esm/generated/ns/webhooks.js.map +1 -0
  199. package/dist/esm/generated/types.d.ts +4613 -0
  200. package/dist/esm/generated/types.js +3 -0
  201. package/dist/esm/generated/types.js.map +1 -0
  202. package/dist/esm/index.d.ts +22 -0
  203. package/dist/esm/index.js +28 -0
  204. package/dist/esm/index.js.map +1 -0
  205. package/dist/esm/webhooks.d.ts +19 -0
  206. package/dist/esm/webhooks.js +79 -0
  207. package/dist/esm/webhooks.js.map +1 -0
  208. package/package.json +98 -4
  209. package/src/core/client.ts +1022 -0
  210. package/src/core/errors.ts +296 -0
  211. package/src/core/index.ts +45 -0
  212. package/src/core/jobs.ts +94 -0
  213. package/src/core/namespace.ts +10 -0
  214. package/src/core/op.ts +53 -0
  215. package/src/core/promise.ts +268 -0
  216. package/src/core/response.ts +115 -0
  217. package/src/core/sse.ts +305 -0
  218. package/src/core/timing.ts +106 -0
  219. package/src/core/transport.ts +489 -0
  220. package/src/core/util.ts +138 -0
  221. package/src/core/ws.ts +215 -0
  222. package/src/generated/client.ts +143 -0
  223. package/src/generated/errors.ts +313 -0
  224. package/src/generated/ids.ts +47 -0
  225. package/src/generated/jobs.ts +25 -0
  226. package/src/generated/ns/actions.ts +353 -0
  227. package/src/generated/ns/infer.ts +332 -0
  228. package/src/generated/ns/keys.ts +152 -0
  229. package/src/generated/ns/limits.ts +35 -0
  230. package/src/generated/ns/orgs.ts +77 -0
  231. package/src/generated/ns/projects.ts +122 -0
  232. package/src/generated/ns/render.ts +348 -0
  233. package/src/generated/ns/requests.ts +61 -0
  234. package/src/generated/ns/routines.ts +474 -0
  235. package/src/generated/ns/sandboxes.ts +671 -0
  236. package/src/generated/ns/usage.ts +56 -0
  237. package/src/generated/ns/vault.ts +136 -0
  238. package/src/generated/ns/vision.ts +836 -0
  239. package/src/generated/ns/webhooks.ts +100 -0
  240. package/src/generated/types.ts +5131 -0
  241. package/src/index.ts +30 -0
  242. package/src/webhooks.ts +100 -0
@@ -0,0 +1,69 @@
1
+ import type { RequestOptions } from "../../core/client.ts";
2
+ import { Namespace } from "../../core/namespace.ts";
3
+ import type { Op } from "../../core/op.ts";
4
+ import type { APIPromise, ListPromise } from "../../core/promise.ts";
5
+ import type * as T from "../types.ts";
6
+ /** Descriptors of every vault operation, keyed by method name (for tooling and custom clients). */
7
+ export declare const vaultOps: {
8
+ readonly listConnections: Op;
9
+ readonly createConnection: Op;
10
+ readonly deleteConnection: Op;
11
+ readonly getConnection: Op;
12
+ readonly updateConnection: Op;
13
+ };
14
+ /** Stored connections (credentials actions and routines use without seeing them) (`/v1/vault`). */
15
+ export declare class VaultAPI extends Namespace {
16
+ /**
17
+ * List connections
18
+ *
19
+ * Lists connections in this project, newest first, optionally only one pack's or one subject's.
20
+ *
21
+ * `GET /v1/vault/connections` · scope `vault:read` · served by the node
22
+ */
23
+ listConnections(params?: T.VaultListConnectionsParams, options?: RequestOptions): ListPromise<T.ConnectionList, T.Connection>;
24
+ /**
25
+ * Create a connection
26
+ *
27
+ * Stores a credential. For a pack connection give `pack` and `key` (the connection key in the pack); the type
28
+ * and bound hosts come from the pack and `type`, if given, must match. For a credential used by your own HTTP
29
+ * steps give `type` and `hosts`. For a verification-only connection give `type` and no `hosts` (or `[]`): it
30
+ * is never injected into any request and holds a secret B3OS itself uses, such as a routine webhook's
31
+ * signing secret (`verify.secret`). `secret` holds the fields of the type: `api_key` {api_key}, `basic`
32
+ * {username, password}, `bearer` {token}, `oauth2` {access_token, refresh_token?, expires_at?, client_id?,
33
+ * client_secret?}, `none` {}. An `oauth2` pack connection with `refresh_token` and `expires_at` is refreshed in
34
+ * the background, always against the token endpoint (`tokenUrl`) its pack declared when the connection was
35
+ * created. A project holds at most 1,000 connections (limit `vault.connections`; more is 422
36
+ * `limit_exceeded`).
37
+ *
38
+ * `POST /v1/vault/connections` · scope `vault:write` · served by the node
39
+ */
40
+ createConnection(body: T.ConnectionCreateRequest, options?: RequestOptions): APIPromise<T.Connection>;
41
+ /**
42
+ * Delete a connection
43
+ *
44
+ * Deletes the connection and its encrypted secret. Routine versions that bind it fail their next step that needs
45
+ * it with `connection_required`; sandboxes granted it lose access.
46
+ *
47
+ * `DELETE /v1/vault/connections/{connection_id}` · scope `vault:write` · served by the node
48
+ */
49
+ deleteConnection(connectionId: string, options?: RequestOptions): APIPromise<T.Deleted>;
50
+ /**
51
+ * Get a connection
52
+ *
53
+ * Returns a connection's metadata, bound hosts and the names of its stored secret fields. Values are never returned.
54
+ *
55
+ * `GET /v1/vault/connections/{connection_id}` · scope `vault:read` · served by the node
56
+ */
57
+ getConnection(connectionId: string, options?: RequestOptions): APIPromise<T.Connection>;
58
+ /**
59
+ * Update a connection
60
+ *
61
+ * Changes a connection's label, subject, params, bound hosts (custom connections only) or metadata, or replaces
62
+ * its secret (all fields at once, for rotation). Omitted fields are unchanged. In-flight calls finish with the old
63
+ * secret; new calls use the new one. Concurrent updates of one connection apply one after another; 409
64
+ * `conflict` means the connection kept changing while this update ran (read it and try again).
65
+ *
66
+ * `PATCH /v1/vault/connections/{connection_id}` · scope `vault:write` · served by the node
67
+ */
68
+ updateConnection(connectionId: string, body: T.ConnectionUpdateRequest, options?: RequestOptions): APIPromise<T.Connection>;
69
+ }
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ // Generated by packages/sdk/scripts/generate.mjs from packages/spec/dist. Do not edit; run `pnpm generate`.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.VaultAPI = exports.vaultOps = void 0;
5
+ const namespace_ts_1 = require("../../core/namespace.js");
6
+ const listConnectionsOp = {
7
+ id: "vaultListConnections",
8
+ method: "GET",
9
+ path: "/v1/vault/connections",
10
+ timeoutMs: 10000,
11
+ scope: "vault:read",
12
+ };
13
+ const createConnectionOp = {
14
+ id: "vaultCreateConnection",
15
+ method: "POST",
16
+ path: "/v1/vault/connections",
17
+ body: "json",
18
+ idem: true,
19
+ timeoutMs: 10000,
20
+ scope: "vault:write",
21
+ };
22
+ const deleteConnectionOp = {
23
+ id: "vaultDeleteConnection",
24
+ method: "DELETE",
25
+ path: "/v1/vault/connections/{connection_id}",
26
+ params: ["connection_id"],
27
+ timeoutMs: 10000,
28
+ scope: "vault:write",
29
+ };
30
+ const getConnectionOp = {
31
+ id: "vaultGetConnection",
32
+ method: "GET",
33
+ path: "/v1/vault/connections/{connection_id}",
34
+ params: ["connection_id"],
35
+ timeoutMs: 10000,
36
+ scope: "vault:read",
37
+ };
38
+ const updateConnectionOp = {
39
+ id: "vaultUpdateConnection",
40
+ method: "PATCH",
41
+ path: "/v1/vault/connections/{connection_id}",
42
+ params: ["connection_id"],
43
+ body: "json",
44
+ timeoutMs: 10000,
45
+ scope: "vault:write",
46
+ };
47
+ /** Descriptors of every vault operation, keyed by method name (for tooling and custom clients). */
48
+ exports.vaultOps = {
49
+ listConnections: listConnectionsOp,
50
+ createConnection: createConnectionOp,
51
+ deleteConnection: deleteConnectionOp,
52
+ getConnection: getConnectionOp,
53
+ updateConnection: updateConnectionOp,
54
+ };
55
+ /** Stored connections (credentials actions and routines use without seeing them) (`/v1/vault`). */
56
+ class VaultAPI extends namespace_ts_1.Namespace {
57
+ /**
58
+ * List connections
59
+ *
60
+ * Lists connections in this project, newest first, optionally only one pack's or one subject's.
61
+ *
62
+ * `GET /v1/vault/connections` · scope `vault:read` · served by the node
63
+ */
64
+ listConnections(params, options) {
65
+ return this._client._list(listConnectionsOp, { query: params }, options);
66
+ }
67
+ /**
68
+ * Create a connection
69
+ *
70
+ * Stores a credential. For a pack connection give `pack` and `key` (the connection key in the pack); the type
71
+ * and bound hosts come from the pack and `type`, if given, must match. For a credential used by your own HTTP
72
+ * steps give `type` and `hosts`. For a verification-only connection give `type` and no `hosts` (or `[]`): it
73
+ * is never injected into any request and holds a secret B3OS itself uses, such as a routine webhook's
74
+ * signing secret (`verify.secret`). `secret` holds the fields of the type: `api_key` {api_key}, `basic`
75
+ * {username, password}, `bearer` {token}, `oauth2` {access_token, refresh_token?, expires_at?, client_id?,
76
+ * client_secret?}, `none` {}. An `oauth2` pack connection with `refresh_token` and `expires_at` is refreshed in
77
+ * the background, always against the token endpoint (`tokenUrl`) its pack declared when the connection was
78
+ * created. A project holds at most 1,000 connections (limit `vault.connections`; more is 422
79
+ * `limit_exceeded`).
80
+ *
81
+ * `POST /v1/vault/connections` · scope `vault:write` · served by the node
82
+ */
83
+ createConnection(body, options) {
84
+ return this._client._call(createConnectionOp, { body }, options);
85
+ }
86
+ /**
87
+ * Delete a connection
88
+ *
89
+ * Deletes the connection and its encrypted secret. Routine versions that bind it fail their next step that needs
90
+ * it with `connection_required`; sandboxes granted it lose access.
91
+ *
92
+ * `DELETE /v1/vault/connections/{connection_id}` · scope `vault:write` · served by the node
93
+ */
94
+ deleteConnection(connectionId, options) {
95
+ return this._client._call(deleteConnectionOp, { path: [connectionId] }, options);
96
+ }
97
+ /**
98
+ * Get a connection
99
+ *
100
+ * Returns a connection's metadata, bound hosts and the names of its stored secret fields. Values are never returned.
101
+ *
102
+ * `GET /v1/vault/connections/{connection_id}` · scope `vault:read` · served by the node
103
+ */
104
+ getConnection(connectionId, options) {
105
+ return this._client._call(getConnectionOp, { path: [connectionId] }, options);
106
+ }
107
+ /**
108
+ * Update a connection
109
+ *
110
+ * Changes a connection's label, subject, params, bound hosts (custom connections only) or metadata, or replaces
111
+ * its secret (all fields at once, for rotation). Omitted fields are unchanged. In-flight calls finish with the old
112
+ * secret; new calls use the new one. Concurrent updates of one connection apply one after another; 409
113
+ * `conflict` means the connection kept changing while this update ran (read it and try again).
114
+ *
115
+ * `PATCH /v1/vault/connections/{connection_id}` · scope `vault:write` · served by the node
116
+ */
117
+ updateConnection(connectionId, body, options) {
118
+ return this._client._call(updateConnectionOp, { path: [connectionId], body }, options);
119
+ }
120
+ }
121
+ exports.VaultAPI = VaultAPI;
122
+ //# sourceMappingURL=vault.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vault.js","sourceRoot":"","sources":["../../../../src/generated/ns/vault.ts"],"names":[],"mappings":";AAAA,4GAA4G;;;AAG5G,0DAAoD;AAKpD,MAAM,iBAAiB,GAAO;IAC5B,EAAE,EAAE,sBAAsB;IAC1B,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,uBAAuB;IAC7B,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,YAAY;CACpB,CAAC;AACF,MAAM,kBAAkB,GAAO;IAC7B,EAAE,EAAE,uBAAuB;IAC3B,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,uBAAuB;IAC7B,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,aAAa;CACrB,CAAC;AACF,MAAM,kBAAkB,GAAO;IAC7B,EAAE,EAAE,uBAAuB;IAC3B,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,uCAAuC;IAC7C,MAAM,EAAE,CAAC,eAAe,CAAC;IACzB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,aAAa;CACrB,CAAC;AACF,MAAM,eAAe,GAAO;IAC1B,EAAE,EAAE,oBAAoB;IACxB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,uCAAuC;IAC7C,MAAM,EAAE,CAAC,eAAe,CAAC;IACzB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,YAAY;CACpB,CAAC;AACF,MAAM,kBAAkB,GAAO;IAC7B,EAAE,EAAE,uBAAuB;IAC3B,MAAM,EAAE,OAAO;IACf,IAAI,EAAE,uCAAuC;IAC7C,MAAM,EAAE,CAAC,eAAe,CAAC;IACzB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,aAAa;CACrB,CAAC;AAEF,mGAAmG;AACtF,QAAA,QAAQ,GAAG;IACtB,eAAe,EAAE,iBAAiB;IAClC,gBAAgB,EAAE,kBAAkB;IACpC,gBAAgB,EAAE,kBAAkB;IACpC,aAAa,EAAE,eAAe;IAC9B,gBAAgB,EAAE,kBAAkB;CAC5B,CAAC;AAEX,mGAAmG;AACnG,MAAa,QAAS,SAAQ,wBAAS;IACrC;;;;;;OAMG;IACH,eAAe,CACb,MAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAiC,iBAAiB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC3G,CAAC;IAED;;;;;;;;;;;;;;;OAeG;IACH,gBAAgB,CAAC,IAA+B,EAAE,OAAwB;QACxE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAe,kBAAkB,EAAE,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IACjF,CAAC;IAED;;;;;;;OAOG;IACH,gBAAgB,CAAC,YAAoB,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAY,kBAAkB,EAAE,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;;OAMG;IACH,aAAa,CAAC,YAAoB,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAe,eAAe,EAAE,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IAC9F,CAAC;IAED;;;;;;;;;OASG;IACH,gBAAgB,CACd,YAAoB,EACpB,IAA+B,EAC/B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAe,kBAAkB,EAAE,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IACvG,CAAC;CACF;AA3ED,4BA2EC"}
@@ -0,0 +1,376 @@
1
+ import type { RequestOptions, StreamOptions } from "../../core/client.ts";
2
+ import { Namespace } from "../../core/namespace.ts";
3
+ import type { Op } from "../../core/op.ts";
4
+ import type { APIPromise, JobPromise, ListPromise } from "../../core/promise.ts";
5
+ import type { EventStream } from "../../core/sse.ts";
6
+ import { type CdpEndpoint } from "../../core/ws.ts";
7
+ import type * as T from "../types.ts";
8
+ /** Descriptors of every vision operation, keyed by method name (for tooling and custom clients). */
9
+ export declare const visionOps: {
10
+ readonly listBatches: Op;
11
+ readonly createBatch: Op;
12
+ readonly getBatch: Op;
13
+ readonly cancelBatch: Op;
14
+ readonly batchEvents: Op;
15
+ readonly listBatchPages: Op;
16
+ readonly listCrawls: Op;
17
+ readonly createCrawl: Op;
18
+ readonly getCrawl: Op;
19
+ readonly cancelCrawl: Op;
20
+ readonly crawlEvents: Op;
21
+ readonly listCrawlPages: Op;
22
+ readonly createExtract: Op;
23
+ readonly getExtract: Op;
24
+ readonly cancelExtract: Op;
25
+ readonly extractEvents: Op;
26
+ readonly map: Op;
27
+ readonly listProfiles: Op;
28
+ readonly createProfile: Op;
29
+ readonly deleteProfile: Op;
30
+ readonly getProfile: Op;
31
+ readonly updateProfile: Op;
32
+ readonly exportProfileState: Op;
33
+ readonly readUrl: Op;
34
+ readonly scrape: Op;
35
+ readonly listSessions: Op;
36
+ readonly createSession: Op;
37
+ readonly closeSession: Op;
38
+ readonly getSession: Op;
39
+ readonly act: Op;
40
+ readonly connectCdp: Op;
41
+ readonly saveSessionProfile: Op;
42
+ readonly createSessionTicket: Op;
43
+ };
44
+ /**
45
+ * Browsers and web extraction: scrape, map, crawl, batch, browser sessions and profiles (`/v1/vision`).
46
+ */
47
+ export declare class VisionAPI extends Namespace {
48
+ /**
49
+ * List batch scrapes
50
+ *
51
+ * Lists batch scrapes in this project, newest first. Records are kept for 7 days after they finish.
52
+ *
53
+ * `GET /v1/vision/batches` · scope `vision:read` · served by the node
54
+ */
55
+ listBatches(params?: T.VisionListBatchesParams, options?: RequestOptions): ListPromise<T.BatchScrapeList, T.BatchScrape>;
56
+ /**
57
+ * Scrape a list of URLs
58
+ *
59
+ * Starts a job that scrapes up to 1,000 URLs with the same options. Each page bills one `vision.page`.
60
+ * Results are listed with `GET /v1/vision/batches/{batch_id}/pages`; `?wait=`, the events stream and
61
+ * `webhook` report progress.
62
+ *
63
+ * `POST /v1/vision/batches` · scope `vision:run` · served by the node
64
+ */
65
+ createBatch(body: T.BatchCreateRequest, options?: RequestOptions): JobPromise<T.BatchScrape, T.BatchEvent>;
66
+ /**
67
+ * Get a batch scrape
68
+ *
69
+ * Returns the batch job with its status, progress and summary result. Page contents are listed separately.
70
+ *
71
+ * `GET /v1/vision/batches/{batch_id}` · scope `vision:read` · served by the node
72
+ */
73
+ getBatch(batchId: string, options?: RequestOptions): APIPromise<T.BatchScrape>;
74
+ /**
75
+ * Cancel a batch scrape
76
+ *
77
+ * Stops scraping new URLs. Pages already scraped stay listed and billed. Returns the batch with status `canceled`.
78
+ *
79
+ * `POST /v1/vision/batches/{batch_id}/cancel` · scope `vision:run` · served by the node
80
+ */
81
+ cancelBatch(batchId: string, options?: RequestOptions): APIPromise<T.BatchScrape>;
82
+ /**
83
+ * Stream a batch's events
84
+ *
85
+ * Server-sent events for the batch: lifecycle events plus `page.succeeded` and `page.failed` per URL. Ends
86
+ * after the terminal event. Reconnect with `Last-Event-ID` to resume.
87
+ *
88
+ * `GET /v1/vision/batches/{batch_id}/events` · scope `vision:read` · served by the node
89
+ */
90
+ batchEvents(batchId: string, options?: StreamOptions): EventStream<T.BatchEvent>;
91
+ /**
92
+ * List a batch's page results
93
+ *
94
+ * Lists the scraped pages of a batch in completion order, including failures. Available while the batch runs.
95
+ *
96
+ * `GET /v1/vision/batches/{batch_id}/pages` · scope `vision:read` · served by the node
97
+ */
98
+ listBatchPages(batchId: string, params?: T.VisionListBatchPagesParams, options?: RequestOptions): ListPromise<T.PageResultList, T.PageResult>;
99
+ /**
100
+ * List crawls
101
+ *
102
+ * Lists crawls in this project, newest first. Records are kept for 7 days after they finish.
103
+ *
104
+ * `GET /v1/vision/crawls` · scope `vision:read` · served by the node
105
+ */
106
+ listCrawls(params?: T.VisionListCrawlsParams, options?: RequestOptions): ListPromise<T.CrawlList, T.Crawl>;
107
+ /**
108
+ * Crawl a site
109
+ *
110
+ * Starts a job that discovers pages from `url` (links and sitemaps), breadth first, and scrapes up to `limit`
111
+ * pages (at most 500). robots.txt is honored and requests to one host are spaced politely. One crawl runs
112
+ * at a time per organization. Each page bills one `vision.page`.
113
+ *
114
+ * `POST /v1/vision/crawls` · scope `vision:run` · served by the node
115
+ */
116
+ createCrawl(body: T.CrawlCreateRequest, options?: RequestOptions): JobPromise<T.Crawl, T.CrawlEvent>;
117
+ /**
118
+ * Get a crawl
119
+ *
120
+ * Returns the crawl job with its status, progress and summary result. Page contents are listed separately.
121
+ *
122
+ * `GET /v1/vision/crawls/{crawl_id}` · scope `vision:read` · served by the node
123
+ */
124
+ getCrawl(crawlId: string, options?: RequestOptions): APIPromise<T.Crawl>;
125
+ /**
126
+ * Cancel a crawl
127
+ *
128
+ * Stops discovering and scraping pages. Pages already scraped stay listed and billed.
129
+ *
130
+ * `POST /v1/vision/crawls/{crawl_id}/cancel` · scope `vision:run` · served by the node
131
+ */
132
+ cancelCrawl(crawlId: string, options?: RequestOptions): APIPromise<T.Crawl>;
133
+ /**
134
+ * Stream a crawl's events
135
+ *
136
+ * Server-sent events for the crawl: lifecycle events plus `page.succeeded` and `page.failed` per page. Ends
137
+ * after the terminal event. Reconnect with `Last-Event-ID` to resume.
138
+ *
139
+ * `GET /v1/vision/crawls/{crawl_id}/events` · scope `vision:read` · served by the node
140
+ */
141
+ crawlEvents(crawlId: string, options?: StreamOptions): EventStream<T.CrawlEvent>;
142
+ /**
143
+ * List a crawl's page results
144
+ *
145
+ * Lists crawled pages in completion order, including failures. Available while the crawl runs.
146
+ *
147
+ * `GET /v1/vision/crawls/{crawl_id}/pages` · scope `vision:read` · served by the node
148
+ */
149
+ listCrawlPages(crawlId: string, params?: T.VisionListCrawlPagesParams, options?: RequestOptions): ListPromise<T.PageResultList, T.PageResult>;
150
+ /**
151
+ * Extract structured data
152
+ *
153
+ * Starts a job that scrapes up to 10 URLs and asks the node's model to fill your JSON Schema from their
154
+ * content (with `prompt` as guidance). The result is validated against the schema; an invalid result after
155
+ * retries fails the job with `extraction_failed`. Bills `vision.page` per page plus the model's tokens.
156
+ *
157
+ * `POST /v1/vision/extracts` · scope `vision:run` · served by the node
158
+ *
159
+ * Stretch: in the contract, but may answer `501 not_implemented` on this deployment.
160
+ */
161
+ createExtract(body: T.ExtractCreateRequest, options?: RequestOptions): JobPromise<T.ExtractJob, T.JobEvent>;
162
+ /**
163
+ * Get an extraction
164
+ *
165
+ * Returns the extraction job; `result.data` holds the extracted JSON once it succeeded.
166
+ *
167
+ * `GET /v1/vision/extracts/{job_id}` · scope `vision:read` · served by the node
168
+ *
169
+ * Stretch: in the contract, but may answer `501 not_implemented` on this deployment.
170
+ */
171
+ getExtract(jobId: string, options?: RequestOptions): APIPromise<T.ExtractJob>;
172
+ /**
173
+ * Cancel an extraction
174
+ *
175
+ * Stops the extraction. Pages already scraped and tokens already used stay billed.
176
+ *
177
+ * `POST /v1/vision/extracts/{job_id}/cancel` · scope `vision:run` · served by the node
178
+ *
179
+ * Stretch: in the contract, but may answer `501 not_implemented` on this deployment.
180
+ */
181
+ cancelExtract(jobId: string, options?: RequestOptions): APIPromise<T.ExtractJob>;
182
+ /**
183
+ * Stream an extraction's events
184
+ *
185
+ * Server-sent lifecycle events for the extraction job. Ends after the terminal event.
186
+ *
187
+ * `GET /v1/vision/extracts/{job_id}/events` · scope `vision:read` · served by the node
188
+ *
189
+ * Stretch: in the contract, but may answer `501 not_implemented` on this deployment.
190
+ */
191
+ extractEvents(jobId: string, options?: StreamOptions): EventStream<T.JobEvent>;
192
+ /**
193
+ * Map a site's URLs
194
+ *
195
+ * Lists URLs on a site from its sitemaps and from links on the start page, without scraping each page. Use it
196
+ * to choose what to scrape or crawl. `search` orders the results by relevance to a phrase. Bills one
197
+ * `vision.page` per call.
198
+ *
199
+ * `POST /v1/vision/map` · scope `vision:run` · served by the node
200
+ */
201
+ map(body: T.MapRequest, options?: RequestOptions): APIPromise<T.MapResult>;
202
+ /**
203
+ * List profiles
204
+ *
205
+ * Lists profiles in this project, newest first.
206
+ *
207
+ * `GET /v1/vision/profiles` · scope `vision:read` · served by the node
208
+ */
209
+ listProfiles(params?: T.VisionListProfilesParams, options?: RequestOptions): ListPromise<T.ProfileList, T.Profile>;
210
+ /**
211
+ * Create a profile
212
+ *
213
+ * Stores cookies and storage as a named profile, encrypted in the node's vault. `state` is Playwright's
214
+ * `storageState` JSON (`context.storageState({indexedDB: true})`) uploaded as is. Every cookie domain and
215
+ * origin must belong to `domains` (derived from the state when omitted). The API returns counts and domains,
216
+ * never cookie values; `GET /v1/vision/profiles/{profile_id}/state` exports the state.
217
+ *
218
+ * `POST /v1/vision/profiles` · scope `vision:write` · served by the node
219
+ */
220
+ createProfile(body: T.ProfileCreateRequest, options?: RequestOptions): APIPromise<T.Profile>;
221
+ /**
222
+ * Delete a profile
223
+ *
224
+ * Deletes the profile and every stored revision. Open sessions that loaded it keep their cookies until they close.
225
+ *
226
+ * `DELETE /v1/vision/profiles/{profile_id}` · scope `vision:write` · served by the node
227
+ */
228
+ deleteProfile(profileId: string, options?: RequestOptions): APIPromise<T.Deleted>;
229
+ /**
230
+ * Get a profile
231
+ *
232
+ * Returns a profile's metadata, revision and counts. Cookie values and storage contents are never returned here.
233
+ *
234
+ * `GET /v1/vision/profiles/{profile_id}` · scope `vision:read` · served by the node
235
+ */
236
+ getProfile(profileId: string, options?: RequestOptions): APIPromise<T.Profile>;
237
+ /**
238
+ * Update a profile
239
+ *
240
+ * Renames a profile, changes its domains, expiry or metadata, or replaces its state (a new revision).
241
+ * Omitted fields are unchanged.
242
+ *
243
+ * `PATCH /v1/vision/profiles/{profile_id}` · scope `vision:write` · served by the node
244
+ */
245
+ updateProfile(profileId: string, body: T.ProfileUpdateRequest, options?: RequestOptions): APIPromise<T.Profile>;
246
+ /**
247
+ * Export a profile's state
248
+ *
249
+ * Returns the current revision's storage state (Playwright `storageState` JSON) so you can load it into your
250
+ * own browser or move it to another project. It contains live session cookies: treat the response like a
251
+ * password. Requires `vision:write`, the same scope that can replace the state.
252
+ *
253
+ * `GET /v1/vision/profiles/{profile_id}/state` · scope `vision:write` · served by the node
254
+ */
255
+ exportProfileState(profileId: string, options?: RequestOptions): APIPromise<T.ProfileStorageState>;
256
+ /**
257
+ * Read a URL as Markdown
258
+ *
259
+ * The shortest way to read a page: put the target URL after `/v1/vision/r/`, unencoded, for example
260
+ * `GET /v1/vision/r/https://example.com/pricing`. Returns `text/markdown` by default. Options go in
261
+ * `X-B3OS-*` headers so the target URL stays untouched. Same tiers, cache and billing as `scrape`.
262
+ *
263
+ * `GET /v1/vision/r/{url}` · scope `vision:run` · served by the node
264
+ */
265
+ readUrl(url: string, params: T.VisionReadUrlParams & {
266
+ format: "json";
267
+ }, options?: RequestOptions): APIPromise<T.ScrapeResult>;
268
+ readUrl(url: string, params?: T.VisionReadUrlParams, options?: RequestOptions): APIPromise<string>;
269
+ /**
270
+ * Scrape a page
271
+ *
272
+ * Fetches one URL and returns the formats you ask for. With `engine: "auto"` (the default) vision answers
273
+ * from the cache when a fresh copy exists (`max_age_ms`, default 2 days), otherwise fetches over HTTP and
274
+ * switches to a warm browser only when the page needs JavaScript. Custom `headers`, a `profile` or `actions`
275
+ * bypass the cache; a page that sets cookies (by a response or a script) is cached for your organization
276
+ * only. The response's `cache.state` and `tier` say what served it.
277
+ *
278
+ * Synchronous: the response arrives when the page is done, within `timeout_ms` (at most 60 seconds). For
279
+ * many pages use a batch scrape or a crawl.
280
+ *
281
+ * `POST /v1/vision/scrape` · scope `vision:run` · served by the node
282
+ */
283
+ scrape(body: T.ScrapeRequest, options?: RequestOptions): APIPromise<T.ScrapeResult>;
284
+ /**
285
+ * List browser sessions
286
+ *
287
+ * Lists sessions in this project, newest first, including recently closed ones (kept for 7 days).
288
+ *
289
+ * `GET /v1/vision/sessions` · scope `vision:read` · served by the node
290
+ */
291
+ listSessions(params?: T.VisionListSessionsParams, options?: RequestOptions): ListPromise<T.BrowserSessionList, T.BrowserSession>;
292
+ /**
293
+ * Create a browser session
294
+ *
295
+ * Claims a warm, dedicated browser for your organization and returns it ready to drive. Load a `profile` to
296
+ * start signed in; set `persist_profile` to save cookies and storage back when the session closes. The
297
+ * session closes after `timeout_s` (at most 1,800) or on `DELETE`. Bills `vision.browser_ms` from claim to
298
+ * close.
299
+ *
300
+ * `POST /v1/vision/sessions` · scope `vision:write` · served by the node
301
+ */
302
+ createSession(body?: T.SessionCreateRequest, options?: RequestOptions): APIPromise<T.BrowserSession>;
303
+ /**
304
+ * Close a browser session
305
+ *
306
+ * Closes the session and destroys its browser. With `persist_profile`, cookies and storage are saved to the
307
+ * profile first (a newer revision saved by another session fails the save with `profile_conflict` unless
308
+ * `overwrite_profile` was set; the session still closes). Returns the closed session with the final browser
309
+ * time. Closing a closed session returns it unchanged.
310
+ *
311
+ * `DELETE /v1/vision/sessions/{session_id}` · scope `vision:write` · served by the node
312
+ */
313
+ closeSession(sessionId: string, options?: RequestOptions): APIPromise<T.BrowserSession>;
314
+ /**
315
+ * Get a browser session
316
+ *
317
+ * Returns the session, its open pages and the browser time used so far.
318
+ *
319
+ * `GET /v1/vision/sessions/{session_id}` · scope `vision:read` · served by the node
320
+ */
321
+ getSession(sessionId: string, options?: RequestOptions): APIPromise<T.BrowserSession>;
322
+ /**
323
+ * Run browser actions
324
+ *
325
+ * Runs a batch of browser actions in order on one page and returns every result in one round trip:
326
+ * `navigate`, `click`, `hover`, `type`, `key`, `scroll`, `select` and `wait` (the same kinds and fields as
327
+ * render scripts), plus `evaluate`, `screenshot` and `markdown`. Execution stops at the first failed action
328
+ * unless `continue_on_error` is set; the failed action's result carries the error (for example
329
+ * `target_not_found`) and later actions are reported as `skipped`. The batch must finish within `timeout_ms`.
330
+ *
331
+ * `POST /v1/vision/sessions/{session_id}/act` · scope `vision:run` · served by the node
332
+ */
333
+ act(sessionId: string, body: T.ActRequest, options?: RequestOptions): APIPromise<T.ActResult>;
334
+ /**
335
+ * Connect over CDP
336
+ *
337
+ * Opens a WebSocket that speaks the Chrome DevTools Protocol for this session only, so Playwright
338
+ * (`chromium.connectOverCDP`), Puppeteer (`puppeteer.connect`) or any CDP client can drive the browser. The
339
+ * proxy exposes only the session's own targets. It refuses `SystemInfo.*`, `Tethering.*`, `Extensions.*`,
340
+ * `Cast.*`, and `Browser.*` except the methods Playwright and Puppeteer need to drive a browser
341
+ * (`getVersion`, the permission methods, window bounds, `setDownloadBehavior` and `cancelDownload`); host
342
+ * file access (`DOM.setFileInputFiles`, file drags); downloads to host paths (they land in the session's
343
+ * own directory, wiped with the browser); and navigation to anything but `http:`, `https:` and
344
+ * `about:blank` (`file:`, `chrome:`, `chrome-extension:`, `view-source:`, `devtools:`, `data:`). These
345
+ * answer `cdp_method_blocked` in the CDP error (`error.data.code`). `Target.createBrowserContext` with
346
+ * `proxyServer`, `proxyBypassList` or `originsWithUniversalNetworkAccess` answers `forbidden` (403):
347
+ * every context of a session uses the session's egress. Authenticate with the `Authorization` header or a
348
+ * ticket from `POST /v1/vision/sessions/{session_id}/ticket`. A client that falls more than a few MB
349
+ * behind is disconnected, and so is one that sends a message over 32 MiB. A message with a repeated member
350
+ * (two `method`s, say) answers the JSON-RPC parse error `-32700`.
351
+ *
352
+ * `GET /v1/vision/sessions/{session_id}/cdp` · scope `vision:run` · served by the node
353
+ */
354
+ connectCdp(sessionId: string, options?: RequestOptions): Promise<CdpEndpoint>;
355
+ /**
356
+ * Save a session to a profile
357
+ *
358
+ * Saves the session's current cookies and storage to a profile now: the named profile is created if it does
359
+ * not exist, otherwise a new revision replaces its state. Use it right after an agent or a person signs in.
360
+ * If another session saved the profile since this one loaded it, the save fails with `profile_conflict`
361
+ * unless `overwrite` is set.
362
+ *
363
+ * `POST /v1/vision/sessions/{session_id}/profile` · scope `vision:write` · served by the node
364
+ */
365
+ saveSessionProfile(sessionId: string, body: T.SessionProfileSaveRequest, options?: RequestOptions): APIPromise<T.Profile>;
366
+ /**
367
+ * Create a stream ticket
368
+ *
369
+ * Returns a single-use ticket, valid for 30 seconds, that opens the session's CDP socket without a bearer
370
+ * header (for browsers and CDP clients that cannot set headers). Pass it as `?ticket=` or in
371
+ * `Sec-WebSocket-Protocol: b3os.v1, b3os.ticket.<ticket>`. The socket runs with this caller's scopes.
372
+ *
373
+ * `POST /v1/vision/sessions/{session_id}/ticket` · scope `vision:read` · served by the node
374
+ */
375
+ createSessionTicket(sessionId: string, options?: RequestOptions): APIPromise<T.StreamTicket>;
376
+ }