@corti/sdk 2.1.0-rc → 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.
Files changed (79) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/Client.d.ts +3 -0
  3. package/dist/cjs/Client.js +15 -10
  4. package/dist/cjs/api/resources/agents/client/Client.d.ts +16 -0
  5. package/dist/cjs/api/resources/agents/client/Client.js +55 -0
  6. package/dist/cjs/api/resources/index.d.ts +3 -0
  7. package/dist/cjs/api/resources/index.js +4 -1
  8. package/dist/cjs/api/resources/languages/client/Client.d.ts +27 -0
  9. package/dist/cjs/api/resources/languages/client/Client.js +134 -0
  10. package/dist/cjs/api/resources/languages/client/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/languages/client/index.js +17 -0
  12. package/dist/cjs/api/resources/languages/client/requests/LanguagesListRequest.d.ts +9 -0
  13. package/dist/cjs/api/resources/languages/client/requests/LanguagesListRequest.js +3 -0
  14. package/dist/cjs/api/resources/languages/client/requests/index.d.ts +1 -0
  15. package/dist/cjs/api/resources/languages/client/requests/index.js +2 -0
  16. package/dist/cjs/api/resources/languages/index.d.ts +2 -0
  17. package/dist/cjs/api/resources/languages/index.js +18 -0
  18. package/dist/cjs/api/resources/languages/types/LanguagesListRequestEndpoint.d.ts +7 -0
  19. package/dist/cjs/api/resources/languages/types/LanguagesListRequestEndpoint.js +10 -0
  20. package/dist/cjs/api/resources/languages/types/index.d.ts +1 -0
  21. package/dist/cjs/api/resources/languages/types/index.js +17 -0
  22. package/dist/cjs/api/types/LanguagesListResponse.d.ts +3 -0
  23. package/dist/cjs/api/types/LanguagesListResponse.js +3 -0
  24. package/dist/cjs/api/types/index.d.ts +1 -0
  25. package/dist/cjs/api/types/index.js +1 -0
  26. package/dist/cjs/serialization/resources/index.d.ts +2 -0
  27. package/dist/cjs/serialization/resources/index.js +3 -1
  28. package/dist/cjs/serialization/resources/languages/index.d.ts +1 -0
  29. package/dist/cjs/serialization/resources/languages/index.js +17 -0
  30. package/dist/cjs/serialization/resources/languages/types/LanguagesListRequestEndpoint.d.ts +7 -0
  31. package/dist/cjs/serialization/resources/languages/types/LanguagesListRequestEndpoint.js +39 -0
  32. package/dist/cjs/serialization/resources/languages/types/index.d.ts +1 -0
  33. package/dist/cjs/serialization/resources/languages/types/index.js +17 -0
  34. package/dist/cjs/serialization/types/LanguagesListResponse.d.ts +9 -0
  35. package/dist/cjs/serialization/types/LanguagesListResponse.js +41 -0
  36. package/dist/cjs/serialization/types/index.d.ts +1 -0
  37. package/dist/cjs/serialization/types/index.js +1 -0
  38. package/dist/cjs/version.d.ts +1 -1
  39. package/dist/cjs/version.js +1 -1
  40. package/dist/esm/BaseClient.mjs +2 -2
  41. package/dist/esm/Client.d.mts +3 -0
  42. package/dist/esm/Client.mjs +5 -0
  43. package/dist/esm/api/resources/agents/client/Client.d.mts +16 -0
  44. package/dist/esm/api/resources/agents/client/Client.mjs +55 -0
  45. package/dist/esm/api/resources/index.d.mts +3 -0
  46. package/dist/esm/api/resources/index.mjs +3 -0
  47. package/dist/esm/api/resources/languages/client/Client.d.mts +27 -0
  48. package/dist/esm/api/resources/languages/client/Client.mjs +97 -0
  49. package/dist/esm/api/resources/languages/client/index.d.mts +1 -0
  50. package/dist/esm/api/resources/languages/client/index.mjs +1 -0
  51. package/dist/esm/api/resources/languages/client/requests/LanguagesListRequest.d.mts +9 -0
  52. package/dist/esm/api/resources/languages/client/requests/LanguagesListRequest.mjs +2 -0
  53. package/dist/esm/api/resources/languages/client/requests/index.d.mts +1 -0
  54. package/dist/esm/api/resources/languages/client/requests/index.mjs +1 -0
  55. package/dist/esm/api/resources/languages/index.d.mts +2 -0
  56. package/dist/esm/api/resources/languages/index.mjs +2 -0
  57. package/dist/esm/api/resources/languages/types/LanguagesListRequestEndpoint.d.mts +7 -0
  58. package/dist/esm/api/resources/languages/types/LanguagesListRequestEndpoint.mjs +7 -0
  59. package/dist/esm/api/resources/languages/types/index.d.mts +1 -0
  60. package/dist/esm/api/resources/languages/types/index.mjs +1 -0
  61. package/dist/esm/api/types/LanguagesListResponse.d.mts +3 -0
  62. package/dist/esm/api/types/LanguagesListResponse.mjs +2 -0
  63. package/dist/esm/api/types/index.d.mts +1 -0
  64. package/dist/esm/api/types/index.mjs +1 -0
  65. package/dist/esm/serialization/resources/index.d.mts +2 -0
  66. package/dist/esm/serialization/resources/index.mjs +2 -0
  67. package/dist/esm/serialization/resources/languages/index.d.mts +1 -0
  68. package/dist/esm/serialization/resources/languages/index.mjs +1 -0
  69. package/dist/esm/serialization/resources/languages/types/LanguagesListRequestEndpoint.d.mts +7 -0
  70. package/dist/esm/serialization/resources/languages/types/LanguagesListRequestEndpoint.mjs +3 -0
  71. package/dist/esm/serialization/resources/languages/types/index.d.mts +1 -0
  72. package/dist/esm/serialization/resources/languages/types/index.mjs +1 -0
  73. package/dist/esm/serialization/types/LanguagesListResponse.d.mts +9 -0
  74. package/dist/esm/serialization/types/LanguagesListResponse.mjs +5 -0
  75. package/dist/esm/serialization/types/index.d.mts +1 -0
  76. package/dist/esm/serialization/types/index.mjs +1 -0
  77. package/dist/esm/version.d.mts +1 -1
  78. package/dist/esm/version.mjs +1 -1
  79. package/package.json +1 -1
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@corti/sdk",
46
- "X-Fern-SDK-Version": "2.1.0-rc",
47
- "User-Agent": "@corti/sdk/2.1.0-rc",
46
+ "X-Fern-SDK-Version": "2.1.0-rc.2",
47
+ "User-Agent": "@corti/sdk/2.1.0-rc.2",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  "Tenant-Name": options === null || options === void 0 ? void 0 : options.tenantName,
@@ -4,6 +4,7 @@ import { CodesClient } from "./api/resources/codes/client/Client.js";
4
4
  import { DocumentsClient } from "./api/resources/documents/client/Client.js";
