@boxrouter/sdk 0.0.0-stage → 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 (343) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +40 -0
  3. package/README.md +508 -2
  4. package/dist/addresses.d.ts +5 -0
  5. package/dist/addresses.js +10 -0
  6. package/dist/api-error.d.ts +62 -0
  7. package/dist/api-error.js +264 -0
  8. package/dist/boxrouter.d.ts +68 -0
  9. package/dist/boxrouter.js +291 -0
  10. package/dist/browser-session/index.d.ts +17 -0
  11. package/dist/browser-session/index.js +48 -0
  12. package/dist/browser-session/operations.gen.d.ts +272 -0
  13. package/dist/browser-session/operations.gen.js +58 -0
  14. package/dist/browser-session/responseContracts/api_keys.d.ts +2 -0
  15. package/dist/browser-session/responseContracts/api_keys.js +10 -0
  16. package/dist/browser-session/responseContracts/credits.d.ts +2 -0
  17. package/dist/browser-session/responseContracts/credits.js +8 -0
  18. package/dist/browser-session/responseContracts/github.d.ts +2 -0
  19. package/dist/browser-session/responseContracts/github.js +11 -0
  20. package/dist/browser-session/responseContracts/identity.d.ts +2 -0
  21. package/dist/browser-session/responseContracts/identity.js +30 -0
  22. package/dist/browser-session/responseContracts/organizations.d.ts +2 -0
  23. package/dist/browser-session/responseContracts/organizations.js +17 -0
  24. package/dist/browser-session/responseContracts/privacy.d.ts +2 -0
  25. package/dist/browser-session/responseContracts/privacy.js +7 -0
  26. package/dist/browser-session/responseContracts.gen.d.ts +3 -0
  27. package/dist/browser-session/responseContracts.gen.js +10 -0
  28. package/dist/browser-session/responseValidators/api_keys-diagnostics.cjs +1 -0
  29. package/dist/browser-session/responseValidators/api_keys-diagnostics.d.cts +4 -0
  30. package/dist/browser-session/responseValidators/api_keys.cjs +2 -0
  31. package/dist/browser-session/responseValidators/api_keys.d.cts +4 -0
  32. package/dist/browser-session/responseValidators/credits-diagnostics.cjs +1 -0
  33. package/dist/browser-session/responseValidators/credits-diagnostics.d.cts +3 -0
  34. package/dist/browser-session/responseValidators/credits.cjs +2 -0
  35. package/dist/browser-session/responseValidators/credits.d.cts +3 -0
  36. package/dist/browser-session/responseValidators/github-diagnostics.cjs +1 -0
  37. package/dist/browser-session/responseValidators/github-diagnostics.d.cts +3 -0
  38. package/dist/browser-session/responseValidators/github.cjs +2 -0
  39. package/dist/browser-session/responseValidators/github.d.cts +3 -0
  40. package/dist/browser-session/responseValidators/identity-diagnostics.cjs +1 -0
  41. package/dist/browser-session/responseValidators/identity-diagnostics.d.cts +23 -0
  42. package/dist/browser-session/responseValidators/identity.cjs +2 -0
  43. package/dist/browser-session/responseValidators/identity.d.cts +23 -0
  44. package/dist/browser-session/responseValidators/organizations-diagnostics.cjs +1 -0
  45. package/dist/browser-session/responseValidators/organizations-diagnostics.d.cts +15 -0
  46. package/dist/browser-session/responseValidators/organizations.cjs +2 -0
  47. package/dist/browser-session/responseValidators/organizations.d.cts +15 -0
  48. package/dist/browser-session/responseValidators/privacy-diagnostics.cjs +1 -0
  49. package/dist/browser-session/responseValidators/privacy-diagnostics.d.cts +2 -0
  50. package/dist/browser-session/responseValidators/privacy.cjs +2 -0
  51. package/dist/browser-session/responseValidators/privacy.d.cts +2 -0
  52. package/dist/client/client.gen.d.ts +2 -0
  53. package/dist/client/client.gen.js +168 -0
  54. package/dist/client/index.d.ts +10 -0
  55. package/dist/client/index.js +17 -0
  56. package/dist/client/types.gen.d.ts +120 -0
  57. package/dist/client/types.gen.js +3 -0
  58. package/dist/client/utils.gen.d.ts +37 -0
  59. package/dist/client/utils.gen.js +239 -0
  60. package/dist/client.gen.d.ts +12 -0
  61. package/dist/client.gen.js +6 -0
  62. package/dist/command-check.gen.d.ts +14 -0
  63. package/dist/command-check.gen.js +23 -0
  64. package/dist/command-input.gen.d.ts +6 -0
  65. package/dist/command-input.gen.js +45 -0
  66. package/dist/core/auth.gen.d.ts +25 -0
  67. package/dist/core/auth.gen.js +18 -0
  68. package/dist/core/binaryStream.d.ts +8 -0
  69. package/dist/core/binaryStream.js +76 -0
  70. package/dist/core/bodySerializer.gen.d.ts +25 -0
  71. package/dist/core/bodySerializer.gen.js +60 -0
  72. package/dist/core/commandValidators.cjs +1 -0
  73. package/dist/core/commandValidators.d.cts +14 -0
  74. package/dist/core/eventValidation.d.ts +17 -0
  75. package/dist/core/eventValidation.js +56 -0
  76. package/dist/core/eventValidators.cjs +1 -0
  77. package/dist/core/eventValidators.d.cts +2 -0
  78. package/dist/core/json.d.ts +3 -0
  79. package/dist/core/json.js +33 -0
  80. package/dist/core/params.gen.d.ts +43 -0
  81. package/dist/core/params.gen.js +112 -0
  82. package/dist/core/pathSerializer.gen.d.ts +33 -0
  83. package/dist/core/pathSerializer.gen.js +115 -0
  84. package/dist/core/queryKeySerializer.gen.d.ts +18 -0
  85. package/dist/core/queryKeySerializer.gen.js +98 -0
  86. package/dist/core/responseContracts/actions.d.ts +2 -0
  87. package/dist/core/responseContracts/actions.js +30 -0
  88. package/dist/core/responseContracts/agents.d.ts +2 -0
  89. package/dist/core/responseContracts/agents.js +7 -0
  90. package/dist/core/responseContracts/artifacts.d.ts +2 -0
  91. package/dist/core/responseContracts/artifacts.js +8 -0
  92. package/dist/core/responseContracts/commands.d.ts +2 -0
  93. package/dist/core/responseContracts/commands.js +6 -0
  94. package/dist/core/responseContracts/credits.d.ts +2 -0
  95. package/dist/core/responseContracts/credits.js +27 -0
  96. package/dist/core/responseContracts/files.d.ts +2 -0
  97. package/dist/core/responseContracts/files.js +15 -0
  98. package/dist/core/responseContracts/github.d.ts +2 -0
  99. package/dist/core/responseContracts/github.js +8 -0
  100. package/dist/core/responseContracts/images.d.ts +2 -0
  101. package/dist/core/responseContracts/images.js +8 -0
  102. package/dist/core/responseContracts/launchRuns.d.ts +2 -0
  103. package/dist/core/responseContracts/launchRuns.js +10 -0
  104. package/dist/core/responseContracts/launches.d.ts +2 -0
  105. package/dist/core/responseContracts/launches.js +10 -0
  106. package/dist/core/responseContracts/operations.d.ts +2 -0
  107. package/dist/core/responseContracts/operations.js +7 -0
  108. package/dist/core/responseContracts/previews.d.ts +2 -0
  109. package/dist/core/responseContracts/previews.js +8 -0
  110. package/dist/core/responseContracts/pricing.d.ts +2 -0
  111. package/dist/core/responseContracts/pricing.js +6 -0
  112. package/dist/core/responseContracts/processes.d.ts +2 -0
  113. package/dist/core/responseContracts/processes.js +11 -0
  114. package/dist/core/responseContracts/provider_accounts.d.ts +2 -0
  115. package/dist/core/responseContracts/provider_accounts.js +13 -0
  116. package/dist/core/responseContracts/providers.d.ts +2 -0
  117. package/dist/core/responseContracts/providers.js +6 -0
  118. package/dist/core/responseContracts/routing.d.ts +2 -0
  119. package/dist/core/responseContracts/routing.js +8 -0
  120. package/dist/core/responseContracts/sandboxes.d.ts +2 -0
  121. package/dist/core/responseContracts/sandboxes.js +15 -0
  122. package/dist/core/responseContracts/secrets.d.ts +2 -0
  123. package/dist/core/responseContracts/secrets.js +8 -0
  124. package/dist/core/responseContracts/spend_limits.d.ts +2 -0
  125. package/dist/core/responseContracts/spend_limits.js +8 -0
  126. package/dist/core/responseContracts/terminals.d.ts +2 -0
  127. package/dist/core/responseContracts/terminals.js +11 -0
  128. package/dist/core/responseContracts/usage.d.ts +2 -0
  129. package/dist/core/responseContracts/usage.js +7 -0
  130. package/dist/core/responseContracts/volumes.d.ts +2 -0
  131. package/dist/core/responseContracts/volumes.js +19 -0
  132. package/dist/core/responseContracts.gen.d.ts +3 -0
  133. package/dist/core/responseContracts.gen.js +27 -0
  134. package/dist/core/responseModes.d.ts +19 -0
  135. package/dist/core/responseModes.js +13 -0
  136. package/dist/core/responseValidation.d.ts +44 -0
  137. package/dist/core/responseValidation.js +174 -0
  138. package/dist/core/responseValidators/actions-diagnostics.cjs +4 -0
  139. package/dist/core/responseValidators/actions-diagnostics.d.cts +24 -0
  140. package/dist/core/responseValidators/actions.cjs +2 -0
  141. package/dist/core/responseValidators/actions.d.cts +24 -0
  142. package/dist/core/responseValidators/agents-diagnostics.cjs +1 -0
  143. package/dist/core/responseValidators/agents-diagnostics.d.cts +2 -0
  144. package/dist/core/responseValidators/agents.cjs +2 -0
  145. package/dist/core/responseValidators/agents.d.cts +2 -0
  146. package/dist/core/responseValidators/artifacts-diagnostics.cjs +1 -0
  147. package/dist/core/responseValidators/artifacts-diagnostics.d.cts +2 -0
  148. package/dist/core/responseValidators/artifacts.cjs +2 -0
  149. package/dist/core/responseValidators/artifacts.d.cts +2 -0
  150. package/dist/core/responseValidators/commands-diagnostics.cjs +1 -0
  151. package/dist/core/responseValidators/commands-diagnostics.d.cts +1 -0
  152. package/dist/core/responseValidators/commands.cjs +2 -0
  153. package/dist/core/responseValidators/commands.d.cts +1 -0
  154. package/dist/core/responseValidators/compact.cjs +122 -0
  155. package/dist/core/responseValidators/credits-diagnostics.cjs +1 -0
  156. package/dist/core/responseValidators/credits-diagnostics.d.cts +21 -0
  157. package/dist/core/responseValidators/credits.cjs +2 -0
  158. package/dist/core/responseValidators/credits.d.cts +21 -0
  159. package/dist/core/responseValidators/files-diagnostics.cjs +1 -0
  160. package/dist/core/responseValidators/files-diagnostics.d.cts +5 -0
  161. package/dist/core/responseValidators/files.cjs +2 -0
  162. package/dist/core/responseValidators/files.d.cts +5 -0
  163. package/dist/core/responseValidators/github-diagnostics.cjs +1 -0
  164. package/dist/core/responseValidators/github-diagnostics.d.cts +2 -0
  165. package/dist/core/responseValidators/github.cjs +2 -0
  166. package/dist/core/responseValidators/github.d.cts +2 -0
  167. package/dist/core/responseValidators/images-diagnostics.cjs +1 -0
  168. package/dist/core/responseValidators/images-diagnostics.d.cts +3 -0
  169. package/dist/core/responseValidators/images.cjs +2 -0
  170. package/dist/core/responseValidators/images.d.cts +3 -0
  171. package/dist/core/responseValidators/launchRuns-diagnostics.cjs +1 -0
  172. package/dist/core/responseValidators/launchRuns-diagnostics.d.cts +5 -0
  173. package/dist/core/responseValidators/launchRuns.cjs +2 -0
  174. package/dist/core/responseValidators/launchRuns.d.cts +5 -0
  175. package/dist/core/responseValidators/launches-diagnostics.cjs +10 -0
  176. package/dist/core/responseValidators/launches-diagnostics.d.cts +5 -0
  177. package/dist/core/responseValidators/launches.cjs +2 -0
  178. package/dist/core/responseValidators/launches.d.cts +5 -0
  179. package/dist/core/responseValidators/operations-diagnostics.cjs +1 -0
  180. package/dist/core/responseValidators/operations-diagnostics.d.cts +2 -0
  181. package/dist/core/responseValidators/operations.cjs +2 -0
  182. package/dist/core/responseValidators/operations.d.cts +2 -0
  183. package/dist/core/responseValidators/previews-diagnostics.cjs +1 -0
  184. package/dist/core/responseValidators/previews-diagnostics.d.cts +3 -0
  185. package/dist/core/responseValidators/previews.cjs +2 -0
  186. package/dist/core/responseValidators/previews.d.cts +3 -0
  187. package/dist/core/responseValidators/pricing-diagnostics.cjs +7 -0
  188. package/dist/core/responseValidators/pricing-diagnostics.d.cts +1 -0
  189. package/dist/core/responseValidators/pricing.cjs +2 -0
  190. package/dist/core/responseValidators/pricing.d.cts +1 -0
  191. package/dist/core/responseValidators/processes-diagnostics.cjs +1 -0
  192. package/dist/core/responseValidators/processes-diagnostics.d.cts +2 -0
  193. package/dist/core/responseValidators/processes.cjs +2 -0
  194. package/dist/core/responseValidators/processes.d.cts +2 -0
  195. package/dist/core/responseValidators/provider_accounts-diagnostics.cjs +1 -0
  196. package/dist/core/responseValidators/provider_accounts-diagnostics.d.cts +8 -0
  197. package/dist/core/responseValidators/provider_accounts.cjs +2 -0
  198. package/dist/core/responseValidators/provider_accounts.d.cts +8 -0
  199. package/dist/core/responseValidators/providers-diagnostics.cjs +1 -0
  200. package/dist/core/responseValidators/providers-diagnostics.d.cts +1 -0
  201. package/dist/core/responseValidators/providers.cjs +2 -0
  202. package/dist/core/responseValidators/providers.d.cts +1 -0
  203. package/dist/core/responseValidators/routing-diagnostics.cjs +1 -0
  204. package/dist/core/responseValidators/routing-diagnostics.d.cts +3 -0
  205. package/dist/core/responseValidators/routing.cjs +2 -0
  206. package/dist/core/responseValidators/routing.d.cts +3 -0
  207. package/dist/core/responseValidators/sandboxes-diagnostics.cjs +1 -0
  208. package/dist/core/responseValidators/sandboxes-diagnostics.d.cts +10 -0
  209. package/dist/core/responseValidators/sandboxes.cjs +2 -0
  210. package/dist/core/responseValidators/sandboxes.d.cts +10 -0
  211. package/dist/core/responseValidators/secrets-diagnostics.cjs +1 -0
  212. package/dist/core/responseValidators/secrets-diagnostics.d.cts +1 -0
  213. package/dist/core/responseValidators/secrets.cjs +2 -0
  214. package/dist/core/responseValidators/secrets.d.cts +1 -0
  215. package/dist/core/responseValidators/spend_limits-diagnostics.cjs +1 -0
  216. package/dist/core/responseValidators/spend_limits-diagnostics.d.cts +3 -0
  217. package/dist/core/responseValidators/spend_limits.cjs +2 -0
  218. package/dist/core/responseValidators/spend_limits.d.cts +3 -0
  219. package/dist/core/responseValidators/terminals-diagnostics.cjs +1 -0
  220. package/dist/core/responseValidators/terminals-diagnostics.d.cts +2 -0
  221. package/dist/core/responseValidators/terminals.cjs +2 -0
  222. package/dist/core/responseValidators/terminals.d.cts +2 -0
  223. package/dist/core/responseValidators/usage-diagnostics.cjs +1 -0
  224. package/dist/core/responseValidators/usage-diagnostics.d.cts +1 -0
  225. package/dist/core/responseValidators/usage.cjs +2 -0
  226. package/dist/core/responseValidators/usage.d.cts +1 -0
  227. package/dist/core/responseValidators/volumes-diagnostics.cjs +1 -0
  228. package/dist/core/responseValidators/volumes-diagnostics.d.cts +10 -0
  229. package/dist/core/responseValidators/volumes.cjs +2 -0
  230. package/dist/core/responseValidators/volumes.d.cts +10 -0
  231. package/dist/core/serverSentEvents.gen.d.ts +30 -0
  232. package/dist/core/serverSentEvents.gen.js +313 -0
  233. package/dist/core/streamErrors.d.ts +32 -0
  234. package/dist/core/streamErrors.js +51 -0
  235. package/dist/core/types.gen.d.ts +83 -0
  236. package/dist/core/types.gen.js +3 -0
  237. package/dist/core/utils.gen.d.ts +19 -0
  238. package/dist/core/utils.gen.js +93 -0
  239. package/dist/creation.gen.d.ts +21 -0
  240. package/dist/creation.gen.js +35 -0
  241. package/dist/data-origin.d.ts +25 -0
  242. package/dist/data-origin.js +57 -0
  243. package/dist/error-codes.gen.d.ts +2 -0
  244. package/dist/error-codes.gen.js +2 -0
  245. package/dist/idempotency.gen.d.ts +1 -0
  246. package/dist/idempotency.gen.js +60 -0
  247. package/dist/images.d.ts +74 -0
  248. package/dist/images.js +88 -0
  249. package/dist/index.d.ts +22 -0
  250. package/dist/index.js +80 -0
  251. package/dist/launch-input.gen.d.ts +9 -0
  252. package/dist/launch-input.gen.js +83 -0
  253. package/dist/launch.d.ts +28 -0
  254. package/dist/launch.js +222 -0
  255. package/dist/namespace-actions.d.mts +307 -0
  256. package/dist/namespace-actions.mjs +595 -0
  257. package/dist/namespace-agents.d.mts +33 -0
  258. package/dist/namespace-agents.mjs +40 -0
  259. package/dist/namespace-artifacts.d.mts +46 -0
  260. package/dist/namespace-artifacts.mjs +69 -0
  261. package/dist/namespace-base.d.mts +7 -0
  262. package/dist/namespace-base.mjs +7 -0
  263. package/dist/namespace-commands.d.mts +57 -0
  264. package/dist/namespace-commands.mjs +57 -0
  265. package/dist/namespace-credits.d.mts +213 -0
  266. package/dist/namespace-credits.mjs +476 -0
  267. package/dist/namespace-files.d.mts +203 -0
  268. package/dist/namespace-files.mjs +334 -0
  269. package/dist/namespace-github.d.mts +50 -0
  270. package/dist/namespace-github.mjs +68 -0
  271. package/dist/namespace-images.d.mts +52 -0
  272. package/dist/namespace-images.mjs +78 -0
  273. package/dist/namespace-launch_runs.d.mts +89 -0
  274. package/dist/namespace-launch_runs.mjs +133 -0
  275. package/dist/namespace-launches.d.mts +89 -0
  276. package/dist/namespace-launches.mjs +133 -0
  277. package/dist/namespace-operations.d.mts +45 -0
  278. package/dist/namespace-operations.mjs +52 -0
  279. package/dist/namespace-previews.d.mts +79 -0
  280. package/dist/namespace-previews.mjs +101 -0
  281. package/dist/namespace-pricing.d.mts +31 -0
  282. package/dist/namespace-pricing.mjs +22 -0
  283. package/dist/namespace-processes.d.mts +125 -0
  284. package/dist/namespace-processes.mjs +184 -0
  285. package/dist/namespace-provider_accounts.d.mts +156 -0
  286. package/dist/namespace-provider_accounts.mjs +241 -0
  287. package/dist/namespace-providers.d.mts +28 -0
  288. package/dist/namespace-providers.mjs +24 -0
  289. package/dist/namespace-routing.d.mts +64 -0
  290. package/dist/namespace-routing.mjs +86 -0
  291. package/dist/namespace-sandboxes.d.mts +287 -0
  292. package/dist/namespace-sandboxes.mjs +402 -0
  293. package/dist/namespace-secrets.d.mts +46 -0
  294. package/dist/namespace-secrets.mjs +68 -0
  295. package/dist/namespace-spend_limits.d.mts +48 -0
  296. package/dist/namespace-spend_limits.mjs +70 -0
  297. package/dist/namespace-terminals.d.mts +112 -0
  298. package/dist/namespace-terminals.mjs +177 -0
  299. package/dist/namespace-usage.d.mts +46 -0
  300. package/dist/namespace-usage.mjs +53 -0
  301. package/dist/namespace-volumes.d.mts +110 -0
  302. package/dist/namespace-volumes.mjs +269 -0
  303. package/dist/operations.d.ts +14 -0
  304. package/dist/operations.js +31 -0
  305. package/dist/retry.d.ts +8 -0
  306. package/dist/retry.js +63 -0
  307. package/dist/routing-choices.gen.d.ts +132 -0
  308. package/dist/routing-choices.gen.js +136 -0
  309. package/dist/routing.d.ts +23 -0
  310. package/dist/routing.js +38 -0
  311. package/dist/sandbox-handle.gen.d.ts +8 -0
  312. package/dist/sandbox-handle.gen.js +14 -0
  313. package/dist/sandboxes.d.ts +213 -0
  314. package/dist/sandboxes.js +507 -0
  315. package/dist/sdk.gen.d.ts +2029 -0
  316. package/dist/sdk.gen.js +3862 -0
  317. package/dist/server-timing.d.ts +19 -0
  318. package/dist/server-timing.gen.d.ts +265 -0
  319. package/dist/server-timing.gen.js +254 -0
  320. package/dist/server-timing.js +421 -0
  321. package/dist/spend-limits.d.ts +17 -0
  322. package/dist/spend-limits.js +26 -0
  323. package/dist/telemetry.d.ts +51 -0
  324. package/dist/telemetry.gen.d.ts +1 -0
  325. package/dist/telemetry.gen.js +5 -0
  326. package/dist/telemetry.js +438 -0
  327. package/dist/terminal.d.ts +61 -0
  328. package/dist/terminal.js +266 -0
  329. package/dist/transfer.d.ts +75 -0
  330. package/dist/transfer.js +389 -0
  331. package/dist/types.gen.d.ts +15016 -0
  332. package/dist/types.gen.js +3 -0
  333. package/dist/user-agent.d.ts +2 -0
  334. package/dist/user-agent.js +18 -0
  335. package/dist/version.gen.d.ts +1 -0
  336. package/dist/version.gen.js +5 -0
  337. package/dist/volumes.d.ts +33 -0
  338. package/dist/volumes.js +221 -0
  339. package/dist/waits.d.ts +31 -0
  340. package/dist/waits.js +42 -0
  341. package/dist/workflow-policy.gen.d.ts +41 -0
  342. package/dist/workflow-policy.gen.js +45 -0
  343. package/package.json +135 -4
