@corti/sdk 1.0.0-rc.4 → 1.0.0-rc.5
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 +5 -69
- package/dist/cjs/custom/auth/CortiAuth.d.ts +26 -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 +5 -69
- package/dist/esm/custom/auth/CortiAuth.d.mts +26 -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": "1.0.0-rc.
|
|
47
|
-
"User-Agent": "@corti/sdk/1.0.0-rc.
|
|
46
|
+
"X-Fern-SDK-Version": "1.0.0-rc.5",
|
|
47
|
+
"User-Agent": "@corti/sdk/1.0.0-rc.5",
|
|
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,
|
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
import type { OAuthAuthProvider } from "../auth/OAuthAuthProvider.js";
|
|
2
1
|
import { CortiClient as BaseCortiClient } from "../Client.js";
|
|
3
2
|
import type * as environments from "../environments.js";
|
|
4
3
|
import { CortiAuth } from "./auth/CortiAuth.js";
|
|
5
4
|
import { CustomStream } from "./stream/CustomStream.js";
|
|
6
5
|
import { CustomTranscribe } from "./transcribe/CustomTranscribe.js";
|
|
7
6
|
import { type Environment } from "./utils/environment.js";
|
|
8
|
-
type TokenDerivableAuth = {
|
|
9
|
-
accessToken: string;
|
|
10
|
-
refreshAccessToken?: OAuthAuthProvider.RefreshAccessTokenFunction;
|
|
11
|
-
expiresIn?: number;
|
|
12
|
-
refreshToken?: string;
|
|
13
|
-
refreshExpiresIn?: number;
|
|
14
|
-
clientId?: string;
|
|
15
|
-
} | {
|
|
16
|
-
refreshAccessToken: OAuthAuthProvider.RefreshAccessTokenFunction;
|
|
17
|
-
accessToken?: string;
|
|
18
|
-
expiresIn?: number;
|
|
19
|
-
refreshToken?: string;
|
|
20
|
-
refreshExpiresIn?: number;
|
|
21
|
-
clientId?: string;
|
|
22
|
-
};
|
|
23
7
|
type OptionsBase = Omit<BaseCortiClient.Options, "clientId" | "clientSecret" | "token" | "environment" | "tenantName" | "baseUrl"> & {
|
|
24
8
|
withCredentials?: boolean;
|
|
25
9
|
/**
|
|
@@ -30,71 +14,23 @@ type OptionsBase = Omit<BaseCortiClient.Options, "clientId" | "clientSecret" | "
|
|
|
30
14
|
encodeHeadersAsWsProtocols?: boolean;
|
|
31
15
|
};
|
|
32
16
|
export declare namespace CortiClient {
|
|
33
|
-
type Auth =
|
|
34
|
-
clientId: string;
|
|
35
|
-
clientSecret: string;
|
|
36
|
-
} | {
|
|
37
|
-
accessToken: string;
|
|
38
|
-
refreshAccessToken?: OAuthAuthProvider.RefreshAccessTokenFunction;
|
|
39
|
-
expiresIn?: number;
|
|
40
|
-
refreshToken?: string;
|
|
41
|
-
refreshExpiresIn?: number;
|
|
42
|
-
clientId?: string;
|
|
43
|
-
} | {
|
|
44
|
-
clientId: string;
|
|
45
|
-
username: string;
|
|
46
|
-
password: string;
|
|
47
|
-
} | {
|
|
48
|
-
clientId: string;
|
|
49
|
-
clientSecret: string;
|
|
50
|
-
code: string;
|
|
51
|
-
redirectUri: string;
|
|
52
|
-
} | {
|
|
53
|
-
clientId: string;
|
|
54
|
-
code: string;
|
|
55
|
-
redirectUri: string;
|
|
56
|
-
codeVerifier?: string;
|
|
57
|
-
} | {
|
|
58
|
-
refreshAccessToken: OAuthAuthProvider.RefreshAccessTokenFunction;
|
|
59
|
-
accessToken?: string;
|
|
60
|
-
expiresIn?: number;
|
|
61
|
-
refreshToken?: string;
|
|
62
|
-
refreshExpiresIn?: number;
|
|
63
|
-
clientId?: string;
|
|
64
|
-
};
|
|
17
|
+
type Auth = CortiAuth.AuthServer | CortiAuth.AuthTokenDerivable;
|
|
65
18
|
type Options = (OptionsBase & {
|
|
66
|
-
auth:
|
|
67
|
-
clientId: string;
|
|
68
|
-
clientSecret: string;
|
|
69
|
-
} | {
|
|
70
|
-
clientId: string;
|
|
71
|
-
username: string;
|
|
72
|
-
password: string;
|
|
73
|
-
} | {
|
|
74
|
-
clientId: string;
|
|
75
|
-
clientSecret: string;
|
|
76
|
-
code: string;
|
|
77
|
-
redirectUri: string;
|
|
78
|
-
} | {
|
|
79
|
-
clientId: string;
|
|
80
|
-
code: string;
|
|
81
|
-
redirectUri: string;
|
|
82
|
-
codeVerifier?: string;
|
|
83
|
-
};
|
|
19
|
+
auth: CortiAuth.AuthServer;
|
|
84
20
|
tenantName: string;
|
|
85
21
|
environment: Environment;
|
|
86
22
|
}) | (OptionsBase & {
|
|
87
|
-
auth:
|
|
23
|
+
auth: CortiAuth.AuthTokenDerivable;
|
|
88
24
|
tenantName?: string;
|
|
89
25
|
environment?: Environment;
|
|
90
26
|
}) | (OptionsBase & {
|
|
91
27
|
baseUrl: string;
|
|
92
|
-
auth?:
|
|
28
|
+
auth?: Auth;
|
|
93
29
|
tenantName?: string;
|
|
94
30
|
environment?: Environment;
|
|
95
31
|
}) | (OptionsBase & {
|
|
96
32
|
environment: environments.CortiEnvironmentUrls;
|
|
97
|
-
auth?:
|
|
33
|
+
auth?: Auth;
|
|
98
34
|
tenantName?: string;
|
|
99
35
|
});
|
|
100
36
|
interface RequestOptions extends BaseCortiClient.RequestOptions {
|
|
@@ -45,6 +45,32 @@ export declare namespace CortiAuth {
|
|
|
45
45
|
codeVerifier?: string;
|
|
46
46
|
scopes?: string[];
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Auth shapes used by `CortiClient` when passing `auth: ...`.
|
|
50
|
+
*/
|
|
51
|
+
type AuthClientCredentials = {
|
|
52
|
+
clientId: string;
|
|
53
|
+
clientSecret: string;
|
|
54
|
+
};
|
|
55
|
+
type AuthRopc = Omit<GetRopcFlowTokenRequest, "scopes">;
|
|
56
|
+
type AuthCode = Omit<GetCodeFlowTokenRequest, "scopes">;
|
|
57
|
+
type AuthPkce = Omit<GetPkceFlowTokenRequest, "scopes">;
|
|
58
|
+
type AuthTokenDerivable = {
|
|
59
|
+
accessToken: string;
|
|
60
|
+
refreshAccessToken?: OAuthAuthProvider.RefreshAccessTokenFunction;
|
|
61
|
+
expiresIn?: number;
|
|
62
|
+
refreshToken?: string;
|
|
63
|
+
refreshExpiresIn?: number;
|
|
64
|
+
clientId?: string;
|
|
65
|
+
} | {
|
|
66
|
+
refreshAccessToken: OAuthAuthProvider.RefreshAccessTokenFunction;
|
|
67
|
+
accessToken?: string;
|
|
68
|
+
expiresIn?: number;
|
|
69
|
+
refreshToken?: string;
|
|
70
|
+
refreshExpiresIn?: number;
|
|
71
|
+
clientId?: string;
|
|
72
|
+
};
|
|
73
|
+
type AuthServer = AuthClientCredentials | AuthRopc | AuthCode | AuthPkce;
|
|
48
74
|
/** Parameters for authorizeURL — builds the Keycloak authorization endpoint URL. */
|
|
49
75
|
interface AuthorizationCodeClient {
|
|
50
76
|
clientId: string;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.0-rc.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.0-rc.5";
|
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": "1.0.0-rc.
|
|
10
|
-
"User-Agent": "@corti/sdk/1.0.0-rc.
|
|
9
|
+
"X-Fern-SDK-Version": "1.0.0-rc.5",
|
|
10
|
+
"User-Agent": "@corti/sdk/1.0.0-rc.5",
|
|
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,
|
|
@@ -1,25 +1,9 @@
|
|
|
1
|
-
import type { OAuthAuthProvider } from "../auth/OAuthAuthProvider.mjs";
|
|
2
1
|
import { CortiClient as BaseCortiClient } from "../Client.mjs";
|
|
3
2
|
import type * as environments from "../environments.mjs";
|
|
4
3
|
import { CortiAuth } from "./auth/CortiAuth.mjs";
|
|
5
4
|
import { CustomStream } from "./stream/CustomStream.mjs";
|
|
6
5
|
import { CustomTranscribe } from "./transcribe/CustomTranscribe.mjs";
|
|
7
6
|
import { type Environment } from "./utils/environment.mjs";
|
|
8
|
-
type TokenDerivableAuth = {
|
|
9
|
-
accessToken: string;
|
|
10
|
-
refreshAccessToken?: OAuthAuthProvider.RefreshAccessTokenFunction;
|
|
11
|
-
expiresIn?: number;
|
|
12
|
-
refreshToken?: string;
|
|
13
|
-
refreshExpiresIn?: number;
|
|
14
|
-
clientId?: string;
|
|
15
|
-
} | {
|
|
16
|
-
refreshAccessToken: OAuthAuthProvider.RefreshAccessTokenFunction;
|
|
17
|
-
accessToken?: string;
|
|
18
|
-
expiresIn?: number;
|
|
19
|
-
refreshToken?: string;
|
|
20
|
-
refreshExpiresIn?: number;
|
|
21
|
-
clientId?: string;
|
|
22
|
-
};
|
|
23
7
|
type OptionsBase = Omit<BaseCortiClient.Options, "clientId" | "clientSecret" | "token" | "environment" | "tenantName" | "baseUrl"> & {
|
|
24
8
|
withCredentials?: boolean;
|
|
25
9
|
/**
|
|
@@ -30,71 +14,23 @@ type OptionsBase = Omit<BaseCortiClient.Options, "clientId" | "clientSecret" | "
|
|
|
30
14
|
encodeHeadersAsWsProtocols?: boolean;
|
|
31
15
|
};
|
|
32
16
|
export declare namespace CortiClient {
|
|
33
|
-
type Auth =
|
|
34
|
-
clientId: string;
|
|
35
|
-
clientSecret: string;
|
|
36
|
-
} | {
|
|
37
|
-
accessToken: string;
|
|
38
|
-
refreshAccessToken?: OAuthAuthProvider.RefreshAccessTokenFunction;
|
|
39
|
-
expiresIn?: number;
|
|
40
|
-
refreshToken?: string;
|
|
41
|
-
refreshExpiresIn?: number;
|
|
42
|
-
clientId?: string;
|
|
43
|
-
} | {
|
|
44
|
-
clientId: string;
|
|
45
|
-
username: string;
|
|
46
|
-
password: string;
|
|
47
|
-
} | {
|
|
48
|
-
clientId: string;
|
|
49
|
-
clientSecret: string;
|
|
50
|
-
code: string;
|
|
51
|
-
redirectUri: string;
|
|
52
|
-
} | {
|
|
53
|
-
clientId: string;
|
|
54
|
-
code: string;
|
|
55
|
-
redirectUri: string;
|
|
56
|
-
codeVerifier?: string;
|
|
57
|
-
} | {
|
|
58
|
-
refreshAccessToken: OAuthAuthProvider.RefreshAccessTokenFunction;
|
|
59
|
-
accessToken?: string;
|
|
60
|
-
expiresIn?: number;
|
|
61
|
-
refreshToken?: string;
|
|
62
|
-
refreshExpiresIn?: number;
|
|
63
|
-
clientId?: string;
|
|
64
|
-
};
|
|
17
|
+
type Auth = CortiAuth.AuthServer | CortiAuth.AuthTokenDerivable;
|
|
65
18
|
type Options = (OptionsBase & {
|
|
66
|
-
auth:
|
|
67
|
-
clientId: string;
|
|
68
|
-
clientSecret: string;
|
|
69
|
-
} | {
|
|
70
|
-
clientId: string;
|
|
71
|
-
username: string;
|
|
72
|
-
password: string;
|
|
73
|
-
} | {
|
|
74
|
-
clientId: string;
|
|
75
|
-
clientSecret: string;
|
|
76
|
-
code: string;
|
|
77
|
-
redirectUri: string;
|
|
78
|
-
} | {
|
|
79
|
-
clientId: string;
|
|
80
|
-
code: string;
|
|
81
|
-
redirectUri: string;
|
|
82
|
-
codeVerifier?: string;
|
|
83
|
-
};
|
|
19
|
+
auth: CortiAuth.AuthServer;
|
|
84
20
|
tenantName: string;
|
|
85
21
|
environment: Environment;
|
|
86
22
|
}) | (OptionsBase & {
|
|
87
|
-
auth:
|
|
23
|
+
auth: CortiAuth.AuthTokenDerivable;
|
|
88
24
|
tenantName?: string;
|
|
89
25
|
environment?: Environment;
|
|
90
26
|
}) | (OptionsBase & {
|
|
91
27
|
baseUrl: string;
|
|
92
|
-
auth?:
|
|
28
|
+
auth?: Auth;
|
|
93
29
|
tenantName?: string;
|
|
94
30
|
environment?: Environment;
|
|
95
31
|
}) | (OptionsBase & {
|
|
96
32
|
environment: environments.CortiEnvironmentUrls;
|
|
97
|
-
auth?:
|
|
33
|
+
auth?: Auth;
|
|
98
34
|
tenantName?: string;
|
|
99
35
|
});
|
|
100
36
|
interface RequestOptions extends BaseCortiClient.RequestOptions {
|
|
@@ -45,6 +45,32 @@ export declare namespace CortiAuth {
|
|
|
45
45
|
codeVerifier?: string;
|
|
46
46
|
scopes?: string[];
|
|
47
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Auth shapes used by `CortiClient` when passing `auth: ...`.
|
|
50
|
+
*/
|
|
51
|
+
type AuthClientCredentials = {
|
|
52
|
+
clientId: string;
|
|
53
|
+
clientSecret: string;
|
|
54
|
+
};
|
|
55
|
+
type AuthRopc = Omit<GetRopcFlowTokenRequest, "scopes">;
|
|
56
|
+
type AuthCode = Omit<GetCodeFlowTokenRequest, "scopes">;
|
|
57
|
+
type AuthPkce = Omit<GetPkceFlowTokenRequest, "scopes">;
|
|
58
|
+
type AuthTokenDerivable = {
|
|
59
|
+
accessToken: string;
|
|
60
|
+
refreshAccessToken?: OAuthAuthProvider.RefreshAccessTokenFunction;
|
|
61
|
+
expiresIn?: number;
|
|
62
|
+
refreshToken?: string;
|
|
63
|
+
refreshExpiresIn?: number;
|
|
64
|
+
clientId?: string;
|
|
65
|
+
} | {
|
|
66
|
+
refreshAccessToken: OAuthAuthProvider.RefreshAccessTokenFunction;
|
|
67
|
+
accessToken?: string;
|
|
68
|
+
expiresIn?: number;
|
|
69
|
+
refreshToken?: string;
|
|
70
|
+
refreshExpiresIn?: number;
|
|
71
|
+
clientId?: string;
|
|
72
|
+
};
|
|
73
|
+
type AuthServer = AuthClientCredentials | AuthRopc | AuthCode | AuthPkce;
|
|
48
74
|
/** Parameters for authorizeURL — builds the Keycloak authorization endpoint URL. */
|
|
49
75
|
interface AuthorizationCodeClient {
|
|
50
76
|
clientId: string;
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.0.0-rc.
|
|
1
|
+
export declare const SDK_VERSION = "1.0.0-rc.5";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.0.0-rc.
|
|
1
|
+
export const SDK_VERSION = "1.0.0-rc.5";
|