From f2a4f41750cc415267eea8de190bd4ebc30a7fc3 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Sat, 28 Nov 2026 12:02:38 +0000 Subject: [PATCH 1/2] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-typescript-sdk: 3.70.1 --- .fern/metadata.json | 7 +- .fern/replay.lock | 10 + .fernignore | 3 + .gitattributes | 1 + package.json | 2 +- src/BaseClient.ts | 4 +- src/api/resources/audio/client/Client.ts | 2 +- .../audio/client/requests/GetSpeechRequest.ts | 8 +- .../StreamWithTimestampsAudioRequest.ts | 2 +- .../audio/types/SessionPronunciations.ts | 2 +- src/api/resources/index.ts | 2 + src/api/resources/workspaces/client/Client.ts | 299 ++++++++++++ src/api/resources/workspaces/client/index.ts | 2 +- .../GetUsageReportWorkspacesRequest.ts | 37 ++ .../workspaces/client/requests/index.ts | 1 + src/api/resources/workspaces/index.ts | 1 + .../GetUsageReportWorkspacesRequestGroupBy.ts | 9 + src/api/resources/workspaces/types/index.ts | 1 + src/api/types/AutoRechargeStatusResponse.ts | 12 + src/api/types/GetStreamRequest.ts | 6 +- src/api/types/PronunciationIpa.ts | 2 +- src/api/types/Pronunciations.ts | 2 +- src/api/types/WorkspaceBalance.ts | 83 ++++ src/api/types/WorkspaceUsageGroup.ts | 62 +++ src/api/types/WorkspaceUsageReport.ts | 41 ++ src/api/types/index.ts | 4 + src/version.ts | 2 +- tests/wire/audio.test.ts | 122 +++-- tests/wire/models.test.ts | 15 +- tests/wire/projects.test.ts | 152 +++--- tests/wire/voices.test.ts | 46 +- tests/wire/voices/consentChallenges.test.ts | 20 +- tests/wire/webhooks/endpoints.test.ts | 88 ++-- tests/wire/workspaces.test.ts | 434 +++++++++++++++++- 34 files changed, 1268 insertions(+), 216 deletions(-) create mode 100644 .fern/replay.lock create mode 100644 .gitattributes create mode 100644 src/api/resources/workspaces/client/requests/GetUsageReportWorkspacesRequest.ts create mode 100644 src/api/resources/workspaces/client/requests/index.ts create mode 100644 src/api/resources/workspaces/types/GetUsageReportWorkspacesRequestGroupBy.ts create mode 100644 src/api/resources/workspaces/types/index.ts create mode 100644 src/api/types/AutoRechargeStatusResponse.ts create mode 100644 src/api/types/WorkspaceBalance.ts create mode 100644 src/api/types/WorkspaceUsageGroup.ts create mode 100644 src/api/types/WorkspaceUsageReport.ts diff --git a/.fern/metadata.json b/.fern/metadata.json index 6a205ad..91653e2 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -5,11 +5,12 @@ "generatorConfig": { "inlineFileProperties": true, "skipResponseValidation": true, - "namespaceExport": "Speechify" + "namespaceExport": "Speechify", + "noSerdeLayer": true }, - "originGitCommit": "840e0cbeef9d9aa315ae4d3c9a871c350f1a305a", + "originGitCommit": "7e0379b8fd0e9d5558e9df4d325afd40b502d411", "originGitCommitIsDirty": false, "invokedBy": "ci", "ciProvider": "github", - "sdkVersion": "5.0.0" + "sdkVersion": "5.0.1" } diff --git a/.fern/replay.lock b/.fern/replay.lock new file mode 100644 index 0000000..dcebc45 --- /dev/null +++ b/.fern/replay.lock @@ -0,0 +1,10 @@ +# DO NOT EDIT MANUALLY - Managed by Fern Replay +version: "1.0" +generations: + - commit_sha: 65728a1bd30ee1027d4c055c41f975fd6fe7b7e7 + tree_hash: 1113fbdde16ae77acf2cd643c4838ddedc0a0797 + timestamp: 2026-11-28T12:01:46.577Z + cli_version: unknown + generator_versions: {} +current_generation: 65728a1bd30ee1027d4c055c41f975fd6fe7b7e7 +patches: [] diff --git a/.fernignore b/.fernignore index 4284186..63a33d0 100644 --- a/.fernignore +++ b/.fernignore @@ -82,3 +82,6 @@ tests/custom.test.ts # License file — not generated by Fern; keep listed so regen never deletes it. LICENSE +.fern/replay.lock +.fern/replay.yml +.gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..74928d6 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.fern/replay.lock linguist-generated=true diff --git a/package.json b/package.json index c7f1078..34f1cda 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@speechify/api", - "version": "5.0.0", + "version": "5.0.1", "private": false, "repository": { "type": "git", diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 551eb37..582a3f6 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -63,8 +63,8 @@ export function normalizeClientOptions { + return core.HttpResponsePromise.fromPromise(this.__getBalance(requestOptions)); + } + + private async __getBalance( + requestOptions?: WorkspacesClient.RequestOptions, + ): Promise> { + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ + "Speechify-Version": requestOptions?.version ?? this._options?.version ?? "2026-09-30", + }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + ((await core.Supplier.get(this._options.environment)) ?? environments.SpeechifyEnvironment.Default) + .base, + "v1/workspaces/current/balance", + ), + method: "GET", + headers: _headers, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { data: _response.body as Speechify.WorkspaceBalance, rawResponse: _response.rawResponse }; + } + + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 401: + throw new Speechify.UnauthorizedError(_response.error.body as unknown, _response.rawResponse); + case 403: + throw new Speechify.ForbiddenError(_response.error.body as Speechify.Error_, _response.rawResponse); + case 409: + throw new Speechify.ConflictError(_response.error.body as unknown, _response.rawResponse); + case 429: + throw new Speechify.TooManyRequestsError( + _response.error.body as Speechify.Error_, + _response.rawResponse, + ); + case 500: + throw new Speechify.InternalServerError( + _response.error.body as Speechify.Error_, + _response.rawResponse, + ); + case 502: + throw new Speechify.BadGatewayError( + _response.error.body as Speechify.Error_, + _response.rawResponse, + ); + default: + throw new errors.SpeechifyError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v1/workspaces/current/balance", + ); + } + + /** + * @beta This endpoint is in pre-release and may change. + * + * What the workspace's usage cost over a window, grouped by model, + * project or API key, readable with an API key. Each group carries the + * metered quantity in its product's unit and its cost in US dollars, + * priced at the workspace's plan rates. + * Use it to charge usage back to your own customers or to see what + * moved the bill. The figures are informational: an invoice also + * carries fees, credits and taxes this report does not. + * + * The window defaults to the calendar month (UTC) to date. For that + * window `total_cost_usd` is the balance read's `monthly_spend` + * (`GET /v1/workspaces/current/balance`) as of `as_of`, the same + * figure the workspace budget is enforced on. + * For any other window the total is the sum of its groups. A window may + * start at most 100 days ago; an older `starting_at` is refused with + * `400`. An `ending_at` later than now reads to now. + * + * Each group's cost is its share of the total in proportion to what the + * usage rated at, rounded to the micro-dollar by largest remainder, so + * the groups add up to `total_cost_usd` to the micro-dollar: round a + * sum of them to 6 decimal places to match it exactly. When there is + * nothing to apportion `monthly_spend` by (no usage rated yet, or a + * credit among the groups), each group keeps what it rated at and the + * total is their sum. A group is one `value` for one `product`: the + * same model can appear once for `tts` and once for `calls`. + * + * Figures can be up to a minute old; `as_of` is when they were read. + * Groups are ordered by `value`, the `null` group last, and paginate + * with `cursor` while `has_more` is true. Every page of one walk reads + * the figures and the window its first page read, even after the month + * turns, so the pages add up to the total each carries; a cursor names + * its window by itself, and a `group_by`, `starting_at` or `ending_at` + * sent with it that names another window is refused with `400`. A + * cursor stays usable for at least 15 minutes after `as_of`, after + * which it is refused with `400` and the query must be repeated. + * + * Reading figures that are not cached asks the billing provider, so + * each workspace may do so 12 times a minute; past that, or when every + * workspace together reads too fast, the request is refused with `429` + * and a `Retry-After` header. Repeating a query within a minute is + * answered from cache and does not count. + * + * Requires an API key granted `billing:read` (or an unrestricted key). + * A key pinned to a project is refused with `403`, as on every + * workspace-level read, and so is a key whose owner may not view the + * workspace's usage. + * + * @param {Speechify.GetUsageReportWorkspacesRequest} request + * @param {WorkspacesClient.RequestOptions} requestOptions - Request-specific configuration. + * + * @throws {@link Speechify.BadRequestError} + * @throws {@link Speechify.UnauthorizedError} + * @throws {@link Speechify.ForbiddenError} + * @throws {@link Speechify.ConflictError} + * @throws {@link Speechify.TooManyRequestsError} + * @throws {@link Speechify.InternalServerError} + * @throws {@link Speechify.BadGatewayError} + * @throws {@link Speechify.ServiceUnavailableError} + * + * @example + * await client.workspaces.getUsageReport({ + * group_by: "model", + * starting_at: "2026-11-01T00:00:00Z", + * ending_at: "2026-11-27T12:00:00Z" + * }) + */ + public async getUsageReport( + request: Speechify.GetUsageReportWorkspacesRequest, + requestOptions?: WorkspacesClient.RequestOptions, + ): Promise> { + const list = core.HttpResponsePromise.interceptFunction( + async ( + request: Speechify.GetUsageReportWorkspacesRequest, + ): Promise> => { + const { group_by: groupBy, starting_at: startingAt, ending_at: endingAt, cursor, limit } = request; + const _queryParams: Record = { + group_by: groupBy, + starting_at: startingAt != null ? startingAt : undefined, + ending_at: endingAt != null ? endingAt : undefined, + cursor, + limit, + }; + const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); + const _headers: core.Fetcher.Args["headers"] = mergeHeaders( + _authRequest.headers, + this._options?.headers, + mergeOnlyDefinedHeaders({ + "Speechify-Version": requestOptions?.version ?? this._options?.version ?? "2026-09-30", + }), + requestOptions?.headers, + ); + const _response = await core.fetcher({ + url: core.url.join( + (await core.Supplier.get(this._options.baseUrl)) ?? + ( + (await core.Supplier.get(this._options.environment)) ?? + environments.SpeechifyEnvironment.Default + ).base, + "v1/workspaces/current/usage", + ), + method: "GET", + headers: _headers, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), + timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, + maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, + abortSignal: requestOptions?.abortSignal, + fetchFn: this._options?.fetch, + logging: this._options.logging, + }); + if (_response.ok) { + return { + data: _response.body as Speechify.WorkspaceUsageReport, + rawResponse: _response.rawResponse, + }; + } + if (_response.error.reason === "status-code") { + switch (_response.error.statusCode) { + case 400: + throw new Speechify.BadRequestError(_response.error.body as unknown, _response.rawResponse); + case 401: + throw new Speechify.UnauthorizedError( + _response.error.body as unknown, + _response.rawResponse, + ); + case 403: + throw new Speechify.ForbiddenError( + _response.error.body as Speechify.Error_, + _response.rawResponse, + ); + case 409: + throw new Speechify.ConflictError(_response.error.body as unknown, _response.rawResponse); + case 429: + throw new Speechify.TooManyRequestsError( + _response.error.body as Speechify.Error_, + _response.rawResponse, + ); + case 500: + throw new Speechify.InternalServerError( + _response.error.body as Speechify.Error_, + _response.rawResponse, + ); + case 502: + throw new Speechify.BadGatewayError( + _response.error.body as Speechify.Error_, + _response.rawResponse, + ); + case 503: + throw new Speechify.ServiceUnavailableError( + _response.error.body as Speechify.Error_, + _response.rawResponse, + ); + default: + throw new errors.SpeechifyError({ + statusCode: _response.error.statusCode, + body: _response.error.body, + rawResponse: _response.rawResponse, + }); + } + } + return handleNonStatusCodeError( + _response.error, + _response.rawResponse, + "GET", + "/v1/workspaces/current/usage", + ); + }, + ); + const dataWithRawResponse = await list(request).withRawResponse(); + return new core.Page({ + response: dataWithRawResponse.data, + rawResponse: dataWithRawResponse.rawResponse, + hasNextPage: (response) => + response?.next_cursor != null && + !(typeof response?.next_cursor === "string" && response?.next_cursor === ""), + getItems: (response) => response?.groups ?? [], + loadPage: (response) => { + return list(core.setObjectProperty(request, "cursor", response?.next_cursor)); + }, + }); + } } diff --git a/src/api/resources/workspaces/client/index.ts b/src/api/resources/workspaces/client/index.ts index cb0ff5c..195f9aa 100644 --- a/src/api/resources/workspaces/client/index.ts +++ b/src/api/resources/workspaces/client/index.ts @@ -1 +1 @@ -export {}; +export * from "./requests/index.js"; diff --git a/src/api/resources/workspaces/client/requests/GetUsageReportWorkspacesRequest.ts b/src/api/resources/workspaces/client/requests/GetUsageReportWorkspacesRequest.ts new file mode 100644 index 0000000..0fefb77 --- /dev/null +++ b/src/api/resources/workspaces/client/requests/GetUsageReportWorkspacesRequest.ts @@ -0,0 +1,37 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Speechify from "../../../../index.js"; + +/** + * @example + * { + * group_by: "model", + * starting_at: "2026-11-01T00:00:00Z", + * ending_at: "2026-11-27T12:00:00Z" + * } + */ +export interface GetUsageReportWorkspacesRequest { + /** + * What to group usage by: `model` (the model id, such as + * `simba-3.5`), `project_id` (the project's `proj_` id; usage in the + * Default project groups as `null`) or `api_key_id` (the key's `key_` + * id; usage made without an API key, such as from the console, + * groups as `null`). + */ + group_by: Speechify.GetUsageReportWorkspacesRequestGroupBy; + /** + * Start of the window, inclusive, as an RFC 3339 timestamp; a date + * alone (`2026-11-01`) reads as midnight UTC. Defaults to the start of + * the calendar month (UTC) the window ends in. At most 100 days ago. + */ + starting_at?: string; + /** + * End of the window, exclusive, in the same form as `starting_at`. + * Defaults to now, and a later value reads to now. + */ + ending_at?: string; + /** Opaque pagination cursor from a previous response. */ + cursor?: string; + /** Max items per page (default 50, max 200). */ + limit?: number; +} diff --git a/src/api/resources/workspaces/client/requests/index.ts b/src/api/resources/workspaces/client/requests/index.ts new file mode 100644 index 0000000..03b4f63 --- /dev/null +++ b/src/api/resources/workspaces/client/requests/index.ts @@ -0,0 +1 @@ +export type { GetUsageReportWorkspacesRequest } from "./GetUsageReportWorkspacesRequest.js"; diff --git a/src/api/resources/workspaces/index.ts b/src/api/resources/workspaces/index.ts index 914b8c3..d9adb1a 100644 --- a/src/api/resources/workspaces/index.ts +++ b/src/api/resources/workspaces/index.ts @@ -1 +1,2 @@ export * from "./client/index.js"; +export * from "./types/index.js"; diff --git a/src/api/resources/workspaces/types/GetUsageReportWorkspacesRequestGroupBy.ts b/src/api/resources/workspaces/types/GetUsageReportWorkspacesRequestGroupBy.ts new file mode 100644 index 0000000..1c2c3c7 --- /dev/null +++ b/src/api/resources/workspaces/types/GetUsageReportWorkspacesRequestGroupBy.ts @@ -0,0 +1,9 @@ +// This file was auto-generated by Fern from our API Definition. + +export const GetUsageReportWorkspacesRequestGroupBy = { + Model: "model", + ProjectId: "project_id", + ApiKeyId: "api_key_id", +} as const; +export type GetUsageReportWorkspacesRequestGroupBy = + (typeof GetUsageReportWorkspacesRequestGroupBy)[keyof typeof GetUsageReportWorkspacesRequestGroupBy]; diff --git a/src/api/resources/workspaces/types/index.ts b/src/api/resources/workspaces/types/index.ts new file mode 100644 index 0000000..b729bc6 --- /dev/null +++ b/src/api/resources/workspaces/types/index.ts @@ -0,0 +1 @@ +export * from "./GetUsageReportWorkspacesRequestGroupBy.js"; diff --git a/src/api/types/AutoRechargeStatusResponse.ts b/src/api/types/AutoRechargeStatusResponse.ts new file mode 100644 index 0000000..f52d525 --- /dev/null +++ b/src/api/types/AutoRechargeStatusResponse.ts @@ -0,0 +1,12 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * The workspace's current auto-recharge rule. + */ +export interface AutoRechargeStatusResponse { + enabled: boolean; + /** Amount charged each firing. Absent when no rule is configured. */ + amount_usd?: number | undefined; + /** Balance level that triggers a recharge. Absent when no rule is configured. */ + threshold_usd?: number | undefined; +} diff --git a/src/api/types/GetStreamRequest.ts b/src/api/types/GetStreamRequest.ts index 5cfba36..071cb1d 100644 --- a/src/api/types/GetStreamRequest.ts +++ b/src/api/types/GetStreamRequest.ts @@ -19,7 +19,7 @@ export interface GetStreamRequest { */ language?: string | undefined; /** - * Model used for audio synthesis. Defaults to `simba-3.0`, which is streaming-native and multilingual: it officially supports English plus `de-DE`, `es-ES`, `es-MX`, `fr-FR`, `it-IT` and `pt-BR`, and routes each request to its English or its multilingual training based on `language` (falling back to the voice's locale when `language` is omitted). `simba-3.2` is the streaming-native model with the lowest TTFB and richest expressivity; it is English only, so a non-English voice returns 400. `simba-3.5` is the recommended model: streaming-native, covering 48 languages under one id, English included, routed by `language` like `simba-3.0`; every voice works on it, cloned voices included. + * Model used for audio synthesis. Defaults to `simba-3.0`, which is streaming-native and multilingual: it officially supports English plus `de-DE`, `es-ES`, `es-MX`, `fr-FR`, `it-IT` and `pt-BR`, and routes each request to its English or its multilingual training based on `language` (falling back to the voice's locale when `language` is omitted). `simba-3.2` is the streaming-native English model; a non-English voice returns 400. `simba-3.5` is the recommended model: streaming-native, covering 48 languages under one id, English included, routed by `language` like `simba-3.0`; every voice works on it, cloned voices included. * * The legacy Simba 1.6 models `simba-english` and `simba-multilingual` are retired from API version `2026-09-21`: naming one returns 400 `model_retired`. Pinning your API version to a date before `2026-09-21` keeps them on their Simba 1.6 training until **2026-11-21**; from then both ids are served by our current models on every API version that can still name them. Migrate to `simba-3.2` (English), `simba-3.0` or `simba-3.5` before then; call GET /v1/audio/models to see the set your workspace can select today. */ @@ -36,7 +36,7 @@ export interface GetStreamRequest { export namespace GetStreamRequest { /** - * Model used for audio synthesis. Defaults to `simba-3.0`, which is streaming-native and multilingual: it officially supports English plus `de-DE`, `es-ES`, `es-MX`, `fr-FR`, `it-IT` and `pt-BR`, and routes each request to its English or its multilingual training based on `language` (falling back to the voice's locale when `language` is omitted). `simba-3.2` is the streaming-native model with the lowest TTFB and richest expressivity; it is English only, so a non-English voice returns 400. `simba-3.5` is the recommended model: streaming-native, covering 48 languages under one id, English included, routed by `language` like `simba-3.0`; every voice works on it, cloned voices included. + * Model used for audio synthesis. Defaults to `simba-3.0`, which is streaming-native and multilingual: it officially supports English plus `de-DE`, `es-ES`, `es-MX`, `fr-FR`, `it-IT` and `pt-BR`, and routes each request to its English or its multilingual training based on `language` (falling back to the voice's locale when `language` is omitted). `simba-3.2` is the streaming-native English model; a non-English voice returns 400. `simba-3.5` is the recommended model: streaming-native, covering 48 languages under one id, English included, routed by `language` like `simba-3.0`; every voice works on it, cloned voices included. * * The legacy Simba 1.6 models `simba-english` and `simba-multilingual` are retired from API version `2026-09-21`: naming one returns 400 `model_retired`. Pinning your API version to a date before `2026-09-21` keeps them on their Simba 1.6 training until **2026-11-21**; from then both ids are served by our current models on every API version that can still name them. Migrate to `simba-3.2` (English), `simba-3.0` or `simba-3.5` before then; call GET /v1/audio/models to see the set your workspace can select today. */ @@ -45,7 +45,7 @@ export namespace GetStreamRequest { * simba-3.0 is the streaming-native multilingual model, and the default when `model` is omitted. Officially supports English plus de-DE, es-ES, es-MX, fr-FR, it-IT and pt-BR; the request language (or the voice's locale when it is omitted) selects the English or the multilingual training. Prefer simba-3.5 for new integrations. Cloned/personal voices work self-serve on simba-3.0. */ Simba30: "simba-3.0", /** - * simba-3.2 is the streaming-native model with the lowest TTFB and richest expressivity. English only; a non-English voice returns 400 - use simba-3.0 for the other supported languages. Every English voice in the catalog is supported, cloned voices included. */ + * simba-3.2 is the streaming-native English model. A non-English voice returns 400 - use simba-3.5 for any other language. Every English voice in the catalog is supported, cloned voices included. */ Simba32: "simba-3.2", /** * simba-3.5 is the recommended streaming-native model, covering 48 languages under one id, English included; the request language (or the voice's locale when it is omitted) selects the English or the multilingual training. Every voice in the catalog is supported, cloned voices included. */ diff --git a/src/api/types/PronunciationIpa.ts b/src/api/types/PronunciationIpa.ts index 6fac5d6..2083e28 100644 --- a/src/api/types/PronunciationIpa.ts +++ b/src/api/types/PronunciationIpa.ts @@ -7,7 +7,7 @@ import type * as Speechify from "../index.js"; */ export interface PronunciationIpa { text: Speechify.PronunciationIpaText; - /** The phones to say `text` with, from the model's phone set, separated by spaces or `|`: for example `s p ˈiː tʃ ɪ f aɪ` or `s|p|ˈiː|tʃ|ɪ|f|aɪ`. 1 to 64 phones. Stress marks belong to the vowel they stress (`ˈiː` is one phone), and phones compare after Unicode NFC normalization, so a precomposed and a decomposed spelling of the same phone are equal. A phone the model does not know returns `400 validation_failed` naming it. */ + /** The phones to say `text` with, from the model's phone set for the request's language (Simba 3.5 reads one set in English and another in every other language), separated by spaces or `|`: for example `s p ˈiː tʃ ɪ f aɪ` or `s|p|ˈiː|tʃ|ɪ|f|aɪ`. 1 to 64 phones. Stress marks belong to the vowel they stress (`ˈiː` is one phone), and phones compare after Unicode NFC normalization, so a precomposed and a decomposed spelling of the same phone are equal. A phone the model does not know returns `400 validation_failed` naming it. */ ipa: string; case_sensitive?: Speechify.PronunciationCaseSensitive | undefined; } diff --git a/src/api/types/Pronunciations.ts b/src/api/types/Pronunciations.ts index ea933e8..77c7f13 100644 --- a/src/api/types/Pronunciations.ts +++ b/src/api/types/Pronunciations.ts @@ -5,7 +5,7 @@ import type * as Speechify from "../index.js"; /** * Optional. How to pronounce words and phrases in `input`: each entry gives a `text` and either the phones to say it with (`ipa`) or plain text to say in its place (`alias`). Every entry applies to the whole request. * - * Supported only in the languages a model's entry in GET /v1/audio/models lists in `pronunciation_languages`, which does not include English yet: any other model or language returns `400 pronunciations_unsupported`. An empty array is accepted by every model in every language. At most 200 entries. A malformed entry, a phone outside the model's phone set, an `ipa` entry whose `text` is more than one word, or two entries for the same `text` returns `400 validation_failed`, with `fields` naming each entry (for example `pronunciations[3].ipa`), before anything is synthesized or billed. So does an `input` longer than 20,000 characters once every alias stands in for its text. + * Supported only in the languages a model's entry in GET /v1/audio/models lists in `pronunciation_languages`: any other model or language returns `400 pronunciations_unsupported`. An empty array is accepted by every model in every language. At most 200 entries. A malformed entry, a phone outside the model's phone set for the request's language, an `ipa` entry whose `text` is more than one word, or two entries for the same `text` returns `400 validation_failed`, with `fields` naming each entry (for example `pronunciations[3].ipa`), before anything is synthesized or billed. So does an `input` longer than 20,000 characters once every alias stands in for its text. * * Entries match case-insensitively unless `case_sensitive` is true, as whole words, except in Chinese, Japanese, Korean, Thai, Lao, Khmer and Burmese, where they match anywhere in the text; the longest matching entry wins, and an entry takes precedence over the model's own pronunciation. Pronunciations are not billed, and speech marks still index `input` exactly as sent. See https://docs.speechify.ai/build/guides/text-to-speech/pronunciation. */ diff --git a/src/api/types/WorkspaceBalance.ts b/src/api/types/WorkspaceBalance.ts new file mode 100644 index 0000000..ccba00a --- /dev/null +++ b/src/api/types/WorkspaceBalance.ts @@ -0,0 +1,83 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Speechify from "../index.js"; + +/** + * Where the workspace's money stands: the credit new work can spend, + * any credit held back, whether the balance tops itself up, and what + * the workspace has spent this calendar month. + */ +export interface WorkspaceBalance { + /** + * Credit new work can spend now, in US dollars to the micro-dollar: + * purchased credit plus the plan's included credit, less + * `held_usd`. It is the balance synthesis and calls are admitted + * on, so at `0` new billable work is refused with + * `402 payment_required` until the workspace tops up. + */ + available_usd: number; + /** + * Plan-included credit still in the balance that cannot be spent + * while a subscription invoice is past due, in US dollars to the + * micro-dollar. Paying the invoice releases it; `0` when nothing is + * held. + */ + held_usd: number; + /** + * The rule that tops the balance up when it falls to a threshold, + * the same shape `GET /v1/workspaces/current/auto-recharge` + * returns. Present whenever the billing plane answered. + */ + auto_recharge?: Speechify.AutoRechargeStatusResponse | undefined; + /** + * The workspace's billed month-to-date spend in US dollars: every + * project's `monthly_spend` plus the Default project's, read from + * the same meter. The month is the calendar month (UTC). Present + * whenever the billing plane answered. + */ + monthly_spend?: number | undefined; + /** + * The workspace's monthly spend budget in US dollars, present only + * when one is set. New billable work is refused with the coded + * `402 spend_budget_exceeded` once `monthly_spend` reaches it. + */ + monthly_budget?: number | undefined; + /** + * Where `monthly_spend` stands against `monthly_budget`, present + * only when both are: `warning` from 80% of the budget, `reached` + * once new billable work is refused, `ok` below 80%. The + * `workspace.spend_budget.warning` and + * `workspace.spend_budget.reached` webhook events fire at the same + * thresholds. + */ + monthly_budget_status?: WorkspaceBalance.MonthlyBudgetStatus | undefined; + /** + * `monthly_budget` minus `monthly_spend` in US dollars, present only + * when both are. Negative by the amount work already under way + * carried the workspace past its budget. + */ + monthly_budget_remaining?: number | undefined; + /** + * When the balance was last read from the billing ledger. Usage is + * metered just after each request, so the balance trails live + * traffic by up to a few minutes. + */ + as_of: string; +} + +export namespace WorkspaceBalance { + /** + * Where `monthly_spend` stands against `monthly_budget`, present + * only when both are: `warning` from 80% of the budget, `reached` + * once new billable work is refused, `ok` below 80%. The + * `workspace.spend_budget.warning` and + * `workspace.spend_budget.reached` webhook events fire at the same + * thresholds. + */ + export const MonthlyBudgetStatus = { + Ok: "ok", + Warning: "warning", + Reached: "reached", + } as const; + export type MonthlyBudgetStatus = (typeof MonthlyBudgetStatus)[keyof typeof MonthlyBudgetStatus]; +} diff --git a/src/api/types/WorkspaceUsageGroup.ts b/src/api/types/WorkspaceUsageGroup.ts new file mode 100644 index 0000000..25cdf57 --- /dev/null +++ b/src/api/types/WorkspaceUsageGroup.ts @@ -0,0 +1,62 @@ +// This file was auto-generated by Fern from our API Definition. + +/** + * One value's usage of one product over the window. + */ +export interface WorkspaceUsageGroup { + /** + * The group's value: a model id, a `proj_` project id or a `key_` + * API key id, by `group_by`. `null` for usage with no value for it: + * no model, the Default project, or no API key. + */ + value: string | null; + /** + * What the usage was: `tts` speech synthesis, `calls` live voice + * calls, `llm` language-model tokens, or `other` for usage of a + * product this report does not name yet. + */ + product: WorkspaceUsageGroup.Product; + /** The metered amount of usage, in `unit`. */ + quantity: number; + /** + * The unit `quantity` is in: `characters` for `tts`, `minutes` for + * `calls`, and `usd` for `llm`, because language-model tokens are + * metered by their list-price cost in US dollars rather than + * counted. `units` for `other`. + */ + unit: WorkspaceUsageGroup.Unit; + /** + * The group's share of `total_cost_usd`, in US dollars to the + * micro-dollar (at most 6 decimal places). Below zero only for a + * group the plan prices as a credit. + */ + cost_usd: number; +} + +export namespace WorkspaceUsageGroup { + /** + * What the usage was: `tts` speech synthesis, `calls` live voice + * calls, `llm` language-model tokens, or `other` for usage of a + * product this report does not name yet. + */ + export const Product = { + Tts: "tts", + Calls: "calls", + Llm: "llm", + Other: "other", + } as const; + export type Product = (typeof Product)[keyof typeof Product]; + /** + * The unit `quantity` is in: `characters` for `tts`, `minutes` for + * `calls`, and `usd` for `llm`, because language-model tokens are + * metered by their list-price cost in US dollars rather than + * counted. `units` for `other`. + */ + export const Unit = { + Characters: "characters", + Minutes: "minutes", + Usd: "usd", + Units: "units", + } as const; + export type Unit = (typeof Unit)[keyof typeof Unit]; +} diff --git a/src/api/types/WorkspaceUsageReport.ts b/src/api/types/WorkspaceUsageReport.ts new file mode 100644 index 0000000..643485b --- /dev/null +++ b/src/api/types/WorkspaceUsageReport.ts @@ -0,0 +1,41 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Speechify from "../index.js"; + +/** + * A window's usage grouped by one property, with each group's metered + * quantity and cost. The groups' costs add up to `total_cost_usd` + * across all pages, to the micro-dollar. + */ +export interface WorkspaceUsageReport extends Speechify.PaginationMeta { + /** Start of the window the report covers, inclusive. */ + starting_at: string; + /** + * End of the window, exclusive. For a window that runs to now, + * the moment the figures were read. + */ + ending_at: string; + /** The property the groups are keyed by, as requested. */ + group_by: WorkspaceUsageReport.GroupBy; + /** + * What the window's usage cost, in US dollars to the micro-dollar + * (at most 6 decimal places). For the calendar month to date it + * is the balance read's `monthly_spend`; otherwise the sum of the + * groups. Below zero only when credits priced into the plan + * outweigh the usage. + */ + total_cost_usd: number; + groups: Speechify.WorkspaceUsageGroup[]; + /** When the figures were read. */ + as_of: string; +} + +export namespace WorkspaceUsageReport { + /** The property the groups are keyed by, as requested. */ + export const GroupBy = { + Model: "model", + ProjectId: "project_id", + ApiKeyId: "api_key_id", + } as const; + export type GroupBy = (typeof GroupBy)[keyof typeof GroupBy]; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 3a02ba4..3b3e46e 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -1,5 +1,6 @@ export * from "./AudioOutputFormat.js"; export * from "./AudioStreamOutputFormat.js"; +export * from "./AutoRechargeStatusResponse.js"; export * from "./BillingEntitlements.js"; export * from "./ConsentChallenge.js"; export * from "./EntitlementsResponse.js"; @@ -46,3 +47,6 @@ export * from "./WatermarkVerificationResponse.js"; export * from "./WebhookDeliveryStatus.js"; export * from "./WebhookEndpoint.js"; export * from "./WebhookEndpointDelivery.js"; +export * from "./WorkspaceBalance.js"; +export * from "./WorkspaceUsageGroup.js"; +export * from "./WorkspaceUsageReport.js"; diff --git a/src/version.ts b/src/version.ts index 2c0fafc..25cf4d2 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "4.0.2"; +export const SDK_VERSION = "5.0.1"; diff --git a/tests/wire/audio.test.ts b/tests/wire/audio.test.ts index c6a40e3..d869d98 100644 --- a/tests/wire/audio.test.ts +++ b/tests/wire/audio.test.ts @@ -11,12 +11,12 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { audio_format: "mp3", input: "Hello! This is the Speechify text-to-speech API.", - model: "simba-3.2", + model: "simba-3.5", voice_id: "geffen_32", }; const rawResponseBody = { @@ -47,7 +47,7 @@ describe("AudioClient", () => { const response = await client.audio.speech({ audio_format: "mp3", input: "Hello! This is the Speechify text-to-speech API.", - model: "simba-3.2", + model: "simba-3.5", voice_id: "geffen_32", }); expect(response).toEqual(rawResponseBody); @@ -59,7 +59,7 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { key: "value" }; @@ -87,7 +87,7 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { key: "value" }; @@ -115,7 +115,7 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -143,7 +143,7 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -171,7 +171,7 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { key: "value" }; @@ -199,7 +199,7 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { key: "value" }; @@ -227,7 +227,35 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + const rawRequestBody = { input: "input", voice_id: "voice_id" }; + const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; + + server + .mockEndpoint() + .post("/v1/audio/speech") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(413) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.audio.speech({ + input: "input", + voice_id: "voice_id", + }); + }).rejects.toThrow(Speechify.ContentTooLargeError); + }); + + test("speech (9)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -249,13 +277,13 @@ describe("AudioClient", () => { }).rejects.toThrow(Speechify.TooManyRequestsError); }); - test("speech (9)", async () => { + test("speech (10)", async () => { const server = mockServerPool.createServer(); const client = new SpeechifyClient({ maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -277,13 +305,13 @@ describe("AudioClient", () => { }).rejects.toThrow(Speechify.InternalServerError); }); - test("speech (10)", async () => { + test("speech (11)", async () => { const server = mockServerPool.createServer(); const client = new SpeechifyClient({ maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -305,13 +333,13 @@ describe("AudioClient", () => { }).rejects.toThrow(Speechify.BadGatewayError); }); - test("speech (11)", async () => { + test("speech (12)", async () => { const server = mockServerPool.createServer(); const client = new SpeechifyClient({ maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -339,11 +367,11 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "Streaming long-form audio with the Speechify API.", - model: "simba-3.2", + model: "simba-3.5", voice_id: "geffen_32", }; const rawResponseBody = @@ -361,7 +389,7 @@ describe("AudioClient", () => { const response = await client.audio.streamWithTimestamps({ body: { input: "Streaming long-form audio with the Speechify API.", - model: "simba-3.2", + model: "simba-3.5", voice_id: "geffen_32", }, }); @@ -393,7 +421,7 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { key: "value" }; @@ -423,7 +451,7 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { key: "value" }; @@ -453,7 +481,7 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -483,7 +511,7 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -513,7 +541,7 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { key: "value" }; @@ -543,7 +571,7 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { key: "value" }; @@ -573,7 +601,37 @@ describe("AudioClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + const rawRequestBody = { input: "input", voice_id: "voice_id" }; + const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; + + server + .mockEndpoint() + .post("/v1/audio/stream/with-timestamps") + .jsonBody(rawRequestBody) + .respondWith() + .statusCode(413) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.audio.streamWithTimestamps({ + body: { + input: "input", + voice_id: "voice_id", + }, + }); + }).rejects.toThrow(Speechify.ContentTooLargeError); + }); + + test("streamWithTimestamps (9)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -597,13 +655,13 @@ describe("AudioClient", () => { }).rejects.toThrow(Speechify.TooManyRequestsError); }); - test("streamWithTimestamps (9)", async () => { + test("streamWithTimestamps (10)", async () => { const server = mockServerPool.createServer(); const client = new SpeechifyClient({ maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -627,13 +685,13 @@ describe("AudioClient", () => { }).rejects.toThrow(Speechify.InternalServerError); }); - test("streamWithTimestamps (10)", async () => { + test("streamWithTimestamps (11)", async () => { const server = mockServerPool.createServer(); const client = new SpeechifyClient({ maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -657,13 +715,13 @@ describe("AudioClient", () => { }).rejects.toThrow(Speechify.BadGatewayError); }); - test("streamWithTimestamps (11)", async () => { + test("streamWithTimestamps (12)", async () => { const server = mockServerPool.createServer(); const client = new SpeechifyClient({ maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { input: "input", voice_id: "voice_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; diff --git a/tests/wire/models.test.ts b/tests/wire/models.test.ts index becca85..dca363c 100644 --- a/tests/wire/models.test.ts +++ b/tests/wire/models.test.ts @@ -11,7 +11,7 @@ describe("ModelsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { @@ -41,7 +41,7 @@ describe("ModelsClient", () => { retired_at: "2026-09-21", sunset_at: "2026-11-21", description: - "Streaming-native model with the lowest time-to-first-byte and richest expressivity, English only today. Serves every English voice in the catalog, your workspace's own cloned voices included. Use `simba-3.0` for any other language.", + "Streaming-native English model. Serves every English voice in the catalog, your workspace's own cloned voices included. Use `simba-3.5` for any other language.", languages: ["en"], endpoints: ["/v1/audio/speech", "/v1/audio/stream", "/v1/audio/stream/with-timestamps"], curated_voices: false, @@ -112,6 +112,7 @@ describe("ModelsClient", () => { curated_voices: false, english_voices_only: false, pronunciation_languages: [ + "en", "ar", "be", "bn", @@ -194,7 +195,7 @@ describe("ModelsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -212,7 +213,7 @@ describe("ModelsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -230,7 +231,7 @@ describe("ModelsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -248,7 +249,7 @@ describe("ModelsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -266,7 +267,7 @@ describe("ModelsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; diff --git a/tests/wire/projects.test.ts b/tests/wire/projects.test.ts index d27e3b8..823b64a 100644 --- a/tests/wire/projects.test.ts +++ b/tests/wire/projects.test.ts @@ -11,7 +11,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { @@ -57,7 +57,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -75,7 +75,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -93,7 +93,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -111,7 +111,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -129,7 +129,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { name: "Production" }; const rawResponseBody = { @@ -167,7 +167,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; @@ -194,7 +194,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; @@ -221,7 +221,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { name: "name" }; const rawResponseBody = { key: "value" }; @@ -248,7 +248,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { name: "name" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -275,7 +275,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { name: "name" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -302,7 +302,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { @@ -339,7 +339,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -365,7 +365,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -391,7 +391,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -417,7 +417,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -443,7 +443,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { mode: "purge", confirm: "Staging" }; @@ -469,7 +469,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; @@ -496,7 +496,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; @@ -523,7 +523,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; @@ -550,7 +550,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; @@ -577,7 +577,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -604,7 +604,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -631,7 +631,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { @@ -669,7 +669,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; @@ -696,7 +696,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; @@ -723,7 +723,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; @@ -750,7 +750,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; @@ -777,7 +777,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -804,7 +804,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -831,7 +831,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); server @@ -853,7 +853,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -879,7 +879,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -905,7 +905,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -931,7 +931,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -957,7 +957,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -983,7 +983,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); server @@ -1005,7 +1005,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1031,7 +1031,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1057,7 +1057,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1083,7 +1083,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1109,7 +1109,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1135,7 +1135,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { @@ -1168,7 +1168,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1194,7 +1194,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1220,7 +1220,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1246,7 +1246,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1272,7 +1272,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1298,7 +1298,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1324,7 +1324,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { @@ -1376,7 +1376,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1402,7 +1402,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1428,7 +1428,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1454,7 +1454,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1480,7 +1480,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1506,7 +1506,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1532,7 +1532,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1558,7 +1558,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { @@ -1598,7 +1598,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1624,7 +1624,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1650,7 +1650,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1676,7 +1676,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1702,7 +1702,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1728,7 +1728,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { user_id: "user_kb3fim3yjnyto3kxli4g4ysdmyzgiuttjrudswlkgbawk" }; @@ -1753,7 +1753,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { user_id: "user_id" }; const rawResponseBody = { key: "value" }; @@ -1781,7 +1781,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { user_id: "user_id" }; const rawResponseBody = { key: "value" }; @@ -1809,7 +1809,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { user_id: "user_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1837,7 +1837,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { user_id: "user_id" }; const rawResponseBody = { key: "value" }; @@ -1865,7 +1865,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { user_id: "user_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1893,7 +1893,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { user_id: "user_id" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1921,7 +1921,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); server @@ -1946,7 +1946,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1973,7 +1973,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -2000,7 +2000,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -2027,7 +2027,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -2054,7 +2054,7 @@ describe("ProjectsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; diff --git a/tests/wire/voices.test.ts b/tests/wire/voices.test.ts index 9ce2b93..bccfacd 100644 --- a/tests/wire/voices.test.ts +++ b/tests/wire/voices.test.ts @@ -11,7 +11,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { @@ -62,7 +62,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -80,7 +80,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -98,7 +98,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -116,7 +116,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -134,7 +134,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -152,7 +152,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { @@ -190,7 +190,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -216,7 +216,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -242,7 +242,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -268,7 +268,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -294,7 +294,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -320,7 +320,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -346,7 +346,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -372,7 +372,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); server.mockEndpoint().delete("/v1/voices/voice_id").respondWith().statusCode(200).build(); @@ -389,7 +389,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -415,7 +415,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -441,7 +441,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -467,7 +467,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -493,7 +493,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -519,7 +519,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -545,7 +545,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -571,7 +571,7 @@ describe("VoicesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; diff --git a/tests/wire/voices/consentChallenges.test.ts b/tests/wire/voices/consentChallenges.test.ts index 50d1c3b..acd4a3a 100644 --- a/tests/wire/voices/consentChallenges.test.ts +++ b/tests/wire/voices/consentChallenges.test.ts @@ -11,7 +11,7 @@ describe("ConsentChallengesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { full_name: "Jane Doe" }; const rawResponseBody = { @@ -43,7 +43,7 @@ describe("ConsentChallengesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { full_name: "full_name" }; const rawResponseBody = { key: "value" }; @@ -70,7 +70,7 @@ describe("ConsentChallengesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { full_name: "full_name" }; const rawResponseBody = { key: "value" }; @@ -97,7 +97,7 @@ describe("ConsentChallengesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { full_name: "full_name" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -124,7 +124,7 @@ describe("ConsentChallengesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { full_name: "full_name" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -151,7 +151,7 @@ describe("ConsentChallengesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { full_name: "full_name" }; const rawResponseBody = { key: "value" }; @@ -178,7 +178,7 @@ describe("ConsentChallengesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { full_name: "full_name" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -205,7 +205,7 @@ describe("ConsentChallengesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { full_name: "full_name" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -232,7 +232,7 @@ describe("ConsentChallengesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { full_name: "full_name" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -259,7 +259,7 @@ describe("ConsentChallengesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { full_name: "full_name" }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; diff --git a/tests/wire/webhooks/endpoints.test.ts b/tests/wire/webhooks/endpoints.test.ts index 9ee2f70..544b388 100644 --- a/tests/wire/webhooks/endpoints.test.ts +++ b/tests/wire/webhooks/endpoints.test.ts @@ -11,7 +11,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { @@ -59,7 +59,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -83,7 +83,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -107,7 +107,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -131,7 +131,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -155,7 +155,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -179,7 +179,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { url: "https://example.com/speechify/webhooks", @@ -223,7 +223,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { url: "url", enabled_events: ["enabled_events", "enabled_events"] }; const rawResponseBody = { key: "value" }; @@ -251,7 +251,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { url: "url", enabled_events: ["enabled_events", "enabled_events"] }; const rawResponseBody = { key: "value" }; @@ -279,7 +279,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { url: "url", enabled_events: ["enabled_events", "enabled_events"] }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -307,7 +307,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { url: "url", enabled_events: ["enabled_events", "enabled_events"] }; const rawResponseBody = { key: "value" }; @@ -335,7 +335,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { url: "url", enabled_events: ["enabled_events", "enabled_events"] }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -363,7 +363,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { url: "url", enabled_events: ["enabled_events", "enabled_events"] }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -391,7 +391,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { url: "url", enabled_events: ["enabled_events", "enabled_events"] }; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -419,7 +419,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { @@ -456,7 +456,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -482,7 +482,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -508,7 +508,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -534,7 +534,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -560,7 +560,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); server @@ -582,7 +582,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -608,7 +608,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -634,7 +634,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -660,7 +660,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -686,7 +686,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -712,7 +712,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = { url: "https://example.com/webhook", @@ -759,7 +759,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; @@ -786,7 +786,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; @@ -813,7 +813,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -840,7 +840,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { key: "value" }; @@ -867,7 +867,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -894,7 +894,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawRequestBody = {}; const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -921,7 +921,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { @@ -958,7 +958,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -984,7 +984,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1010,7 +1010,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1036,7 +1036,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1062,7 +1062,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1088,7 +1088,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { @@ -1139,7 +1139,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1165,7 +1165,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1191,7 +1191,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -1217,7 +1217,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -1243,7 +1243,7 @@ describe("EndpointsClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; diff --git a/tests/wire/workspaces.test.ts b/tests/wire/workspaces.test.ts index 856e8d5..5b22571 100644 --- a/tests/wire/workspaces.test.ts +++ b/tests/wire/workspaces.test.ts @@ -11,7 +11,7 @@ describe("WorkspacesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { @@ -75,7 +75,7 @@ describe("WorkspacesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { key: "value" }; @@ -99,7 +99,7 @@ describe("WorkspacesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -123,7 +123,7 @@ describe("WorkspacesClient", () => { maxRetries: 0, token: "test", version: "test", - environment: { base: server.baseUrl, production: server.baseUrl }, + environment: { base: server.baseUrl, websocket: server.baseUrl }, }); const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; @@ -140,4 +140,430 @@ describe("WorkspacesClient", () => { return await client.workspaces.getEntitlements(); }).rejects.toThrow(Speechify.InternalServerError); }); + + test("getBalance (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { + available_usd: 88.62, + held_usd: 0, + auto_recharge: { enabled: true, amount_usd: 50, threshold_usd: 10 }, + monthly_spend: 128.4412, + monthly_budget: 500, + monthly_budget_status: "ok", + monthly_budget_remaining: 371.5588, + as_of: "2026-11-27T12:00:05Z", + }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/balance") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const response = await client.workspaces.getBalance(); + expect(response).toEqual(rawResponseBody); + }); + + test("getBalance (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/balance") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.getBalance(); + }).rejects.toThrow(Speechify.UnauthorizedError); + }); + + test("getBalance (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/balance") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.getBalance(); + }).rejects.toThrow(Speechify.ForbiddenError); + }); + + test("getBalance (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/balance") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.getBalance(); + }).rejects.toThrow(Speechify.ConflictError); + }); + + test("getBalance (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/balance") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.getBalance(); + }).rejects.toThrow(Speechify.TooManyRequestsError); + }); + + test("getBalance (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/balance") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.getBalance(); + }).rejects.toThrow(Speechify.InternalServerError); + }); + + test("getBalance (7)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/balance") + .respondWith() + .statusCode(502) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.getBalance(); + }).rejects.toThrow(Speechify.BadGatewayError); + }); + + test("getUsageReport (1)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { + has_more: false, + starting_at: "2026-11-01T00:00:00Z", + ending_at: "2026-11-27T12:00:00Z", + group_by: "model", + total_cost_usd: 128.4412, + groups: [ + { value: "gpt-5-mini", product: "llm", quantity: 3.7912, unit: "usd", cost_usd: 3.7912 }, + { value: "simba-3.2", product: "tts", quantity: 2000000, unit: "characters", cost_usd: 20 }, + { value: "simba-3.5", product: "calls", quantity: 120.5, unit: "minutes", cost_usd: 12.05 }, + { value: "simba-3.5", product: "tts", quantity: 9260000, unit: "characters", cost_usd: 92.6 }, + ], + as_of: "2026-11-27T12:00:05Z", + }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/usage") + .respondWith() + .statusCode(200) + .jsonBody(rawResponseBody) + .build(); + + const expected = rawResponseBody; + const page = await client.workspaces.getUsageReport({ + group_by: "model", + starting_at: "2026-11-01T00:00:00Z", + ending_at: "2026-11-27T12:00:00Z", + }); + + expect(expected.groups).toEqual(page.data); + }); + + test("getUsageReport (2)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/usage") + .respondWith() + .statusCode(400) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.getUsageReport({ + group_by: "model", + }); + }).rejects.toThrow(Speechify.BadRequestError); + }); + + test("getUsageReport (3)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/usage") + .respondWith() + .statusCode(401) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.getUsageReport({ + group_by: "model", + }); + }).rejects.toThrow(Speechify.UnauthorizedError); + }); + + test("getUsageReport (4)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/usage") + .respondWith() + .statusCode(403) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.getUsageReport({ + group_by: "model", + }); + }).rejects.toThrow(Speechify.ForbiddenError); + }); + + test("getUsageReport (5)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { key: "value" }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/usage") + .respondWith() + .statusCode(409) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.getUsageReport({ + group_by: "model", + }); + }).rejects.toThrow(Speechify.ConflictError); + }); + + test("getUsageReport (6)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/usage") + .respondWith() + .statusCode(429) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.getUsageReport({ + group_by: "model", + }); + }).rejects.toThrow(Speechify.TooManyRequestsError); + }); + + test("getUsageReport (7)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/usage") + .respondWith() + .statusCode(500) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.getUsageReport({ + group_by: "model", + }); + }).rejects.toThrow(Speechify.InternalServerError); + }); + + test("getUsageReport (8)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/usage") + .respondWith() + .statusCode(502) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.getUsageReport({ + group_by: "model", + }); + }).rejects.toThrow(Speechify.BadGatewayError); + }); + + test("getUsageReport (9)", async () => { + const server = mockServerPool.createServer(); + const client = new SpeechifyClient({ + maxRetries: 0, + token: "test", + version: "test", + environment: { base: server.baseUrl, websocket: server.baseUrl }, + }); + + const rawResponseBody = { error: { code: "endpoint_moved", message: "message" } }; + + server + .mockEndpoint() + .get("/v1/workspaces/current/usage") + .respondWith() + .statusCode(503) + .jsonBody(rawResponseBody) + .build(); + + await expect(async () => { + return await client.workspaces.getUsageReport({ + group_by: "model", + }); + }).rejects.toThrow(Speechify.ServiceUnavailableError); + }); }); From 3ea4cee04528e190164269f6a8247e02ab4d8437 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Sat, 28 Nov 2026 12:02:39 +0000 Subject: [PATCH 2/2] [fern-replay] advance lockfile --- .fern/replay.lock | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.fern/replay.lock b/.fern/replay.lock index dcebc45..fd74be3 100644 --- a/.fern/replay.lock +++ b/.fern/replay.lock @@ -6,5 +6,11 @@ generations: timestamp: 2026-11-28T12:01:46.577Z cli_version: unknown generator_versions: {} -current_generation: 65728a1bd30ee1027d4c055c41f975fd6fe7b7e7 + - commit_sha: 8a15c4f890f9390dc672ae6025997f1af3a134a1 + tree_hash: a0774a7018db94487bf71ea360d7cb8ac01315db + timestamp: 2026-11-28T12:02:36.027Z + cli_version: unknown + generator_versions: + fernapi/fern-typescript-sdk: 3.70.1 +current_generation: 8a15c4f890f9390dc672ae6025997f1af3a134a1 patches: []