@speechall/sdk 1.0.0 → 2.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. package/.beads/README.md +81 -0
  2. package/.beads/config.yaml +62 -0
  3. package/.beads/issues.jsonl +46 -0
  4. package/.beads/metadata.json +4 -0
  5. package/.env.example +5 -0
  6. package/.fernignore +45 -0
  7. package/.gitattributes +3 -0
  8. package/.github/copilot-instructions.md +78 -0
  9. package/.github/workflows/auto-release-simple.yml.deprecated +106 -0
  10. package/.github/workflows/auto-release.yml +67 -0
  11. package/.github/workflows/ci.yml +41 -0
  12. package/.github/workflows/release.yml +57 -0
  13. package/AGENTS.md +94 -0
  14. package/CHANGELOG.md +58 -0
  15. package/CLAUDE.md +75 -0
  16. package/README.md +294 -155
  17. package/examples/CLAUDE.md +136 -0
  18. package/examples/advanced-options.ts +213 -0
  19. package/examples/basic-transcription.ts +66 -0
  20. package/examples/error-handling.ts +251 -0
  21. package/examples/list-models.ts +112 -0
  22. package/examples/remote-transcription.ts +60 -0
  23. package/fern/fern.config.json +4 -0
  24. package/fern/generators.yml +43 -0
  25. package/jest.config.js +11 -0
  26. package/package.json +26 -46
  27. package/regenerate.sh +45 -0
  28. package/scripts/fix-generated-code.sh +25 -0
  29. package/src/BaseClient.ts +82 -0
  30. package/src/Client.ts +30 -0
  31. package/src/api/errors/BadRequestError.ts +22 -0
  32. package/src/api/errors/GatewayTimeoutError.ts +22 -0
  33. package/src/api/errors/InternalServerError.ts +22 -0
  34. package/src/api/errors/NotFoundError.ts +22 -0
  35. package/src/api/errors/PaymentRequiredError.ts +22 -0
  36. package/src/api/errors/ServiceUnavailableError.ts +22 -0
  37. package/src/api/errors/TooManyRequestsError.ts +22 -0
  38. package/src/api/errors/UnauthorizedError.ts +22 -0
  39. package/src/api/errors/index.ts +8 -0
  40. package/src/api/index.ts +3 -0
  41. package/src/api/resources/index.ts +5 -0
  42. package/src/api/resources/replacementRules/client/Client.ts +148 -0
  43. package/src/api/resources/replacementRules/client/index.ts +1 -0
  44. package/src/api/resources/replacementRules/client/requests/CreateReplacementRulesetRequest.ts +25 -0
  45. package/src/api/resources/replacementRules/client/requests/index.ts +1 -0
  46. package/src/api/resources/replacementRules/index.ts +2 -0
  47. package/src/api/resources/replacementRules/types/CreateReplacementRulesetResponse.ts +6 -0
  48. package/src/api/resources/replacementRules/types/index.ts +1 -0
  49. package/src/api/resources/speechToText/client/Client.ts +275 -0
  50. package/src/api/resources/speechToText/client/index.ts +1 -0
  51. package/src/api/resources/speechToText/client/requests/RemoteTranscriptionConfiguration.ts +20 -0
  52. package/src/api/resources/speechToText/client/requests/TranscribeRequest.ts +26 -0
  53. package/src/api/resources/speechToText/client/requests/index.ts +2 -0
  54. package/src/api/resources/speechToText/index.ts +1 -0
  55. package/src/api/types/BaseTranscriptionConfiguration.ts +29 -0
  56. package/src/api/types/ErrorResponse.ts +11 -0
  57. package/src/api/types/ExactRule.ts +13 -0
  58. package/src/api/types/RegexGroupRule.ts +28 -0
  59. package/src/api/types/RegexRule.ts +28 -0
  60. package/src/api/types/ReplacementRule.ts +25 -0
  61. package/src/api/types/SpeechToTextModel.ts +90 -0
  62. package/src/api/types/TranscriptLanguageCode.ts +114 -0
  63. package/src/api/types/TranscriptOutputFormat.ts +18 -0
  64. package/src/api/types/TranscriptionDetailed.ts +19 -0
  65. package/src/api/types/TranscriptionModelIdentifier.ts +80 -0
  66. package/src/api/types/TranscriptionOnlyText.ts +11 -0
  67. package/src/api/types/TranscriptionProvider.ts +23 -0
  68. package/src/api/types/TranscriptionResponse.ts +8 -0
  69. package/src/api/types/TranscriptionSegment.ts +17 -0
  70. package/src/api/types/TranscriptionWord.ts +17 -0
  71. package/src/api/types/index.ts +16 -0
  72. package/src/auth/BearerAuthProvider.ts +37 -0
  73. package/src/auth/index.ts +1 -0
  74. package/src/core/auth/AuthProvider.ts +6 -0
  75. package/src/core/auth/AuthRequest.ts +9 -0
  76. package/src/core/auth/BasicAuth.ts +32 -0
  77. package/src/core/auth/BearerToken.ts +20 -0
  78. package/src/core/auth/NoOpAuthProvider.ts +8 -0
  79. package/src/core/auth/index.ts +5 -0
  80. package/src/core/base64.ts +27 -0
  81. package/src/core/exports.ts +2 -0
  82. package/src/core/fetcher/APIResponse.ts +23 -0
  83. package/src/core/fetcher/BinaryResponse.ts +34 -0
  84. package/src/core/fetcher/EndpointMetadata.ts +13 -0
  85. package/src/core/fetcher/EndpointSupplier.ts +14 -0
  86. package/src/core/fetcher/Fetcher.ts +391 -0
  87. package/src/core/fetcher/Headers.ts +93 -0
  88. package/src/core/fetcher/HttpResponsePromise.ts +116 -0
  89. package/src/core/fetcher/RawResponse.ts +61 -0
  90. package/src/core/fetcher/Supplier.ts +11 -0
  91. package/src/core/fetcher/createRequestUrl.ts +6 -0
  92. package/src/core/fetcher/getErrorResponseBody.ts +33 -0
  93. package/src/core/fetcher/getFetchFn.ts +3 -0
  94. package/src/core/fetcher/getHeader.ts +8 -0
  95. package/src/core/fetcher/getRequestBody.ts +20 -0
  96. package/src/core/fetcher/getResponseBody.ts +58 -0
  97. package/src/core/fetcher/index.ts +11 -0
  98. package/src/core/fetcher/makeRequest.ts +42 -0
  99. package/src/core/fetcher/requestWithRetries.ts +64 -0
  100. package/src/core/fetcher/signals.ts +26 -0
  101. package/src/core/file/exports.ts +1 -0
  102. package/src/core/file/file.ts +217 -0
  103. package/src/core/file/index.ts +2 -0
  104. package/src/core/file/types.ts +81 -0
  105. package/src/core/headers.ts +35 -0
  106. package/src/core/index.ts +7 -0
  107. package/src/core/json.ts +27 -0
  108. package/src/core/logging/exports.ts +19 -0
  109. package/src/core/logging/index.ts +1 -0
  110. package/src/core/logging/logger.ts +203 -0
  111. package/src/core/runtime/index.ts +1 -0
  112. package/src/core/runtime/runtime.ts +134 -0
  113. package/src/core/url/encodePathParam.ts +18 -0
  114. package/src/core/url/index.ts +3 -0
  115. package/src/core/url/join.ts +79 -0
  116. package/src/core/url/qs.ts +74 -0
  117. package/src/environments.ts +7 -0
  118. package/src/errors/SpeechallError.ts +58 -0
  119. package/src/errors/SpeechallTimeoutError.ts +13 -0
  120. package/src/errors/handleNonStatusCodeError.ts +37 -0
  121. package/src/errors/index.ts +2 -0
  122. package/src/exports.ts +1 -0
  123. package/src/index.ts +6 -0
  124. package/test-import.ts +17 -0
  125. package/tests/integration/api.test.ts +93 -0
  126. package/tests/unit/client.test.ts +91 -0
  127. package/tsconfig.json +20 -0
  128. package/dist/api.d.ts +0 -501
  129. package/dist/api.d.ts.map +0 -1
  130. package/dist/api.js +0 -610
  131. package/dist/base.d.ts +0 -32
  132. package/dist/base.d.ts.map +0 -1
  133. package/dist/base.js +0 -35
  134. package/dist/common.d.ts +0 -14
  135. package/dist/common.d.ts.map +0 -1
  136. package/dist/common.js +0 -91
  137. package/dist/configuration.d.ts +0 -23
  138. package/dist/configuration.d.ts.map +0 -1
  139. package/dist/configuration.js +0 -25
  140. package/dist/esm/api.js +0 -592
  141. package/dist/esm/base.js +0 -27
  142. package/dist/esm/common.js +0 -79
  143. package/dist/esm/configuration.js +0 -21
  144. package/dist/esm/example.js +0 -131
  145. package/dist/esm/index.js +0 -2
  146. package/dist/example.d.ts +0 -3
  147. package/dist/example.d.ts.map +0 -1
  148. package/dist/example.js +0 -133
  149. package/dist/index.d.ts +0 -3
  150. package/dist/index.d.ts.map +0 -1
  151. package/dist/index.js +0 -18