5
5
  import { FactsClient } from "./api/resources/facts/client/Client.js";
6
6
  import { InteractionsClient } from "./api/resources/interactions/client/Client.js";
7
+ import { LanguagesClient } from "./api/resources/languages/client/Client.js";
7
8
  import { RecordingsClient } from "./api/resources/recordings/client/Client.js";
8
9
  import { StreamClient } from "./api/resources/stream/client/Client.js";
9
10
  import { TemplatesClient } from "./api/resources/templates/client/Client.js";
@@ -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;
@@ -8,11 +8,12 @@ const Client_js_3 = require("./api/resources/codes/client/Client.js");
8
8
  const Client_js_4 = require("./api/resources/documents/client/Client.js");
9
9
  const Client_js_5 = require("./api/resources/facts/client/Client.js");
10
10
  const Client_js_6 = require("./api/resources/interactions/client/Client.js");
11
- const Client_js_7 = require("./api/resources/recordings/client/Client.js");
12
- const Client_js_8 = require("./api/resources/stream/client/Client.js");
13
- const Client_js_9 = require("./api/resources/templates/client/Client.js");
14
- const Client_js_10 = require("./api/resources/transcribe/client/Client.js");
15
- const Client_js_11 = require("./api/resources/transcripts/client/Client.js");
11
+ const Client_js_7 = require("./api/resources/languages/client/Client.js");
12
+ const Client_js_8 = require("./api/resources/recordings/client/Client.js");
13
+ const Client_js_9 = require("./api/resources/stream/client/Client.js");
14
+ const Client_js_10 = require("./api/resources/templates/client/Client.js");
15
+ const Client_js_11 = require("./api/resources/transcribe/client/Client.js");
16
+ const Client_js_12 = require("./api/resources/transcripts/client/Client.js");
16
17
  const BaseClient_js_1 = require("./BaseClient.js");
