@boxrouter/sdk 0.0.1-alpha.0 → 0.12.190

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 (338) hide show
  1. package/NOTICE +29 -5
  2. package/README.md +497 -24
  3. package/dist/addresses.d.ts +5 -0
  4. package/dist/addresses.js +10 -0
  5. package/dist/api-error.d.ts +62 -0
  6. package/dist/api-error.js +264 -0
  7. package/dist/boxrouter.d.ts +68 -0
  8. package/dist/boxrouter.js +291 -0
  9. package/dist/browser-session/index.d.ts +17 -0
  10. package/dist/browser-session/index.js +48 -0
  11. package/dist/browser-session/operations.gen.d.ts +272 -0
  12. package/dist/browser-session/operations.gen.js +58 -0
  13. package/dist/browser-session/responseContracts/api_keys.d.ts +2 -0
  14. package/dist/browser-session/responseContracts/api_keys.js +10 -0
  15. package/dist/browser-session/responseContracts/credits.d.ts +2 -0
  16. package/dist/browser-session/responseContracts/credits.js +8 -0
  17. package/dist/browser-session/responseContracts/github.d.ts +2 -0
  18. package/dist/browser-session/responseContracts/github.js +11 -0
  19. package/dist/browser-session/responseContracts/identity.d.ts +2 -0
  20. package/dist/browser-session/responseContracts/identity.js +30 -0
  21. package/dist/browser-session/responseContracts/organizations.d.ts +2 -0
  22. package/dist/browser-session/responseContracts/organizations.js +17 -0
  23. package/dist/browser-session/responseContracts/privacy.d.ts +2 -0
  24. package/dist/browser-session/responseContracts/privacy.js +7 -0
  25. package/dist/browser-session/responseContracts.gen.d.ts +3 -0
  26. package/dist/browser-session/responseContracts.gen.js +10 -0
  27. package/dist/browser-session/responseValidators/api_keys-diagnostics.cjs +1 -0
  28. package/dist/browser-session/responseValidators/api_keys-diagnostics.d.cts +4 -0
  29. package/dist/browser-session/responseValidators/api_keys.cjs +2 -0
  30. package/dist/browser-session/responseValidators/api_keys.d.cts +4 -0
  31. package/dist/browser-session/responseValidators/credits-diagnostics.cjs +1 -0
  32. package/dist/browser-session/responseValidators/credits-diagnostics.d.cts +3 -0
  33. package/dist/browser-session/responseValidators/credits.cjs +2 -0
  34. package/dist/browser-session/responseValidators/credits.d.cts +3 -0
  35. package/dist/browser-session/responseValidators/github-diagnostics.cjs +1 -0
  36. package/dist/browser-session/responseValidators/github-diagnostics.d.cts +3 -0
  37. package/dist/browser-session/responseValidators/github.cjs +2 -0
  38. package/dist/browser-session/responseValidators/github.d.cts +3 -0
  39. package/dist/browser-session/responseValidators/identity-diagnostics.cjs +1 -0
  40. package/dist/browser-session/responseValidators/identity-diagnostics.d.cts +23 -0
  41. package/dist/browser-session/responseValidators/identity.cjs +2 -0
  42. package/dist/browser-session/responseValidators/identity.d.cts +23 -0
  43. package/dist/browser-session/responseValidators/organizations-diagnostics.cjs +1 -0
  44. package/dist/browser-session/responseValidators/organizations-diagnostics.d.cts +15 -0
  45. package/dist/browser-session/responseValidators/organizations.cjs +2 -0
  46. package/dist/browser-session/responseValidators/organizations.d.cts +15 -0
  47. package/dist/browser-session/responseValidators/privacy-diagnostics.cjs +1 -0
  48. package/dist/browser-session/responseValidators/privacy-diagnostics.d.cts +2 -0
  49. package/dist/browser-session/responseValidators/privacy.cjs +2 -0
  50. package/dist/browser-session/responseValidators/privacy.d.cts +2 -0
  51. package/dist/client/client.gen.d.ts +1 -1
  52. package/dist/client/client.gen.js +46 -94
  53. package/dist/client/index.d.ts +10 -10
  54. package/dist/client/index.js +16 -5
  55. package/dist/client/types.gen.d.ts +6 -6
  56. package/dist/client/types.gen.js +2 -1
  57. package/dist/client/utils.gen.d.ts +2 -2
  58. package/dist/client/utils.gen.js +31 -20
  59. package/dist/client.gen.d.ts +2 -2
  60. package/dist/client.gen.js +5 -2
  61. package/dist/command-check.gen.d.ts +14 -0
  62. package/dist/command-check.gen.js +23 -0
  63. package/dist/command-input.gen.d.ts +6 -0
  64. package/dist/command-input.gen.js +45 -0
  65. package/dist/core/auth.gen.js +5 -1
  66. package/dist/core/binaryStream.d.ts +8 -0
  67. package/dist/core/binaryStream.js +76 -0
  68. package/dist/core/bodySerializer.gen.d.ts +1 -1
  69. package/dist/core/bodySerializer.gen.js +8 -5
  70. package/dist/core/commandValidators.cjs +1 -0
  71. package/dist/core/commandValidators.d.cts +14 -0
  72. package/dist/core/eventValidation.d.ts +17 -0
  73. package/dist/core/eventValidation.js +56 -0
  74. package/dist/core/eventValidators.cjs +1 -0
  75. package/dist/core/eventValidators.d.cts +2 -0
  76. package/dist/core/json.d.ts +3 -0
  77. package/dist/core/json.js +33 -0
  78. package/dist/core/params.gen.js +4 -1
  79. package/dist/core/pathSerializer.gen.js +20 -11
  80. package/dist/core/queryKeySerializer.gen.js +12 -6
  81. package/dist/core/responseContracts/actions.d.ts +2 -0
  82. package/dist/core/responseContracts/actions.js +30 -0
  83. package/dist/core/responseContracts/agents.d.ts +2 -0
  84. package/dist/core/responseContracts/agents.js +7 -0
  85. package/dist/core/responseContracts/artifacts.d.ts +2 -0
  86. package/dist/core/responseContracts/artifacts.js +8 -0
  87. package/dist/core/responseContracts/commands.d.ts +2 -0
  88. package/dist/core/responseContracts/commands.js +6 -0
  89. package/dist/core/responseContracts/credits.d.ts +2 -0
  90. package/dist/core/responseContracts/credits.js +27 -0
  91. package/dist/core/responseContracts/files.d.ts +2 -0
  92. package/dist/core/responseContracts/files.js +15 -0
  93. package/dist/core/responseContracts/github.d.ts +2 -0
  94. package/dist/core/responseContracts/github.js +8 -0
  95. package/dist/core/responseContracts/images.d.ts +2 -0
  96. package/dist/core/responseContracts/images.js +8 -0
  97. package/dist/core/responseContracts/launchRuns.d.ts +2 -0
  98. package/dist/core/responseContracts/launchRuns.js +10 -0
  99. package/dist/core/responseContracts/launches.d.ts +2 -0
  100. package/dist/core/responseContracts/launches.js +10 -0
  101. package/dist/core/responseContracts/operations.d.ts +2 -0
  102. package/dist/core/responseContracts/operations.js +7 -0
  103. package/dist/core/responseContracts/previews.d.ts +2 -0
  104. package/dist/core/responseContracts/previews.js +8 -0
  105. package/dist/core/responseContracts/pricing.d.ts +2 -0
  106. package/dist/core/responseContracts/pricing.js +6 -0
  107. package/dist/core/responseContracts/processes.d.ts +2 -0
  108. package/dist/core/responseContracts/processes.js +11 -0
  109. package/dist/core/responseContracts/provider_accounts.d.ts +2 -0
  110. package/dist/core/responseContracts/provider_accounts.js +13 -0
  111. package/dist/core/responseContracts/providers.d.ts +2 -0
  112. package/dist/core/responseContracts/providers.js +6 -0
  113. package/dist/core/responseContracts/routing.d.ts +2 -0
  114. package/dist/core/responseContracts/routing.js +8 -0
  115. package/dist/core/responseContracts/sandboxes.d.ts +2 -0
  116. package/dist/core/responseContracts/sandboxes.js +15 -0
  117. package/dist/core/responseContracts/secrets.d.ts +2 -0
  118. package/dist/core/responseContracts/secrets.js +8 -0
  119. package/dist/core/responseContracts/spend_limits.d.ts +2 -0
  120. package/dist/core/responseContracts/spend_limits.js +8 -0
  121. package/dist/core/responseContracts/terminals.d.ts +2 -0
  122. package/dist/core/responseContracts/terminals.js +11 -0
  123. package/dist/core/responseContracts/usage.d.ts +2 -0
  124. package/dist/core/responseContracts/usage.js +7 -0
  125. package/dist/core/responseContracts/volumes.d.ts +2 -0
  126. package/dist/core/responseContracts/volumes.js +19 -0
  127. package/dist/core/responseContracts.gen.d.ts +3 -0
  128. package/dist/core/responseContracts.gen.js +27 -0
  129. package/dist/core/responseModes.d.ts +19 -0
  130. package/dist/core/responseModes.js +13 -0
  131. package/dist/core/responseValidation.d.ts +44 -0
  132. package/dist/core/responseValidation.js +174 -0
  133. package/dist/core/responseValidators/actions-diagnostics.cjs +4 -0
  134. package/dist/core/responseValidators/actions-diagnostics.d.cts +24 -0
  135. package/dist/core/responseValidators/actions.cjs +2 -0
  136. package/dist/core/responseValidators/actions.d.cts +24 -0
  137. package/dist/core/responseValidators/agents-diagnostics.cjs +1 -0
  138. package/dist/core/responseValidators/agents-diagnostics.d.cts +2 -0
  139. package/dist/core/responseValidators/agents.cjs +2 -0
  140. package/dist/core/responseValidators/agents.d.cts +2 -0
  141. package/dist/core/responseValidators/artifacts-diagnostics.cjs +1 -0
  142. package/dist/core/responseValidators/artifacts-diagnostics.d.cts +2 -0
  143. package/dist/core/responseValidators/artifacts.cjs +2 -0
  144. package/dist/core/responseValidators/artifacts.d.cts +2 -0
  145. package/dist/core/responseValidators/commands-diagnostics.cjs +1 -0
  146. package/dist/core/responseValidators/commands-diagnostics.d.cts +1 -0
  147. package/dist/core/responseValidators/commands.cjs +2 -0
  148. package/dist/core/responseValidators/commands.d.cts +1 -0
  149. package/dist/core/responseValidators/compact.cjs +122 -0
  150. package/dist/core/responseValidators/credits-diagnostics.cjs +1 -0
  151. package/dist/core/responseValidators/credits-diagnostics.d.cts +21 -0
  152. package/dist/core/responseValidators/credits.cjs +2 -0
  153. package/dist/core/responseValidators/credits.d.cts +21 -0
  154. package/dist/core/responseValidators/files-diagnostics.cjs +1 -0
  155. package/dist/core/responseValidators/files-diagnostics.d.cts +5 -0
  156. package/dist/core/responseValidators/files.cjs +2 -0
  157. package/dist/core/responseValidators/files.d.cts +5 -0
  158. package/dist/core/responseValidators/github-diagnostics.cjs +1 -0
  159. package/dist/core/responseValidators/github-diagnostics.d.cts +2 -0
  160. package/dist/core/responseValidators/github.cjs +2 -0
  161. package/dist/core/responseValidators/github.d.cts +2 -0
  162. package/dist/core/responseValidators/images-diagnostics.cjs +1 -0
  163. package/dist/core/responseValidators/images-diagnostics.d.cts +3 -0
  164. package/dist/core/responseValidators/images.cjs +2 -0
  165. package/dist/core/responseValidators/images.d.cts +3 -0
  166. package/dist/core/responseValidators/launchRuns-diagnostics.cjs +1 -0
  167. package/dist/core/responseValidators/launchRuns-diagnostics.d.cts +5 -0
  168. package/dist/core/responseValidators/launchRuns.cjs +2 -0
  169. package/dist/core/responseValidators/launchRuns.d.cts +5 -0
  170. package/dist/core/responseValidators/launches-diagnostics.cjs +10 -0
  171. package/dist/core/responseValidators/launches-diagnostics.d.cts +5 -0
  172. package/dist/core/responseValidators/launches.cjs +2 -0
  173. package/dist/core/responseValidators/launches.d.cts +5 -0
  174. package/dist/core/responseValidators/operations-diagnostics.cjs +1 -0
  175. package/dist/core/responseValidators/operations-diagnostics.d.cts +2 -0
  176. package/dist/core/responseValidators/operations.cjs +2 -0
  177. package/dist/core/responseValidators/operations.d.cts +2 -0
  178. package/dist/core/responseValidators/previews-diagnostics.cjs +1 -0
  179. package/dist/core/responseValidators/previews-diagnostics.d.cts +3 -0
  180. package/dist/core/responseValidators/previews.cjs +2 -0
  181. package/dist/core/responseValidators/previews.d.cts +3 -0
  182. package/dist/core/responseValidators/pricing-diagnostics.cjs +7 -0
  183. package/dist/core/responseValidators/pricing-diagnostics.d.cts +1 -0
  184. package/dist/core/responseValidators/pricing.cjs +2 -0
  185. package/dist/core/responseValidators/pricing.d.cts +1 -0
  186. package/dist/core/responseValidators/processes-diagnostics.cjs +1 -0
  187. package/dist/core/responseValidators/processes-diagnostics.d.cts +2 -0
  188. package/dist/core/responseValidators/processes.cjs +2 -0
  189. package/dist/core/responseValidators/processes.d.cts +2 -0
  190. package/dist/core/responseValidators/provider_accounts-diagnostics.cjs +1 -0
  191. package/dist/core/responseValidators/provider_accounts-diagnostics.d.cts +8 -0
  192. package/dist/core/responseValidators/provider_accounts.cjs +2 -0
  193. package/dist/core/responseValidators/provider_accounts.d.cts +8 -0
  194. package/dist/core/responseValidators/providers-diagnostics.cjs +1 -0
  195. package/dist/core/responseValidators/providers-diagnostics.d.cts +1 -0
  196. package/dist/core/responseValidators/providers.cjs +2 -0
  197. package/dist/core/responseValidators/providers.d.cts +1 -0
  198. package/dist/core/responseValidators/routing-diagnostics.cjs +1 -0
  199. package/dist/core/responseValidators/routing-diagnostics.d.cts +3 -0
  200. package/dist/core/responseValidators/routing.cjs +2 -0
  201. package/dist/core/responseValidators/routing.d.cts +3 -0
  202. package/dist/core/responseValidators/sandboxes-diagnostics.cjs +1 -0
  203. package/dist/core/responseValidators/sandboxes-diagnostics.d.cts +10 -0
  204. package/dist/core/responseValidators/sandboxes.cjs +2 -0
  205. package/dist/core/responseValidators/sandboxes.d.cts +10 -0
  206. package/dist/core/responseValidators/secrets-diagnostics.cjs +1 -0
  207. package/dist/core/responseValidators/secrets-diagnostics.d.cts +1 -0
  208. package/dist/core/responseValidators/secrets.cjs +2 -0
  209. package/dist/core/responseValidators/secrets.d.cts +1 -0
  210. package/dist/core/responseValidators/spend_limits-diagnostics.cjs +1 -0
  211. package/dist/core/responseValidators/spend_limits-diagnostics.d.cts +3 -0
  212. package/dist/core/responseValidators/spend_limits.cjs +2 -0
  213. package/dist/core/responseValidators/spend_limits.d.cts +3 -0
  214. package/dist/core/responseValidators/terminals-diagnostics.cjs +1 -0
  215. package/dist/core/responseValidators/terminals-diagnostics.d.cts +2 -0
  216. package/dist/core/responseValidators/terminals.cjs +2 -0
  217. package/dist/core/responseValidators/terminals.d.cts +2 -0
  218. package/dist/core/responseValidators/usage-diagnostics.cjs +1 -0
  219. package/dist/core/responseValidators/usage-diagnostics.d.cts +1 -0
  220. package/dist/core/responseValidators/usage.cjs +2 -0
  221. package/dist/core/responseValidators/usage.d.cts +1 -0
  222. package/dist/core/responseValidators/volumes-diagnostics.cjs +1 -0
  223. package/dist/core/responseValidators/volumes-diagnostics.d.cts +10 -0
  224. package/dist/core/responseValidators/volumes.cjs +2 -0
  225. package/dist/core/responseValidators/volumes.d.cts +10 -0
  226. package/dist/core/serverSentEvents.gen.d.ts +21 -62
  227. package/dist/core/serverSentEvents.gen.js +297 -116
  228. package/dist/core/streamErrors.d.ts +32 -0
  229. package/dist/core/streamErrors.js +51 -0
  230. package/dist/core/types.gen.d.ts +2 -2
  231. package/dist/core/types.gen.js +2 -1
  232. package/dist/core/utils.gen.d.ts +1 -1
  233. package/dist/core/utils.gen.js +16 -10
  234. package/dist/creation.gen.d.ts +21 -0
  235. package/dist/creation.gen.js +35 -0
  236. package/dist/data-origin.d.ts +25 -0
  237. package/dist/data-origin.js +57 -0
  238. package/dist/error-codes.gen.d.ts +2 -0
  239. package/dist/error-codes.gen.js +2 -0
  240. package/dist/idempotency.gen.d.ts +1 -0
  241. package/dist/idempotency.gen.js +60 -0
  242. package/dist/images.d.ts +74 -0
  243. package/dist/images.js +88 -0
  244. package/dist/index.d.ts +22 -2
  245. package/dist/index.js +79 -1
  246. package/dist/launch-input.gen.d.ts +9 -0
  247. package/dist/launch-input.gen.js +83 -0
  248. package/dist/launch.d.ts +28 -0
  249. package/dist/launch.js +222 -0
  250. package/dist/namespace-actions.d.mts +307 -0
  251. package/dist/namespace-actions.mjs +595 -0
  252. package/dist/namespace-agents.d.mts +33 -0
  253. package/dist/namespace-agents.mjs +40 -0
  254. package/dist/namespace-artifacts.d.mts +46 -0
  255. package/dist/namespace-artifacts.mjs +69 -0
  256. package/dist/namespace-base.d.mts +7 -0
  257. package/dist/namespace-base.mjs +7 -0
  258. package/dist/namespace-commands.d.mts +57 -0
  259. package/dist/namespace-commands.mjs +57 -0
  260. package/dist/namespace-credits.d.mts +213 -0
  261. package/dist/namespace-credits.mjs +476 -0
  262. package/dist/namespace-files.d.mts +203 -0
  263. package/dist/namespace-files.mjs +334 -0
  264. package/dist/namespace-github.d.mts +50 -0
  265. package/dist/namespace-github.mjs +68 -0
  266. package/dist/namespace-images.d.mts +52 -0
  267. package/dist/namespace-images.mjs +78 -0
  268. package/dist/namespace-launch_runs.d.mts +89 -0
  269. package/dist/namespace-launch_runs.mjs +133 -0
  270. package/dist/namespace-launches.d.mts +89 -0
  271. package/dist/namespace-launches.mjs +133 -0
  272. package/dist/namespace-operations.d.mts +45 -0
  273. package/dist/namespace-operations.mjs +52 -0
  274. package/dist/namespace-previews.d.mts +79 -0
  275. package/dist/namespace-previews.mjs +101 -0
  276. package/dist/namespace-pricing.d.mts +31 -0
  277. package/dist/namespace-pricing.mjs +22 -0
  278. package/dist/namespace-processes.d.mts +125 -0
  279. package/dist/namespace-processes.mjs +184 -0
  280. package/dist/namespace-provider_accounts.d.mts +156 -0
  281. package/dist/namespace-provider_accounts.mjs +241 -0
  282. package/dist/namespace-providers.d.mts +28 -0
  283. package/dist/namespace-providers.mjs +24 -0
  284. package/dist/namespace-routing.d.mts +64 -0
  285. package/dist/namespace-routing.mjs +86 -0
  286. package/dist/namespace-sandboxes.d.mts +287 -0
  287. package/dist/namespace-sandboxes.mjs +402 -0
  288. package/dist/namespace-secrets.d.mts +46 -0
  289. package/dist/namespace-secrets.mjs +68 -0
  290. package/dist/namespace-spend_limits.d.mts +48 -0
  291. package/dist/namespace-spend_limits.mjs +70 -0
  292. package/dist/namespace-terminals.d.mts +112 -0
  293. package/dist/namespace-terminals.mjs +177 -0
  294. package/dist/namespace-usage.d.mts +46 -0
  295. package/dist/namespace-usage.mjs +53 -0
  296. package/dist/namespace-volumes.d.mts +110 -0
  297. package/dist/namespace-volumes.mjs +269 -0
  298. package/dist/operations.d.ts +14 -0
  299. package/dist/operations.js +31 -0
  300. package/dist/retry.d.ts +8 -0
  301. package/dist/retry.js +63 -0
  302. package/dist/routing-choices.gen.d.ts +132 -0
  303. package/dist/routing-choices.gen.js +136 -0
  304. package/dist/routing.d.ts +23 -0
  305. package/dist/routing.js +38 -0
  306. package/dist/sandbox-handle.gen.d.ts +8 -0
  307. package/dist/sandbox-handle.gen.js +14 -0
  308. package/dist/sandboxes.d.ts +213 -0
  309. package/dist/sandboxes.js +507 -0
  310. package/dist/sdk.gen.d.ts +2016 -12
  311. package/dist/sdk.gen.js +3862 -16
  312. package/dist/server-timing.d.ts +19 -0
  313. package/dist/server-timing.gen.d.ts +265 -0
  314. package/dist/server-timing.gen.js +254 -0
  315. package/dist/server-timing.js +421 -0
  316. package/dist/spend-limits.d.ts +17 -0
  317. package/dist/spend-limits.js +26 -0
  318. package/dist/telemetry.d.ts +51 -0
  319. package/dist/telemetry.gen.d.ts +1 -0
  320. package/dist/telemetry.gen.js +5 -0
  321. package/dist/telemetry.js +438 -0
  322. package/dist/terminal.d.ts +61 -0
  323. package/dist/terminal.js +266 -0
  324. package/dist/transfer.d.ts +75 -0
  325. package/dist/transfer.js +389 -0
  326. package/dist/types.gen.d.ts +14936 -110
  327. package/dist/types.gen.js +2 -1
  328. package/dist/user-agent.d.ts +2 -0
  329. package/dist/user-agent.js +18 -0
  330. package/dist/version.gen.d.ts +1 -0
  331. package/dist/version.gen.js +5 -0
  332. package/dist/volumes.d.ts +33 -0
  333. package/dist/volumes.js +221 -0
  334. package/dist/waits.d.ts +31 -0
  335. package/dist/waits.js +42 -0
  336. package/dist/workflow-policy.gen.d.ts +41 -0
  337. package/dist/workflow-policy.gen.js +45 -0
  338. package/package.json +124 -14
