@skyvern/client 1.0.10 → 1.0.12

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 (125) hide show
  1. package/README.md +0 -1
  2. package/dist/cjs/Client.d.ts +68 -0
  3. package/dist/cjs/Client.js +263 -2
  4. package/dist/cjs/api/client/requests/ChangeTierRequest.d.ts +10 -0
  5. package/dist/cjs/api/client/requests/ChangeTierRequest.js +3 -0
  6. package/dist/cjs/api/client/requests/CheckoutSubscriptionRequest.d.ts +10 -0
  7. package/dist/cjs/api/client/requests/CheckoutSubscriptionRequest.js +3 -0
  8. package/dist/cjs/api/client/requests/CreateBrowserSessionRequest.d.ts +10 -5
  9. package/dist/cjs/api/client/requests/TotpCodeCreate.d.ts +3 -0
  10. package/dist/cjs/api/client/requests/index.d.ts +2 -0
  11. package/dist/cjs/api/types/Action.d.ts +3 -0
  12. package/dist/cjs/api/types/ArtifactType.d.ts +1 -0
  13. package/dist/cjs/api/types/ArtifactType.js +1 -0
  14. package/dist/cjs/api/types/BillingStateResponse.d.ts +19 -0
  15. package/dist/cjs/api/types/BillingStateResponse.js +3 -0
  16. package/dist/cjs/api/types/BlockType.d.ts +1 -0
  17. package/dist/cjs/api/types/BlockType.js +1 -0
  18. package/dist/cjs/api/types/BrowserSessionResponse.d.ts +6 -0
  19. package/dist/cjs/api/types/ChangeTierResponse.d.ts +5 -0
  20. package/dist/cjs/api/types/ChangeTierResponse.js +3 -0
  21. package/dist/cjs/api/types/CheckoutSessionResponse.d.ts +4 -0
  22. package/dist/cjs/api/types/CheckoutSessionResponse.js +3 -0
  23. package/dist/cjs/api/types/Extensions.d.ts +5 -0
  24. package/dist/cjs/api/types/Extensions.js +8 -0
  25. package/dist/cjs/api/types/ForLoopBlockLoopBlocksItem.d.ts +4 -1
  26. package/dist/cjs/api/types/ForLoopBlockYamlLoopBlocksItem.d.ts +4 -1
  27. package/dist/cjs/api/types/HttpRequestBlock.d.ts +2 -0
  28. package/dist/cjs/api/types/HttpRequestBlockYaml.d.ts +2 -0
  29. package/dist/cjs/api/types/InputOrSelectContext.d.ts +1 -0
  30. package/dist/cjs/api/types/PdfFormat.d.ts +7 -0
  31. package/dist/cjs/api/types/PdfFormat.js +10 -0
  32. package/dist/cjs/api/types/PersistentBrowserType.d.ts +5 -0
  33. package/dist/cjs/api/types/PersistentBrowserType.js +8 -0
  34. package/dist/cjs/api/types/PlanTier.d.ts +7 -0
  35. package/dist/cjs/api/types/PlanTier.js +10 -0
  36. package/dist/cjs/api/types/PortalSessionResponse.d.ts +3 -0
  37. package/dist/cjs/api/types/PortalSessionResponse.js +3 -0
  38. package/dist/cjs/api/types/PrintPageBlock.d.ts +18 -0
  39. package/dist/cjs/api/types/PrintPageBlock.js +3 -0
  40. package/dist/cjs/api/types/PrintPageBlockParametersItem.d.ts +37 -0
  41. package/dist/cjs/api/types/PrintPageBlockParametersItem.js +3 -0
  42. package/dist/cjs/api/types/PrintPageBlockYaml.d.ts +16 -0
  43. package/dist/cjs/api/types/PrintPageBlockYaml.js +3 -0
  44. package/dist/cjs/api/types/ProxyLocation.d.ts +1 -0
  45. package/dist/cjs/api/types/ProxyLocation.js +1 -0
  46. package/dist/cjs/api/types/TaskRunRequest.d.ts +14 -10
  47. package/dist/cjs/api/types/TaskRunResponse.d.ts +2 -0
  48. package/dist/cjs/api/types/ThoughtScenario.d.ts +7 -0
  49. package/dist/cjs/api/types/ThoughtScenario.js +7 -0
  50. package/dist/cjs/api/types/ThoughtType.d.ts +7 -0
  51. package/dist/cjs/api/types/ThoughtType.js +7 -0
  52. package/dist/cjs/api/types/TotpCode.d.ts +2 -0
  53. package/dist/cjs/api/types/WorkflowDefinition.d.ts +1 -0
  54. package/dist/cjs/api/types/WorkflowDefinitionBlocksItem.d.ts +4 -1
  55. package/dist/cjs/api/types/WorkflowDefinitionYaml.d.ts +1 -0
  56. package/dist/cjs/api/types/WorkflowDefinitionYamlBlocksItem.d.ts +4 -1
  57. package/dist/cjs/api/types/WorkflowRunRequest.d.ts +12 -10
  58. package/dist/cjs/api/types/WorkflowRunResponse.d.ts +2 -0
  59. package/dist/cjs/api/types/index.d.ts +11 -0
  60. package/dist/cjs/api/types/index.js +11 -0
  61. package/dist/cjs/version.d.ts +1 -1
  62. package/dist/cjs/version.js +1 -1
  63. package/dist/esm/Client.d.mts +68 -0
  64. package/dist/esm/Client.mjs +263 -2
  65. package/dist/esm/api/client/requests/ChangeTierRequest.d.mts +10 -0
  66. package/dist/esm/api/client/requests/ChangeTierRequest.mjs +2 -0
  67. package/dist/esm/api/client/requests/CheckoutSubscriptionRequest.d.mts +10 -0
  68. package/dist/esm/api/client/requests/CheckoutSubscriptionRequest.mjs +2 -0
  69. package/dist/esm/api/client/requests/CreateBrowserSessionRequest.d.mts +10 -5
  70. package/dist/esm/api/client/requests/TotpCodeCreate.d.mts +3 -0
  71. package/dist/esm/api/client/requests/index.d.mts +2 -0
  72. package/dist/esm/api/types/Action.d.mts +3 -0
  73. package/dist/esm/api/types/ArtifactType.d.mts +1 -0
  74. package/dist/esm/api/types/ArtifactType.mjs +1 -0
  75. package/dist/esm/api/types/BillingStateResponse.d.mts +19 -0
  76. package/dist/esm/api/types/BillingStateResponse.mjs +2 -0
  77. package/dist/esm/api/types/BlockType.d.mts +1 -0
  78. package/dist/esm/api/types/BlockType.mjs +1 -0
  79. package/dist/esm/api/types/BrowserSessionResponse.d.mts +6 -0
  80. package/dist/esm/api/types/ChangeTierResponse.d.mts +5 -0
  81. package/dist/esm/api/types/ChangeTierResponse.mjs +2 -0
  82. package/dist/esm/api/types/CheckoutSessionResponse.d.mts +4 -0
  83. package/dist/esm/api/types/CheckoutSessionResponse.mjs +2 -0
  84. package/dist/esm/api/types/Extensions.d.mts +5 -0
  85. package/dist/esm/api/types/Extensions.mjs +5 -0
  86. package/dist/esm/api/types/ForLoopBlockLoopBlocksItem.d.mts +4 -1
  87. package/dist/esm/api/types/ForLoopBlockYamlLoopBlocksItem.d.mts +4 -1
  88. package/dist/esm/api/types/HttpRequestBlock.d.mts +2 -0
  89. package/dist/esm/api/types/HttpRequestBlockYaml.d.mts +2 -0
  90. package/dist/esm/api/types/InputOrSelectContext.d.mts +1 -0
  91. package/dist/esm/api/types/PdfFormat.d.mts +7 -0
  92. package/dist/esm/api/types/PdfFormat.mjs +7 -0
  93. package/dist/esm/api/types/PersistentBrowserType.d.mts +5 -0
  94. package/dist/esm/api/types/PersistentBrowserType.mjs +5 -0
  95. package/dist/esm/api/types/PlanTier.d.mts +7 -0
  96. package/dist/esm/api/types/PlanTier.mjs +7 -0
  97. package/dist/esm/api/types/PortalSessionResponse.d.mts +3 -0
  98. package/dist/esm/api/types/PortalSessionResponse.mjs +2 -0
  99. package/dist/esm/api/types/PrintPageBlock.d.mts +18 -0
  100. package/dist/esm/api/types/PrintPageBlock.mjs +2 -0
  101. package/dist/esm/api/types/PrintPageBlockParametersItem.d.mts +37 -0
  102. package/dist/esm/api/types/PrintPageBlockParametersItem.mjs +2 -0
  103. package/dist/esm/api/types/PrintPageBlockYaml.d.mts +16 -0
  104. package/dist/esm/api/types/PrintPageBlockYaml.mjs +2 -0
  105. package/dist/esm/api/types/ProxyLocation.d.mts +1 -0
  106. package/dist/esm/api/types/ProxyLocation.mjs +1 -0
  107. package/dist/esm/api/types/TaskRunRequest.d.mts +14 -10
  108. package/dist/esm/api/types/TaskRunResponse.d.mts +2 -0
  109. package/dist/esm/api/types/ThoughtScenario.d.mts +7 -0
  110. package/dist/esm/api/types/ThoughtScenario.mjs +7 -0
  111. package/dist/esm/api/types/ThoughtType.d.mts +7 -0
  112. package/dist/esm/api/types/ThoughtType.mjs +7 -0
  113. package/dist/esm/api/types/TotpCode.d.mts +2 -0
  114. package/dist/esm/api/types/WorkflowDefinition.d.mts +1 -0
  115. package/dist/esm/api/types/WorkflowDefinitionBlocksItem.d.mts +4 -1
  116. package/dist/esm/api/types/WorkflowDefinitionYaml.d.mts +1 -0
  117. package/dist/esm/api/types/WorkflowDefinitionYamlBlocksItem.d.mts +4 -1
  118. package/dist/esm/api/types/WorkflowRunRequest.d.mts +12 -10
  119. package/dist/esm/api/types/WorkflowRunResponse.d.mts +2 -0
  120. package/dist/esm/api/types/index.d.mts +11 -0
  121. package/dist/esm/api/types/index.mjs +11 -0
  122. package/dist/esm/version.d.mts +1 -1
  123. package/dist/esm/version.mjs +1 -1
  124. package/package.json +1 -1
  125. package/reference.md +8 -8