17
18
  class CortiClient {
18
19
  constructor(options) {
@@ -28,11 +29,11 @@ class CortiClient {
28
29
  }
29
30
  get recordings() {
30
31
  var _a;
31
- return ((_a = this._recordings) !== null && _a !== void 0 ? _a : (this._recordings = new Client_js_7.RecordingsClient(this._options)));
32
+ return ((_a = this._recordings) !== null && _a !== void 0 ? _a : (this._recordings = new Client_js_8.RecordingsClient(this._options)));
32
33
  }
33
34
  get transcripts() {
34
35
  var _a;
35
- return ((_a = this._transcripts) !== null && _a !== void 0 ? _a : (this._transcripts = new Client_js_11.TranscriptsClient(this._options)));
36
+ return ((_a = this._transcripts) !== null && _a !== void 0 ? _a : (this._transcripts = new Client_js_12.TranscriptsClient(this._options)));
36
37
  }
37
38
  get facts() {
38
39
  var _a;
@@ -44,23 +45,27 @@ class CortiClient {
44
45
  }
45
46
  get templates() {
46
47
  var _a;
47
- return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Client_js_9.TemplatesClient(this._options)));
48
+ return ((_a = this._templates) !== null && _a !== void 0 ? _a : (this._templates = new Client_js_10.TemplatesClient(this._options)));
48
49
  }
49
50
  get codes() {
50
51
  var _a;
51
52
  return ((_a = this._codes) !== null && _a !== void 0 ? _a : (this._codes = new Client_js_3.CodesClient(this._options)));
52
53
  }
54
+ get languages() {
55
+ var _a;
56
+ return ((_a = this._languages) !== null && _a !== void 0 ? _a : (this._languages = new Client_js_7.LanguagesClient(this._options)));
57
+ }
53
58
  get agents() {
54
59
  var _a;
55
60
  return ((_a = this._agents) !== null && _a !== void 0 ? _a : (this._agents = new Client_js_1.AgentsClient(this._options)));
56
61
  }
57
62
  get stream() {
58
63
  var _a;
59
- return ((_a = this._stream) !== null && _a !== void 0 ? _a : (this._stream = new Client_js_8.StreamClient(this._options)));
64
+ return ((_a = this._stream) !== null && _a !== void 0 ? _a : (this._stream = new Client_js_9.StreamClient(this._options)));
60
65
  }
61
66
  get transcribe() {
62
67
  var _a;
63
- return ((_a = this._transcribe) !== null && _a !== void 0 ? _a : (this._transcribe = new Client_js_10.TranscribeClient(this._options)));
68
+ return ((_a = this._transcribe) !== null && _a !== void 0 ? _a : (this._transcribe = new Client_js_11.TranscribeClient(this._options)));
64
69
  }
65
70
  }