@@ -0,0 +1,476 @@
1
+ import { HeyApiClient } from './namespace-base.mjs';
2
+ export class Credits extends HeyApiClient {
3
+ /**
4
+ * Get the workspace credit balance
5
+ *
6
+ * Requires account-management permission; execution keys receive 403. Returns 503
7
+ * payments_unavailable while credit purchases are not configured. BYOK work never
8
+ * depends on this balance.
9
+ *
10
+ */
11
+ balance(options) {
12
+ return (options?.client ?? this.client).get({
13
+ responseStyle: 'data',
14
+ security: [{ scheme: 'bearer', type: 'http' }, {
15
+ in: 'cookie',
16
+ name: '__Host-boxrouter_session',
17
+ type: 'apiKey'
18
+ }],
19
+ url: '/credits',
20
+ ...options
21
+ });
22
+ }
23
+ /**
24
+ * List recent credit purchases
25
+ *
26
+ * Workspace-owned purchases in every state, ordered by creation time and ID descending. Invoice and receipt links appear only after confirmed payment. New purchases do not shift subsequent pages. Invalid or another workspace's cursor is a 400.
27
+ */
28
+ purchases(options) {
29
+ return (options?.client ?? this.client).get({
30
+ responseStyle: 'data',
31
+ security: [{ scheme: 'bearer', type: 'http' }, {
32
+ in: 'cookie',
33
+ name: '__Host-boxrouter_session',
34
+ type: 'apiKey'
35
+ }],
36
+ url: '/credits/purchases',
37
+ ...options
38
+ });
39
+ }
40
+ /**
41
+ * Start a credit purchase through Checkout or a saved card
42
+ *
43
+ * Without payment_method_id, records a pending purchase and returns the hosted
44
+ * Checkout page; success_url and cancel_url are required for this path. The response
45
+ * reports fee_minor and total_minor before redirect: Checkout charges total_minor
46
+ * (amount_minor plus BoxRouter's purchase fee, before tax) in two line items, and only
47
+ * amount_minor is added as credit. A refund returns credit only; the fee is not
48
+ * refunded. With a
49
+ * workspace-owned payment_method_id, creates and pays a
50
+ * Stripe invoice using that card. A verified paid invoice returns confirmed; when
51
+ * payer authentication is required, returns pending with the hosted invoice
52
+ * authentication_url. Send the payer there, then poll this purchase after they
53
+ * return to the dashboard. Credit is added only after BoxRouter fetches and validates
54
+ * the paid invoice. A definitive card decline returns payment_declined with the
55
+ * purchase ID and a short safe decline reason in error details, outcome not_started;
56
+ * the failed purchase remains in history. Repeating a request with the same
57
+ * Idempotency-Key returns its original result; a different amount or card under that
58
+ * key is a 409. After a payment_provider_unavailable response with outcome unknown,
59
+ * retry with the same key.
60
+ *
61
+ */
62
+ purchase(options) {
63
+ return (options.client ?? this.client).post({
64
+ responseStyle: 'data',
65
+ security: [{ scheme: 'bearer', type: 'http' }, {
66
+ in: 'cookie',
67
+ name: '__Host-boxrouter_session',
68
+ type: 'apiKey'
69
+ }],
70
+ url: '/credits/purchases',
71
+ ...options,
72
+ headers: {
73
+ 'Content-Type': 'application/json',
74
+ ...options.headers
75
+ }
76
+ });
77
+ }
78
+ /**
79
+ * Preview a credit purchase and its tax
80
+ *
81
+ * Returns Stripe's current tax preview for the requested top-up amount. Requires account-management permission and is available only when in-page card purchases are enabled.
82
+ */
83
+ quotePurchase(options) {
84
+ return (options.client ?? this.client).post({
85
+ responseStyle: 'data',
86
+ security: [{ scheme: 'bearer', type: 'http' }, {
87
+ in: 'cookie',
88
+ name: '__Host-boxrouter_session',
89
+ type: 'apiKey'
90
+ }],
91
+ url: '/credits/purchases/quote',
92
+ ...options,
93
+ headers: {
94
+ 'Content-Type': 'application/json',
95
+ ...options.headers
96
+ }
97
+ });
98
+ }
99
+ /**
100
+ * List managed-compute credit movements
101
+ *
102
+ * Requires account-management permission; execution keys receive 403. Returns
103
+ * confirmed, nonzero charges from the configured test or live billing book, the later
104
+ * corrections to them, reservations still held, and reservations released with no
105
+ * charge, newest first. Results are limited to the calling workspace. BYOK work,
106
+ * supplier costs, provider account identities, API-key digests and raw usage evidence
107
+ * are not returned; a row's `key_id` names the workspace API key it belongs to. A
108
+ * cursor belongs to this workspace and billing mode; invalid or foreign cursors
109
+ * return 400. New rows do not shift subsequent pages. No provider or payment-provider
110
+ * calls are made.
111
+ *
112
+ */
113
+ usage(options) {
114
+ return (options?.client ?? this.client).get({
115
+ responseStyle: 'data',
116
+ security: [{ scheme: 'bearer', type: 'http' }, {
117
+ in: 'cookie',
118
+ name: '__Host-boxrouter_session',
119
+ type: 'apiKey'
120
+ }],
121
+ url: '/credits/usage',
122
+ ...options
123
+ });
124
+ }
125
+ /**
126
+ * Get one credit purchase
127
+ *
128
+ * The authoritative state to poll after the payer returns from Checkout. Another workspace's purchase is a 404.
129
+ */
130
+ getPurchase(options) {
131
+ return (options.client ?? this.client).get({
132
+ responseStyle: 'data',
133
+ security: [{ scheme: 'bearer', type: 'http' }, {
134
+ in: 'cookie',
135
+ name: '__Host-boxrouter_session',
136
+ type: 'apiKey'
137
+ }],
138
+ url: '/credits/purchases/{purchase_id}',
139
+ ...options
140
+ });
141
+ }
142
+ /**
143
+ * Close an unpaid Checkout session
144
+ *
145
+ * Expires a known open Checkout session for this workspace-owned purchase. A
146
+ * completed payment is reconciled and remains confirmed. If Checkout creation
147
+ * had an unknown outcome and no session ID was recorded, the same stable Stripe
148
+ * idempotency key recovers that request before BoxRouter expires the session.
149
+ * Repeating this request is safe. The request needs no body: the return URLs are
150
+ * optional and unused when closing a purchase.
151
+ *
152
+ */
153
+ cancelPurchase(options) {
154
+ return (options.client ?? this.client).post({
155
+ responseStyle: 'data',
156
+ security: [{ scheme: 'bearer', type: 'http' }, {
157
+ in: 'cookie',
158
+ name: '__Host-boxrouter_session',
159
+ type: 'apiKey'
160
+ }],
161
+ url: '/credits/purchases/{purchase_id}/cancel',
162
+ ...options,
163
+ headers: {
164
+ 'Content-Type': 'application/json',
165
+ ...options.headers
166
+ }
167
+ });
168
+ }
169
+ /**
170
+ * List redeemed promotion codes
171
+ *
172
+ * Promotion codes this workspace redeemed, newest first.
173
+ */
174
+ promotions(options) {
175
+ return (options?.client ?? this.client).get({
176
+ responseStyle: 'data',
177
+ security: [{ scheme: 'bearer', type: 'http' }, {
178
+ in: 'cookie',
179
+ name: '__Host-boxrouter_session',
180
+ type: 'apiKey'
181
+ }],
182
+ url: '/credits/promotions',
183
+ ...options
184
+ });
185
+ }
186
+ /**
187
+ * Redeem a promotion code for free credit
188
+ *
189
+ * Adds the code's credit to the workspace balance, once per workspace. Codes are
190
+ * case-insensitive and surrounding spaces are ignored. An unknown, expired, disabled
191
+ * or fully used code is 404 promotion_code_invalid; these cases are not told apart.
192
+ * A new redemption answers 201. A code this workspace already redeemed is refused
193
+ * with 409 promotion_already_redeemed and details.redemption containing the original redemption;
194
+ * its message names the redemption date. No credit is granted again. Promotional
195
+ * credit does not expire. Requires account-management permission; 503 payments_unavailable while
196
+ * credits are not configured.
197
+ *
198
+ */
199
+ redeem(options) {
200
+ return (options.client ?? this.client).post({
201
+ responseStyle: 'data',
202
+ security: [{ scheme: 'bearer', type: 'http' }, {
203
+ in: 'cookie',
204
+ name: '__Host-boxrouter_session',
205
+ type: 'apiKey'
206
+ }],
207
+ url: '/credits/promotions',
208
+ ...options,
209
+ headers: {
210
+ 'Content-Type': 'application/json',
211
+ ...options.headers
212
+ }
213
+ });
214
+ }
215
+ /**
216
+ * Get workspace billing details
217
+ *
218
+ * Requires account-management permission. Reads the workspace Stripe customer. When multiple customer tax IDs exist, tax_id is the newest by creation time (ID breaks ties). Unset details are null.
219
+ */
220
+ billingDetails(options) {
221
+ return (options?.client ?? this.client).get({
222
+ responseStyle: 'data',
223
+ security: [{ scheme: 'bearer', type: 'http' }, {
224
+ in: 'cookie',
225
+ name: '__Host-boxrouter_session',
226
+ type: 'apiKey'
227
+ }],
228
+ url: '/credits/billing-details',
229
+ ...options
230
+ });
231
+ }
232
+ /**
233
+ * Replace workspace billing details
234
+ *
235
+ * Stores legal name, invoice email, address and one tax ID on the workspace Stripe customer, creating it when absent. Details apply to future invoices. PUT replaces all customer tax IDs with the supplied single ID, adding the replacement before deleting old IDs so a rejected replacement preserves them. Stripe tax ID verification can be pending or unsuccessful. Repeat an uncertain update with the same Idempotency-Key; a changed body under that key returns 409. Stripe rejection returns 502; the update can have partially completed, so read current details before correcting it.
236
+ */
237
+ updateBillingDetails(options) {
238
+ return (options.client ?? this.client).put({
239
+ responseStyle: 'data',
240
+ security: [{ scheme: 'bearer', type: 'http' }, {
241
+ in: 'cookie',
242
+ name: '__Host-boxrouter_session',
243
+ type: 'apiKey'
244
+ }],
245
+ url: '/credits/billing-details',
246
+ ...options,
247
+ headers: {
248
+ 'Content-Type': 'application/json',
249
+ ...options.headers
250
+ }
251
+ });
252
+ }
253
+ /**
254
+ * Get workspace credit alert settings
255
+ *
256
+ * Requires account-management permission. Returns workspace-owned settings only.
257
+ */
258
+ alerts(options) {
259
+ return (options?.client ?? this.client).get({
260
+ responseStyle: 'data',
261
+ security: [{ scheme: 'bearer', type: 'http' }, {
262
+ in: 'cookie',
263
+ name: '__Host-boxrouter_session',
264
+ type: 'apiKey'
265
+ }],
266
+ url: '/credits/alerts',
267
+ ...options
268
+ });
269
+ }
270
+ /**
271
+ * Replace workspace credit alert settings
272
+ *
273
+ * Atomically replaces the optional trigger level and evaluates the current available balance. Repeating identical settings is idempotent and requires no Idempotency-Key. Sends the owner one alert per crossing below the trigger level and one when available credit is zero or negative; a repeated evaluation does not resend. Re-arms at or above the trigger level and above zero respectively. BYOK work is unaffected by credit balance.
274
+ */
275
+ updateAlerts(options) {
276
+ return (options.client ?? this.client).put({
277
+ responseStyle: 'data',
278
+ security: [{ scheme: 'bearer', type: 'http' }, {
279
+ in: 'cookie',
280
+ name: '__Host-boxrouter_session',
281
+ type: 'apiKey'
282
+ }],
283
+ url: '/credits/alerts',
284
+ ...options,
285
+ headers: {
286
+ 'Content-Type': 'application/json',
287
+ ...options.headers
288
+ }
289
+ });
290
+ }
291
+ /**
292
+ * List saved workspace payment methods
293
+ *
294
+ * Returns masked card details only. Saved methods can be charged for a workspace member's purchase or immediately when enabling auto top-up with a trigger level above the current balance.
295
+ */
296
+ paymentMethods(options) {
297
+ return (options?.client ?? this.client).get({
298
+ responseStyle: 'data',
299
+ security: [{ scheme: 'bearer', type: 'http' }, {
300
+ in: 'cookie',
301
+ name: '__Host-boxrouter_session',
302
+ type: 'apiKey'
303
+ }],
304
+ url: '/credits/payment-methods',
305
+ ...options
306
+ });
307
+ }
308
+ /**
309
+ * Start hosted setup for a saved payment method
310
+ *
311
+ * Creates a Stripe-hosted setup page and returns its URL. Setup does not charge the
312
+ * payer. The completed method can be charged for a later user-initiated purchase or immediately when enabling auto top-up with a trigger level above the current balance.
313
+ * Repeating the request with the same Idempotency-Key returns the same page.
314
+ *
315
+ */
316
+ setupPaymentMethod(options) {
317
+ return (options.client ?? this.client).post({
318
+ responseStyle: 'data',
319
+ security: [{ scheme: 'bearer', type: 'http' }, {
320
+ in: 'cookie',
321
+ name: '__Host-boxrouter_session',
322
+ type: 'apiKey'
323
+ }],
324
+ url: '/credits/payment-methods/setup',
325
+ ...options,
326
+ headers: {
327
+ 'Content-Type': 'application/json',
328
+ ...options.headers
329
+ }
330
+ });
331
+ }
332
+ /**
333
+ * Start in-page saved card setup
334
+ *
335
+ * Creates a Stripe SetupIntent for in-page card collection. Requires account-management permission and the in-page cards feature.
336
+ */
337
+ setupPaymentMethodIntent(options) {
338
+ return (options?.client ?? this.client).post({
339
+ responseStyle: 'data',
340
+ security: [{ scheme: 'bearer', type: 'http' }, {
341
+ in: 'cookie',
342
+ name: '__Host-boxrouter_session',
343
+ type: 'apiKey'
344
+ }],
345
+ url: '/credits/payment-methods/setup-intent',
346
+ ...options
347
+ });
348
+ }
349
+ /**
350
+ * Set saved card charge order
351
+ *
352
+ * Replaces the order of every saved card and Link method for automatic top-up. Requires account-management permission and the multi-card top-up feature.
353
+ */
354
+ reorderPaymentMethods(options) {
355
+ return (options.client ?? this.client).put({
356
+ responseStyle: 'data',
357
+ security: [{ scheme: 'bearer', type: 'http' }, {
358
+ in: 'cookie',
359
+ name: '__Host-boxrouter_session',
360
+ type: 'apiKey'
361
+ }],
362
+ url: '/credits/payment-methods/order',
363
+ ...options,
364
+ headers: {
365
+ 'Content-Type': 'application/json',
366
+ ...options.headers
367
+ }
368
+ });
369
+ }
370
+ /**
371
+ * Get a saved payment method setup status
372
+ *
373
+ * Reads Stripe's current setup state after the payer returns. Another workspace's setup is a 404.
374
+ */
375
+ getPaymentMethodSetup(options) {
376
+ return (options.client ?? this.client).get({
377
+ responseStyle: 'data',
378
+ security: [{ scheme: 'bearer', type: 'http' }, {
379
+ in: 'cookie',
380
+ name: '__Host-boxrouter_session',
381
+ type: 'apiKey'
382
+ }],
383
+ url: '/credits/payment-method-setups/{setup_id}',
384
+ ...options
385
+ });
386
+ }
387
+ /**
388
+ * Remove a saved workspace payment method
389
+ *
390
+ * Detaches a saved card. Another workspace's payment method is a 404. If the card
391
+ * was the default, the next saved card becomes default; removing the last card
392
+ * disables auto top-up with disabled_reason payment_method_required.
393
+ *
394
+ */
395
+ deletePaymentMethod(options) {
396
+ return (options.client ?? this.client).delete({
397
+ responseStyle: 'data',
398
+ security: [{ scheme: 'bearer', type: 'http' }, {
399
+ in: 'cookie',
400
+ name: '__Host-boxrouter_session',
401
+ type: 'apiKey'
402
+ }],
403
+ url: '/credits/payment-methods/{payment_method_id}',
404
+ ...options
405
+ });
406
+ }
407
+ /**
408
+ * Set the workspace's default saved card
409
+ *
410
+ * Makes this workspace-owned saved card the only default card. The first saved
411
+ * card becomes default automatically. This local setting is used by one-click
412
+ * purchases and auto top-up; repeating the request is safe. Another workspace's
413
+ * card is a 404.
414
+ *
415
+ */
416
+ setDefaultPaymentMethod(options) {
417
+ return (options.client ?? this.client).post({
418
+ responseStyle: 'data',
419
+ security: [{ scheme: 'bearer', type: 'http' }, {
420
+ in: 'cookie',
421
+ name: '__Host-boxrouter_session',
422
+ type: 'apiKey'
423
+ }],
424
+ url: '/credits/payment-methods/{payment_method_id}/default',
425
+ ...options
426
+ });
427
+ }
428
+ /**
429
+ * Get automatic credit top-up settings
430
+ *
431
+ * Requires account-management permission. Auto top-up is off until explicitly enabled.
432
+ */
433
+ autoTopUp(options) {
434
+ return (options?.client ?? this.client).get({
435
+ responseStyle: 'data',
436
+ security: [{ scheme: 'bearer', type: 'http' }, {
437
+ in: 'cookie',
438
+ name: '__Host-boxrouter_session',
439
+ type: 'apiKey'
440
+ }],
441
+ url: '/credits/auto-top-up',
442
+ ...options
443
+ });
444
+ }
445
+ /**
446
+ * Replace automatic credit top-up settings
447
+ *
448
+ * Stores the enabled state, trigger level and purchase amount. The amount must be
449
+ * within current purchase_bounds_minor and the trigger level must be zero or greater.
450
+ * Enabling requires a default saved card. Enabling with a trigger level above current
451
+ * available credit evaluates and attempts one top-up immediately. An attempt is
452
+ * made once per crossing below the trigger level and is never retried automatically. A
453
+ * decline or required authentication disables auto top-up and records the reason.
454
+ * Repeating the same settings is idempotent and does not start a second attempt for
455
+ * the same balance crossing. After a 503 with outcome unknown, retry the identical
456
+ * settings or GET the settings; inspect last_attempt.purchase_id and poll that
457
+ * purchase to reconcile the original attempt.
458
+ *
459
+ */
460
+ updateAutoTopUp(options) {
461
+ return (options.client ?? this.client).put({
462
+ responseStyle: 'data',
463
+ security: [{ scheme: 'bearer', type: 'http' }, {
464
+ in: 'cookie',
465
+ name: '__Host-boxrouter_session',
466
+ type: 'apiKey'
467
+ }],
468
+ url: '/credits/auto-top-up',
469
+ ...options,
470
+ headers: {
471
+ 'Content-Type': 'application/json',
472
+ ...options.headers
473
+ }
474
+ });
475
+ }
476
+ }
@@ -0,0 +1,203 @@
1
+ import type { BinaryStreamResponses } from "./core/binaryStream.js";
2
+ import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
3
+ import { HeyApiClient } from './namespace-base.mjs';
4
+ import type { FilesAbortUploadData, FilesAbortUploadErrors, FilesAbortUploadResponses, FilesCompleteUploadData, FilesCompleteUploadErrors, FilesCompleteUploadResponses, FilesCreateDownloadData, FilesCreateDownloadErrors, FilesCreateDownloadResponses, FilesCreateUploadData, FilesCreateUploadErrors, FilesCreateUploadResponses, FilesExistsData, FilesExistsErrors, FilesExistsResponses, FilesListData, FilesListErrors, FilesListResponses, FilesMkdirData, FilesMkdirErrors, FilesMkdirResponses, FilesReadData, FilesReadErrors, FilesReadResponses, FilesRemoveData, FilesRemoveErrors, FilesRemoveResponses, FilesWriteData, FilesWriteErrors, FilesWriteResponses } from './types.gen.js';
5
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
6
+ /**
7
+ * You can provide a client instance returned by `createClient()` instead of
8
+ * individual options. This might be also useful if you want to implement a
9
+ * custom client.
10
+ */
11
+ client?: Client;
12
+ /**
13
+ * You can pass arbitrary values through the `meta` object. This can be
14
+ * used to access values that aren't defined as part of the SDK function.
15
+ */
16
+ meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
17
+ };
18
+ export declare class Files extends HeyApiClient {
19
+ /**
20
+ * Read exact file bytes
21
+ *
22
+ * You can rely on:
23
+ * - Returns complete bytes, or resource_limit with no prefix returned.
24
+ * - Reading a directory or another path that is not a regular file fails and returns no data.
25
+ * - An absent path is not_found, outcome failed: a read has no effect, so its outcome is never unknown.
26
+ *
27
+ * You can set: path.
28
+ *
29
+ * Not promised: consistency while another writer changes the file.
30
+ *
31
+ * The limit is the advertised limits.file_transfer_bytes. Bytes are not text-decoded.
32
+ * Closing the transfer does not destroy the sandbox. A stream that ends before
33
+ * Content-Length is an incomplete transfer, not a successful file read.
34
+ *
35
+ */
36
+ read<ThrowOnError extends boolean = true>(options: Options<FilesReadData, ThrowOnError>): RequestResult<FilesReadResponses, FilesReadErrors, ThrowOnError, 'data'>;
37
+ /**
38
+ * Read exact file bytes
39
+ *
40
+ * You can rely on:
41
+ * - Returns complete bytes, or resource_limit with no prefix returned.
42
+ * - Reading a directory or another path that is not a regular file fails and returns no data.
43
+ * - An absent path is not_found, outcome failed: a read has no effect, so its outcome is never unknown.
44
+ *
45
+ * You can set: path.
46
+ *
47
+ * Not promised: consistency while another writer changes the file.
48
+ *
49
+ * The limit is the advertised limits.file_transfer_bytes. Bytes are not text-decoded.
50
+ * Closing the transfer does not destroy the sandbox. A stream that ends before
51
+ * Content-Length is an incomplete transfer, not a successful file read.
52
+ *
53
+ */
54
+ readStream<ThrowOnError extends boolean = true>(options: Omit<Options<FilesReadData, ThrowOnError>, "parseAs" | "responseStyle">): RequestResult<BinaryStreamResponses<FilesReadResponses>, FilesReadErrors, ThrowOnError, "fields">;
55
+ /**
56
+ * Write exact file bytes
57
+ *
58
+ * You can rely on:
59
+ * - Writes exact bytes.
60
+ * - Creates missing parents.
61
+ * - A new file is readable and writable by the command user.
62
+ * - The size limit is enforced.
63
+ *
64
+ * You can set: path, data.
65
+ *
66
+ * Not promised: owner, mode or executable bit; atomic replace; whether a symbolic link at the path is followed or replaced.
67
+ *
68
+ * The limit is the advertised limits.file_transfer_bytes. A failed transfer may leave
69
+ * partial data; the error's outcome describes what is known. SDK text helpers must encode
70
+ * text as UTF-8 before transfer.
71
+ *
72
+ */
73
+ write<ThrowOnError extends boolean = true>(options: Options<FilesWriteData, ThrowOnError>): RequestResult<FilesWriteResponses, FilesWriteErrors, ThrowOnError, 'data'>;
74
+ /**
75
+ * Create a sandbox file upload
76
+ *
77
+ * You can rely on:
78
+ * - A completed upload leaves exactly the declared bytes at the path; a body of another length is refused.
79
+ *
80
+ * You can set: path, size.
81
+ *
82
+ * Not promised: removing bytes already written when an upload is aborted.
83
+ *
84
+ * Starts an upload of a file of known size to an absolute path in a running sandbox. Send
85
+ * every returned part as described by its `TransferPart`, then call `completeSandboxUpload`
86
+ * with each part's response `ETag`, if any. BoxRouter chooses the `route`; it is
87
+ * informational and clients must not branch on it. Upload links and the session last up to
88
+ * six hours after creation; `expires_at` says when they end. Launch behaviour is always
89
+ * exactly one part. Idempotency-Key is required on create, complete and abort; repeat an
90
+ * uncertain call with the same key.
91
+ *
92
+ */
93
+ createUpload<ThrowOnError extends boolean = true>(options: Options<FilesCreateUploadData, ThrowOnError>): RequestResult<FilesCreateUploadResponses, FilesCreateUploadErrors, ThrowOnError, 'data'>;
94
+ /**
95
+ * Complete a sandbox file upload
96
+ *
97
+ * You can rely on:
98
+ * - A completed upload leaves exactly the declared bytes at the path; a body of another length is refused.
99
+ *
100
+ * You can set: path, size.
101
+ *
102
+ * Not promised: removing bytes already written when an upload is aborted.
103
+ *
104
+ * Supply each part number exactly once with the `ETag` header returned by its request, if
105
+ * it returned one. Repeating the call with the same idempotency key returns the same result.
106
+ *
107
+ */
108
+ completeUpload<ThrowOnError extends boolean = true>(options: Options<FilesCompleteUploadData, ThrowOnError>): RequestResult<FilesCompleteUploadResponses, FilesCompleteUploadErrors, ThrowOnError, 'data'>;
109
+ /**
110
+ * Abort a sandbox file upload
111
+ *
112
+ * You can rely on:
113
+ * - A completed upload leaves exactly the declared bytes at the path; a body of another length is refused.
114
+ *
115
+ * You can set: path, size.
116
+ *
117
+ * Not promised: removing bytes already written when an upload is aborted.
118
+ *
119
+ * Idempotent.
120
+ *
121
+ */
122
+ abortUpload<ThrowOnError extends boolean = true>(options: Options<FilesAbortUploadData, ThrowOnError>): RequestResult<FilesAbortUploadResponses, FilesAbortUploadErrors, ThrowOnError, 'data'>;
123
+ /**
124
+ * Create a sandbox file download
125
+ *
126
+ * You can rely on:
127
+ * - A complete download returns exactly the file's bytes; a transfer that ends short fails instead of returning a prefix.
128
+ *
129
+ * You can set: path.
130
+ *
131
+ * Not promised: the file's size before the download starts.
132
+ *
133
+ * Creates a temporary download link for a file in a running sandbox. The link lasts up to
134
+ * one hour after creation; `expires_at` says when it ends. `route` is informational and
135
+ * clients must not branch on it.
136
+ *
137
+ */
138
+ createDownload<ThrowOnError extends boolean = true>(options: Options<FilesCreateDownloadData, ThrowOnError>): RequestResult<FilesCreateDownloadResponses, FilesCreateDownloadErrors, ThrowOnError, 'data'>;
139
+ /**
140
+ * List the immediate entries of a directory
141
+ *
142
+ * You can rely on:
143
+ * - Returns every immediate entry, including hidden ones and broken symbolic links, sorted by name.
144
+ * - Each entry has its type (file, directory, symlink, other); a link is not followed.
145
+ * - More entries than the advertised limit fail; the list is never truncated.
146
+ *
147
+ * You can set: path.
148
+ *
149
+ * Not promised: metadata beyond the type; a consistent snapshot while the directory changes.
150
+ *
151
+ * An unreadable or missing directory fails; it does not appear empty. No recursion.
152
+ *
153
+ */
154
+ list<ThrowOnError extends boolean = true>(options: Options<FilesListData, ThrowOnError>): RequestResult<FilesListResponses, FilesListErrors, ThrowOnError, 'data'>;
155
+ /**
156
+ * Create a directory
157
+ *
158
+ * You can rely on:
159
+ * - parents=true (the default) creates missing parents and accepts an existing directory.
160
+ * - parents=false requires the parent and refuses an existing path.
161
+ *
162
+ * You can set: path, parents.
163
+ *
164
+ * Not promised: mode and owner beyond command-user usability.
165
+ *
166
+ * A failure may leave some parent directories created. An uncertain mutation is never automatically replayed.
167
+ *
168
+ */
169
+ mkdir<ThrowOnError extends boolean = true>(options: Options<FilesMkdirData, ThrowOnError>): RequestResult<FilesMkdirResponses, FilesMkdirErrors, ThrowOnError, 'data'>;
170
+ /**
171
+ * Check for an accessible filesystem target
172
+ *
173
+ * You can rely on:
174
+ * - Follows symbolic links. True when the target exists; false when it is missing, the link is broken, or the target is not accessible.
175
+ * - A failure to check raises an error; it never reads as false.
176
+ *
177
+ * You can set: path.
178
+ *
179
+ * Not promised: whether the answer still holds after the call.
180
+ *
181
+ * Transport and command-startup failures remain errors. This read does not reserve the path or guarantee it remains present.
182
+ *
183
+ */
184
+ exists<ThrowOnError extends boolean = true>(options: Options<FilesExistsData, ThrowOnError>): RequestResult<FilesExistsResponses, FilesExistsErrors, ThrowOnError, 'data'>;
185
+ /**
186
+ * Remove a file, symbolic link or directory
187
+ *
188
+ * You can rely on:
189
+ * - Removes only the named entry.
190
+ * - A nonempty directory needs recursive.
191
+ * - A symbolic link, broken or not, is unlinked and its target kept.
192
+ * - A missing path fails.
193
+ * - The sandbox root is refused.
194
+ *
195
+ * You can set: path, recursive.
196
+ *
197
+ * Not promised: atomicity; partial progress after a failure.
198
+ *
199
+ * A final slash does not change which entry is removed. Failures may leave partial changes. An uncertain mutation is never automatically replayed.
200
+ *
201
+ */
202
+ remove<ThrowOnError extends boolean = true>(options: Options<FilesRemoveData, ThrowOnError>): RequestResult<FilesRemoveResponses, FilesRemoveErrors, ThrowOnError, 'data'>;
203
+ }