@corti/sdk 3.0.0 → 3.1.0-rc
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/custom/CortiClient.d.ts +14 -0
- package/dist/cjs/custom/CortiClient.js +21 -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/custom/CortiClient.d.mts +14 -0
- package/dist/esm/custom/CortiClient.mjs +21 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -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": "3.
|
|
47
|
-
"User-Agent": "@corti/sdk/3.
|
|
46
|
+
"X-Fern-SDK-Version": "3.1.0-rc",
|
|
47
|
+
"User-Agent": "@corti/sdk/3.1.0-rc",
|
|
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,
|
|
@@ -48,6 +48,20 @@ export declare class CortiClient extends BaseCortiClient {
|
|
|
48
48
|
get stream(): CustomStream;
|
|
49
49
|
get transcribe(): CustomTranscribe;
|
|
50
50
|
get agents(): CustomAgents;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the full set of URLs the client is configured to use.
|
|
53
|
+
*
|
|
54
|
+
* If a custom `baseUrl` was provided it overrides the `base` field; all
|
|
55
|
+
* other URLs are derived from the configured environment.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const client = new CortiClient({ environment: "eu", ... });
|
|
60
|
+
* const urls = await client.getEnvironmentUrls();
|
|
61
|
+
* // { base: "https://api.eu.corti.app/v2", wss: "wss://...", login: "https://...", agents: "https://..." }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
getEnvironmentUrls: () => Promise<environments.CortiEnvironmentUrls>;
|
|
51
65
|
/**
|
|
52
66
|
* Retrieves authentication headers for API requests.
|
|
53
67
|
*
|
|
@@ -59,6 +59,27 @@ class CortiClient extends Client_js_1.CortiClient {
|
|
|
59
59
|
const ctx = (0, resolveClientOptions_js_1.resolveClientOptions)(options);
|
|
60
60
|
const restOptions = Object.assign(Object.assign(Object.assign({}, opts), { tenantName: ctx.tenantName, environment: (0, environment_js_1.getEnvironment)(ctx.environment) }), (ctx.initialTokenResponse != null ? { initialTokenResponse: ctx.initialTokenResponse } : {}));
|
|
61
61
|
super((0, authToBaseOptions_js_1.authToBaseOptions)(opts.auth, restOptions));
|
|
62
|
+
/**
|
|
63
|
+
* Returns the full set of URLs the client is configured to use.
|
|
64
|
+
*
|
|
65
|
+
* If a custom `baseUrl` was provided it overrides the `base` field; all
|
|
66
|
+
* other URLs are derived from the configured environment.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```typescript
|
|
70
|
+
* const client = new CortiClient({ environment: "eu", ... });
|
|
71
|
+
* const urls = await client.getEnvironmentUrls();
|
|
72
|
+
* // { base: "https://api.eu.corti.app/v2", wss: "wss://...", login: "https://...", agents: "https://..." }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
this.getEnvironmentUrls = () => __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const baseUrl = yield core.Supplier.get(this._options.baseUrl);
|
|
77
|
+
// baseUrl is a universal override: all generated clients use `baseUrl ?? env.<field>`.
|
|
78
|
+
// Resolve environment only in the fallback path to avoid triggering auth discovery needlessly.
|
|
79
|
+
if (baseUrl != null)
|
|
80
|
+
return { base: baseUrl, wss: baseUrl, login: baseUrl, agents: baseUrl };
|
|
81
|
+
return yield core.Supplier.get(this._options.environment);
|
|
82
|
+
});
|
|
62
83
|
/**
|
|
63
84
|
* Retrieves authentication headers for API requests.
|
|
64
85
|
*
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.
|
|
1
|
+
export declare const SDK_VERSION = "3.1.0-rc";
|
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": "3.
|
|
10
|
-
"User-Agent": "@corti/sdk/3.
|
|
9
|
+
"X-Fern-SDK-Version": "3.1.0-rc",
|
|
10
|
+
"User-Agent": "@corti/sdk/3.1.0-rc",
|
|
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,
|
|
@@ -48,6 +48,20 @@ export declare class CortiClient extends BaseCortiClient {
|
|
|
48
48
|
get stream(): CustomStream;
|
|
49
49
|
get transcribe(): CustomTranscribe;
|
|
50
50
|
get agents(): CustomAgents;
|
|
51
|
+
/**
|
|
52
|
+
* Returns the full set of URLs the client is configured to use.
|
|
53
|
+
*
|
|
54
|
+
* If a custom `baseUrl` was provided it overrides the `base` field; all
|
|
55
|
+
* other URLs are derived from the configured environment.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const client = new CortiClient({ environment: "eu", ... });
|
|
60
|
+
* const urls = await client.getEnvironmentUrls();
|
|
61
|
+
* // { base: "https://api.eu.corti.app/v2", wss: "wss://...", login: "https://...", agents: "https://..." }
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
getEnvironmentUrls: () => Promise<environments.CortiEnvironmentUrls>;
|
|
51
65
|
/**
|
|
52
66
|
* Retrieves authentication headers for API requests.
|
|
53
67
|
*
|
|
@@ -23,6 +23,27 @@ export class CortiClient extends BaseCortiClient {
|
|
|
23
23
|
const ctx = resolveClientOptions(options);
|
|
24
24
|
const restOptions = Object.assign(Object.assign(Object.assign({}, opts), { tenantName: ctx.tenantName, environment: getEnvironment(ctx.environment) }), (ctx.initialTokenResponse != null ? { initialTokenResponse: ctx.initialTokenResponse } : {}));
|
|
25
25
|
super(authToBaseOptions(opts.auth, restOptions));
|
|
26
|
+
/**
|
|
27
|
+
* Returns the full set of URLs the client is configured to use.
|
|
28
|
+
*
|
|
29
|
+
* If a custom `baseUrl` was provided it overrides the `base` field; all
|
|
30
|
+
* other URLs are derived from the configured environment.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const client = new CortiClient({ environment: "eu", ... });
|
|
35
|
+
* const urls = await client.getEnvironmentUrls();
|
|
36
|
+
* // { base: "https://api.eu.corti.app/v2", wss: "wss://...", login: "https://...", agents: "https://..." }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
this.getEnvironmentUrls = () => __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const baseUrl = yield core.Supplier.get(this._options.baseUrl);
|
|
41
|
+
// baseUrl is a universal override: all generated clients use `baseUrl ?? env.<field>`.
|
|
42
|
+
// Resolve environment only in the fallback path to avoid triggering auth discovery needlessly.
|
|
43
|
+
if (baseUrl != null)
|
|
44
|
+
return { base: baseUrl, wss: baseUrl, login: baseUrl, agents: baseUrl };
|
|
45
|
+
return yield core.Supplier.get(this._options.environment);
|
|
46
|
+
});
|
|
26
47
|
/**
|
|
27
48
|
* Retrieves authentication headers for API requests.
|
|
28
49
|
*
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "3.
|
|
1
|
+
export declare const SDK_VERSION = "3.1.0-rc";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "3.
|
|
1
|
+
export const SDK_VERSION = "3.1.0-rc";
|