@@ -20,8 +20,8 @@ export class SkyvernClient {
20
20
  "x-api-key": _options === null || _options === void 0 ? void 0 : _options.apiKey,
21
21
  "X-Fern-Language": "JavaScript",
22
22
  "X-Fern-SDK-Name": "@skyvern/client",
23
- "X-Fern-SDK-Version": "1.0.10",
24
- "User-Agent": "@skyvern/client/1.0.10",
23
+ "X-Fern-SDK-Version": "1.0.12",
24
+ "User-Agent": "@skyvern/client/1.0.12",
25
25
  "X-Fern-Runtime": core.RUNTIME.type,
26
26
  "X-Fern-Runtime-Version": core.RUNTIME.version,
27
27
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -2227,4 +2227,265 @@ export class SkyvernClient {
2227
2227
  }
2228
2228
  });
2229
2229
  }
2230
+ /**
2231
+ * Create a Stripe Checkout Session for subscribing to a tier.
2232
+ *
2233
+ * Frontend should redirect the user to the returned URL.
2234
+ * After successful checkout, Stripe will send a webhook that we handle
2235
+ * to store the subscription and initialize billing state.
2236
+ *
2237
+ * Returns 400 if org already has an active subscription (use portal instead).
2238
+ *
2239
+ * @param {Skyvern.CheckoutSubscriptionRequest} request
2240
+ * @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
2241
+ *
2242
+ * @throws {@link Skyvern.UnprocessableEntityError}
2243
+ *
2244
+ * @example
2245
+ * await client.createCheckoutSessionApiV1BillingCheckoutPost({
2246
+ * tier: "free"
2247
+ * })
2248
+ */
2249
+ createCheckoutSessionApiV1BillingCheckoutPost(request, requestOptions) {
2250
+ return core.HttpResponsePromise.fromPromise(this.__createCheckoutSessionApiV1BillingCheckoutPost(request, requestOptions));
2251
+ }
2252
+ __createCheckoutSessionApiV1BillingCheckoutPost(request, requestOptions) {
2253
+ return __awaiter(this, void 0, void 0, function* () {
2254
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2255
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2256
+ const _response = yield core.fetcher({
2257
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "api/v1/billing/checkout"),
2258
+ method: "POST",
2259
+ headers: _headers,
2260
+ contentType: "application/json",
2261
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2262
+ requestType: "json",
2263
+ body: request,
2264
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
2265
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
2266
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2267
+ });
2268
+ if (_response.ok) {
2269
+ return { data: _response.body, rawResponse: _response.rawResponse };
2270
+ }
2271
+ if (_response.error.reason === "status-code") {
2272
+ switch (_response.error.statusCode) {
2273
+ case 422:
2274
+ throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
2275
+ default:
2276
+ throw new errors.SkyvernError({
2277
+ statusCode: _response.error.statusCode,
2278
+ body: _response.error.body,
2279
+ rawResponse: _response.rawResponse,
2280
+ });
2281
+ }
2282
+ }
2283
+ switch (_response.error.reason) {
2284
+ case "non-json":
2285
+ throw new errors.SkyvernError({
2286
+ statusCode: _response.error.statusCode,
2287
+ body: _response.error.rawBody,
2288
+ rawResponse: _response.rawResponse,
2289
+ });
2290
+ case "timeout":
2291
+ throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /api/v1/billing/checkout.");
2292
+ case "unknown":
2293
+ throw new errors.SkyvernError({
2294
+ message: _response.error.errorMessage,
2295
+ rawResponse: _response.rawResponse,
2296
+ });
2297
+ }
2298
+ });
2299
+ }
2300
+ /**
2301
+ * Create a Stripe Customer Portal session for managing subscription.
2302
+ *
2303
+ * Frontend should redirect the user to the returned URL.
2304
+ * The portal allows users to:
2305
+ * - Update payment methods
2306
+ * - Upgrade/downgrade plans
2307
+ * - Cancel subscription
2308
+ * - View invoices
2309
+ *
2310
+ * @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
2311
+ *
2312
+ * @throws {@link Skyvern.UnprocessableEntityError}
2313
+ *
2314
+ * @example
2315
+ * await client.createPortalSessionApiV1BillingPortalPost()
2316
+ */
2317
+ createPortalSessionApiV1BillingPortalPost(requestOptions) {
2318
+ return core.HttpResponsePromise.fromPromise(this.__createPortalSessionApiV1BillingPortalPost(requestOptions));
2319
+ }
2320
+ __createPortalSessionApiV1BillingPortalPost(requestOptions) {
2321
+ return __awaiter(this, void 0, void 0, function* () {
2322
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2323
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2324
+ const _response = yield core.fetcher({
2325
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "api/v1/billing/portal"),
2326
+ method: "POST",
2327
+ headers: _headers,
2328
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2329
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
2330
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
2331
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2332
+ });
2333
+ if (_response.ok) {
2334
+ return { data: _response.body, rawResponse: _response.rawResponse };
2335
+ }
2336
+ if (_response.error.reason === "status-code") {
2337
+ switch (_response.error.statusCode) {
2338
+ case 422:
2339
+ throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
2340
+ default:
2341
+ throw new errors.SkyvernError({
2342
+ statusCode: _response.error.statusCode,
2343
+ body: _response.error.body,
2344
+ rawResponse: _response.rawResponse,
2345
+ });
2346
+ }
2347
+ }
2348
+ switch (_response.error.reason) {
2349
+ case "non-json":
2350
+ throw new errors.SkyvernError({
2351
+ statusCode: _response.error.statusCode,
2352
+ body: _response.error.rawBody,
2353
+ rawResponse: _response.rawResponse,
2354
+ });
2355
+ case "timeout":
2356
+ throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /api/v1/billing/portal.");
2357
+ case "unknown":
2358
+ throw new errors.SkyvernError({
2359
+ message: _response.error.errorMessage,
2360
+ rawResponse: _response.rawResponse,
2361
+ });
2362
+ }
2363
+ });
2364
+ }
2365
+ /**
2366
+ * @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
2367
+ *
2368
+ * @throws {@link Skyvern.UnprocessableEntityError}
2369
+ *
2370
+ * @example
2371
+ * await client.getOrganizationBillingApiV1BillingStateGet()
2372
+ */
2373
+ getOrganizationBillingApiV1BillingStateGet(requestOptions) {
2374
+ return core.HttpResponsePromise.fromPromise(this.__getOrganizationBillingApiV1BillingStateGet(requestOptions));
2375
+ }
2376
+ __getOrganizationBillingApiV1BillingStateGet(requestOptions) {
2377
+ return __awaiter(this, void 0, void 0, function* () {
2378
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2379
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2380
+ const _response = yield core.fetcher({
2381
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "api/v1/billing/state"),
2382
+ method: "GET",
2383
+ headers: _headers,
2384
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2385
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
2386
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
2387
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2388
+ });
2389
+ if (_response.ok) {
2390
+ return {
2391
+ data: _response.body,
2392
+ rawResponse: _response.rawResponse,
2393
+ };
2394
+ }
2395
+ if (_response.error.reason === "status-code") {
2396
+ switch (_response.error.statusCode) {
2397
+ case 422:
2398
+ throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
2399
+ default:
2400
+ throw new errors.SkyvernError({
2401
+ statusCode: _response.error.statusCode,
2402
+ body: _response.error.body,
2403
+ rawResponse: _response.rawResponse,
2404
+ });
2405
+ }
2406
+ }
2407
+ switch (_response.error.reason) {
2408
+ case "non-json":
2409
+ throw new errors.SkyvernError({
2410
+ statusCode: _response.error.statusCode,
2411
+ body: _response.error.rawBody,
2412
+ rawResponse: _response.rawResponse,
2413
+ });
2414
+ case "timeout":
2415
+ throw new errors.SkyvernTimeoutError("Timeout exceeded when calling GET /api/v1/billing/state.");
2416
+ case "unknown":
2417
+ throw new errors.SkyvernError({
2418
+ message: _response.error.errorMessage,
2419
+ rawResponse: _response.rawResponse,
2420
+ });
2421
+ }
2422
+ });
2423
+ }
2424
+ /**
2425
+ * Redirect to Stripe Portal for tier changes.
2426
+ * Portal handles proration based on configured settings:
2427
+ * - Upgrades: Immediate proration charge
2428
+ * - Downgrades: Apply at end of billing period
2429
+ *
2430
+ * @param {Skyvern.ChangeTierRequest} request
2431
+ * @param {SkyvernClient.RequestOptions} requestOptions - Request-specific configuration.
2432
+ *
2433
+ * @throws {@link Skyvern.UnprocessableEntityError}
2434
+ *
2435
+ * @example
2436
+ * await client.changeTierApiV1BillingChangeTierPost({
2437
+ * tier: "free"
2438
+ * })
2439
+ */
2440
+ changeTierApiV1BillingChangeTierPost(request, requestOptions) {
2441
+ return core.HttpResponsePromise.fromPromise(this.__changeTierApiV1BillingChangeTierPost(request, requestOptions));
2442
+ }
2443
+ __changeTierApiV1BillingChangeTierPost(request, requestOptions) {
2444
+ return __awaiter(this, void 0, void 0, function* () {
2445
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2446
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "x-api-key": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
2447
+ const _response = yield core.fetcher({
2448
+ url: core.url.join((_e = (_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment))) !== null && _e !== void 0 ? _e : environments.SkyvernEnvironment.Cloud, "api/v1/billing/change-tier"),
2449
+ method: "POST",
2450
+ headers: _headers,
2451
+ contentType: "application/json",
2452
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
2453
+ requestType: "json",
2454
+ body: request,
2455
+ timeoutMs: ((_h = (_f = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _f !== void 0 ? _f : (_g = this._options) === null || _g === void 0 ? void 0 : _g.timeoutInSeconds) !== null && _h !== void 0 ? _h : 60) * 1000,
2456
+ maxRetries: (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.maxRetries,
2457
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
2458
+ });
2459
+ if (_response.ok) {
2460
+ return { data: _response.body, rawResponse: _response.rawResponse };
2461
+ }
2462
+ if (_response.error.reason === "status-code") {
2463
+ switch (_response.error.statusCode) {
2464
+ case 422:
2465
+ throw new Skyvern.UnprocessableEntityError(_response.error.body, _response.rawResponse);
2466
+ default:
2467
+ throw new errors.SkyvernError({
2468
+ statusCode: _response.error.statusCode,
2469
+ body: _response.error.body,
2470
+ rawResponse: _response.rawResponse,
2471
+ });
2472
+ }
2473
+ }
2474
+ switch (_response.error.reason) {
2475
+ case "non-json":
2476
+ throw new errors.SkyvernError({
2477
+ statusCode: _response.error.statusCode,
2478
+ body: _response.error.rawBody,
2479
+ rawResponse: _response.rawResponse,
2480
+ });
2481
+ case "timeout":
2482
+ throw new errors.SkyvernTimeoutError("Timeout exceeded when calling POST /api/v1/billing/change-tier.");
2483
+ case "unknown":
2484
+ throw new errors.SkyvernError({
2485
+ message: _response.error.errorMessage,
2486
+ rawResponse: _response.rawResponse,
2487
+ });
2488
+ }
2489
+ });
2490
+ }
2230
2491
  }