@@ -0,0 +1,43 @@
1
+ # yaml-language-server: $schema=https://schema.buildwithfern.dev/generators-yml.json
2
+ api:
3
+ specs:
4
+ # Fern doesn't support remote URLs in generators.yml (only local paths)
5
+ # The remote URL is public: https://raw.githubusercontent.com/Speechall/speechall-openapi/refs/heads/main/openapi.yaml
6
+ # But must be downloaded locally first via: fern init --openapi <url>
7
+ - openapi: ../../../Speechall-Repositories/speechall-openapi/openapi.yaml
8
+
9
+ default-group: local
10
+
11
+ groups:
12
+ local:
13
+ generators:
14
+ - name: fernapi/fern-typescript-sdk
15
+ version: 3.42.0
16
+ output:
17
+ location: local-file-system
18
+ path: ../src
19
+ config:
20
+ namespaceExport: Speechall
21
+ enableInlineTypes: true
22
+ generateWireTests: true
23
+ neverThrowErrors: false
24
+ skipResponseValidation: false
25
+ treatUnknownAsAny: false
26
+ outputSourceFiles: true
27
+ packageJson:
28
+ name: "@speechall/sdk"
29
+ version: 2.0.4
30
+ description: "TypeScript SDK for Speechall API - Speech-to-text transcription
31
+ service"
32
+ author: Speechall
33
+ license: MIT
34
+ repository:
35
+ type: git
36
+ url: "https://github.com/Speechall/speechall-typescript-sdk"
37
+ homepage: "https://docs.speechall.com"
38
+ keywords:
39
+ - speechall
40
+ - speech-to-text
41
+ - transcription
42
+ - api
43
+ - sdk
package/jest.config.js ADDED
@@ -0,0 +1,11 @@
1
+ module.exports = {
2
+ preset: 'ts-jest',
3
+ testEnvironment: 'node',
4
+ roots: ['<rootDir>/tests'],
5
+ testMatch: ['**/*.test.ts'],
6
+ collectCoverageFrom: ['src/**/*.ts'],
7
+ coverageDirectory: 'coverage',
8
+ moduleNameMapper: {
9
+ '^(\\.{1,2}/.*)\\.js$': '$1',
10
+ },
11
+ };
package/package.json CHANGED
@@ -1,64 +1,44 @@
1
1
  {
2
2
  "name": "@speechall/sdk",
3
- "version": "1.0.0",
4
- "description": "TypeScript SDK for the Speechall API - A powerful and flexible speech-to-text service",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "module": "dist/esm/index.js",
8
- "sideEffects": false,
9
- "files": [
10
- "dist/**/*",
11
- "README.md",
12
- "LICENSE"
13
- ],
14
- "scripts": {
15
- "build": "npm run build:cjs && npm run build:esm",
16
- "build:cjs": "tsc -p tsconfig.json",
17
- "build:esm": "tsc -p tsconfig.esm.json && node scripts/fix-esm-imports.js",
18
- "clean": "rimraf dist",
19
- "prepublishOnly": "npm run clean && npm run build",
20
- "test": "echo \"Error: no test specified\" && exit 1",
21
- "lint": "eslint . --ext .ts",
22
- "lint:fix": "eslint . --ext .ts --fix",
23
- "generate": "node scripts/generate-sdk.js",
24
- "generate:bash": "bash scripts/generate-sdk.sh"
3
+ "version": "2.0.4",
4
+ "description": "TypeScript SDK for Speechall API - Speech-to-text transcription service",
5
+ "author": "Speechall",
6
+ "license": "MIT",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/Speechall/speechall-typescript-sdk"
25
10
  },
11
+ "homepage": "https://docs.speechall.com",
26
12
  "keywords": [
27
13
  "speechall",
28
14
  "speech-to-text",
29
- "stt",
30
15
  "transcription",
31
- "audio",
32
- "voice",
33
16
  "api",
34
- "typescript",
35
17
  "sdk"
36
18
  ],
37
- "author": "Speechall",
38
- "license": "MIT",
39
- "repository": {
40
- "type": "git",
41
- "url": "git+https://github.com/speechall/speechall-typescript-sdk.git"
42
- },
43
- "bugs": {
44
- "url": "https://github.com/speechall/speechall-typescript-sdk/issues"
19
+ "main": "./dist/index.js",
20
+ "types": "./dist/index.d.ts",
21
+ "scripts": {
22
+ "build": "tsc",
23
+ "prepublishOnly": "npm run build",
24
+ "test": "jest",
25
+ "test:unit": "jest tests/unit",
26
+ "test:integration": "jest tests/integration",
27
+ "test:coverage": "jest --coverage",
28
+ "test:watch": "jest --watch"
45
29
  },
46
- "homepage": "https://github.com/speechall/speechall-typescript-sdk#readme",
47
30
  "dependencies": {
48
- "axios": "^1.6.0"
31
+ "@types/url-join": "4.0.1",
32
+ "url-join": "4.0.1"
49
33
  },
50
34
  "devDependencies": {
51
- "@semantic-release/changelog": "^6.0.3",
52
- "@semantic-release/git": "^10.0.1",
35
+ "@types/jest": "^30.0.0",
53
36
  "@types/node": "^20.0.0",
54
- "@typescript-eslint/eslint-plugin": "^6.0.0",
55
- "@typescript-eslint/parser": "^6.0.0",
56
- "eslint": "^8.0.0",
57
- "rimraf": "^5.0.0",
58
- "semantic-release": "^22.0.12",
37
+ "dotenv": "^17.2.3",
38
+ "jest": "^30.2.0",
39
+ "ts-jest": "^29.4.6",
40
+ "ts-node": "^10.9.2",
41
+ "tsx": "^4.21.0",
59
42
  "typescript": "^5.0.0"
60
- },
61
- "engines": {
62
- "node": ">=16"
63
43
  }
64
44
  }
package/regenerate.sh ADDED
@@ -0,0 +1,45 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ echo "Validating Fern configuration..."
5
+
6
+ if [ ! -f "fern/generators.yml" ]; then
7
+ echo "Error: fern/generators.yml not found"
8
+ exit 1
9
+ fi
10
+
11
+ echo "Using OpenAPI spec configured in fern/generators.yml"
12
+ echo "Note: The OpenAPI spec path is configured in fern/generators.yml"
13
+ echo "For local OpenAPI changes, edit fern/generators.yml to use your local path."
14
+
15
+ echo "Generating TypeScript SDK with Fern..."
16
+ fern generate --local --force
17
+
18
+ echo "SDK generation complete!"
19
+
20
+ # Apply post-generation fixes for known Fern generator bugs
21
+ if [ -f "scripts/fix-generated-code.sh" ]; then
22
+ ./scripts/fix-generated-code.sh
23
+ fi
24
+
25
+ # Optional: Run type checking
26
+ if [ -f "tsconfig.json" ]; then
27
+ echo "Running TypeScript type check..."
28
+ if command -v npx &> /dev/null; then
29
+ npx tsc --noEmit
30
+ else
31
+ echo "npx not available, skipping type check"
32
+ fi
33
+ fi
34
+
35
+ # Optional: Run tests
36
+ if [ -d "tests" ] || [ -d "__tests__" ]; then
37
+ echo "Running tests..."
38
+ if command -v npm &> /dev/null; then
39
+ npm test
40
+ else
41
+ echo "npm not available, skipping tests"
42
+ fi
43
+ fi
44
+
45
+ echo "Regeneration complete!"
@@ -0,0 +1,25 @@
1
+ #!/bin/bash
2
+ # Post-generation fix script for Fern TypeScript SDK
3
+ # Fixes known bugs in the generated code
4
+ #
5
+ # This script is automatically run by regenerate.sh after fern generate
6
+
7
+ set -e
8
+
9
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10
+ PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
11
+ SRC_DIR="$PROJECT_ROOT/src"
12
+
13
+ echo "Applying post-generation fixes..."
14
+
15
+ # Fix 1: Remove spurious "*/" before JSDoc comments (Fern generator bug)
16
+ # This bug appears when a method without @example is followed by a method with @example
17
+ if [[ "$OSTYPE" == "darwin"* ]]; then
18
+ # macOS requires different sed syntax
19
+ find "$SRC_DIR" -name "*.ts" -exec sed -i '' 's/^\([[:space:]]*\)\*\/\/\*\*/\1\/\*\*/g' {} +
20
+ else
21
+ # Linux
22
+ find "$SRC_DIR" -name "*.ts" -exec sed -i 's/^\([[:space:]]*\)\*\/\/\*\*/\1\/\*\*/g' {} +
23
+ fi
24
+
25
+ echo "Post-generation fixes applied successfully."
@@ -0,0 +1,82 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import { BearerAuthProvider } from "./auth/BearerAuthProvider.js";
4
+ import { mergeHeaders } from "./core/headers.js";
5
+ import * as core from "./core/index.js";
6
+ import type * as environments from "./environments.js";
7
+
8
+ export type BaseClientOptions = {
9
+ environment?: core.Supplier<environments.SpeechallEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
12
+ /** Additional headers to include in requests. */
13
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
14
+ /** The default maximum time to wait for a response in seconds. */
15
+ timeoutInSeconds?: number;
16
+ /** The default number of times to retry the request. Defaults to 2. */
17
+ maxRetries?: number;
18
+ /** Provide a custom fetch implementation. Useful for platforms that don't have a built-in fetch or need a custom implementation. */
19
+ fetch?: typeof fetch;
20
+ /** Configure logging for the client. */
21
+ logging?: core.logging.LogConfig | core.logging.Logger;
22
+ } & BearerAuthProvider.AuthOptions;
23
+
24
+ export interface BaseRequestOptions {
25
+ /** The maximum time to wait for a response in seconds. */
26
+ timeoutInSeconds?: number;
27
+ /** The number of times to retry the request. Defaults to 2. */
28
+ maxRetries?: number;
29
+ /** A hook to abort the request. */
30
+ abortSignal?: AbortSignal;
31
+ /** Additional query string parameters to include in the request. */
32
+ queryParams?: Record<string, unknown>;
33
+ /** Additional headers to include in the request. */
34
+ headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
35
+ }
36
+
37
+ export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
38
+ logging: core.logging.Logger;
39
+ authProvider?: core.AuthProvider;
40
+ };
41
+
42
+ export type NormalizedClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions> =
43
+ NormalizedClientOptions<T> & {
44
+ authProvider: core.AuthProvider;
45
+ };
46
+
47
+ export function normalizeClientOptions<T extends BaseClientOptions = BaseClientOptions>(
48
+ options: T,
49
+ ): NormalizedClientOptions<T> {
50
+ const headers = mergeHeaders(
51
+ {
52
+ "X-Fern-Language": "JavaScript",
53
+ "X-Fern-Runtime": core.RUNTIME.type,
54
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
55
+ },
56
+ options?.headers,
57
+ );
58
+
59
+ return {
60
+ ...options,
61
+ logging: core.logging.createLogger(options?.logging),
62
+ headers,
63
+ } as NormalizedClientOptions<T>;
64
+ }
65
+
66
+ export function normalizeClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions>(
67
+ options: T,
68
+ ): NormalizedClientOptionsWithAuth<T> {
69
+ const normalized = normalizeClientOptions(options) as NormalizedClientOptionsWithAuth<T>;
70
+ const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
71
+ normalized.authProvider ??= new BearerAuthProvider(normalizedWithNoOpAuthProvider);
72
+ return normalized;
73
+ }
74
+
75
+ function withNoOpAuthProvider<T extends BaseClientOptions = BaseClientOptions>(
76
+ options: NormalizedClientOptions<T>,
77
+ ): NormalizedClientOptionsWithAuth<T> {
78
+ return {
79
+ ...options,
80
+ authProvider: new core.NoOpAuthProvider(),
81
+ };
82
+ }
package/src/Client.ts ADDED
@@ -0,0 +1,30 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import { ReplacementRulesClient } from "./api/resources/replacementRules/client/Client.js";
4
+ import { SpeechToTextClient } from "./api/resources/speechToText/client/Client.js";
5
+ import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
6
+ import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "./BaseClient.js";
7
+
8
+ export declare namespace SpeechallClient {
9
+ export type Options = BaseClientOptions;
10
+
11
+ export interface RequestOptions extends BaseRequestOptions {}
12
+ }
13
+
14
+ export class SpeechallClient {
15
+ protected readonly _options: NormalizedClientOptionsWithAuth<SpeechallClient.Options>;
16
+ protected _speechToText: SpeechToTextClient | undefined;
17
+ protected _replacementRules: ReplacementRulesClient | undefined;
18
+
19
+ constructor(options: SpeechallClient.Options) {
20
+ this._options = normalizeClientOptionsWithAuth(options);
21
+ }
22
+
23
+ public get speechToText(): SpeechToTextClient {
24
+ return (this._speechToText ??= new SpeechToTextClient(this._options));
25
+ }
26
+
27
+ public get replacementRules(): ReplacementRulesClient {
28
+ return (this._replacementRules ??= new ReplacementRulesClient(this._options));
29
+ }
30
+ }
@@ -0,0 +1,22 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type * as core from "../../core/index.js";
4
+ import * as errors from "../../errors/index.js";
5
+ import type * as Speechall from "../index.js";
6
+
7
+ export class BadRequestError extends errors.SpeechallError {
8
+ constructor(body: Speechall.ErrorResponse, rawResponse?: core.RawResponse) {
9
+ super({
10
+ message: "BadRequestError",
11
+ statusCode: 400,
12
+ body: body,
13
+ rawResponse: rawResponse,
14
+ });
15
+ Object.setPrototypeOf(this, new.target.prototype);
16
+ if (Error.captureStackTrace) {
17
+ Error.captureStackTrace(this, this.constructor);
18
+ }
19
+
20
+ this.name = this.constructor.name;
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type * as core from "../../core/index.js";
4
+ import * as errors from "../../errors/index.js";
5
+ import type * as Speechall from "../index.js";
6
+
7
+ export class GatewayTimeoutError extends errors.SpeechallError {
8
+ constructor(body: Speechall.ErrorResponse, rawResponse?: core.RawResponse) {
9
+ super({
10
+ message: "GatewayTimeoutError",
11
+ statusCode: 504,
12
+ body: body,
13
+ rawResponse: rawResponse,
14
+ });
15
+ Object.setPrototypeOf(this, new.target.prototype);
16
+ if (Error.captureStackTrace) {
17
+ Error.captureStackTrace(this, this.constructor);
18
+ }
19
+
20
+ this.name = this.constructor.name;
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type * as core from "../../core/index.js";
4
+ import * as errors from "../../errors/index.js";
5
+ import type * as Speechall from "../index.js";
6
+
7
+ export class InternalServerError extends errors.SpeechallError {
8
+ constructor(body: Speechall.ErrorResponse, rawResponse?: core.RawResponse) {
9
+ super({
10
+ message: "InternalServerError",
11
+ statusCode: 500,
12
+ body: body,
13
+ rawResponse: rawResponse,
14
+ });
15
+ Object.setPrototypeOf(this, new.target.prototype);
16
+ if (Error.captureStackTrace) {
17
+ Error.captureStackTrace(this, this.constructor);
18
+ }
19
+
20
+ this.name = this.constructor.name;
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type * as core from "../../core/index.js";
4
+ import * as errors from "../../errors/index.js";
5
+ import type * as Speechall from "../index.js";
6
+
7
+ export class NotFoundError extends errors.SpeechallError {
8
+ constructor(body: Speechall.ErrorResponse, rawResponse?: core.RawResponse) {
9
+ super({
10
+ message: "NotFoundError",
11
+ statusCode: 404,
12
+ body: body,
13
+ rawResponse: rawResponse,
14
+ });
15
+ Object.setPrototypeOf(this, new.target.prototype);
16
+ if (Error.captureStackTrace) {
17
+ Error.captureStackTrace(this, this.constructor);
18
+ }
19
+
20
+ this.name = this.constructor.name;
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type * as core from "../../core/index.js";
4
+ import * as errors from "../../errors/index.js";
5
+ import type * as Speechall from "../index.js";
6
+
7
+ export class PaymentRequiredError extends errors.SpeechallError {
8
+ constructor(body: Speechall.ErrorResponse, rawResponse?: core.RawResponse) {
9
+ super({
10
+ message: "PaymentRequiredError",
11
+ statusCode: 402,
12
+ body: body,
13
+ rawResponse: rawResponse,
14
+ });
15
+ Object.setPrototypeOf(this, new.target.prototype);
16
+ if (Error.captureStackTrace) {
17
+ Error.captureStackTrace(this, this.constructor);
18
+ }
19
+
20
+ this.name = this.constructor.name;
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type * as core from "../../core/index.js";
4
+ import * as errors from "../../errors/index.js";
5
+ import type * as Speechall from "../index.js";
6
+
7
+ export class ServiceUnavailableError extends errors.SpeechallError {
8
+ constructor(body: Speechall.ErrorResponse, rawResponse?: core.RawResponse) {
9
+ super({
10
+ message: "ServiceUnavailableError",
11
+ statusCode: 503,
12
+ body: body,
13
+ rawResponse: rawResponse,
14
+ });
15
+ Object.setPrototypeOf(this, new.target.prototype);
16
+ if (Error.captureStackTrace) {
17
+ Error.captureStackTrace(this, this.constructor);
18
+ }
19
+
20
+ this.name = this.constructor.name;
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type * as core from "../../core/index.js";
4
+ import * as errors from "../../errors/index.js";
5
+ import type * as Speechall from "../index.js";
6
+
7
+ export class TooManyRequestsError extends errors.SpeechallError {
8
+ constructor(body: Speechall.ErrorResponse, rawResponse?: core.RawResponse) {
9
+ super({
10
+ message: "TooManyRequestsError",
11
+ statusCode: 429,
12
+ body: body,
13
+ rawResponse: rawResponse,
14
+ });
15
+ Object.setPrototypeOf(this, new.target.prototype);
16
+ if (Error.captureStackTrace) {
17
+ Error.captureStackTrace(this, this.constructor);
18
+ }
19
+
20
+ this.name = this.constructor.name;
21
+ }
22
+ }
@@ -0,0 +1,22 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+
3
+ import type * as core from "../../core/index.js";
4
+ import * as errors from "../../errors/index.js";
5
+ import type * as Speechall from "../index.js";
6
+
7
+ export class UnauthorizedError extends errors.SpeechallError {
8
+ constructor(body: Speechall.ErrorResponse, rawResponse?: core.RawResponse) {
9
+ super({
10
+ message: "UnauthorizedError",
11
+ statusCode: 401,
12
+ body: body,
13
+ rawResponse: rawResponse,
14
+ });
15
+ Object.setPrototypeOf(this, new.target.prototype);
16
+ if (Error.captureStackTrace) {
17
+ Error.captureStackTrace(this, this.constructor);
18
+ }
19
+
20
+ this.name = this.constructor.name;
21
+ }
22
+ }
@@ -0,0 +1,8 @@
1
+ export * from "./BadRequestError.js";
2
+ export * from "./GatewayTimeoutError.js";
3
+ export * from "./InternalServerError.js";
4
+ export * from "./NotFoundError.js";
5
+ export * from "./PaymentRequiredError.js";
6
+ export * from "./ServiceUnavailableError.js";
7
+ export * from "./TooManyRequestsError.js";
8
+ export * from "./UnauthorizedError.js";
@@ -0,0 +1,3 @@
1
+ export * from "./errors/index.js";
2
+ export * from "./resources/index.js";
3
+ export * from "./types/index.js";
@@ -0,0 +1,5 @@
1
+ export * from "./replacementRules/client/requests/index.js";
2
+ export * as replacementRules from "./replacementRules/index.js";
3
+ export * from "./replacementRules/types/index.js";
4
+ export * from "./speechToText/client/requests/index.js";
5
+ export * as speechToText from "./speechToText/index.js";