@speechall/sdk 1.0.0 → 2.1.0
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.
- package/.beads/README.md +81 -0
- package/.beads/config.yaml +62 -0
- package/.beads/issues.jsonl +47 -0
- package/.beads/metadata.json +4 -0
- package/.env.example +5 -0
- package/.fernignore +45 -0
- package/.gitattributes +3 -0
- package/.github/copilot-instructions.md +78 -0
- package/.github/workflows/auto-release-simple.yml.deprecated +106 -0
- package/.github/workflows/auto-release.yml +67 -0
- package/.github/workflows/ci.yml +41 -0
- package/.github/workflows/release.yml +57 -0
- package/AGENTS.md +94 -0
- package/CHANGELOG.md +65 -0
- package/CLAUDE.md +129 -0
- package/README.md +294 -155
- package/examples/CLAUDE.md +136 -0
- package/examples/advanced-options.ts +213 -0
- package/examples/basic-transcription.ts +66 -0
- package/examples/error-handling.ts +251 -0
- package/examples/list-models.ts +112 -0
- package/examples/remote-transcription.ts +60 -0
- package/fern/fern.config.json +4 -0
- package/fern/generators.yml +43 -0
- package/jest.config.js +11 -0
- package/package.json +26 -46
- package/regenerate.sh +45 -0
- package/scripts/fix-generated-code.sh +25 -0
- package/src/BaseClient.ts +82 -0
- package/src/Client.ts +30 -0
- package/src/api/errors/BadRequestError.ts +22 -0
- package/src/api/errors/GatewayTimeoutError.ts +22 -0
- package/src/api/errors/InternalServerError.ts +22 -0
- package/src/api/errors/NotFoundError.ts +22 -0
- package/src/api/errors/PaymentRequiredError.ts +22 -0
- package/src/api/errors/ServiceUnavailableError.ts +22 -0
- package/src/api/errors/TooManyRequestsError.ts +22 -0
- package/src/api/errors/UnauthorizedError.ts +22 -0
- package/src/api/errors/index.ts +8 -0
- package/src/api/index.ts +3 -0
- package/src/api/resources/index.ts +5 -0
- package/src/api/resources/replacementRules/client/Client.ts +148 -0
- package/src/api/resources/replacementRules/client/index.ts +1 -0
- package/src/api/resources/replacementRules/client/requests/CreateReplacementRulesetRequest.ts +25 -0
- package/src/api/resources/replacementRules/client/requests/index.ts +1 -0
- package/src/api/resources/replacementRules/index.ts +2 -0
- package/src/api/resources/replacementRules/types/CreateReplacementRulesetResponse.ts +6 -0
- package/src/api/resources/replacementRules/types/index.ts +1 -0
- package/src/api/resources/speechToText/client/Client.ts +275 -0
- package/src/api/resources/speechToText/client/index.ts +1 -0
- package/src/api/resources/speechToText/client/requests/RemoteTranscriptionConfiguration.ts +20 -0
- package/src/api/resources/speechToText/client/requests/TranscribeRequest.ts +26 -0
- package/src/api/resources/speechToText/client/requests/index.ts +2 -0
- package/src/api/resources/speechToText/index.ts +1 -0
- package/src/api/types/BaseTranscriptionConfiguration.ts +29 -0
- package/src/api/types/ErrorResponse.ts +11 -0
- package/src/api/types/ExactRule.ts +13 -0
- package/src/api/types/RegexGroupRule.ts +28 -0
- package/src/api/types/RegexRule.ts +28 -0
- package/src/api/types/ReplacementRule.ts +25 -0
- package/src/api/types/SpeechToTextModel.ts +90 -0
- package/src/api/types/TranscriptLanguageCode.ts +114 -0
- package/src/api/types/TranscriptOutputFormat.ts +18 -0
- package/src/api/types/TranscriptionDetailed.ts +19 -0
- package/src/api/types/TranscriptionModelIdentifier.ts +70 -0
- package/src/api/types/TranscriptionOnlyText.ts +11 -0
- package/src/api/types/TranscriptionProvider.ts +23 -0
- package/src/api/types/TranscriptionResponse.ts +8 -0
- package/src/api/types/TranscriptionSegment.ts +17 -0
- package/src/api/types/TranscriptionWord.ts +17 -0
- package/src/api/types/index.ts +16 -0
- package/src/auth/BearerAuthProvider.ts +37 -0
- package/src/auth/index.ts +1 -0
- package/src/core/auth/AuthProvider.ts +6 -0
- package/src/core/auth/AuthRequest.ts +9 -0
- package/src/core/auth/BasicAuth.ts +32 -0
- package/src/core/auth/BearerToken.ts +20 -0
- package/src/core/auth/NoOpAuthProvider.ts +8 -0
- package/src/core/auth/index.ts +5 -0
- package/src/core/base64.ts +27 -0
- package/src/core/exports.ts +2 -0
- package/src/core/fetcher/APIResponse.ts +23 -0
- package/src/core/fetcher/BinaryResponse.ts +34 -0
- package/src/core/fetcher/EndpointMetadata.ts +13 -0
- package/src/core/fetcher/EndpointSupplier.ts +14 -0
- package/src/core/fetcher/Fetcher.ts +391 -0
- package/src/core/fetcher/Headers.ts +93 -0
- package/src/core/fetcher/HttpResponsePromise.ts +116 -0
- package/src/core/fetcher/RawResponse.ts +61 -0
- package/src/core/fetcher/Supplier.ts +11 -0
- package/src/core/fetcher/createRequestUrl.ts +6 -0
- package/src/core/fetcher/getErrorResponseBody.ts +33 -0
- package/src/core/fetcher/getFetchFn.ts +3 -0
- package/src/core/fetcher/getHeader.ts +8 -0
- package/src/core/fetcher/getRequestBody.ts +20 -0
- package/src/core/fetcher/getResponseBody.ts +58 -0
- package/src/core/fetcher/index.ts +11 -0
- package/src/core/fetcher/makeRequest.ts +42 -0
- package/src/core/fetcher/requestWithRetries.ts +64 -0
- package/src/core/fetcher/signals.ts +26 -0
- package/src/core/file/exports.ts +1 -0
- package/src/core/file/file.ts +217 -0
- package/src/core/file/index.ts +2 -0
- package/src/core/file/types.ts +81 -0
- package/src/core/headers.ts +35 -0
- package/src/core/index.ts +7 -0
- package/src/core/json.ts +27 -0
- package/src/core/logging/exports.ts +19 -0
- package/src/core/logging/index.ts +1 -0
- package/src/core/logging/logger.ts +203 -0
- package/src/core/runtime/index.ts +1 -0
- package/src/core/runtime/runtime.ts +134 -0
- package/src/core/url/encodePathParam.ts +18 -0
- package/src/core/url/index.ts +3 -0
- package/src/core/url/join.ts +79 -0
- package/src/core/url/qs.ts +74 -0
- package/src/environments.ts +7 -0
- package/src/errors/SpeechallError.ts +58 -0
- package/src/errors/SpeechallTimeoutError.ts +13 -0
- package/src/errors/handleNonStatusCodeError.ts +37 -0
- package/src/errors/index.ts +2 -0
- package/src/exports.ts +1 -0
- package/src/index.ts +6 -0
- package/test-import.ts +17 -0
- package/tests/integration/api.test.ts +93 -0
- package/tests/unit/client.test.ts +91 -0
- package/tsconfig.json +20 -0
- package/dist/api.d.ts +0 -501
- package/dist/api.d.ts.map +0 -1
- package/dist/api.js +0 -610
- package/dist/base.d.ts +0 -32
- package/dist/base.d.ts.map +0 -1
- package/dist/base.js +0 -35
- package/dist/common.d.ts +0 -14
- package/dist/common.d.ts.map +0 -1
- package/dist/common.js +0 -91
- package/dist/configuration.d.ts +0 -23
- package/dist/configuration.d.ts.map +0 -1
- package/dist/configuration.js +0 -25
- package/dist/esm/api.js +0 -592
- package/dist/esm/base.js +0 -27
- package/dist/esm/common.js +0 -79
- package/dist/esm/configuration.js +0 -21
- package/dist/esm/example.js +0 -131
- package/dist/esm/index.js +0 -2
- package/dist/example.d.ts +0 -3
- package/dist/example.d.ts.map +0 -1
- package/dist/example.js +0 -133
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- 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.1.0
|
|
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
|
|
4
|
-
"description": "TypeScript SDK for
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
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.1.0",
|
|
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
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
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
|
-
"
|
|
31
|
+
"@types/url-join": "4.0.1",
|
|
32
|
+
"url-join": "4.0.1"
|
|
49
33
|
},
|
|
50
34
|
"devDependencies": {
|
|
51
|
-
"@
|
|
52
|
-
"@semantic-release/git": "^10.0.1",
|
|
35
|
+
"@types/jest": "^30.0.0",
|
|
53
36
|
"@types/node": "^20.0.0",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
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";
|
package/src/api/index.ts
ADDED
|
@@ -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";
|