@@ -0,0 +1,10 @@
1
+ import type * as Skyvern from "../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {
5
+ * tier: "free"
6
+ * }
7
+ */
8
+ export interface ChangeTierRequest {
9
+ tier: Skyvern.PlanTier;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ import type * as Skyvern from "../../index.mjs";
2
+ /**
3
+ * @example
4
+ * {
5
+ * tier: "free"
6
+ * }
7
+ */
8
+ export interface CheckoutSubscriptionRequest {
9
+ tier: Skyvern.PlanTier;
10
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -19,16 +19,21 @@ export interface CreateBrowserSessionRequest {
19
19
  * - RESIDENTIAL_FR: France
20
20
  * - RESIDENTIAL_DE: Germany
21
21
  * - RESIDENTIAL_NZ: New Zealand
22
+ * - RESIDENTIAL_PH: Philippines
22
23
  * - RESIDENTIAL_ZA: South Africa
23
24
  * - RESIDENTIAL_AR: Argentina
24
25
  * - RESIDENTIAL_AU: Australia
25
26
  * - RESIDENTIAL_ISP: ISP proxy
26
- * - US-CA: California
27
- * - US-NY: New York
28
- * - US-TX: Texas
29
- * - US-FL: Florida
30
- * - US-WA: Washington
27
+ * - US-CA: California (deprecated, routes through RESIDENTIAL_ISP)
28
+ * - US-NY: New York (deprecated, routes through RESIDENTIAL_ISP)
29
+ * - US-TX: Texas (deprecated, routes through RESIDENTIAL_ISP)
30
+ * - US-FL: Florida (deprecated, routes through RESIDENTIAL_ISP)
31
+ * - US-WA: Washington (deprecated, routes through RESIDENTIAL_ISP)
31
32
  * - NONE: No proxy
32
33
  */
33
34
  proxy_location?: Skyvern.ProxyLocation;
35
+ /** A list of extensions to install in the browser session. */
36
+ extensions?: Skyvern.Extensions[];
37
+ /** The type of browser to use for the session. */
38
+ browser_type?: Skyvern.PersistentBrowserType;
34
39
  }
@@ -1,3 +1,4 @@
1
+ import type * as Skyvern from "../../index.mjs";
1
2
  /**
2
3
  * @example
3
4
  * {
@@ -20,4 +21,6 @@ export interface TotpCodeCreate {
20
21
  content: string;
21
22
  /** The timestamp when the TOTP code expires */
22
23
  expired_at?: string;
24
+ /** Optional. If provided, forces extraction of this specific OTP type (totp or magic_link). Use this when the content contains multiple OTP types and you want to specify which one to extract. */
25
+ type?: Skyvern.OtpType;
23
26
  }
@@ -1,4 +1,6 @@
1
1
  export type { BodyUploadFileV1UploadFilePost } from "./BodyUploadFileV1UploadFilePost.mjs";
2
+ export type { ChangeTierRequest } from "./ChangeTierRequest.mjs";
3
+ export type { CheckoutSubscriptionRequest } from "./CheckoutSubscriptionRequest.mjs";
2
4
  export type { CreateBrowserProfileRequest } from "./CreateBrowserProfileRequest.mjs";
3
5
  export type { CreateBrowserSessionRequest } from "./CreateBrowserSessionRequest.mjs";
4
6
  export type { CreateCredentialRequest } from "./CreateCredentialRequest.mjs";
@@ -18,6 +18,7 @@ export interface Action {
18
18
  element_id?: string;
19
19
  skyvern_element_hash?: string;
20
20
  skyvern_element_data?: Record<string, unknown>;
21
+ screenshot_artifact_id?: string;
21
22
  tool_call_id?: string;
22
23
  xpath?: string;
23
24
  errors?: Skyvern.UserDefinedError[];
@@ -25,6 +26,8 @@ export interface Action {
25
26
  file_name?: string;
26
27
  file_url?: string;
27
28
  download?: boolean;
29
+ download_triggered?: boolean;
30
+ downloaded_files?: string[];
28
31
  is_upload_file_tag?: boolean;
29
32
  text?: string;
30
33
  input_or_select_context?: Skyvern.InputOrSelectContext;
@@ -25,5 +25,6 @@ export declare const ArtifactType: {
25
25
  readonly Trace: "trace";
26
26
  readonly Har: "har";
27
27
  readonly ScriptFile: "script_file";
28
+ readonly Pdf: "pdf";
28
29
  };
29
30
  export type ArtifactType = (typeof ArtifactType)[keyof typeof ArtifactType];
@@ -26,4 +26,5 @@ export const ArtifactType = {
26
26
  Trace: "trace",
27
27
  Har: "har",
28
28
  ScriptFile: "script_file",
29
+ Pdf: "pdf",
29
30
  };
@@ -0,0 +1,19 @@
1
+ import type * as Skyvern from "../index.mjs";
2
+ export interface BillingStateResponse {
3
+ billing_id: string;
4
+ organization_id: string;
5
+ plan_tier: Skyvern.PlanTier;
6
+ current_period_start?: string;
7
+ current_period_end?: string;
8
+ included_credits_this_period: number;
9
+ credits_consumed_this_period: number;
10
+ cached_credits_consumed_this_period: number;
11
+ overage_enabled: boolean;
12
+ browser_uptime_seconds_consumed: number;
13
+ topup_credits_total: number;
14
+ topup_credits_used: number;
15
+ topup_credits_remaining: number;
16
+ credits_remaining: number;
17
+ created_at: string;
18
+ modified_at: string;
19
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -21,5 +21,6 @@ export declare const BlockType: {
21
21
  readonly PdfParser: "pdf_parser";
22
22
  readonly HttpRequest: "http_request";
23
23
  readonly HumanInteraction: "human_interaction";
24
+ readonly PrintPage: "print_page";
24
25
  };
25
26
  export type BlockType = (typeof BlockType)[keyof typeof BlockType];
@@ -22,4 +22,5 @@ export const BlockType = {
22
22
  PdfParser: "pdf_parser",
23
23
  HttpRequest: "http_request",
24
24
  HumanInteraction: "human_interaction",
25
+ PrintPage: "print_page",
25
26
  };
@@ -7,6 +7,8 @@ export interface BrowserSessionResponse {
7
7
  browser_session_id: string;
8
8
  /** ID of the organization that owns this session */
9
9
  organization_id: string;
10
+ /** Current status of the browser session */
11
+ status?: string;
10
12
  /** Type of the current runnable associated with this session (workflow, task etc) */
11
13
  runnable_type?: string;
12
14
  /** ID of the current runnable */
@@ -17,6 +19,10 @@ export interface BrowserSessionResponse {
17
19
  browser_address?: string;
18
20
  /** Url for the browser session page */
19
21
  app_url?: string;
22
+ /** A list of extensions installed in the browser session. */
23
+ extensions?: Skyvern.Extensions[];
24
+ /** The type of browser used for the session. */
25
+ browser_type?: Skyvern.PersistentBrowserType;
20
26
  /** Whether the browser session supports VNC streaming */
21
27
  vnc_streaming_supported?: boolean;
22
28
  /** The path where the browser session downloads files */
@@ -0,0 +1,5 @@
1
+ export interface ChangeTierResponse {
2
+ status: string;
3
+ tier: string;
4
+ redirect_url?: string;
5
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface CheckoutSessionResponse {
2
+ id: string;
3
+ url: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const Extensions: {
2
+ readonly AdBlocker: "ad-blocker";
3
+ readonly CaptchaSolver: "captcha-solver";
4
+ };
5
+ export type Extensions = (typeof Extensions)[keyof typeof Extensions];
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export const Extensions = {
3
+ AdBlocker: "ad-blocker",
4
+ CaptchaSolver: "captcha-solver",
5
+ };
@@ -1,5 +1,5 @@
1
1
  import type * as Skyvern from "../index.mjs";
2
- export type ForLoopBlockLoopBlocksItem = Skyvern.ForLoopBlockLoopBlocksItem.Action | Skyvern.ForLoopBlockLoopBlocksItem.Code | Skyvern.ForLoopBlockLoopBlocksItem.Conditional | Skyvern.ForLoopBlockLoopBlocksItem.DownloadToS3 | Skyvern.ForLoopBlockLoopBlocksItem.Extraction | Skyvern.ForLoopBlockLoopBlocksItem.FileDownload | Skyvern.ForLoopBlockLoopBlocksItem.FileUpload | Skyvern.ForLoopBlockLoopBlocksItem.FileUrlParser | Skyvern.ForLoopBlockLoopBlocksItem.ForLoop | Skyvern.ForLoopBlockLoopBlocksItem.GotoUrl | Skyvern.ForLoopBlockLoopBlocksItem.HttpRequest | Skyvern.ForLoopBlockLoopBlocksItem.HumanInteraction | Skyvern.ForLoopBlockLoopBlocksItem.Login | Skyvern.ForLoopBlockLoopBlocksItem.Navigation | Skyvern.ForLoopBlockLoopBlocksItem.PdfParser | Skyvern.ForLoopBlockLoopBlocksItem.SendEmail | Skyvern.ForLoopBlockLoopBlocksItem.Task | Skyvern.ForLoopBlockLoopBlocksItem.TaskV2 | Skyvern.ForLoopBlockLoopBlocksItem.TextPrompt | Skyvern.ForLoopBlockLoopBlocksItem.UploadToS3 | Skyvern.ForLoopBlockLoopBlocksItem.Validation | Skyvern.ForLoopBlockLoopBlocksItem.Wait;
2
+ export type ForLoopBlockLoopBlocksItem = Skyvern.ForLoopBlockLoopBlocksItem.Action | Skyvern.ForLoopBlockLoopBlocksItem.Code | Skyvern.ForLoopBlockLoopBlocksItem.Conditional | Skyvern.ForLoopBlockLoopBlocksItem.DownloadToS3 | Skyvern.ForLoopBlockLoopBlocksItem.Extraction | Skyvern.ForLoopBlockLoopBlocksItem.FileDownload | Skyvern.ForLoopBlockLoopBlocksItem.FileUpload | Skyvern.ForLoopBlockLoopBlocksItem.FileUrlParser | Skyvern.ForLoopBlockLoopBlocksItem.ForLoop | Skyvern.ForLoopBlockLoopBlocksItem.GotoUrl | Skyvern.ForLoopBlockLoopBlocksItem.HttpRequest | Skyvern.ForLoopBlockLoopBlocksItem.HumanInteraction | Skyvern.ForLoopBlockLoopBlocksItem.Login | Skyvern.ForLoopBlockLoopBlocksItem.Navigation | Skyvern.ForLoopBlockLoopBlocksItem.PdfParser | Skyvern.ForLoopBlockLoopBlocksItem.PrintPage | Skyvern.ForLoopBlockLoopBlocksItem.SendEmail | Skyvern.ForLoopBlockLoopBlocksItem.Task | Skyvern.ForLoopBlockLoopBlocksItem.TaskV2 | Skyvern.ForLoopBlockLoopBlocksItem.TextPrompt | Skyvern.ForLoopBlockLoopBlocksItem.UploadToS3 | Skyvern.ForLoopBlockLoopBlocksItem.Validation | Skyvern.ForLoopBlockLoopBlocksItem.Wait;
3
3
  export declare namespace ForLoopBlockLoopBlocksItem {
4
4
  interface Action extends Skyvern.ActionBlock {
5
5
  block_type: "action";
@@ -46,6 +46,9 @@ export declare namespace ForLoopBlockLoopBlocksItem {
46
46
  interface PdfParser extends Skyvern.PdfParserBlock {
47
47
  block_type: "pdf_parser";
48
48
  }
49
+ interface PrintPage extends Skyvern.PrintPageBlock {
50
+ block_type: "print_page";
51
+ }
49
52
  interface SendEmail extends Skyvern.SendEmailBlock {
50
53
  block_type: "send_email";
51
54
  }
@@ -1,5 +1,5 @@
1
1
  import type * as Skyvern from "../index.mjs";
2
- export type ForLoopBlockYamlLoopBlocksItem = Skyvern.ForLoopBlockYamlLoopBlocksItem.Task | Skyvern.ForLoopBlockYamlLoopBlocksItem.ForLoop | Skyvern.ForLoopBlockYamlLoopBlocksItem.Code | Skyvern.ForLoopBlockYamlLoopBlocksItem.TextPrompt | Skyvern.ForLoopBlockYamlLoopBlocksItem.DownloadToS3 | Skyvern.ForLoopBlockYamlLoopBlocksItem.UploadToS3 | Skyvern.ForLoopBlockYamlLoopBlocksItem.FileUpload | Skyvern.ForLoopBlockYamlLoopBlocksItem.SendEmail | Skyvern.ForLoopBlockYamlLoopBlocksItem.FileUrlParser | Skyvern.ForLoopBlockYamlLoopBlocksItem.Validation | Skyvern.ForLoopBlockYamlLoopBlocksItem.Action | Skyvern.ForLoopBlockYamlLoopBlocksItem.Navigation | Skyvern.ForLoopBlockYamlLoopBlocksItem.Extraction | Skyvern.ForLoopBlockYamlLoopBlocksItem.Login | Skyvern.ForLoopBlockYamlLoopBlocksItem.Wait | Skyvern.ForLoopBlockYamlLoopBlocksItem.HumanInteraction | Skyvern.ForLoopBlockYamlLoopBlocksItem.FileDownload | Skyvern.ForLoopBlockYamlLoopBlocksItem.GotoUrl | Skyvern.ForLoopBlockYamlLoopBlocksItem.PdfParser | Skyvern.ForLoopBlockYamlLoopBlocksItem.TaskV2 | Skyvern.ForLoopBlockYamlLoopBlocksItem.HttpRequest | Skyvern.ForLoopBlockYamlLoopBlocksItem.Conditional;
2
+ export type ForLoopBlockYamlLoopBlocksItem = Skyvern.ForLoopBlockYamlLoopBlocksItem.Task | Skyvern.ForLoopBlockYamlLoopBlocksItem.ForLoop | Skyvern.ForLoopBlockYamlLoopBlocksItem.Code | Skyvern.ForLoopBlockYamlLoopBlocksItem.TextPrompt | Skyvern.ForLoopBlockYamlLoopBlocksItem.DownloadToS3 | Skyvern.ForLoopBlockYamlLoopBlocksItem.UploadToS3 | Skyvern.ForLoopBlockYamlLoopBlocksItem.FileUpload | Skyvern.ForLoopBlockYamlLoopBlocksItem.SendEmail | Skyvern.ForLoopBlockYamlLoopBlocksItem.FileUrlParser | Skyvern.ForLoopBlockYamlLoopBlocksItem.Validation | Skyvern.ForLoopBlockYamlLoopBlocksItem.Action | Skyvern.ForLoopBlockYamlLoopBlocksItem.Navigation | Skyvern.ForLoopBlockYamlLoopBlocksItem.Extraction | Skyvern.ForLoopBlockYamlLoopBlocksItem.Login | Skyvern.ForLoopBlockYamlLoopBlocksItem.Wait | Skyvern.ForLoopBlockYamlLoopBlocksItem.HumanInteraction | Skyvern.ForLoopBlockYamlLoopBlocksItem.FileDownload | Skyvern.ForLoopBlockYamlLoopBlocksItem.GotoUrl | Skyvern.ForLoopBlockYamlLoopBlocksItem.PdfParser | Skyvern.ForLoopBlockYamlLoopBlocksItem.TaskV2 | Skyvern.ForLoopBlockYamlLoopBlocksItem.HttpRequest | Skyvern.ForLoopBlockYamlLoopBlocksItem.Conditional | Skyvern.ForLoopBlockYamlLoopBlocksItem.PrintPage;
3
3
  export declare namespace ForLoopBlockYamlLoopBlocksItem {
4
4
  interface Task extends Skyvern.TaskBlockYaml {
5
5
  block_type: "task";
@@ -67,4 +67,7 @@ export declare namespace ForLoopBlockYamlLoopBlocksItem {
67
67
  interface Conditional extends Skyvern.ConditionalBlockYaml {
68
68
  block_type: "conditional";
69
69
  }
70
+ interface PrintPage extends Skyvern.PrintPageBlockYaml {
71
+ block_type: "print_page";
72
+ }
70
73
  }
@@ -16,5 +16,7 @@ export interface HttpRequestBlock {
16
16
  files?: Record<string, string | undefined>;
17
17
  timeout?: number;
18
18
  follow_redirects?: boolean;
19
+ download_filename?: string;
20
+ save_response_as_file?: boolean;
19
21
  parameters?: Skyvern.HttpRequestBlockParametersItem[];
20
22
  }
@@ -13,5 +13,7 @@ export interface HttpRequestBlockYaml {
13
13
  files?: Record<string, string | undefined>;
14
14
  timeout?: number;
15
15
  follow_redirects?: boolean;
16
+ download_filename?: string;
17
+ save_response_as_file?: boolean;
16
18
  parameter_keys?: string[];
17
19
  }
@@ -6,4 +6,5 @@ export interface InputOrSelectContext {
6
6
  is_location_input?: boolean;
7
7
  is_date_related?: boolean;
8
8
  date_format?: string;
9
+ is_text_captcha?: boolean;
9
10
  }
@@ -0,0 +1,7 @@
1
+ export declare const PdfFormat: {
2
+ readonly A4: "A4";
3
+ readonly Letter: "Letter";
4
+ readonly Legal: "Legal";
5
+ readonly Tabloid: "Tabloid";
6
+ };
7
+ export type PdfFormat = (typeof PdfFormat)[keyof typeof PdfFormat];
@@ -0,0 +1,7 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export const PdfFormat = {
3
+ A4: "A4",
4
+ Letter: "Letter",
5
+ Legal: "Legal",
6
+ Tabloid: "Tabloid",
7
+ };
@@ -0,0 +1,5 @@
1
+ export declare const PersistentBrowserType: {
2
+ readonly Msedge: "msedge";
3
+ readonly Chrome: "chrome";
4
+ };
5
+ export type PersistentBrowserType = (typeof PersistentBrowserType)[keyof typeof PersistentBrowserType];
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export const PersistentBrowserType = {
3
+ Msedge: "msedge",
4
+ Chrome: "chrome",
5
+ };
@@ -0,0 +1,7 @@
1
+ /** Self-serve subscription tiers. Enterprise customers use manual billing (bypass). */
2
+ export declare const PlanTier: {
3
+ readonly Free: "free";
4
+ readonly Hobby: "hobby";
5
+ readonly Pro: "pro";
6
+ };
7
+ export type PlanTier = (typeof PlanTier)[keyof typeof PlanTier];
@@ -0,0 +1,7 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ /** Self-serve subscription tiers. Enterprise customers use manual billing (bypass). */
3
+ export const PlanTier = {
4
+ Free: "free",
5
+ Hobby: "hobby",
6
+ Pro: "pro",
7
+ };
@@ -0,0 +1,3 @@
1
+ export interface PortalSessionResponse {
2
+ url: string;
3
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,18 @@
1
+ import type * as Skyvern from "../index.mjs";
2
+ export interface PrintPageBlock {
3
+ /** Author-facing identifier for a block; unique within a workflow. */
4
+ label: string;
5
+ /** Optional pointer to the next block label when constructing a DAG. Defaults to sequential order when omitted. */
6
+ next_block_label?: string;
7
+ output_parameter: Skyvern.OutputParameter;
8
+ continue_on_failure?: boolean;
9
+ model?: Record<string, unknown>;
10
+ disable_cache?: boolean;
11
+ next_loop_on_failure?: boolean;
12
+ include_timestamp?: boolean;
13
+ custom_filename?: string;
14
+ format?: string;
15
+ landscape?: boolean;
16
+ print_background?: boolean;
17
+ parameters?: Skyvern.PrintPageBlockParametersItem[];
18
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};