@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,46 @@
1
+ import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
2
+ import { HeyApiClient } from './namespace-base.mjs';
3
+ import type { ArtifactsDeleteData, ArtifactsDeleteErrors, ArtifactsDeleteResponses, ArtifactsGetData, ArtifactsGetErrors, ArtifactsGetResponses, ArtifactsUploadData, ArtifactsUploadErrors, ArtifactsUploadResponses } from './types.gen.js';
4
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
5
+ /**
6
+ * You can provide a client instance returned by `createClient()` instead of
7
+ * individual options. This might be also useful if you want to implement a
8
+ * custom client.
9
+ */
10
+ client?: Client;
11
+ /**
12
+ * You can pass arbitrary values through the `meta` object. This can be
13
+ * used to access values that aren't defined as part of the SDK function.
14
+ */
15
+ meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
16
+ };
17
+ export declare class Artifacts extends HeyApiClient {
18
+ /**
19
+ * Upload a staged input
20
+ *
21
+ * Stream opaque source bytes to workspace-scoped temporary storage. Enforce
22
+ * workspace upload quotas without buffering the entire request in memory.
23
+ * Compute the digest server-side; return a handle only after the full upload
24
+ * succeeds. A failed upload is not a usable artifact. Do not execute or import
25
+ * uploaded code. Artifact references stay workspace-scoped and can be used across routes.
26
+ *
27
+ */
28
+ upload<ThrowOnError extends boolean = true>(options: Options<ArtifactsUploadData, ThrowOnError>): RequestResult<ArtifactsUploadResponses, ArtifactsUploadErrors, ThrowOnError, 'data'>;
29
+ /**
30
+ * Remove a staged artifact
31
+ *
32
+ * Delete source storage without deleting resulting provider images. Reject with
33
+ * 409 while a submitted build, file transfer or credential-factory activation
34
+ * still needs these bytes. An activated factory uses its retained encrypted
35
+ * copy; deleting staging bytes does not revoke that credential version. Successful deletion is
36
+ * idempotent for a known owned record; unowned IDs remain 404.
37
+ *
38
+ */
39
+ delete<ThrowOnError extends boolean = true>(options: Options<ArtifactsDeleteData, ThrowOnError>): RequestResult<ArtifactsDeleteResponses, ArtifactsDeleteErrors, ThrowOnError, 'data'>;
40
+ /**
41
+ * Inspect a staged artifact
42
+ *
43
+ * Return metadata only. Unknown, unowned and expired artifacts return 404.
44
+ */
45
+ get<ThrowOnError extends boolean = true>(options: Options<ArtifactsGetData, ThrowOnError>): RequestResult<ArtifactsGetResponses, ArtifactsGetErrors, ThrowOnError, 'data'>;
46
+ }
@@ -0,0 +1,69 @@
1
+ import { HeyApiClient } from './namespace-base.mjs';
2
+ export class Artifacts extends HeyApiClient {
3
+ /**
4
+ * Upload a staged input
5
+ *
6
+ * Stream opaque source bytes to workspace-scoped temporary storage. Enforce
7
+ * workspace upload quotas without buffering the entire request in memory.
8
+ * Compute the digest server-side; return a handle only after the full upload
9
+ * succeeds. A failed upload is not a usable artifact. Do not execute or import
10
+ * uploaded code. Artifact references stay workspace-scoped and can be used across routes.
11
+ *
12
+ */
13
+ upload(options) {
14
+ return (options.client ?? this.client).post({
15
+ bodySerializer: null,
16
+ responseStyle: 'data',
17
+ security: [{ scheme: 'bearer', type: 'http' }, {
18
+ in: 'cookie',
19
+ name: '__Host-boxrouter_session',
20
+ type: 'apiKey'
21
+ }],
22
+ url: '/artifacts',
23
+ ...options,
24
+ headers: {
25
+ 'Content-Type': 'application/octet-stream',
26
+ ...options.headers
27
+ }
28
+ });
29
+ }
30
+ /**
31
+ * Remove a staged artifact
32
+ *
33
+ * Delete source storage without deleting resulting provider images. Reject with
34
+ * 409 while a submitted build, file transfer or credential-factory activation
35
+ * still needs these bytes. An activated factory uses its retained encrypted
36
+ * copy; deleting staging bytes does not revoke that credential version. Successful deletion is
37
+ * idempotent for a known owned record; unowned IDs remain 404.
38
+ *
39
+ */
40
+ delete(options) {
41
+ return (options.client ?? this.client).delete({
42
+ responseStyle: 'data',
43
+ security: [{ scheme: 'bearer', type: 'http' }, {
44
+ in: 'cookie',
45
+ name: '__Host-boxrouter_session',
46
+ type: 'apiKey'
47
+ }],
48
+ url: '/artifacts/{artifact_id}',
49
+ ...options
50
+ });
51
+ }
52
+ /**
53
+ * Inspect a staged artifact
54
+ *
55
+ * Return metadata only. Unknown, unowned and expired artifacts return 404.
56
+ */
57
+ get(options) {
58
+ return (options.client ?? this.client).get({
59
+ responseStyle: 'data',
60
+ security: [{ scheme: 'bearer', type: 'http' }, {
61
+ in: 'cookie',
62
+ name: '__Host-boxrouter_session',
63
+ type: 'apiKey'
64
+ }],
65
+ url: '/artifacts/{artifact_id}',
66
+ ...options
67
+ });
68
+ }
69
+ }
@@ -0,0 +1,7 @@
1
+ import type { Client } from './client/index.js';
2
+ export declare class HeyApiClient {
3
+ protected client: Client;
4
+ constructor(args?: {
5
+ client?: Client;
6
+ });
7
+ }
@@ -0,0 +1,7 @@
1
+ import { client } from './client.gen.js';
2
+ export class HeyApiClient {
3
+ client;
4
+ constructor(args) {
5
+ this.client = args?.client ?? client;
6
+ }
7
+ }
@@ -0,0 +1,57 @@
1
+ import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
2
+ import { HeyApiClient } from './namespace-base.mjs';
3
+ import type { CommandsRunData, CommandsRunErrors, CommandsRunResponses } from './types.gen.js';
4
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
5
+ /**
6
+ * You can provide a client instance returned by `createClient()` instead of
7
+ * individual options. This might be also useful if you want to implement a
8
+ * custom client.
9
+ */
10
+ client?: Client;
11
+ /**
12
+ * You can pass arbitrary values through the `meta` object. This can be
13
+ * used to access values that aren't defined as part of the SDK function.
14
+ */
15
+ meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
16
+ };
17
+ export declare class Commands extends HeyApiClient {
18
+ /**
19
+ * Run a buffered command
20
+ *
21
+ * **Commands**
22
+ *
23
+ * You can rely on:
24
+ * - Runs in a login Bash, so PATH changes that installers write to ~/.profile apply to later commands.
25
+ * - Returns the exit status.
26
+ * - Returns stdout and stderr separately.
27
+ * - Returns exact bytes in byte mode.
28
+ * - The timeout ends the command.
29
+ * - On a timeout the command's process group receives TERM at the deadline and KILL 5 seconds later, in both output modes.
30
+ * - Returned output is captured after the shell exits, and later writes by background children cannot change it.
31
+ * - An uncertain outcome is never replayed.
32
+ * - Output over the limit returns the exit status and the first output_limit_bytes of each stream, marked truncated. Default and maximum: 512 KiB per stream. Processes stream complete large output.
33
+ *
34
+ * You can set: command, cwd, env, timeout_seconds, output (text or bytes), output_limit_bytes.
35
+ *
36
+ * Not promised: guest disk used by output above the limit; ending children that leave the command's process group (for example setsid daemons).
37
+ *
38
+ * **Command stdin**
39
+ *
40
+ * You can rely on:
41
+ * - A command takes no input: it starts with stdin at end-of-file, and login profiles, the command and its children all read empty input.
42
+ *
43
+ * You can set: nothing (use process input for interactive input).
44
+ *
45
+ * Output over output_limit_bytes is not an error: the result sets stdout_truncated or
46
+ * stderr_truncated. A nonzero exit is a completed workload result, not an HTTP failure.
47
+ * A command that reaches timeout_seconds is a result too: the process group is ended and
48
+ * the answer is 200 with timed_out true, exit_code null and the output written so far.
49
+ * 504 timeout is left for the case where BoxRouter lost sight of the command and cannot
50
+ * say whether it ran. A disconnected HTTP client is not promised to end the command; the
51
+ * timeout ends it. Use process streaming for output without a bound.
52
+ * Generated clients take an opt-in check argument and raise CommandFailed (the operation's
53
+ * x-boxrouter-result-check) when exit_code is not 0 or timed_out is true.
54
+ *
55
+ */
56
+ run<ThrowOnError extends boolean = true>(options: Options<CommandsRunData, ThrowOnError>): RequestResult<CommandsRunResponses, CommandsRunErrors, ThrowOnError, 'data'>;
57
+ }
@@ -0,0 +1,57 @@
1
+ import { HeyApiClient } from './namespace-base.mjs';
2
+ export class Commands extends HeyApiClient {
3
+ /**
4
+ * Run a buffered command
5
+ *
6
+ * **Commands**
7
+ *
8
+ * You can rely on:
9
+ * - Runs in a login Bash, so PATH changes that installers write to ~/.profile apply to later commands.
10
+ * - Returns the exit status.
11
+ * - Returns stdout and stderr separately.
12
+ * - Returns exact bytes in byte mode.
13
+ * - The timeout ends the command.
14
+ * - On a timeout the command's process group receives TERM at the deadline and KILL 5 seconds later, in both output modes.
15
+ * - Returned output is captured after the shell exits, and later writes by background children cannot change it.
16
+ * - An uncertain outcome is never replayed.
17
+ * - Output over the limit returns the exit status and the first output_limit_bytes of each stream, marked truncated. Default and maximum: 512 KiB per stream. Processes stream complete large output.
18
+ *
19
+ * You can set: command, cwd, env, timeout_seconds, output (text or bytes), output_limit_bytes.
20
+ *
21
+ * Not promised: guest disk used by output above the limit; ending children that leave the command's process group (for example setsid daemons).
22
+ *
23
+ * **Command stdin**
24
+ *
25
+ * You can rely on:
26
+ * - A command takes no input: it starts with stdin at end-of-file, and login profiles, the command and its children all read empty input.
27
+ *
28
+ * You can set: nothing (use process input for interactive input).
29
+ *
30
+ * Output over output_limit_bytes is not an error: the result sets stdout_truncated or
31
+ * stderr_truncated. A nonzero exit is a completed workload result, not an HTTP failure.
32
+ * A command that reaches timeout_seconds is a result too: the process group is ended and
33
+ * the answer is 200 with timed_out true, exit_code null and the output written so far.
34
+ * 504 timeout is left for the case where BoxRouter lost sight of the command and cannot
35
+ * say whether it ran. A disconnected HTTP client is not promised to end the command; the
36
+ * timeout ends it. Use process streaming for output without a bound.
37
+ * Generated clients take an opt-in check argument and raise CommandFailed (the operation's
38
+ * x-boxrouter-result-check) when exit_code is not 0 or timed_out is true.
39
+ *
40
+ */
41
+ run(options) {
42
+ return (options.client ?? this.client).post({
43
+ responseStyle: 'data',
44
+ security: [{ scheme: 'bearer', type: 'http' }, {
45
+ in: 'cookie',
46
+ name: '__Host-boxrouter_session',
47
+ type: 'apiKey'
48
+ }],
49
+ url: '/sandboxes/{sandbox_id}/commands',
50
+ ...options,
51
+ headers: {
52
+ 'Content-Type': 'application/json',
53
+ ...options.headers
54
+ }
55
+ });
56
+ }
57
+ }
@@ -0,0 +1,213 @@
1
+ import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client/index.js';
2
+ import { HeyApiClient } from './namespace-base.mjs';
3
+ import type { CreditsAlertsData, CreditsAlertsErrors, CreditsAlertsResponses, CreditsAutoTopUpData, CreditsAutoTopUpErrors, CreditsAutoTopUpResponses, CreditsBalanceData, CreditsBalanceErrors, CreditsBalanceResponses, CreditsBillingDetailsData, CreditsBillingDetailsErrors, CreditsBillingDetailsResponses, CreditsCancelPurchaseData, CreditsCancelPurchaseErrors, CreditsCancelPurchaseResponses, CreditsDeletePaymentMethodData, CreditsDeletePaymentMethodErrors, CreditsDeletePaymentMethodResponses, CreditsGetPaymentMethodSetupData, CreditsGetPaymentMethodSetupErrors, CreditsGetPaymentMethodSetupResponses, CreditsGetPurchaseData, CreditsGetPurchaseErrors, CreditsGetPurchaseResponses, CreditsPaymentMethodsData, CreditsPaymentMethodsErrors, CreditsPaymentMethodsResponses, CreditsPromotionsData, CreditsPromotionsErrors, CreditsPromotionsResponses, CreditsPurchaseData, CreditsPurchaseErrors, CreditsPurchaseResponses, CreditsPurchasesData, CreditsPurchasesErrors, CreditsPurchasesResponses, CreditsQuotePurchaseData, CreditsQuotePurchaseErrors, CreditsQuotePurchaseResponses, CreditsRedeemData, CreditsRedeemErrors, CreditsRedeemResponses, CreditsReorderPaymentMethodsData, CreditsReorderPaymentMethodsErrors, CreditsReorderPaymentMethodsResponses, CreditsSetDefaultPaymentMethodData, CreditsSetDefaultPaymentMethodErrors, CreditsSetDefaultPaymentMethodResponses, CreditsSetupPaymentMethodData, CreditsSetupPaymentMethodErrors, CreditsSetupPaymentMethodIntentData, CreditsSetupPaymentMethodIntentErrors, CreditsSetupPaymentMethodIntentResponses, CreditsSetupPaymentMethodResponses, CreditsUpdateAlertsData, CreditsUpdateAlertsErrors, CreditsUpdateAlertsResponses, CreditsUpdateAutoTopUpData, CreditsUpdateAutoTopUpErrors, CreditsUpdateAutoTopUpResponses, CreditsUpdateBillingDetailsData, CreditsUpdateBillingDetailsErrors, CreditsUpdateBillingDetailsResponses, CreditsUsageData, CreditsUsageErrors, CreditsUsageResponses } from './types.gen.js';
4
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
5
+ /**
6
+ * You can provide a client instance returned by `createClient()` instead of
7
+ * individual options. This might be also useful if you want to implement a
8
+ * custom client.
9
+ */
10
+ client?: Client;
11
+ /**
12
+ * You can pass arbitrary values through the `meta` object. This can be
13
+ * used to access values that aren't defined as part of the SDK function.
14
+ */
15
+ meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
16
+ };
17
+ export declare class Credits extends HeyApiClient {
18
+ /**
19
+ * Get the workspace credit balance
20
+ *
21
+ * Requires account-management permission; execution keys receive 403. Returns 503
22
+ * payments_unavailable while credit purchases are not configured. BYOK work never
23
+ * depends on this balance.
24
+ *
25
+ */
26
+ balance<ThrowOnError extends boolean = true>(options?: Options<CreditsBalanceData, ThrowOnError>): RequestResult<CreditsBalanceResponses, CreditsBalanceErrors, ThrowOnError, 'data'>;
27
+ /**
28
+ * List recent credit purchases
29
+ *
30
+ * 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.
31
+ */
32
+ purchases<ThrowOnError extends boolean = true>(options?: Options<CreditsPurchasesData, ThrowOnError>): RequestResult<CreditsPurchasesResponses, CreditsPurchasesErrors, ThrowOnError, 'data'>;
33
+ /**
34
+ * Start a credit purchase through Checkout or a saved card
35
+ *
36
+ * Without payment_method_id, records a pending purchase and returns the hosted
37
+ * Checkout page; success_url and cancel_url are required for this path. The response
38
+ * reports fee_minor and total_minor before redirect: Checkout charges total_minor
39
+ * (amount_minor plus BoxRouter's purchase fee, before tax) in two line items, and only
40
+ * amount_minor is added as credit. A refund returns credit only; the fee is not
41
+ * refunded. With a
42
+ * workspace-owned payment_method_id, creates and pays a
43
+ * Stripe invoice using that card. A verified paid invoice returns confirmed; when
44
+ * payer authentication is required, returns pending with the hosted invoice
45
+ * authentication_url. Send the payer there, then poll this purchase after they
46
+ * return to the dashboard. Credit is added only after BoxRouter fetches and validates
47
+ * the paid invoice. A definitive card decline returns payment_declined with the
48
+ * purchase ID and a short safe decline reason in error details, outcome not_started;
49
+ * the failed purchase remains in history. Repeating a request with the same
50
+ * Idempotency-Key returns its original result; a different amount or card under that
51
+ * key is a 409. After a payment_provider_unavailable response with outcome unknown,
52
+ * retry with the same key.
53
+ *
54
+ */
55
+ purchase<ThrowOnError extends boolean = true>(options: Options<CreditsPurchaseData, ThrowOnError>): RequestResult<CreditsPurchaseResponses, CreditsPurchaseErrors, ThrowOnError, 'data'>;
56
+ /**
57
+ * Preview a credit purchase and its tax
58
+ *
59
+ * 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.
60
+ */
61
+ quotePurchase<ThrowOnError extends boolean = true>(options: Options<CreditsQuotePurchaseData, ThrowOnError>): RequestResult<CreditsQuotePurchaseResponses, CreditsQuotePurchaseErrors, ThrowOnError, 'data'>;
62
+ /**
63
+ * List managed-compute credit movements
64
+ *
65
+ * Requires account-management permission; execution keys receive 403. Returns
66
+ * confirmed, nonzero charges from the configured test or live billing book, the later
67
+ * corrections to them, reservations still held, and reservations released with no
68
+ * charge, newest first. Results are limited to the calling workspace. BYOK work,
69
+ * supplier costs, provider account identities, API-key digests and raw usage evidence
70
+ * are not returned; a row's `key_id` names the workspace API key it belongs to. A
71
+ * cursor belongs to this workspace and billing mode; invalid or foreign cursors
72
+ * return 400. New rows do not shift subsequent pages. No provider or payment-provider
73
+ * calls are made.
74
+ *
75
+ */
76
+ usage<ThrowOnError extends boolean = true>(options?: Options<CreditsUsageData, ThrowOnError>): RequestResult<CreditsUsageResponses, CreditsUsageErrors, ThrowOnError, 'data'>;
77
+ /**
78
+ * Get one credit purchase
79
+ *
80
+ * The authoritative state to poll after the payer returns from Checkout. Another workspace's purchase is a 404.
81
+ */
82
+ getPurchase<ThrowOnError extends boolean = true>(options: Options<CreditsGetPurchaseData, ThrowOnError>): RequestResult<CreditsGetPurchaseResponses, CreditsGetPurchaseErrors, ThrowOnError, 'data'>;
83
+ /**
84
+ * Close an unpaid Checkout session
85
+ *
86
+ * Expires a known open Checkout session for this workspace-owned purchase. A
87
+ * completed payment is reconciled and remains confirmed. If Checkout creation
88
+ * had an unknown outcome and no session ID was recorded, the same stable Stripe
89
+ * idempotency key recovers that request before BoxRouter expires the session.
90
+ * Repeating this request is safe. The request needs no body: the return URLs are
91
+ * optional and unused when closing a purchase.
92
+ *
93
+ */
94
+ cancelPurchase<ThrowOnError extends boolean = true>(options: Options<CreditsCancelPurchaseData, ThrowOnError>): RequestResult<CreditsCancelPurchaseResponses, CreditsCancelPurchaseErrors, ThrowOnError, 'data'>;
95
+ /**
96
+ * List redeemed promotion codes
97
+ *
98
+ * Promotion codes this workspace redeemed, newest first.
99
+ */
100
+ promotions<ThrowOnError extends boolean = true>(options?: Options<CreditsPromotionsData, ThrowOnError>): RequestResult<CreditsPromotionsResponses, CreditsPromotionsErrors, ThrowOnError, 'data'>;
101
+ /**
102
+ * Redeem a promotion code for free credit
103
+ *
104
+ * Adds the code's credit to the workspace balance, once per workspace. Codes are
105
+ * case-insensitive and surrounding spaces are ignored. An unknown, expired, disabled
106
+ * or fully used code is 404 promotion_code_invalid; these cases are not told apart.
107
+ * A new redemption answers 201. A code this workspace already redeemed is refused
108
+ * with 409 promotion_already_redeemed and details.redemption containing the original redemption;
109
+ * its message names the redemption date. No credit is granted again. Promotional
110
+ * credit does not expire. Requires account-management permission; 503 payments_unavailable while
111
+ * credits are not configured.
112
+ *
113
+ */
114
+ redeem<ThrowOnError extends boolean = true>(options: Options<CreditsRedeemData, ThrowOnError>): RequestResult<CreditsRedeemResponses, CreditsRedeemErrors, ThrowOnError, 'data'>;
115
+ /**
116
+ * Get workspace billing details
117
+ *
118
+ * 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.
119
+ */
120
+ billingDetails<ThrowOnError extends boolean = true>(options?: Options<CreditsBillingDetailsData, ThrowOnError>): RequestResult<CreditsBillingDetailsResponses, CreditsBillingDetailsErrors, ThrowOnError, 'data'>;
121
+ /**
122
+ * Replace workspace billing details
123
+ *
124
+ * 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.
125
+ */
126
+ updateBillingDetails<ThrowOnError extends boolean = true>(options: Options<CreditsUpdateBillingDetailsData, ThrowOnError>): RequestResult<CreditsUpdateBillingDetailsResponses, CreditsUpdateBillingDetailsErrors, ThrowOnError, 'data'>;
127
+ /**
128
+ * Get workspace credit alert settings
129
+ *
130
+ * Requires account-management permission. Returns workspace-owned settings only.
131
+ */
132
+ alerts<ThrowOnError extends boolean = true>(options?: Options<CreditsAlertsData, ThrowOnError>): RequestResult<CreditsAlertsResponses, CreditsAlertsErrors, ThrowOnError, 'data'>;
133
+ /**
134
+ * Replace workspace credit alert settings
135
+ *
136
+ * 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.
137
+ */
138
+ updateAlerts<ThrowOnError extends boolean = true>(options: Options<CreditsUpdateAlertsData, ThrowOnError>): RequestResult<CreditsUpdateAlertsResponses, CreditsUpdateAlertsErrors, ThrowOnError, 'data'>;
139
+ /**
140
+ * List saved workspace payment methods
141
+ *
142
+ * 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.
143
+ */
144
+ paymentMethods<ThrowOnError extends boolean = true>(options?: Options<CreditsPaymentMethodsData, ThrowOnError>): RequestResult<CreditsPaymentMethodsResponses, CreditsPaymentMethodsErrors, ThrowOnError, 'data'>;
145
+ /**
146
+ * Start hosted setup for a saved payment method
147
+ *
148
+ * Creates a Stripe-hosted setup page and returns its URL. Setup does not charge the
149
+ * 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.
150
+ * Repeating the request with the same Idempotency-Key returns the same page.
151
+ *
152
+ */
153
+ setupPaymentMethod<ThrowOnError extends boolean = true>(options: Options<CreditsSetupPaymentMethodData, ThrowOnError>): RequestResult<CreditsSetupPaymentMethodResponses, CreditsSetupPaymentMethodErrors, ThrowOnError, 'data'>;
154
+ /**
155
+ * Start in-page saved card setup
156
+ *
157
+ * Creates a Stripe SetupIntent for in-page card collection. Requires account-management permission and the in-page cards feature.
158
+ */
159
+ setupPaymentMethodIntent<ThrowOnError extends boolean = true>(options?: Options<CreditsSetupPaymentMethodIntentData, ThrowOnError>): RequestResult<CreditsSetupPaymentMethodIntentResponses, CreditsSetupPaymentMethodIntentErrors, ThrowOnError, 'data'>;
160
+ /**
161
+ * Set saved card charge order
162
+ *
163
+ * 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.
164
+ */
165
+ reorderPaymentMethods<ThrowOnError extends boolean = true>(options: Options<CreditsReorderPaymentMethodsData, ThrowOnError>): RequestResult<CreditsReorderPaymentMethodsResponses, CreditsReorderPaymentMethodsErrors, ThrowOnError, 'data'>;
166
+ /**
167
+ * Get a saved payment method setup status
168
+ *
169
+ * Reads Stripe's current setup state after the payer returns. Another workspace's setup is a 404.
170
+ */
171
+ getPaymentMethodSetup<ThrowOnError extends boolean = true>(options: Options<CreditsGetPaymentMethodSetupData, ThrowOnError>): RequestResult<CreditsGetPaymentMethodSetupResponses, CreditsGetPaymentMethodSetupErrors, ThrowOnError, 'data'>;
172
+ /**
173
+ * Remove a saved workspace payment method
174
+ *
175
+ * Detaches a saved card. Another workspace's payment method is a 404. If the card
176
+ * was the default, the next saved card becomes default; removing the last card
177
+ * disables auto top-up with disabled_reason payment_method_required.
178
+ *
179
+ */
180
+ deletePaymentMethod<ThrowOnError extends boolean = true>(options: Options<CreditsDeletePaymentMethodData, ThrowOnError>): RequestResult<CreditsDeletePaymentMethodResponses, CreditsDeletePaymentMethodErrors, ThrowOnError, 'data'>;
181
+ /**
182
+ * Set the workspace's default saved card
183
+ *
184
+ * Makes this workspace-owned saved card the only default card. The first saved
185
+ * card becomes default automatically. This local setting is used by one-click
186
+ * purchases and auto top-up; repeating the request is safe. Another workspace's
187
+ * card is a 404.
188
+ *
189
+ */
190
+ setDefaultPaymentMethod<ThrowOnError extends boolean = true>(options: Options<CreditsSetDefaultPaymentMethodData, ThrowOnError>): RequestResult<CreditsSetDefaultPaymentMethodResponses, CreditsSetDefaultPaymentMethodErrors, ThrowOnError, 'data'>;
191
+ /**
192
+ * Get automatic credit top-up settings
193
+ *
194
+ * Requires account-management permission. Auto top-up is off until explicitly enabled.
195
+ */
196
+ autoTopUp<ThrowOnError extends boolean = true>(options?: Options<CreditsAutoTopUpData, ThrowOnError>): RequestResult<CreditsAutoTopUpResponses, CreditsAutoTopUpErrors, ThrowOnError, 'data'>;
197
+ /**
198
+ * Replace automatic credit top-up settings
199
+ *
200
+ * Stores the enabled state, trigger level and purchase amount. The amount must be
201
+ * within current purchase_bounds_minor and the trigger level must be zero or greater.
202
+ * Enabling requires a default saved card. Enabling with a trigger level above current
203
+ * available credit evaluates and attempts one top-up immediately. An attempt is
204
+ * made once per crossing below the trigger level and is never retried automatically. A
205
+ * decline or required authentication disables auto top-up and records the reason.
206
+ * Repeating the same settings is idempotent and does not start a second attempt for
207
+ * the same balance crossing. After a 503 with outcome unknown, retry the identical
208
+ * settings or GET the settings; inspect last_attempt.purchase_id and poll that
209
+ * purchase to reconcile the original attempt.
210
+ *
211
+ */
212
+ updateAutoTopUp<ThrowOnError extends boolean = true>(options: Options<CreditsUpdateAutoTopUpData, ThrowOnError>): RequestResult<CreditsUpdateAutoTopUpResponses, CreditsUpdateAutoTopUpErrors, ThrowOnError, 'data'>;
213
+ }