@@ -0,0 +1,133 @@
1
+ import { HeyApiClient } from './namespace-base.mjs';
2
+ export class LaunchRuns extends HeyApiClient {
3
+ /**
4
+ * List launch runs
5
+ *
6
+ * List the authenticated workspace's launch runs, newest first, as lightweight summaries.
7
+ * Rows contain no copy items, specs, command data or outputs; read getLaunchRun for one
8
+ * run's copies. `total_copies` and `live_copies` cover every run in the workspace, not
9
+ * only the returned page. A live copy is one whose sandbox has not been confirmed absent,
10
+ * including copies that are stopping. The read uses stored metadata only and makes no
11
+ * provider calls. Responses are private to the workspace and must not be cached.
12
+ *
13
+ * If launch-run copies are not available to you, the read still answers 200, with `available`
14
+ * false, no runs and zero totals.
15
+ *
16
+ * `next_cursor` is an opaque, workspace-scoped value for the next page and is null on the
17
+ * last page. A cursor from another workspace or a malformed cursor is invalid_request.
18
+ *
19
+ */
20
+ list(options) {
21
+ return (options?.client ?? this.client).get({
22
+ responseStyle: 'data',
23
+ security: [{ scheme: 'bearer', type: 'http' }, {
24
+ in: 'cookie',
25
+ name: '__Host-boxrouter_session',
26
+ type: 'apiKey'
27
+ }],
28
+ url: '/launch-runs',
29
+ ...options
30
+ });
31
+ }
32
+ /**
33
+ * Start an unattended launch run
34
+ *
35
+ * Reserve one workspace-owned run and all requested copies atomically. The existing
36
+ * launch request fields select exactly one catalog agent or inline manifest; `copies`
37
+ * is required. Acceptance returns 202 with a Location for metadata polling and makes
38
+ * no provider create before the executor claims each copy. Reuse the same
39
+ * Idempotency-Key and identical body to recover an uncertain acceptance; a changed
40
+ * body conflicts and never creates another run.
41
+ *
42
+ * Credential selectors are resolved at each copy claim. Secret values and provider
43
+ * tokens are never stored. Saved secrets are re-read by name, so rotation can affect
44
+ * later copies. Inline secret_values, interactive launches, and unsupported manifest
45
+ * features are refused before reservation. The feature remains opt-in until compatible
46
+ * clients are released.
47
+ *
48
+ */
49
+ create(options) {
50
+ return (options.client ?? this.client).post({
51
+ responseStyle: 'data',
52
+ security: [{ scheme: 'bearer', type: 'http' }, {
53
+ in: 'cookie',
54
+ name: '__Host-boxrouter_session',
55
+ type: 'apiKey'
56
+ }],
57
+ url: '/launch-runs',
58
+ ...options,
59
+ headers: {
60
+ 'Content-Type': 'application/json',
61
+ ...options.headers
62
+ }
63
+ });
64
+ }
65
+ /**
66
+ * Read launch run metadata
67
+ *
68
+ * Read the stored run row and copy rows only. This response excludes command data and
69
+ * output fields and makes no provider calls. `include=command` opts into bounded state
70
+ * and exit-code observations for active copies; the server uses at most eight
71
+ * observations at once and one five-second response deadline. Unknown, hung, saturated,
72
+ * or failed observations return `unknown`. Neither variant exposes command text,
73
+ * outputs, process handles, or credentials. Foreign and missing IDs have the same 404
74
+ * response.
75
+ *
76
+ */
77
+ get(options) {
78
+ return (options.client ?? this.client).get({
79
+ responseStyle: 'data',
80
+ security: [{ scheme: 'bearer', type: 'http' }, {
81
+ in: 'cookie',
82
+ name: '__Host-boxrouter_session',
83
+ type: 'apiKey'
84
+ }],
85
+ url: '/launch-runs/{run_id}',
86
+ ...options
87
+ });
88
+ }
89
+ /**
90
+ * Stop a launch run
91
+ *
92
+ * Set the workspace-owned run's desired state to stopped and request copy cancellation. The request is idempotent; repeating stop returns the original stop timestamp. This does not imply that the provider sandbox was destroyed. Foreign and missing IDs have the same 404 response.
93
+ */
94
+ stop(options) {
95
+ return (options.client ?? this.client).post({
96
+ responseStyle: 'data',
97
+ security: [{ scheme: 'bearer', type: 'http' }, {
98
+ in: 'cookie',
99
+ name: '__Host-boxrouter_session',
100
+ type: 'apiKey'
101
+ }],
102
+ url: '/launch-runs/{run_id}/stop',
103
+ ...options
104
+ });
105
+ }
106
+ /**
107
+ * Destroy one launch-run copy
108
+ *
109
+ * Durably request cleanup of one copy of a workspace-owned run; the run and its other
110
+ * copies keep running. Acceptance records the request only: no provider call is made
111
+ * during the request, and `stopping` does not mean the sandbox is gone. The copy's
112
+ * status in getLaunchRun becomes `stopped` only after its absence is confirmed; a queued
113
+ * copy that was never dispatched has no sandbox and stops at once.
114
+ *
115
+ * The request is idempotent. Retrying it, or destroying a copy that is already stopping
116
+ * or stopped, returns the same 202 and leaves the copy's state and timestamps unchanged.
117
+ * Foreign and missing run IDs and copy indexes have the same 404 response. Responses are
118
+ * private and must not be cached.
119
+ *
120
+ */
121
+ destroyCopy(options) {
122
+ return (options.client ?? this.client).post({
123
+ responseStyle: 'data',
124
+ security: [{ scheme: 'bearer', type: 'http' }, {
125
+ in: 'cookie',
126
+ name: '__Host-boxrouter_session',
127
+ type: 'apiKey'
128
+ }],
129
+ url: '/launch-runs/{run_id}/copies/{copy_index}/destroy',
130
+ ...options
131
+ });
132
+ }
133
+ }
@@ -0,0 +1,89 @@
1
+ import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
2
+ import { HeyApiClient } from './namespace-base.mjs';
3
+ import type { LaunchesCheckRepositoryAccessData, LaunchesCheckRepositoryAccessErrors, LaunchesCheckRepositoryAccessResponses, LaunchesCreateData, LaunchesCreateErrors, LaunchesCreateResponses, LaunchesGetCommandData, LaunchesGetCommandErrors, LaunchesGetCommandResponses, LaunchesGetOperationData, LaunchesGetOperationErrors, LaunchesGetOperationResponses, LaunchesGetSettingsData, LaunchesGetSettingsErrors, LaunchesGetSettingsResponses } from './types.gen.js';
4
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
5
+ /**
6
+ * You can provide a client instance returned by `createClient()` instead of
7
+ * individual options. This might be also useful if you want to implement a
8
+ * custom client.
9
+ */
10
+ client?: Client;
11
+ /**
12
+ * You can pass arbitrary values through the `meta` object. This can be
13
+ * used to access values that aren't defined as part of the SDK function.
14
+ */
15
+ meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
16
+ };
17
+ export declare class Launches extends HeyApiClient {
18
+ /**
19
+ * Create an agent launch
20
+ *
21
+ * Create one workspace-owned sandbox and prepare it from a catalog agent or inline
22
+ * manifest. `overrides.lifetime_seconds` requests a lifetime in seconds in place of
23
+ * the manifest value. The required Idempotency-Key identifies one logical launch; retry an
24
+ * uncertain request with the same key and body. BoxRouter validates the manifest,
25
+ * the secrets, the routes and the funding first and answers 400, 402 or 409 with outcome
26
+ * `not_started` for a launch it cannot start; it returns 202 only after the launch
27
+ * operation is durably accepted. Poll the operation URL from Location for
28
+ * queued/running status and phase progress. A matching key returns the same operation,
29
+ * including the original result. New requests and matching retries both return HTTP 202.
30
+ * A key used with different input returns 409 and does not start another launch.
31
+ * Setup, file, background and preview preparation failures destroy the newly created
32
+ * sandbox before the operation becomes failed.
33
+ *
34
+ * Secret values supplied in secret_values are used only for this request and are
35
+ * never stored or returned. Names declared by the manifest can instead resolve from
36
+ * the workspace secret store. The successful operation contains the sandbox ID,
37
+ * phase results, preview URLs and enforced expiry in result.
38
+ *
39
+ */
40
+ create<ThrowOnError extends boolean = true>(options: Options<LaunchesCreateData, ThrowOnError>): RequestResult<LaunchesCreateResponses, LaunchesCreateErrors, ThrowOnError, 'data'>;
41
+ /**
42
+ * Get launch status and phase progress
43
+ *
44
+ * Returns the durable status of one launch operation owned by the caller's workspace.
45
+ * Poll while status is queued or running, respecting Retry-After when present. A
46
+ * succeeded operation includes result; a failed operation includes the original
47
+ * structured API error and its HTTP status. Secret values are never included.
48
+ *
49
+ */
50
+ getOperation<ThrowOnError extends boolean = true>(options: Options<LaunchesGetOperationData, ThrowOnError>): RequestResult<LaunchesGetOperationResponses, LaunchesGetOperationErrors, ThrowOnError, 'data'>;
51
+ /**
52
+ * Get what a launch asked for
53
+ *
54
+ * Returns the choices one launch was created with: the catalog agent or the caller's own
55
+ * source, whether BoxRouter picked the provider or the caller chose one, and the names of
56
+ * the secrets it used. Every client that creates a launch (the dashboard, the CLI, the
57
+ * SDKs) is recorded the same way, so any of them can show or repeat it. Secret values are
58
+ * never recorded or returned. A launch created before settings were recorded is 404.
59
+ *
60
+ */
61
+ getSettings<ThrowOnError extends boolean = true>(options: Options<LaunchesGetSettingsData, ThrowOnError>): RequestResult<LaunchesGetSettingsResponses, LaunchesGetSettingsErrors, ThrowOnError, 'data'>;
62
+ /**
63
+ * Get unattended command state
64
+ *
65
+ * Returns the observed state of the unattended command attached to a launch owned by the
66
+ * caller's workspace. Observation waits up to five seconds. While the command is running,
67
+ * call this endpoint again to observe its state. `unknown` means the outcome could not be
68
+ * confirmed; it is never inferred from a missing sandbox or an observation failure.
69
+ * A launch with no recorded unattended command returns 404. This response never contains
70
+ * command text, environment variables, process identity, stdout, stderr or other output.
71
+ * `timed_out` with exit code 124 means the armed command timer was observed to expire; an
72
+ * ordinary command exit with code 124 remains `exited`.
73
+ *
74
+ */
75
+ getCommand<ThrowOnError extends boolean = true>(options: Options<LaunchesGetCommandData, ThrowOnError>): RequestResult<LaunchesGetCommandResponses, LaunchesGetCommandErrors, ThrowOnError, 'data'>;
76
+ /**
77
+ * Check whether this workspace can read a repository
78
+ *
79
+ * Answers, without launching anything, whether the caller's workspace can read the
80
+ * repository: public repositories directly, private ones through the workspace's linked
81
+ * GitHub App installation. A repository that cannot be read is a 200 with readable false
82
+ * and the refusal's code, message and fix. When readable, the answer also names the commit
83
+ * the default branch (or the requested ref) points at, the repository's top-level entries
84
+ * (directories end in a slash) and the recipe a launch would use. Results are cached per
85
+ * commit and never stored in a response cache.
86
+ *
87
+ */
88
+ checkRepositoryAccess<ThrowOnError extends boolean = true>(options: Options<LaunchesCheckRepositoryAccessData, ThrowOnError>): RequestResult<LaunchesCheckRepositoryAccessResponses, LaunchesCheckRepositoryAccessErrors, ThrowOnError, 'data'>;
89
+ }
@@ -0,0 +1,133 @@
1
+ import { HeyApiClient } from './namespace-base.mjs';
2
+ export class Launches extends HeyApiClient {
3
+ /**
4
+ * Create an agent launch
5
+ *
6
+ * Create one workspace-owned sandbox and prepare it from a catalog agent or inline
7
+ * manifest. `overrides.lifetime_seconds` requests a lifetime in seconds in place of
8
+ * the manifest value. The required Idempotency-Key identifies one logical launch; retry an
9
+ * uncertain request with the same key and body. BoxRouter validates the manifest,
10
+ * the secrets, the routes and the funding first and answers 400, 402 or 409 with outcome
11
+ * `not_started` for a launch it cannot start; it returns 202 only after the launch
12
+ * operation is durably accepted. Poll the operation URL from Location for
13
+ * queued/running status and phase progress. A matching key returns the same operation,
14
+ * including the original result. New requests and matching retries both return HTTP 202.
15
+ * A key used with different input returns 409 and does not start another launch.
16
+ * Setup, file, background and preview preparation failures destroy the newly created
17
+ * sandbox before the operation becomes failed.
18
+ *
19
+ * Secret values supplied in secret_values are used only for this request and are
20
+ * never stored or returned. Names declared by the manifest can instead resolve from
21
+ * the workspace secret store. The successful operation contains the sandbox ID,
22
+ * phase results, preview URLs and enforced expiry in result.
23
+ *
24
+ */
25
+ create(options) {
26
+ return (options.client ?? this.client).post({
27
+ responseStyle: 'data',
28
+ security: [{ scheme: 'bearer', type: 'http' }, {
29
+ in: 'cookie',
30
+ name: '__Host-boxrouter_session',
31
+ type: 'apiKey'
32
+ }],
33
+ url: '/launches',
34
+ ...options,
35
+ headers: {
36
+ 'Content-Type': 'application/json',
37
+ ...options.headers
38
+ }
39
+ });
40
+ }
41
+ /**
42
+ * Get launch status and phase progress
43
+ *
44
+ * Returns the durable status of one launch operation owned by the caller's workspace.
45
+ * Poll while status is queued or running, respecting Retry-After when present. A
46
+ * succeeded operation includes result; a failed operation includes the original
47
+ * structured API error and its HTTP status. Secret values are never included.
48
+ *
49
+ */
50
+ getOperation(options) {
51
+ return (options.client ?? this.client).get({
52
+ responseStyle: 'data',
53
+ security: [{ scheme: 'bearer', type: 'http' }, {
54
+ in: 'cookie',
55
+ name: '__Host-boxrouter_session',
56
+ type: 'apiKey'
57
+ }],
58
+ url: '/launches/{operation_id}',
59
+ ...options
60
+ });
61
+ }
62
+ /**
63
+ * Get what a launch asked for
64
+ *
65
+ * Returns the choices one launch was created with: the catalog agent or the caller's own
66
+ * source, whether BoxRouter picked the provider or the caller chose one, and the names of
67
+ * the secrets it used. Every client that creates a launch (the dashboard, the CLI, the
68
+ * SDKs) is recorded the same way, so any of them can show or repeat it. Secret values are
69
+ * never recorded or returned. A launch created before settings were recorded is 404.
70
+ *
71
+ */
72
+ getSettings(options) {
73
+ return (options.client ?? this.client).get({
74
+ responseStyle: 'data',
75
+ security: [{ scheme: 'bearer', type: 'http' }, {
76
+ in: 'cookie',
77
+ name: '__Host-boxrouter_session',
78
+ type: 'apiKey'
79
+ }],
80
+ url: '/launches/{operation_id}/settings',
81
+ ...options
82
+ });
83
+ }
84
+ /**
85
+ * Get unattended command state
86
+ *
87
+ * Returns the observed state of the unattended command attached to a launch owned by the
88
+ * caller's workspace. Observation waits up to five seconds. While the command is running,
89
+ * call this endpoint again to observe its state. `unknown` means the outcome could not be
90
+ * confirmed; it is never inferred from a missing sandbox or an observation failure.
91
+ * A launch with no recorded unattended command returns 404. This response never contains
92
+ * command text, environment variables, process identity, stdout, stderr or other output.
93
+ * `timed_out` with exit code 124 means the armed command timer was observed to expire; an
94
+ * ordinary command exit with code 124 remains `exited`.
95
+ *
96
+ */
97
+ getCommand(options) {
98
+ return (options.client ?? this.client).get({
99
+ responseStyle: 'data',
100
+ security: [{ scheme: 'bearer', type: 'http' }, {
101
+ in: 'cookie',
102
+ name: '__Host-boxrouter_session',
103
+ type: 'apiKey'
104
+ }],
105
+ url: '/launches/{operation_id}/command',
106
+ ...options
107
+ });
108
+ }
109
+ /**
110
+ * Check whether this workspace can read a repository
111
+ *
112
+ * Answers, without launching anything, whether the caller's workspace can read the
113
+ * repository: public repositories directly, private ones through the workspace's linked
114
+ * GitHub App installation. A repository that cannot be read is a 200 with readable false
115
+ * and the refusal's code, message and fix. When readable, the answer also names the commit
116
+ * the default branch (or the requested ref) points at, the repository's top-level entries
117
+ * (directories end in a slash) and the recipe a launch would use. Results are cached per
118
+ * commit and never stored in a response cache.
119
+ *
120
+ */
121
+ checkRepositoryAccess(options) {
122
+ return (options.client ?? this.client).get({
123
+ responseStyle: 'data',
124
+ security: [{ scheme: 'bearer', type: 'http' }, {
125
+ in: 'cookie',
126
+ name: '__Host-boxrouter_session',
127
+ type: 'apiKey'
128
+ }],
129
+ url: '/repositories/{owner}/{repo}/access',
130
+ ...options
131
+ });
132
+ }
133
+ }
@@ -0,0 +1,45 @@
1
+ import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
2
+ import { HeyApiClient } from './namespace-base.mjs';
3
+ import type { OperationsGetData, OperationsGetErrors, OperationsGetResponses, OperationsListData, OperationsListErrors, OperationsListResponses } from './types.gen.js';
4
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
5
+ /**
6
+ * You can provide a client instance returned by `createClient()` instead of
7
+ * individual options. This might be also useful if you want to implement a
8
+ * custom client.
9
+ */
10
+ client?: Client;
11
+ /**
12
+ * You can pass arbitrary values through the `meta` object. This can be
13
+ * used to access values that aren't defined as part of the SDK function.
14
+ */
15
+ meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
16
+ };
17
+ export declare class Operations extends HeyApiClient {
18
+ /**
19
+ * List recorded workspace operations
20
+ *
21
+ * Stable ID-ordered pagination over authoritative mutation records. Observed time is the lookup time, not the original execution timestamp. Listing never reconciles or retries work.
22
+ */
23
+ list<ThrowOnError extends boolean = true>(options?: Options<OperationsListData, ThrowOnError>): RequestResult<OperationsListResponses, OperationsListErrors, ThrowOnError, 'data'>;
24
+ /**
25
+ * Get a mutation's known outcome
26
+ *
27
+ * Read the workspace-owned mutation record identified in an error response.
28
+ * This lookup never repeats the mutation. Unknown remains unknown until
29
+ * reconciliation establishes an outcome.
30
+ *
31
+ * If a creation response was lost, explicitly resubmitting POST /sandboxes
32
+ * in the original workspace with the original Idempotency-Key and identical
33
+ * effective request body recovers a retained creation record. Completed
34
+ * creation returns the original sandbox or an error retaining its operation
35
+ * ID if observing the sandbox's current state fails. An unresolved record
36
+ * returns 409 with its operation ID without dispatching creation again.
37
+ * Different input returns 409. This POST can create a sandbox if no record
38
+ * exists; it is not a read-only lookup. Unknown records remain until resolved;
39
+ * completed records remain for at least 24 hours. Without the original key and request,
40
+ * or beyond guaranteed retention, inspect owned resources or use support
41
+ * before creating more work. Never change the key to bypass uncertainty.
42
+ *
43
+ */
44
+ get<ThrowOnError extends boolean = true>(options: Options<OperationsGetData, ThrowOnError>): RequestResult<OperationsGetResponses, OperationsGetErrors, ThrowOnError, 'data'>;
45
+ }
@@ -0,0 +1,52 @@
1
+ import { HeyApiClient } from './namespace-base.mjs';
2
+ export class Operations extends HeyApiClient {
3
+ /**
4
+ * List recorded workspace operations
5
+ *
6
+ * Stable ID-ordered pagination over authoritative mutation records. Observed time is the lookup time, not the original execution timestamp. Listing never reconciles or retries work.
7
+ */
8
+ list(options) {
9
+ return (options?.client ?? this.client).get({
10
+ responseStyle: 'data',
11
+ security: [{ scheme: 'bearer', type: 'http' }, {
12
+ in: 'cookie',
13
+ name: '__Host-boxrouter_session',
14
+ type: 'apiKey'
15
+ }],
16
+ url: '/operations',
17
+ ...options
18
+ });
19
+ }
20
+ /**
21
+ * Get a mutation's known outcome
22
+ *
23
+ * Read the workspace-owned mutation record identified in an error response.
24
+ * This lookup never repeats the mutation. Unknown remains unknown until
25
+ * reconciliation establishes an outcome.
26
+ *
27
+ * If a creation response was lost, explicitly resubmitting POST /sandboxes
28
+ * in the original workspace with the original Idempotency-Key and identical
29
+ * effective request body recovers a retained creation record. Completed
30
+ * creation returns the original sandbox or an error retaining its operation
31
+ * ID if observing the sandbox's current state fails. An unresolved record
32
+ * returns 409 with its operation ID without dispatching creation again.
33
+ * Different input returns 409. This POST can create a sandbox if no record
34
+ * exists; it is not a read-only lookup. Unknown records remain until resolved;
35
+ * completed records remain for at least 24 hours. Without the original key and request,
36
+ * or beyond guaranteed retention, inspect owned resources or use support
37
+ * before creating more work. Never change the key to bypass uncertainty.
38
+ *
39
+ */
40
+ get(options) {
41
+ return (options.client ?? this.client).get({
42
+ responseStyle: 'data',
43
+ security: [{ scheme: 'bearer', type: 'http' }, {
44
+ in: 'cookie',
45
+ name: '__Host-boxrouter_session',
46
+ type: 'apiKey'
47
+ }],
48
+ url: '/operations/{operation_id}',
49
+ ...options
50
+ });
51
+ }
52
+ }
@@ -0,0 +1,79 @@
1
+ import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
2
+ import { HeyApiClient } from './namespace-base.mjs';
3
+ import type { PreviewsListData, PreviewsListErrors, PreviewsListResponses, PreviewsOpenData, PreviewsOpenErrors, PreviewsOpenResponses, PreviewsRevokeData, PreviewsRevokeErrors, PreviewsRevokeResponses } from './types.gen.js';
4
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
5
+ /**
6
+ * You can provide a client instance returned by `createClient()` instead of
7
+ * individual options. This might be also useful if you want to implement a
8
+ * custom client.
9
+ */
10
+ client?: Client;
11
+ /**
12
+ * You can pass arbitrary values through the `meta` object. This can be
13
+ * used to access values that aren't defined as part of the SDK function.
14
+ */
15
+ meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
16
+ };
17
+ export declare class Previews extends HeyApiClient {
18
+ /**
19
+ * List a sandbox's open previews
20
+ *
21
+ * You can rely on:
22
+ * - Lists the previews this sandbox has open, as recorded when they were opened; a resume forgets them, so the list is empty until one is opened again.
23
+ *
24
+ * You can set: cursor, limit.
25
+ *
26
+ * Not promised: that a listed preview still works.
27
+ *
28
+ * Records only: this call observes no provider.
29
+ *
30
+ */
31
+ list<ThrowOnError extends boolean = true>(options: Options<PreviewsListData, ThrowOnError>): RequestResult<PreviewsListResponses, PreviewsListErrors, ThrowOnError, 'data'>;
32
+ /**
33
+ * Get a URL for a sandbox port
34
+ *
35
+ * You can rely on:
36
+ * - A private preview never falls back to a public link, and a requested credential form never falls back to the other; a mode the sandbox cannot enforce is refused. A route whose declaration cannot enforce the mode is refused before anything is opened; a weaker preview a route does open is ended before the refusal, or the refusal says it may still be reachable and names its port and id.
37
+ * - Opening a port that already has a preview with the same access returns that preview instead of opening a second one.
38
+ *
39
+ * You can set: port, access, credential.
40
+ *
41
+ * Not promised: that an application is listening on the port; an expiry time unless one is enforced.
42
+ *
43
+ * Returns an HTTPS URL for one port in the sandbox and, when the link is private, where its
44
+ * credential is carried. The sandbox must have been created with the `previews`
45
+ * requirement naming that port and the access you ask for.
46
+ *
47
+ * 404 means the sandbox does not exist in this workspace. A sandbox that exists but
48
+ * was not created through this API is refused with `409 invalid_state`; one that has
49
+ * ended answers `410 sandbox_ended`.
50
+ *
51
+ * A preview is never returned with other access than the request asked for. When the
52
+ * provider answers with one (for example a public link for a private request), the call
53
+ * is refused with `502 preview_access_refused` and the unwanted preview is ended where
54
+ * the provider allows. `details.port` names the port. `details.revoked` is true when it
55
+ * was ended and no access remains. When it could not be ended the outcome is `unknown`,
56
+ * the message says the preview may still be reachable, and `details.preview_id` and
57
+ * `details.url` name a public one (a private preview's address holds a credential and is
58
+ * never repeated). The operation stays open for reconciliation: do not send the call
59
+ * again; end the sandbox to be certain no access remains.
60
+ *
61
+ */
62
+ open<ThrowOnError extends boolean = true>(options: Options<PreviewsOpenData, ThrowOnError>): RequestResult<PreviewsOpenResponses, PreviewsOpenErrors, ThrowOnError, 'data'>;
63
+ /**
64
+ * Revoke a preview
65
+ *
66
+ * You can rely on:
67
+ * - Access through the named preview ends while the sandbox and its other previews keep running; revoking a preview that already ended succeeds.
68
+ *
69
+ * You can set: preview id.
70
+ *
71
+ * Ends a preview, named by the ID that opening it returned. The sandbox must have been created
72
+ * with `previews.revocable` set to `true`; otherwise the call fails with `not_named`, and `fix`
73
+ * shows the requirement to send. A sandbox that is not running fails with `not_running`, even
74
+ * if the preview has already ended. Otherwise, ending a preview that has already ended answers
75
+ * `204`.
76
+ *
77
+ */
78
+ revoke<ThrowOnError extends boolean = true>(options: Options<PreviewsRevokeData, ThrowOnError>): RequestResult<PreviewsRevokeResponses, PreviewsRevokeErrors, ThrowOnError, 'data'>;
79
+ }
@@ -0,0 +1,101 @@
1
+ import { HeyApiClient } from './namespace-base.mjs';
2
+ export class Previews extends HeyApiClient {
3
+ /**
4
+ * List a sandbox's open previews
5
+ *
6
+ * You can rely on:
7
+ * - Lists the previews this sandbox has open, as recorded when they were opened; a resume forgets them, so the list is empty until one is opened again.
8
+ *
9
+ * You can set: cursor, limit.
10
+ *
11
+ * Not promised: that a listed preview still works.
12
+ *
13
+ * Records only: this call observes no provider.
14
+ *
15
+ */
16
+ list(options) {
17
+ return (options.client ?? this.client).get({
18
+ responseStyle: 'data',
19
+ security: [{ scheme: 'bearer', type: 'http' }, {
20
+ in: 'cookie',
21
+ name: '__Host-boxrouter_session',
22
+ type: 'apiKey'
23
+ }],
24
+ url: '/sandboxes/{sandbox_id}/previews',
25
+ ...options
26
+ });
27
+ }
28
+ /**
29
+ * Get a URL for a sandbox port
30
+ *
31
+ * You can rely on:
32
+ * - A private preview never falls back to a public link, and a requested credential form never falls back to the other; a mode the sandbox cannot enforce is refused. A route whose declaration cannot enforce the mode is refused before anything is opened; a weaker preview a route does open is ended before the refusal, or the refusal says it may still be reachable and names its port and id.
33
+ * - Opening a port that already has a preview with the same access returns that preview instead of opening a second one.
34
+ *
35
+ * You can set: port, access, credential.
36
+ *
37
+ * Not promised: that an application is listening on the port; an expiry time unless one is enforced.
38
+ *
39
+ * Returns an HTTPS URL for one port in the sandbox and, when the link is private, where its
40
+ * credential is carried. The sandbox must have been created with the `previews`
41
+ * requirement naming that port and the access you ask for.
42
+ *
43
+ * 404 means the sandbox does not exist in this workspace. A sandbox that exists but
44
+ * was not created through this API is refused with `409 invalid_state`; one that has
45
+ * ended answers `410 sandbox_ended`.
46
+ *
47
+ * A preview is never returned with other access than the request asked for. When the
48
+ * provider answers with one (for example a public link for a private request), the call
49
+ * is refused with `502 preview_access_refused` and the unwanted preview is ended where
50
+ * the provider allows. `details.port` names the port. `details.revoked` is true when it
51
+ * was ended and no access remains. When it could not be ended the outcome is `unknown`,
52
+ * the message says the preview may still be reachable, and `details.preview_id` and
53
+ * `details.url` name a public one (a private preview's address holds a credential and is
54
+ * never repeated). The operation stays open for reconciliation: do not send the call
55
+ * again; end the sandbox to be certain no access remains.
56
+ *
57
+ */
58
+ open(options) {
59
+ return (options.client ?? this.client).post({
60
+ responseStyle: 'data',
61
+ security: [{ scheme: 'bearer', type: 'http' }, {
62
+ in: 'cookie',
63
+ name: '__Host-boxrouter_session',
64
+ type: 'apiKey'
65
+ }],
66
+ url: '/sandboxes/{sandbox_id}/previews',
67
+ ...options,
68
+ headers: {
69
+ 'Content-Type': 'application/json',
70
+ ...options.headers
71
+ }
72
+ });
73
+ }
74
+ /**
75
+ * Revoke a preview
76
+ *
77
+ * You can rely on:
78
+ * - Access through the named preview ends while the sandbox and its other previews keep running; revoking a preview that already ended succeeds.
79
+ *
80
+ * You can set: preview id.
81
+ *
82
+ * Ends a preview, named by the ID that opening it returned. The sandbox must have been created
83
+ * with `previews.revocable` set to `true`; otherwise the call fails with `not_named`, and `fix`
84
+ * shows the requirement to send. A sandbox that is not running fails with `not_running`, even
85
+ * if the preview has already ended. Otherwise, ending a preview that has already ended answers
86
+ * `204`.
87
+ *
88
+ */
89
+ revoke(options) {
90
+ return (options.client ?? this.client).delete({
91
+ responseStyle: 'data',
92
+ security: [{ scheme: 'bearer', type: 'http' }, {
93
+ in: 'cookie',
94
+ name: '__Host-boxrouter_session',
95
+ type: 'apiKey'
96
+ }],
97
+ url: '/sandboxes/{sandbox_id}/previews/{preview_id}',
98
+ ...options
99
+ });
100
+ }
101
+ }