66
71
  exports.CortiClient = CortiClient;
@@ -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
  *
@@ -707,6 +707,61 @@ class AgentsClient {
707
707
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/agents/{id}/v1/contexts/{contextId}");
708
708
  });
709
709
  }
710
+ /**
711
+ * 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.
712
+ *
713
+ * @param {string} id - The identifier of the agent associated with the context.
714
+ * @param {string} contextId - The identifier of the context (thread) to delete.
715
+ * @param {AgentsClient.RequestOptions} requestOptions - Request-specific configuration.
716
+ *
717
+ * @throws {@link Corti.BadRequestError}
718
+ * @throws {@link Corti.UnauthorizedError}
719
+ * @throws {@link Corti.NotFoundError}
720
+ *
721
+ * @example
722
+ * await client.agents.deleteContext("12345678-90ab-cdef-gh12-34567890abc", "contextId")
723
+ */
724
+ deleteContext(id, contextId, requestOptions) {
725
+ return core.HttpResponsePromise.fromPromise(this.__deleteContext(id, contextId, requestOptions));
726
+ }
727
+ __deleteContext(id, contextId, requestOptions) {
728
+ return __awaiter(this, void 0, void 0, function* () {
729
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
730
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
731
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.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);
732
+ const _response = yield core.fetcher({
733
+ 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)}`),
734
+ method: "DELETE",
735
+ headers: _headers,
736
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
737
+ 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,
738
+ 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,
739
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
740
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
741
+ logging: this._options.logging,
742
+ });
743
+ if (_response.ok) {
744
+ return { data: undefined, rawResponse: _response.rawResponse };
745
+ }
746
+ if (_response.error.reason === "status-code") {
747
+ switch (_response.error.statusCode) {
748
+ case 400:
749
+ throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
750
+ case 401:
751
+ throw new Corti.UnauthorizedError(_response.error.body, _response.rawResponse);
752
+ case 404:
753
+ throw new Corti.NotFoundError(_response.error.body, _response.rawResponse);
754
+ default:
755
+ throw new errors.CortiError({
756
+ statusCode: _response.error.statusCode,
757
+ body: _response.error.body,
758
+ rawResponse: _response.rawResponse,
759
+ });
760
+ }
761
+ }
762
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/agents/{id}/v1/contexts/{contextId}");
763
+ });
764
+ }
710
765
  /**
711
766
  * This endpoint retrieves the experts registry, which contains information about all available experts that can be referenced when creating agents through the AgentsCreateExpertReference schema.
712
767
  *
@@ -12,6 +12,9 @@ export * as facts from "./facts/index.js";
12
12
  export * from "./interactions/client/requests/index.js";
13
13
  export * as interactions from "./interactions/index.js";
14
14
  export * from "./interactions/types/index.js";
15
+ export * from "./languages/client/requests/index.js";
16
+ export * as languages from "./languages/index.js";
17
+ export * from "./languages/types/index.js";
15
18
  export * as recordings from "./recordings/index.js";
16
19
  export * as stream from "./stream/index.js";
17
20
  export * from "./templates/client/requests/index.js";
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.transcripts = exports.transcribe = exports.templates = exports.stream = exports.recordings = exports.interactions = exports.facts = exports.documents = exports.codes = exports.auth = exports.agents = void 0;
39
+ exports.transcripts = exports.transcribe = exports.templates = exports.stream = exports.recordings = exports.languages = exports.interactions = exports.facts = exports.documents = exports.codes = exports.auth = exports.agents = void 0;
40
40
  __exportStar(require("./agents/client/requests/index.js"), exports);
41
41
  exports.agents = __importStar(require("./agents/index.js"));
42
42
  __exportStar(require("./agents/types/index.js"), exports);
@@ -51,6 +51,9 @@ exports.facts = __importStar(require("./facts/index.js"));
51
51
  __exportStar(require("./interactions/client/requests/index.js"), exports);
52
52
  exports.interactions = __importStar(require("./interactions/index.js"));
53
53
  __exportStar(require("./interactions/types/index.js"), exports);
54
+ __exportStar(require("./languages/client/requests/index.js"), exports);
55
+ exports.languages = __importStar(require("./languages/index.js"));
56
+ __exportStar(require("./languages/types/index.js"), exports);
54
57
  exports.recordings = __importStar(require("./recordings/index.js"));
55
58
  exports.stream = __importStar(require("./stream/index.js"));
56
59
  __exportStar(require("./templates/client/requests/index.js"), exports);
@@ -0,0 +1,27 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as Corti from "../../../index.js";
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,134 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
+ return new (P || (P = Promise))(function (resolve, reject) {
39
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
43
+ });
44
+ };
45
+ Object.defineProperty(exports, "__esModule", { value: true });
46
+ exports.LanguagesClient = void 0;
47
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
48
+ const headers_js_1 = require("../../../../core/headers.js");
49
+ const core = __importStar(require("../../../../core/index.js"));
50
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
51
+ const errors = __importStar(require("../../../../errors/index.js"));
52
+ const serializers = __importStar(require("../../../../serialization/index.js"));
53
+ const Corti = __importStar(require("../../../index.js"));
54
+ class LanguagesClient {
55
+ constructor(options) {
56
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
57
+ }
58
+ /**
59
+ * Returns a list of available languages with their enabled endpoints details.
60
+ *
61
+ * @param {Corti.LanguagesListRequest} request
62
+ * @param {LanguagesClient.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link Corti.BadRequestError}
65
+ * @throws {@link Corti.InternalServerError}
66
+ *
67
+ * @example
68
+ * await client.languages.list()
69
+ */
70
+ list(request = {}, requestOptions) {
71
+ return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
72
+ }
73
+ __list() {
74
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
75
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
76
+ const { endpoint } = request;
77
+ const _queryParams = {
78
+ endpoint: endpoint != null
79
+ ? serializers.LanguagesListRequestEndpoint.jsonOrThrow(endpoint, {
80
+ unrecognizedObjectKeys: "strip",
81
+ omitUndefined: true,
82
+ })
83
+ : undefined,
84
+ };
85
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
86
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.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);
87
+ const _response = yield core.fetcher({
88
+ 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/"),
89
+ method: "GET",
90
+ headers: _headers,
91
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
92
+ 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,
93
+ 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,
94
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
95
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
96
+ logging: this._options.logging,
97
+ });
98
+ if (_response.ok) {
99
+ return {
100
+ data: serializers.LanguagesListResponse.parseOrThrow(_response.body, {
101
+ unrecognizedObjectKeys: "passthrough",
102
+ allowUnrecognizedUnionMembers: true,
103
+ allowUnrecognizedEnumValues: true,
104
+ skipValidation: true,
105
+ breadcrumbsPrefix: ["response"],
106
+ }),
107
+ rawResponse: _response.rawResponse,
108
+ };
109
+ }
110
+ if (_response.error.reason === "status-code") {
111
+ switch (_response.error.statusCode) {
112
+ case 400:
113
+ throw new Corti.BadRequestError(_response.error.body, _response.rawResponse);
114
+ case 500:
115
+ throw new Corti.InternalServerError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
116
+ unrecognizedObjectKeys: "passthrough",
117
+ allowUnrecognizedUnionMembers: true,
118
+ allowUnrecognizedEnumValues: true,
119
+ skipValidation: true,
120
+ breadcrumbsPrefix: ["response"],
121
+ }), _response.rawResponse);
122
+ default:
123
+ throw new errors.CortiError({
124
+ statusCode: _response.error.statusCode,
125
+ body: _response.error.body,
126
+ rawResponse: _response.rawResponse,
127
+ });
128
+ }
129
+ }
130
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/languages/");
131
+ });
132
+ }
133
+ }
134
+ exports.LanguagesClient = LanguagesClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -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("./requests/index.js"), exports);
@@ -0,0 +1,9 @@
1
+ import type * as Corti from "../../../../index.js";
2
+ /**
3
+ * @example
4
+ * {}
5
+ */
6
+ export interface LanguagesListRequest {
7
+ /** Field used to filter languages that supported specific endpoint. */
8
+ endpoint?: Corti.LanguagesListRequestEndpoint;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type { LanguagesListRequest } from "./LanguagesListRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.js";
2
+ export * from "./types/index.js";
@@ -0,0 +1,18 @@
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("./client/index.js"), exports);
18
+ __exportStar(require("./types/index.js"), exports);
@@ -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,10 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.LanguagesListRequestEndpoint = void 0;
5
+ /** Field used to filter languages that supported specific endpoint. */
6
+ exports.LanguagesListRequestEndpoint = {
7
+ Streams: "streams",
8
+ Transcribe: "transcribe",
9
+ Transcripts: "transcripts",
10
+ };
@@ -0,0 +1 @@
1
+ export * from "./LanguagesListRequestEndpoint.js";
@@ -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,3 @@
1
+ export interface LanguagesListResponse {
2
+ languages: Record<string, unknown>;
3
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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);
@@ -12,6 +12,8 @@ export * as facts from "./facts/index.js";
12
12
  export * from "./interactions/client/requests/index.js";
13
13
  export * as interactions from "./interactions/index.js";
14
14
  export * from "./interactions/types/index.js";
15
+ export * as languages from "./languages/index.js";
16
+ export * from "./languages/types/index.js";
15
17
  export * from "./stream/client/socket/index.js";
16
18
  export * as stream from "./stream/index.js";
17
19
  export * from "./transcribe/client/socket/index.js";
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.transcripts = exports.transcribe = exports.stream = exports.interactions = exports.facts = exports.documents = exports.codes = exports.auth = exports.agents = void 0;
39
+ exports.transcripts = exports.transcribe = exports.stream = exports.languages = exports.interactions = exports.facts = exports.documents = exports.codes = exports.auth = exports.agents = void 0;
40
40
  __exportStar(require("./agents/client/requests/index.js"), exports);
41
41
  exports.agents = __importStar(require("./agents/index.js"));
42
42
  __exportStar(require("./agents/types/index.js"), exports);
@@ -51,6 +51,8 @@ exports.facts = __importStar(require("./facts/index.js"));
51
51
  __exportStar(require("./interactions/client/requests/index.js"), exports);
52
52
  exports.interactions = __importStar(require("./interactions/index.js"));
53
53
  __exportStar(require("./interactions/types/index.js"), exports);
54
+ exports.languages = __importStar(require("./languages/index.js"));
55
+ __exportStar(require("./languages/types/index.js"), exports);
54
56
  __exportStar(require("./stream/client/socket/index.js"), exports);
55
57
  exports.stream = __importStar(require("./stream/index.js"));
56
58
  __exportStar(require("./transcribe/client/socket/index.js"), exports);
@@ -0,0 +1 @@
1
+ export * from "./types/index.js";
@@ -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("./types/index.js"), exports);
@@ -0,0 +1,7 @@
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 LanguagesListRequestEndpoint: core.serialization.Schema<serializers.LanguagesListRequestEndpoint.Raw, Corti.LanguagesListRequestEndpoint>;
5
+ export declare namespace LanguagesListRequestEndpoint {
6
+ type Raw = "streams" | "transcribe" | "transcripts";
7
+ }
@@ -0,0 +1,39 @@
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.LanguagesListRequestEndpoint = void 0;
38
+ const core = __importStar(require("../../../../core/index.js"));
39
+ exports.LanguagesListRequestEndpoint = core.serialization.enum_(["streams", "transcribe", "transcripts"]);
@@ -0,0 +1 @@
1
+ export * from "./LanguagesListRequestEndpoint.js";