@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,269 @@
1
+ import { HeyApiClient } from './namespace-base.mjs';
2
+ export class Volumes extends HeyApiClient {
3
+ /**
4
+ * List volumes
5
+ *
6
+ * Lists volumes in the caller's workspace using cursor-based pagination. The response includes the current storage usage and live-volume policy only when those values are available.
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: '/volumes',
17
+ ...options
18
+ });
19
+ }
20
+ /**
21
+ * Create a volume
22
+ *
23
+ * The service selects its configured live backend when this workspace's live-volume policy allows creation. Backend identity is neither a request field nor a response label.
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: '/volumes',
34
+ ...options,
35
+ headers: {
36
+ 'Content-Type': 'application/json',
37
+ ...options.headers
38
+ }
39
+ });
40
+ }
41
+ /**
42
+ * Delete a volume and its checkpoints
43
+ *
44
+ * Deletes a volume and all checkpoint references and stored bytes for it. When the volume's writer is ending (its destroy was accepted), the call waits for the release, at most 120 seconds, before deleting. A running writer fails at once with volume_busy (409). Reuse a supplied Idempotency-Key with the identical request to reconcile an uncertain result; a conflicting active use can return 409.
45
+ */
46
+ delete(options) {
47
+ return (options.client ?? this.client).delete({
48
+ responseStyle: 'data',
49
+ security: [{ scheme: 'bearer', type: 'http' }, {
50
+ in: 'cookie',
51
+ name: '__Host-boxrouter_session',
52
+ type: 'apiKey'
53
+ }],
54
+ url: '/volumes/{volume_id}',
55
+ ...options
56
+ });
57
+ }
58
+ /**
59
+ * Get a volume
60
+ *
61
+ * Returns metadata for a BoxRouter-managed volume in the caller's workspace.
62
+ */
63
+ get(options) {
64
+ return (options.client ?? this.client).get({
65
+ responseStyle: 'data',
66
+ security: [{ scheme: 'bearer', type: 'http' }, {
67
+ in: 'cookie',
68
+ name: '__Host-boxrouter_session',
69
+ type: 'apiKey'
70
+ }],
71
+ url: '/volumes/{volume_id}',
72
+ ...options
73
+ });
74
+ }
75
+ /**
76
+ * List volume checkpoints
77
+ *
78
+ * Lists committed checkpoints for this volume, newest first. A checkpoint created by an in-progress save is not listed until the save commits.
79
+ */
80
+ listCheckpoints(options) {
81
+ return (options.client ?? this.client).get({
82
+ responseStyle: 'data',
83
+ security: [{ scheme: 'bearer', type: 'http' }, {
84
+ in: 'cookie',
85
+ name: '__Host-boxrouter_session',
86
+ type: 'apiKey'
87
+ }],
88
+ url: '/volumes/{volume_id}/checkpoints',
89
+ ...options
90
+ });
91
+ }
92
+ /**
93
+ * Save a volume checkpoint
94
+ *
95
+ * Saves the current volume filesystem as an immutable checkpoint. The optional sandbox_id identifies the expected writer-lease holder; if omitted, the current holder is used. A mounted branch sandbox can be named to checkpoint its branch files without advancing the source volume's head. Read-only sandboxes cannot save. Reuse a supplied Idempotency-Key with the identical request to reconcile an uncertain response.
96
+ */
97
+ save(options) {
98
+ return (options.client ?? this.client).post({
99
+ responseStyle: 'data',
100
+ security: [{ scheme: 'bearer', type: 'http' }, {
101
+ in: 'cookie',
102
+ name: '__Host-boxrouter_session',
103
+ type: 'apiKey'
104
+ }],
105
+ url: '/volumes/{volume_id}/checkpoints',
106
+ ...options,
107
+ headers: {
108
+ 'Content-Type': 'application/json',
109
+ ...options.headers
110
+ }
111
+ });
112
+ }
113
+ /**
114
+ * Delete a checkpoint
115
+ *
116
+ * Removes the checkpoint reference. Backend data is reclaimed when the volume is erased.
117
+ */
118
+ deleteCheckpoint(options) {
119
+ return (options.client ?? this.client).delete({
120
+ responseStyle: 'data',
121
+ security: [{ scheme: 'bearer', type: 'http' }, {
122
+ in: 'cookie',
123
+ name: '__Host-boxrouter_session',
124
+ type: 'apiKey'
125
+ }],
126
+ url: '/volumes/{volume_id}/checkpoints/{checkpoint}',
127
+ ...options
128
+ });
129
+ }
130
+ /**
131
+ * Get a volume checkpoint
132
+ *
133
+ * Returns an immutable committed checkpoint by its volume ID and checkpoint number.
134
+ */
135
+ getCheckpoint(options) {
136
+ return (options.client ?? this.client).get({
137
+ responseStyle: 'data',
138
+ security: [{ scheme: 'bearer', type: 'http' }, {
139
+ in: 'cookie',
140
+ name: '__Host-boxrouter_session',
141
+ type: 'apiKey'
142
+ }],
143
+ url: '/volumes/{volume_id}/checkpoints/{checkpoint}',
144
+ ...options
145
+ });
146
+ }
147
+ /**
148
+ * Release a volume's writer lease
149
+ *
150
+ * Releases the volume's writer lease and advances its epoch, invalidating the former writer's lease token. Reuse a supplied Idempotency-Key with the identical request to reconcile an uncertain result.
151
+ */
152
+ release(options) {
153
+ return (options.client ?? this.client).delete({
154
+ responseStyle: 'data',
155
+ security: [{ scheme: 'bearer', type: 'http' }, {
156
+ in: 'cookie',
157
+ name: '__Host-boxrouter_session',
158
+ type: 'apiKey'
159
+ }],
160
+ url: '/volumes/{volume_id}/lease',
161
+ ...options
162
+ });
163
+ }
164
+ /**
165
+ * Create a volume file upload
166
+ *
167
+ * Creates a multipart upload for a file that will appear at
168
+ * `/workspace/<path>` in sandboxes. Upload every returned part URL with an
169
+ * HTTP PUT containing exactly that part's bytes; save the response `ETag`
170
+ * header for the completion request. Part URLs expire after six hours.
171
+ * An open upload blocks `write` sandboxes, and a live or pending `write`
172
+ * attachment blocks uploads (`volume_busy`). `read` and `shared` attachments
173
+ * may coexist, but their sandboxes may need to refresh their volume cache to
174
+ * see the new file.
175
+ *
176
+ */
177
+ createUpload(options) {
178
+ return (options.client ?? this.client).post({
179
+ responseStyle: 'data',
180
+ security: [{ scheme: 'bearer', type: 'http' }, {
181
+ in: 'cookie',
182
+ name: '__Host-boxrouter_session',
183
+ type: 'apiKey'
184
+ }],
185
+ url: '/volumes/{volume_id}/uploads',
186
+ ...options,
187
+ headers: {
188
+ 'Content-Type': 'application/json',
189
+ ...options.headers
190
+ }
191
+ });
192
+ }
193
+ /**
194
+ * Complete a volume file upload
195
+ *
196
+ * Supply each part number exactly once with the `ETag` header returned by its PUT response.
197
+ */
198
+ completeUpload(options) {
199
+ return (options.client ?? this.client).post({
200
+ responseStyle: 'data',
201
+ security: [{ scheme: 'bearer', type: 'http' }, {
202
+ in: 'cookie',
203
+ name: '__Host-boxrouter_session',
204
+ type: 'apiKey'
205
+ }],
206
+ url: '/volumes/{volume_id}/uploads/{upload_id}/complete',
207
+ ...options,
208
+ headers: {
209
+ 'Content-Type': 'application/json',
210
+ ...options.headers
211
+ }
212
+ });
213
+ }
214
+ /**
215
+ * Abort a volume file upload
216
+ *
217
+ * Aborts an open multipart upload for this volume. Repeating an abort is safe; the uploaded file is not made visible in the volume.
218
+ */
219
+ abortUpload(options) {
220
+ return (options.client ?? this.client).delete({
221
+ responseStyle: 'data',
222
+ security: [{ scheme: 'bearer', type: 'http' }, {
223
+ in: 'cookie',
224
+ name: '__Host-boxrouter_session',
225
+ type: 'apiKey'
226
+ }],
227
+ url: '/volumes/{volume_id}/uploads/{upload_id}',
228
+ ...options
229
+ });
230
+ }
231
+ /**
232
+ * Create a volume file download
233
+ *
234
+ * Creates a temporary download link that expires after one hour.
235
+ */
236
+ createDownload(options) {
237
+ return (options.client ?? this.client).post({
238
+ responseStyle: 'data',
239
+ security: [{ scheme: 'bearer', type: 'http' }, {
240
+ in: 'cookie',
241
+ name: '__Host-boxrouter_session',
242
+ type: 'apiKey'
243
+ }],
244
+ url: '/volumes/{volume_id}/downloads',
245
+ ...options,
246
+ headers: {
247
+ 'Content-Type': 'application/json',
248
+ ...options.headers
249
+ }
250
+ });
251
+ }
252
+ /**
253
+ * List files in a volume
254
+ *
255
+ * Recursively lists files in path order without a directory delimiter. Read and shared sandboxes may need to refresh their volume cache to see new files.
256
+ */
257
+ listFiles(options) {
258
+ return (options.client ?? this.client).get({
259
+ responseStyle: 'data',
260
+ security: [{ scheme: 'bearer', type: 'http' }, {
261
+ in: 'cookie',
262
+ name: '__Host-boxrouter_session',
263
+ type: 'apiKey'
264
+ }],
265
+ url: '/volumes/{volume_id}/files',
266
+ ...options
267
+ });
268
+ }
269
+ }
@@ -0,0 +1,14 @@
1
+ import type { BoxRouterApi } from './sdk.gen';
2
+ import type { Operation } from './types.gen';
3
+ import type { RequestOptions } from './sandboxes';
4
+ /** Read the recorded outcome of a mutation, or wait until it is no longer unknown. */
5
+ export declare class OperationResources {
6
+ private readonly api;
7
+ constructor(api: BoxRouterApi);
8
+ /**
9
+ * Read an operation until its outcome is known, then return it. An `unknown` outcome stays unknown
10
+ * until BoxRouter reconciles it. Rejects with a TimeoutError when it is still unknown after the bound,
11
+ * and never repeats the mutation itself.
12
+ */
13
+ wait(id: string, options?: RequestOptions): Promise<Operation>;
14
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OperationResources = void 0;
4
+ const workflow_policy_gen_1 = require("./workflow-policy.gen");
5
+ const waits_1 = require("./waits");
6
+ /** Read the recorded outcome of a mutation, or wait until it is no longer unknown. */
7
+ class OperationResources {
8
+ api;
9
+ constructor(api) {
10
+ this.api = api;
11
+ }
12
+ /**
13
+ * Read an operation until its outcome is known, then return it. An `unknown` outcome stays unknown
14
+ * until BoxRouter reconciles it. Rejects with a TimeoutError when it is still unknown after the bound,
15
+ * and never repeats the mutation itself.
16
+ */
17
+ async wait(id, options = {}) {
18
+ const read = () => this.api.operations.get({
19
+ path: { operation_id: id }, signal: options.signal
20
+ });
21
+ const first = await read();
22
+ return (0, waits_1.pollWhile)(first, {
23
+ pending: operation => workflow_policy_gen_1.OPERATION_WAIT_PENDING.includes(operation.outcome),
24
+ read,
25
+ timing: { intervalSeconds: workflow_policy_gen_1.OPERATION_WAIT_POLL_INTERVAL_SECONDS, boundSeconds: workflow_policy_gen_1.OPERATION_WAIT_BOUND_SECONDS },
26
+ timeout: () => new waits_1.WaitTimeoutError(id, `Operation ${id} is still ${first.outcome} after ${workflow_policy_gen_1.OPERATION_WAIT_BOUND_SECONDS} s; ` +
27
+ 'inspect it before sending the request again'),
28
+ });
29
+ }
30
+ }
31
+ exports.OperationResources = OperationResources;
@@ -0,0 +1,8 @@
1
+ /** The client's `maxRetries`: an explicit count, or the shared default. */
2
+ export declare function checkMaxRetries(value: number | undefined): number;
3
+ /**
4
+ * Resend a call the server marked `retry: safe`, with the same idempotency key; every other failure
5
+ * goes to the caller. Only a call that can be sent twice is held for a resend: it has no body, or it
6
+ * carries an idempotency key.
7
+ */
8
+ export declare function retryingFetch(fetch: () => typeof globalThis.fetch, maxRetries: number, sleep?: (seconds: number) => Promise<void>): typeof globalThis.fetch;
package/dist/retry.js ADDED
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkMaxRetries = checkMaxRetries;
4
+ exports.retryingFetch = retryingFetch;
5
+ const workflow_policy_gen_1 = require("./workflow-policy.gen");
6
+ /** Sent with a key made for this request; a resend must let Cloud check its record first. */
7
+ const FIRST_SEND_HEADER = 'X-BoxRouter-First-Send';
8
+ const wait = (seconds) => new Promise(resolve => setTimeout(resolve, seconds * 1000));
9
+ /** The client's `maxRetries`: an explicit count, or the shared default. */
10
+ function checkMaxRetries(value) {
11
+ if (value === undefined)
12
+ return workflow_policy_gen_1.DEFAULT_MAX_RETRIES;
13
+ if (!Number.isSafeInteger(value) || value < 0)
14
+ throw new TypeError('maxRetries must be a non-negative integer');
15
+ return value;
16
+ }
17
+ /** Seconds to wait before resending this response's request, or undefined to return it to the caller. */
18
+ async function retryDelay(response, retriesMade, maxRetries) {
19
+ if (response.status < 400 || retriesMade >= maxRetries)
20
+ return undefined;
21
+ if (!(response.headers.get('content-type') ?? '').includes('json'))
22
+ return undefined;
23
+ let body;
24
+ try {
25
+ body = await response.clone().json();
26
+ }
27
+ catch {
28
+ return undefined;
29
+ }
30
+ const error = body !== null && typeof body === 'object' ? body.error : undefined;
31
+ if (error === null || typeof error !== 'object')
32
+ return undefined;
33
+ const { retry, retry_after_seconds: after } = error;
34
+ if (retry !== workflow_policy_gen_1.RETRY_WHEN)
35
+ return undefined;
36
+ const delay = typeof after === 'number' && Number.isFinite(after) && after >= 0
37
+ ? after : Math.min(workflow_policy_gen_1.RETRY_BASE_DELAY_SECONDS * 2 ** retriesMade, workflow_policy_gen_1.RETRY_MAX_DELAY_SECONDS);
38
+ return delay <= workflow_policy_gen_1.RETRY_MAX_DELAY_SECONDS ? delay : undefined;
39
+ }
40
+ /**
41
+ * Resend a call the server marked `retry: safe`, with the same idempotency key; every other failure
42
+ * goes to the caller. Only a call that can be sent twice is held for a resend: it has no body, or it
43
+ * carries an idempotency key.
44
+ */
45
+ function retryingFetch(fetch, maxRetries, sleep = wait) {
46
+ return async (input, init) => {
47
+ let request = input instanceof Request && init === undefined ? input : new Request(input, init);
48
+ if (maxRetries === 0 || (request.body !== null && !request.headers.has('Idempotency-Key'))) {
49
+ return fetch()(request);
50
+ }
51
+ for (let retries = 0;; retries++) {
52
+ const replay = request.clone();
53
+ const response = await fetch()(request);
54
+ const delay = await retryDelay(response, retries, maxRetries);
55
+ if (delay === undefined)
56
+ return response;
57
+ await response.body?.cancel();
58
+ await sleep(delay);
59
+ replay.headers.delete(FIRST_SEND_HEADER);
60
+ request = replay;
61
+ }
62
+ };
63
+ }
@@ -0,0 +1,132 @@
1
+ export declare const SORT_CHOICES: {
2
+ readonly price: {
3
+ readonly label: "Price";
4
+ readonly line: "Lowest hourly price first.";
5
+ readonly measure: "price";
6
+ readonly better: "lower";
7
+ };
8
+ readonly time: {
9
+ readonly label: "Time";
10
+ readonly line: "Shortest run time measured on reference workloads first.";
11
+ readonly measure: "time";
12
+ readonly better: "lower";
13
+ };
14
+ };
15
+ export declare const MODE_CHOICES: {
16
+ readonly automatic: {
17
+ readonly label: "Auto";
18
+ readonly line: "A random draw weighted toward lower hourly price.";
19
+ };
20
+ readonly cheapest: {
21
+ readonly label: "Cheapest";
22
+ readonly line: "Lowest hourly price first.";
23
+ readonly measure: "price";
24
+ readonly better: "lower";
25
+ };
26
+ readonly fastest: {
27
+ readonly label: "Fastest";
28
+ readonly line: "Shortest run time measured on reference workloads first.";
29
+ readonly measure: "time";
30
+ readonly better: "lower";
31
+ };
32
+ readonly custom: {
33
+ readonly label: "Custom";
34
+ readonly line: "Your exact provider order, top to bottom.";
35
+ };
36
+ };
37
+ export declare const OBJECTIVE_CHOICES: {
38
+ readonly default: {
39
+ readonly label: "Workspace setting";
40
+ readonly line: "Uses the workspace routing setting.";
41
+ };
42
+ readonly fastest: {
43
+ readonly label: "Fastest";
44
+ readonly line: "Shortest run time measured on reference workloads first.";
45
+ readonly measure: "time";
46
+ readonly better: "lower";
47
+ };
48
+ readonly cheapest: {
49
+ readonly label: "Cheapest";
50
+ readonly line: "Lowest hourly price first.";
51
+ readonly measure: "price";
52
+ readonly better: "lower";
53
+ };
54
+ };
55
+ export declare const RANKED_BY_CHOICES: {
56
+ readonly price: {
57
+ readonly label: "Price";
58
+ readonly line: "Lowest hourly price first.";
59
+ readonly measure: "price";
60
+ readonly better: "lower";
61
+ };
62
+ readonly time: {
63
+ readonly label: "Time";
64
+ readonly line: "Shortest run time measured on reference workloads first.";
65
+ readonly measure: "time";
66
+ readonly better: "lower";
67
+ };
68
+ readonly providers: {
69
+ readonly label: "Providers";
70
+ readonly line: "The hard list order.";
71
+ };
72
+ readonly order: {
73
+ readonly label: "Order";
74
+ readonly line: "A soft provider preference.";
75
+ };
76
+ };
77
+ export declare const RANKING_REASON_CHOICES: {
78
+ readonly lowest_price: {
79
+ readonly label: "Lowest price";
80
+ readonly line: "Lowest hourly price of the routes ranked together.";
81
+ };
82
+ readonly weighted_price: {
83
+ readonly label: "Weighted price";
84
+ readonly line: "Automatic mode leads with a draw weighted toward lower prices, so the leader can change between creates; the routes behind it follow by price.";
85
+ };
86
+ readonly lowest_time: {
87
+ readonly label: "Lowest time";
88
+ readonly line: "Shortest run time measured on reference workloads first.";
89
+ };
90
+ readonly predicted_completion: {
91
+ readonly label: "Predicted completion";
92
+ readonly line: "Soonest predicted completion among the routes ranked together.";
93
+ };
94
+ readonly predicted_ready_time: {
95
+ readonly label: "Predicted ready time";
96
+ readonly line: "Ordered by predicted time to ready from this workspace's history.";
97
+ };
98
+ readonly explicit_order: {
99
+ readonly label: "Explicit order";
100
+ readonly line: "Placed by the provider order you set in Routing or in the request.";
101
+ };
102
+ readonly after_named_providers: {
103
+ readonly label: "After named providers";
104
+ readonly line: "Behind the providers you named in your order; the others keep BoxRouter's ranking.";
105
+ };
106
+ readonly provider_key_order: {
107
+ readonly label: "Provider key order";
108
+ readonly line: "Another key of a provider already placed; one provider's keys are tried in the order you set in Routing.";
109
+ };
110
+ readonly only_eligible_route: {
111
+ readonly label: "Only eligible route";
112
+ readonly line: "Nothing else to rank it against in its group.";
113
+ };
114
+ readonly health_deprioritized: {
115
+ readonly label: "Health deprioritized";
116
+ readonly line: "Recent failures or degraded health put it behind healthier routes.";
117
+ };
118
+ readonly price_unknown: {
119
+ readonly label: "Price unknown";
120
+ readonly line: "No price quote at this size, so routes with a quote are tried first.";
121
+ };
122
+ readonly no_signals: {
123
+ readonly label: "No signals";
124
+ readonly line: "No price or time signals exist yet, so it keeps BoxRouter's default order.";
125
+ };
126
+ };
127
+ export declare const RUNNER_OBJECTIVE_CHOICES: {
128
+ readonly any: {
129
+ readonly label: "Any Fit";
130
+ readonly line: "on any available provider with this size.";
131
+ };
132
+ };
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RUNNER_OBJECTIVE_CHOICES = exports.RANKING_REASON_CHOICES = exports.RANKED_BY_CHOICES = exports.OBJECTIVE_CHOICES = exports.MODE_CHOICES = exports.SORT_CHOICES = void 0;
4
+ // Routing choice labels and meanings declared by OpenAPI (x-boxrouter-choices).
5
+ exports.SORT_CHOICES = {
6
+ "price": {
7
+ "label": "Price",
8
+ "line": "Lowest hourly price first.",
9
+ "measure": "price",
10
+ "better": "lower"
11
+ },
12
+ "time": {
13
+ "label": "Time",
14
+ "line": "Shortest run time measured on reference workloads first.",
15
+ "measure": "time",
16
+ "better": "lower"
17
+ }
18
+ };
19
+ exports.MODE_CHOICES = {
20
+ "automatic": {
21
+ "label": "Auto",
22
+ "line": "A random draw weighted toward lower hourly price."
23
+ },
24
+ "cheapest": {
25
+ "label": "Cheapest",
26
+ "line": "Lowest hourly price first.",
27
+ "measure": "price",
28
+ "better": "lower"
29
+ },
30
+ "fastest": {
31
+ "label": "Fastest",
32
+ "line": "Shortest run time measured on reference workloads first.",
33
+ "measure": "time",
34
+ "better": "lower"
35
+ },
36
+ "custom": {
37
+ "label": "Custom",
38
+ "line": "Your exact provider order, top to bottom."
39
+ }
40
+ };
41
+ exports.OBJECTIVE_CHOICES = {
42
+ "default": {
43
+ "label": "Workspace setting",
44
+ "line": "Uses the workspace routing setting."
45
+ },
46
+ "fastest": {
47
+ "label": "Fastest",
48
+ "line": "Shortest run time measured on reference workloads first.",
49
+ "measure": "time",
50
+ "better": "lower"
51
+ },
52
+ "cheapest": {
53
+ "label": "Cheapest",
54
+ "line": "Lowest hourly price first.",
55
+ "measure": "price",
56
+ "better": "lower"
57
+ }
58
+ };
59
+ exports.RANKED_BY_CHOICES = {
60
+ "price": {
61
+ "label": "Price",
62
+ "line": "Lowest hourly price first.",
63
+ "measure": "price",
64
+ "better": "lower"
65
+ },
66
+ "time": {
67
+ "label": "Time",
68
+ "line": "Shortest run time measured on reference workloads first.",
69
+ "measure": "time",
70
+ "better": "lower"
71
+ },
72
+ "providers": {
73
+ "label": "Providers",
74
+ "line": "The hard list order."
75
+ },
76
+ "order": {
77
+ "label": "Order",
78
+ "line": "A soft provider preference."
79
+ }
80
+ };
81
+ exports.RANKING_REASON_CHOICES = {
82
+ "lowest_price": {
83
+ "label": "Lowest price",
84
+ "line": "Lowest hourly price of the routes ranked together."
85
+ },
86
+ "weighted_price": {
87
+ "label": "Weighted price",
88
+ "line": "Automatic mode leads with a draw weighted toward lower prices, so the leader can change between creates; the routes behind it follow by price."
89
+ },
90
+ "lowest_time": {
91
+ "label": "Lowest time",
92
+ "line": "Shortest run time measured on reference workloads first."
93
+ },
94
+ "predicted_completion": {
95
+ "label": "Predicted completion",
96
+ "line": "Soonest predicted completion among the routes ranked together."
97
+ },
98
+ "predicted_ready_time": {
99
+ "label": "Predicted ready time",
100
+ "line": "Ordered by predicted time to ready from this workspace's history."
101
+ },
102
+ "explicit_order": {
103
+ "label": "Explicit order",
104
+ "line": "Placed by the provider order you set in Routing or in the request."
105
+ },
106
+ "after_named_providers": {
107
+ "label": "After named providers",
108
+ "line": "Behind the providers you named in your order; the others keep BoxRouter's ranking."
109
+ },
110
+ "provider_key_order": {
111
+ "label": "Provider key order",
112
+ "line": "Another key of a provider already placed; one provider's keys are tried in the order you set in Routing."
113
+ },
114
+ "only_eligible_route": {
115
+ "label": "Only eligible route",
116
+ "line": "Nothing else to rank it against in its group."
117
+ },
118
+ "health_deprioritized": {
119
+ "label": "Health deprioritized",
120
+ "line": "Recent failures or degraded health put it behind healthier routes."
121
+ },
122
+ "price_unknown": {
123
+ "label": "Price unknown",
124
+ "line": "No price quote at this size, so routes with a quote are tried first."
125
+ },
126
+ "no_signals": {
127
+ "label": "No signals",
128
+ "line": "No price or time signals exist yet, so it keeps BoxRouter's default order."
129
+ }
130
+ };
131
+ exports.RUNNER_OBJECTIVE_CHOICES = {
132
+ "any": {
133
+ "label": "Any Fit",
134
+ "line": "on any available provider with this size."
135
+ }
136
+ };
@@ -0,0 +1,23 @@
1
+ import type { BoxRouterApi } from './sdk.gen';
2
+ import type { ProviderFundingUpdate, ProviderSlug, RoutingFieldsUpdate } from './types.gen';
3
+ import type { RequestOptions } from './sandboxes';
4
+ type RoutingApi = BoxRouterApi['routing'];
5
+ type Settings = Awaited<ReturnType<RoutingApi['settings']>>;
6
+ type Preview = Awaited<ReturnType<RoutingApi['preview']>>;
7
+ /** Guard a routing write with the section token read from `settings().section_etags`. */
8
+ export interface RoutingWriteOptions extends RequestOptions {
9
+ ifMatch?: string;
10
+ }
11
+ /** Workspace Routing settings and read-only availability preview. */
12
+ export declare class RoutingResources {
13
+ private readonly api;
14
+ constructor(api: BoxRouterApi);
15
+ settings(options?: RequestOptions): Promise<Settings>;
16
+ /** Change only the routing fields you give; omitted fields keep their stored values. */
17
+ update(fields: RoutingFieldsUpdate, options?: RoutingWriteOptions): Promise<Settings>;
18
+ /** Change only the funding fields you give for one provider. */
19
+ updateFunding(provider: ProviderSlug, funding: ProviderFundingUpdate, options?: RoutingWriteOptions): Promise<Settings>;
20
+ /** Read current routing availability; this is not a route prediction. */
21
+ preview(options?: RequestOptions): Promise<Preview>;
22
+ }
23
+ export {};