@corti/sdk 2.1.0-rc.1 → 2.1.0-rc.2
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/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/Client.d.ts +3 -0
- package/dist/cjs/Client.js +15 -10
- package/dist/cjs/api/resources/agents/client/Client.d.ts +16 -0
- package/dist/cjs/api/resources/agents/client/Client.js +55 -0
- package/dist/cjs/api/resources/index.d.ts +3 -0
- package/dist/cjs/api/resources/index.js +4 -1
- package/dist/cjs/api/resources/languages/client/Client.d.ts +27 -0
- package/dist/cjs/api/resources/languages/client/Client.js +134 -0
- package/dist/cjs/api/resources/languages/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/languages/client/index.js +17 -0
- package/dist/cjs/api/resources/languages/client/requests/LanguagesListRequest.d.ts +9 -0
- package/dist/cjs/api/resources/languages/client/requests/LanguagesListRequest.js +3 -0
- package/dist/cjs/api/resources/languages/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/languages/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/languages/index.d.ts +2 -0
- package/dist/cjs/api/resources/languages/index.js +18 -0
- package/dist/cjs/api/resources/languages/types/LanguagesListRequestEndpoint.d.ts +7 -0
- package/dist/cjs/api/resources/languages/types/LanguagesListRequestEndpoint.js +10 -0
- package/dist/cjs/api/resources/languages/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/languages/types/index.js +17 -0
- package/dist/cjs/api/types/LanguagesListResponse.d.ts +3 -0
- package/dist/cjs/api/types/LanguagesListResponse.js +3 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/serialization/resources/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/index.js +3 -1
- package/dist/cjs/serialization/resources/languages/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/languages/index.js +17 -0
- package/dist/cjs/serialization/resources/languages/types/LanguagesListRequestEndpoint.d.ts +7 -0
- package/dist/cjs/serialization/resources/languages/types/LanguagesListRequestEndpoint.js +39 -0
- package/dist/cjs/serialization/resources/languages/types/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/languages/types/index.js +17 -0
- package/dist/cjs/serialization/types/LanguagesListResponse.d.ts +9 -0
- package/dist/cjs/serialization/types/LanguagesListResponse.js +41 -0
- package/dist/cjs/serialization/types/index.d.ts +1 -0
- package/dist/cjs/serialization/types/index.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/Client.d.mts +3 -0
- package/dist/esm/Client.mjs +5 -0
- package/dist/esm/api/resources/agents/client/Client.d.mts +16 -0
- package/dist/esm/api/resources/agents/client/Client.mjs +55 -0
- package/dist/esm/api/resources/index.d.mts +3 -0
- package/dist/esm/api/resources/index.mjs +3 -0
- package/dist/esm/api/resources/languages/client/Client.d.mts +27 -0
- package/dist/esm/api/resources/languages/client/Client.mjs +97 -0
- package/dist/esm/api/resources/languages/client/index.d.mts +1 -0
- package/dist/esm/api/resources/languages/client/index.mjs +1 -0
- package/dist/esm/api/resources/languages/client/requests/LanguagesListRequest.d.mts +9 -0
- package/dist/esm/api/resources/languages/client/requests/LanguagesListRequest.mjs +2 -0
- package/dist/esm/api/resources/languages/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/languages/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/languages/index.d.mts +2 -0
- package/dist/esm/api/resources/languages/index.mjs +2 -0
- package/dist/esm/api/resources/languages/types/LanguagesListRequestEndpoint.d.mts +7 -0
- package/dist/esm/api/resources/languages/types/LanguagesListRequestEndpoint.mjs +7 -0
- package/dist/esm/api/resources/languages/types/index.d.mts +1 -0
- package/dist/esm/api/resources/languages/types/index.mjs +1 -0
- package/dist/esm/api/types/LanguagesListResponse.d.mts +3 -0
- package/dist/esm/api/types/LanguagesListResponse.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/serialization/resources/index.d.mts +2 -0
- package/dist/esm/serialization/resources/index.mjs +2 -0
- package/dist/esm/serialization/resources/languages/index.d.mts +1 -0
- package/dist/esm/serialization/resources/languages/index.mjs +1 -0
- package/dist/esm/serialization/resources/languages/types/LanguagesListRequestEndpoint.d.mts +7 -0
- package/dist/esm/serialization/resources/languages/types/LanguagesListRequestEndpoint.mjs +3 -0
- package/dist/esm/serialization/resources/languages/types/index.d.mts +1 -0
- package/dist/esm/serialization/resources/languages/types/index.mjs +1 -0
- package/dist/esm/serialization/types/LanguagesListResponse.d.mts +9 -0
- package/dist/esm/serialization/types/LanguagesListResponse.mjs +5 -0
- package/dist/esm/serialization/types/index.d.mts +1 -0
- package/dist/esm/serialization/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./LanguagesListRequestEndpoint.js"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as Corti from "../../api/index.js";
|
|
2
|
+
import * as core from "../../core/index.js";
|
|
3
|
+
import type * as serializers from "../index.js";
|
|
4
|
+
export declare const LanguagesListResponse: core.serialization.ObjectSchema<serializers.LanguagesListResponse.Raw, Corti.LanguagesListResponse>;
|
|
5
|
+
export declare namespace LanguagesListResponse {
|
|
6
|
+
interface Raw {
|
|
7
|
+
languages: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.LanguagesListResponse = void 0;
|
|
38
|
+
const core = __importStar(require("../../core/index.js"));
|
|
39
|
+
exports.LanguagesListResponse = core.serialization.object({
|
|
40
|
+
languages: core.serialization.record(core.serialization.string(), core.serialization.unknown()),
|
|
41
|
+
});
|
|
@@ -124,6 +124,7 @@ export * from "./InteractionsGenderEnum.js";
|
|
|
124
124
|
export * from "./InteractionsGetResponse.js";
|
|
125
125
|
export * from "./InteractionsListResponse.js";
|
|
126
126
|
export * from "./InteractionsPatient.js";
|
|
127
|
+
export * from "./LanguagesListResponse.js";
|
|
127
128
|
export * from "./OAuthTokenRequest.js";
|
|
128
129
|
export * from "./RecordingsCreateResponse.js";
|
|
129
130
|
export * from "./RecordingsListResponse.js";
|
|
@@ -140,6 +140,7 @@ __exportStar(require("./InteractionsGenderEnum.js"), exports);
|
|
|
140
140
|
__exportStar(require("./InteractionsGetResponse.js"), exports);
|
|
141
141
|
__exportStar(require("./InteractionsListResponse.js"), exports);
|
|
142
142
|
__exportStar(require("./InteractionsPatient.js"), exports);
|
|
143
|
+
__exportStar(require("./LanguagesListResponse.js"), exports);
|
|
143
144
|
__exportStar(require("./OAuthTokenRequest.js"), exports);
|
|
144
145
|
__exportStar(require("./RecordingsCreateResponse.js"), exports);
|
|
145
146
|
__exportStar(require("./RecordingsListResponse.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.1.0-rc.
|
|
1
|
+
export declare const SDK_VERSION = "2.1.0-rc.2";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@corti/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "2.1.0-rc.
|
|
10
|
-
"User-Agent": "@corti/sdk/2.1.0-rc.
|
|
9
|
+
"X-Fern-SDK-Version": "2.1.0-rc.2",
|
|
10
|
+
"User-Agent": "@corti/sdk/2.1.0-rc.2",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
"Tenant-Name": options === null || options === void 0 ? void 0 : options.tenantName,
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -4,6 +4,7 @@ import { CodesClient } from "./api/resources/codes/client/Client.mjs";
|
|
|
4
4
|
import { DocumentsClient } from "./api/resources/documents/client/Client.mjs";
|
|
5
5
|
import { FactsClient } from "./api/resources/facts/client/Client.mjs";
|
|
6
6
|
import { InteractionsClient } from "./api/resources/interactions/client/Client.mjs";
|
|
7
|
+
import { LanguagesClient } from "./api/resources/languages/client/Client.mjs";
|
|
7
8
|
import { RecordingsClient } from "./api/resources/recordings/client/Client.mjs";
|
|
8
9
|
import { StreamClient } from "./api/resources/stream/client/Client.mjs";
|
|
9
10
|
import { TemplatesClient } from "./api/resources/templates/client/Client.mjs";
|
|
@@ -26,6 +27,7 @@ export declare class CortiClient {
|
|
|
26
27
|
protected _documents: DocumentsClient | undefined;
|
|
27
28
|
protected _templates: TemplatesClient | undefined;
|
|
28
29
|
protected _codes: CodesClient | undefined;
|
|
30
|
+
protected _languages: LanguagesClient | undefined;
|
|
29
31
|
protected _agents: AgentsClient | undefined;
|
|
30
32
|
protected _stream: StreamClient | undefined;
|
|
31
33
|
protected _transcribe: TranscribeClient | undefined;
|
|
@@ -38,6 +40,7 @@ export declare class CortiClient {
|
|
|
38
40
|
get documents(): DocumentsClient;
|
|
39
41
|
get templates(): TemplatesClient;
|
|
40
42
|
get codes(): CodesClient;
|
|
43
|
+
get languages(): LanguagesClient;
|
|
41
44
|
get agents(): AgentsClient;
|
|
42
45
|
get stream(): StreamClient;
|
|
43
46
|
get transcribe(): TranscribeClient;
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import { CodesClient } from "./api/resources/codes/client/Client.mjs";
|
|
|
5
5
|
import { DocumentsClient } from "./api/resources/documents/client/Client.mjs";
|
|
6
6
|
import { FactsClient } from "./api/resources/facts/client/Client.mjs";
|
|
7
7
|
import { InteractionsClient } from "./api/resources/interactions/client/Client.mjs";
|
|
8
|
+
import { LanguagesClient } from "./api/resources/languages/client/Client.mjs";
|
|
8
9
|
import { RecordingsClient } from "./api/resources/recordings/client/Client.mjs";
|
|
9
10
|
import { StreamClient } from "./api/resources/stream/client/Client.mjs";
|
|
10
11
|
import { TemplatesClient } from "./api/resources/templates/client/Client.mjs";
|
|
@@ -47,6 +48,10 @@ export class CortiClient {
|
|
|
47
48
|
var _a;
|
|
48
49
|
return ((_a = this._codes) !== null && _a !== void 0 ? _a : (this._codes = new CodesClient(this._options)));
|
|
49
50
|
}
|
|
51
|
+
get languages() {
|
|
52
|
+
var _a;
|
|
53
|
+
return ((_a = this._languages) !== null && _a !== void 0 ? _a : (this._languages = new LanguagesClient(this._options)));
|
|
54
|
+
}
|
|
50
55
|
get agents() {
|
|
51
56
|
var _a;
|
|
52
57
|
return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new AgentsClient(this._options)));
|
|
@@ -167,6 +167,22 @@ export declare class AgentsClient {
|
|
|
167
167
|
*/
|
|
168
168
|
getContext(id: string, contextId: string, request?: Corti.AgentsGetContextRequest, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<Corti.AgentsContext>;
|
|
169
169
|
private __getContext;
|
|
170
|
+
/**
|
|
171
|
+
* This endpoint deletes a context (thread) and scrubs all associated data including messages, memories, and memory chunks for the given agent. Thread and task metadata is soft-deleted for audit purposes, while content columns are irreversibly overwritten.
|
|
172
|
+
*
|
|
173
|
+
* @param {string} id - The identifier of the agent associated with the context.
|
|
174
|
+
* @param {string} contextId - The identifier of the context (thread) to delete.
|
|
175
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
176
|
+
*
|
|
177
|
+
* @throws {@link Corti.BadRequestError}
|
|
178
|
+
* @throws {@link Corti.UnauthorizedError}
|
|
179
|
+
* @throws {@link Corti.NotFoundError}
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* await client.agents.deleteContext("12345678-90ab-cdef-gh12-34567890abc", "contextId")
|
|
183
|
+
*/
|
|
184
|
+
deleteContext(id: string, contextId: string, requestOptions?: AgentsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
185
|
+
private __deleteContext;
|
|
170
186
|
/**
|
|
171
187
|
* This endpoint retrieves the experts registry, which contains information about all available experts that can be referenced when creating agents through the AgentsCreateExpertReference schema.
|
|
172
188
|
*
|
|
@@ -671,6 +671,61 @@ export class AgentsClient {
|
|
|
671
671
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/agents/{id}/v1/contexts/{contextId}");
|
|
672
672
|
});
|
|
673
673
|
}
|
|
674
|
+
/**
|
|
675
|
+
* This endpoint deletes a context (thread) and scrubs all associated data including messages, memories, and memory chunks for the given agent. Thread and task metadata is soft-deleted for audit purposes, while content columns are irreversibly overwritten.
|
|
676
|
+
*
|
|
677
|
+
* @param {string} id - The identifier of the agent associated with the context.
|
|
678
|
+
* @param {string} contextId - The identifier of the context (thread) to delete.
|
|
679
|
+
* @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
680
|
+
*
|
|
681
|
+
* @throws {@link Corti.BadRequestError}
|
|
682
|
+
* @throws {@link Corti.UnauthorizedError}
|
|
683
|
+
* @throws {@link Corti.NotFoundError}
|
|
684
|
+
*
|
|
685
|
+
* @example
|
|
686
|
+
* await client.agents.deleteContext("12345678-90ab-cdef-gh12-34567890abc", "contextId")
|
|
687
|
+
*/
|
|
688
|
+
deleteContext(id, contextId, requestOptions) {
|
|
689
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteContext(id, contextId, requestOptions));
|
|
690
|
+
}
|
|
691
|
+
__deleteContext(id, contextId, requestOptions) {
|
|
692
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
693
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
694
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
695
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "Tenant-Name": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.tenantName }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
696
|
+
const _response = yield core.fetcher({
|
|
697
|
+
url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment)).agents, `agents/${core.url.encodePathParam(id)}/v1/contexts/${core.url.encodePathParam(contextId)}`),
|
|
698
|
+
method: "DELETE",
|
|
699
|
+
headers: _headers,
|
|
700
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
701
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
702
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
703
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
704
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
705
|
+
logging: this._options.logging,
|
|
706
|
+
});
|
|
707
|
+
if (_response.ok) {
|
|
708
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
709
|
+
}
|
|
710
|
+
if (_response.error.reason === "status-code") {
|
|
711
|
+
switch (_response.error.statusCode) {
|
|
712
|
+
case 400:
|
|
713
|
+
throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
|
|
714
|
+
case 401:
|
|
715
|
+
throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
716
|
+
case 404:
|
|
717
|
+
throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
|
|
718
|
+
default:
|
|
719
|
+
throw new errors.CortiError({
|
|
720
|
+
statusCode: _response.error.statusCode,
|
|
721
|
+
body: _response.error.body,
|
|
722
|
+
rawResponse: _response.rawResponse,
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/agents/{id}/v1/contexts/{contextId}");
|
|
727
|
+
});
|
|
728
|
+
}
|
|
674
729
|
/**
|
|
675
730
|
* This endpoint retrieves the experts registry, which contains information about all available experts that can be referenced when creating agents through the AgentsCreateExpertReference schema.
|
|
676
731
|
*
|
|
@@ -12,6 +12,9 @@ export * as facts from "./facts/index.mjs";
|
|
|
12
12
|
export * from "./interactions/client/requests/index.mjs";
|
|
13
13
|
export * as interactions from "./interactions/index.mjs";
|
|
14
14
|
export * from "./interactions/types/index.mjs";
|
|
15
|
+
export * from "./languages/client/requests/index.mjs";
|
|
16
|
+
export * as languages from "./languages/index.mjs";
|
|
17
|
+
export * from "./languages/types/index.mjs";
|
|
15
18
|
export * as recordings from "./recordings/index.mjs";
|
|
16
19
|
export * as stream from "./stream/index.mjs";
|
|
17
20
|
export * from "./templates/client/requests/index.mjs";
|
|
@@ -12,6 +12,9 @@ export * as facts from "./facts/index.mjs";
|
|
|
12
12
|
export * from "./interactions/client/requests/index.mjs";
|
|
13
13
|
export * as interactions from "./interactions/index.mjs";
|
|
14
14
|
export * from "./interactions/types/index.mjs";
|
|
15
|
+
export * from "./languages/client/requests/index.mjs";
|
|
16
|
+
export * as languages from "./languages/index.mjs";
|
|
17
|
+
export * from "./languages/types/index.mjs";
|
|
15
18
|
export * as recordings from "./recordings/index.mjs";
|
|
16
19
|
export * as stream from "./stream/index.mjs";
|
|
17
20
|
export * from "./templates/client/requests/index.mjs";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
|
+
import * as core from "../../../../core/index.mjs";
|
|
4
|
+
import * as Corti from "../../../index.mjs";
|
|
5
|
+
export declare namespace LanguagesClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class LanguagesClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<LanguagesClient.Options>;
|
|
12
|
+
constructor(options: LanguagesClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Returns a list of available languages with their enabled endpoints details.
|
|
15
|
+
*
|
|
16
|
+
* @param {Corti.LanguagesListRequest} request
|
|
17
|
+
* @param {LanguagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link Corti.BadRequestError}
|
|
20
|
+
* @throws {@link Corti.InternalServerError}
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* await client.languages.list()
|
|
24
|
+
*/
|
|
25
|
+
list(request?: Corti.LanguagesListRequest, requestOptions?: LanguagesClient.RequestOptions): core.HttpResponsePromise<Corti.LanguagesListResponse>;
|
|
26
|
+
private __list;
|
|
27
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
13
|
+
import * as core from "../../../../core/index.mjs";
|
|
14
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.mjs";
|
|
15
|
+
import * as errors from "../../../../errors/index.mjs";
|
|
16
|
+
import * as serializers from "../../../../serialization/index.mjs";
|
|
17
|
+
import * as Corti from "../../../index.mjs";
|
|
18
|
+
export class LanguagesClient {
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns a list of available languages with their enabled endpoints details.
|
|
24
|
+
*
|
|
25
|
+
* @param {Corti.LanguagesListRequest} request
|
|
26
|
+
* @param {LanguagesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link Corti.BadRequestError}
|
|
29
|
+
* @throws {@link Corti.InternalServerError}
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* await client.languages.list()
|
|
33
|
+
*/
|
|
34
|
+
list(request = {}, requestOptions) {
|
|
35
|
+
return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
36
|
+
}
|
|
37
|
+
__list() {
|
|
38
|
+
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
40
|
+
const { endpoint } = request;
|
|
41
|
+
const _queryParams = {
|
|
42
|
+
endpoint: endpoint != null
|
|
43
|
+
? serializers.LanguagesListRequestEndpoint.jsonOrThrow(endpoint, {
|
|
44
|
+
unrecognizedObjectKeys: "strip",
|
|
45
|
+
omitUndefined: true,
|
|
46
|
+
})
|
|
47
|
+
: undefined,
|
|
48
|
+
};
|
|
49
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
50
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ "Tenant-Name": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.tenantName }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
51
|
+
const _response = yield core.fetcher({
|
|
52
|
+
url: core.url.join((_d = (yield core.Supplier.get(this._options.baseUrl))) !== null && _d !== void 0 ? _d : (yield core.Supplier.get(this._options.environment)).base, "languages/"),
|
|
53
|
+
method: "GET",
|
|
54
|
+
headers: _headers,
|
|
55
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
56
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
57
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
58
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
59
|
+
fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
|
|
60
|
+
logging: this._options.logging,
|
|
61
|
+
});
|
|
62
|
+
if (_response.ok) {
|
|
63
|
+
return {
|
|
64
|
+
data: serializers.LanguagesListResponse.parseOrThrow(_response.body, {
|
|
65
|
+
unrecognizedObjectKeys: "passthrough",
|
|
66
|
+
allowUnrecognizedUnionMembers: true,
|
|
67
|
+
allowUnrecognizedEnumValues: true,
|
|
68
|
+
skipValidation: true,
|
|
69
|
+
breadcrumbsPrefix: ["response"],
|
|
70
|
+
}),
|
|
71
|
+
rawResponse: _response.rawResponse,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
if (_response.error.reason === "status-code") {
|
|
75
|
+
switch (_response.error.statusCode) {
|
|
76
|
+
case 400:
|
|
77
|
+
throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
|
|
78
|
+
case 500:
|
|
79
|
+
throw new Corti.InternalServerError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
|
|
80
|
+
unrecognizedObjectKeys: "passthrough",
|
|
81
|
+
allowUnrecognizedUnionMembers: true,
|
|
82
|
+
allowUnrecognizedEnumValues: true,
|
|
83
|
+
skipValidation: true,
|
|
84
|
+
breadcrumbsPrefix: ["response"],
|
|
85
|
+
}), _response.rawResponse);
|
|
86
|
+
default:
|
|
87
|
+
throw new errors.CortiError({
|
|
88
|
+
statusCode: _response.error.statusCode,
|
|
89
|
+
body: _response.error.body,
|
|
90
|
+
rawResponse: _response.rawResponse,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/languages/");
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { LanguagesListRequest } from "./LanguagesListRequest.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Field used to filter languages that supported specific endpoint. */
|
|
2
|
+
export declare const LanguagesListRequestEndpoint: {
|
|
3
|
+
readonly Streams: "streams";
|
|
4
|
+
readonly Transcribe: "transcribe";
|
|
5
|
+
readonly Transcripts: "transcripts";
|
|
6
|
+
};
|
|
7
|
+
export type LanguagesListRequestEndpoint = (typeof LanguagesListRequestEndpoint)[keyof typeof LanguagesListRequestEndpoint];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
/** Field used to filter languages that supported specific endpoint. */
|
|
3
|
+
export const LanguagesListRequestEndpoint = {
|
|
4
|
+
Streams: "streams",
|
|
5
|
+
Transcribe: "transcribe",
|
|
6
|
+
Transcripts: "transcripts",
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./LanguagesListRequestEndpoint.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./LanguagesListRequestEndpoint.mjs";
|
|
@@ -124,6 +124,7 @@ export * from "./InteractionsGenderEnum.mjs";
|
|
|
124
124
|
export * from "./InteractionsGetResponse.mjs";
|
|
125
125
|
export * from "./InteractionsListResponse.mjs";
|
|
126
126
|
export * from "./InteractionsPatient.mjs";
|
|
127
|
+
export * from "./LanguagesListResponse.mjs";
|
|
127
128
|
export * from "./OAuthTokenRequest.mjs";
|
|
128
129
|
export * from "./RecordingsCreateResponse.mjs";
|
|
129
130
|
export * from "./RecordingsListResponse.mjs";
|
|
@@ -124,6 +124,7 @@ export * from "./InteractionsGenderEnum.mjs";
|
|
|
124
124
|
export * from "./InteractionsGetResponse.mjs";
|
|
125
125
|
export * from "./InteractionsListResponse.mjs";
|
|
126
126
|
export * from "./InteractionsPatient.mjs";
|
|
127
|
+
export * from "./LanguagesListResponse.mjs";
|
|
127
128
|
export * from "./OAuthTokenRequest.mjs";
|
|
128
129
|
export * from "./RecordingsCreateResponse.mjs";
|
|
129
130
|
export * from "./RecordingsListResponse.mjs";
|
|
@@ -12,6 +12,8 @@ export * as facts from "./facts/index.mjs";
|
|
|
12
12
|
export * from "./interactions/client/requests/index.mjs";
|
|
13
13
|
export * as interactions from "./interactions/index.mjs";
|
|
14
14
|
export * from "./interactions/types/index.mjs";
|
|
15
|
+
export * as languages from "./languages/index.mjs";
|
|
16
|
+
export * from "./languages/types/index.mjs";
|
|
15
17
|
export * from "./stream/client/socket/index.mjs";
|
|
16
18
|
export * as stream from "./stream/index.mjs";
|
|
17
19
|
export * from "./transcribe/client/socket/index.mjs";
|
|
@@ -12,6 +12,8 @@ export * as facts from "./facts/index.mjs";
|
|
|
12
12
|
export * from "./interactions/client/requests/index.mjs";
|
|
13
13
|
export * as interactions from "./interactions/index.mjs";
|
|
14
14
|
export * from "./interactions/types/index.mjs";
|
|
15
|
+
export * as languages from "./languages/index.mjs";
|
|
16
|
+
export * from "./languages/types/index.mjs";
|
|
15
17
|
export * from "./stream/client/socket/index.mjs";
|
|
16
18
|
export * as stream from "./stream/index.mjs";
|
|
17
19
|
export * from "./transcribe/client/socket/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./types/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./types/index.mjs";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type * as Corti from "../../../../api/index.mjs";
|
|
2
|
+
import * as core from "../../../../core/index.mjs";
|
|
3
|
+
import type * as serializers from "../../../index.mjs";
|
|
4
|
+
export declare const LanguagesListRequestEndpoint: core.serialization.Schema<serializers.LanguagesListRequestEndpoint.Raw, Corti.LanguagesListRequestEndpoint>;
|
|
5
|
+
export declare namespace LanguagesListRequestEndpoint {
|
|
6
|
+
type Raw = "streams" | "transcribe" | "transcripts";
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./LanguagesListRequestEndpoint.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./LanguagesListRequestEndpoint.mjs";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type * as Corti from "../../api/index.mjs";
|
|
2
|
+
import * as core from "../../core/index.mjs";
|
|
3
|
+
import type * as serializers from "../index.mjs";
|
|
4
|
+
export declare const LanguagesListResponse: core.serialization.ObjectSchema<serializers.LanguagesListResponse.Raw, Corti.LanguagesListResponse>;
|
|
5
|
+
export declare namespace LanguagesListResponse {
|
|
6
|
+
interface Raw {
|
|
7
|
+
languages: Record<string, unknown>;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import * as core from "../../core/index.mjs";
|
|
3
|
+
export const LanguagesListResponse = core.serialization.object({
|
|
4
|
+
languages: core.serialization.record(core.serialization.string(), core.serialization.unknown()),
|
|
5
|
+
});
|
|
@@ -124,6 +124,7 @@ export * from "./InteractionsGenderEnum.mjs";
|
|
|
124
124
|
export * from "./InteractionsGetResponse.mjs";
|
|
125
125
|
export * from "./InteractionsListResponse.mjs";
|
|
126
126
|
export * from "./InteractionsPatient.mjs";
|
|
127
|
+
export * from "./LanguagesListResponse.mjs";
|
|
127
128
|
export * from "./OAuthTokenRequest.mjs";
|
|
128
129
|
export * from "./RecordingsCreateResponse.mjs";
|
|
129
130
|
export * from "./RecordingsListResponse.mjs";
|
|
@@ -124,6 +124,7 @@ export * from "./InteractionsGenderEnum.mjs";
|
|
|
124
124
|
export * from "./InteractionsGetResponse.mjs";
|
|
125
125
|
export * from "./InteractionsListResponse.mjs";
|
|
126
126
|
export * from "./InteractionsPatient.mjs";
|
|
127
|
+
export * from "./LanguagesListResponse.mjs";
|
|
127
128
|
export * from "./OAuthTokenRequest.mjs";
|
|
128
129
|
export * from "./RecordingsCreateResponse.mjs";
|
|
129
130
|
export * from "./RecordingsListResponse.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.1.0-rc.
|
|
1
|
+
export declare const SDK_VERSION = "2.1.0-rc.2";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "2.1.0-rc.
|
|
1
|
+
export const SDK_VERSION = "2.1.0-rc.2";
|