@corti/sdk 0.1.2-rc → 0.1.2-rc.4
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/api/index.d.ts +4 -0
- package/dist/cjs/api/index.js +4 -0
- package/dist/cjs/custom/CortiClient.js +2 -2
- package/dist/cjs/custom/RefreshBearerProvider.d.ts +4 -1
- package/dist/cjs/custom/index.d.ts +1 -0
- package/dist/cjs/custom/index.js +17 -0
- package/dist/esm/api/index.d.mts +4 -0
- package/dist/esm/api/index.mjs +4 -0
- package/dist/esm/custom/CortiClient.mjs +2 -2
- package/dist/esm/custom/RefreshBearerProvider.d.mts +4 -1
- package/dist/esm/custom/index.d.mts +1 -0
- package/dist/esm/custom/index.mjs +1 -0
- package/package.json +1 -1
package/dist/cjs/api/index.d.ts
CHANGED
package/dist/cjs/api/index.js
CHANGED
|
@@ -17,3 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./resources/index.js"), exports);
|
|
18
18
|
__exportStar(require("./types/index.js"), exports);
|
|
19
19
|
__exportStar(require("./errors/index.js"), exports);
|
|
20
|
+
/**
|
|
21
|
+
* Patch: including custom types to main export of types
|
|
22
|
+
*/
|
|
23
|
+
__exportStar(require("../custom/index.js"), exports);
|
|
@@ -100,9 +100,9 @@ class CortiClient {
|
|
|
100
100
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
101
101
|
}, _options === null || _options === void 0 ? void 0 : _options.headers), clientId: "clientId" in _options.auth ? _options.auth.clientId : undefined, clientSecret: "clientSecret" in _options.auth ? _options.auth.clientSecret : undefined, token: "accessToken" in _options.auth ? _options.auth.accessToken : undefined, environment: (0, getEnvironmentFromString_js_1.getEnvironment)(_options.environment) });
|
|
102
102
|
/**
|
|
103
|
-
* Patch: if `
|
|
103
|
+
* Patch: if `clientId` is provided, use OAuthTokenProvider, otherwise use BearerProvider
|
|
104
104
|
*/
|
|
105
|
-
this._oauthTokenProvider = "
|
|
105
|
+
this._oauthTokenProvider = "clientId" in _options.auth ?
|
|
106
106
|
new core.OAuthTokenProvider({
|
|
107
107
|
clientId: _options.auth.clientId,
|
|
108
108
|
clientSecret: _options.auth.clientSecret,
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as core from "../core/index.js";
|
|
5
5
|
import * as api from "../api/index.js";
|
|
6
|
-
type
|
|
6
|
+
type ExpectedTokenResponse = Omit<api.GetTokenResponse, 'tokenType'> & {
|
|
7
|
+
tokenType?: string;
|
|
8
|
+
};
|
|
9
|
+
type RefreshAccessTokenFunction = (refreshToken?: string) => Promise<ExpectedTokenResponse> | ExpectedTokenResponse;
|
|
7
10
|
export type BearerOptions = Partial<Omit<api.GetTokenResponse, 'accessToken'>> & ({
|
|
8
11
|
refreshAccessToken?: RefreshAccessTokenFunction;
|
|
9
12
|
accessToken: core.Supplier<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RefreshBearerProvider.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("./RefreshBearerProvider.js"), exports);
|
package/dist/esm/api/index.d.mts
CHANGED
package/dist/esm/api/index.mjs
CHANGED
|
@@ -64,9 +64,9 @@ export class CortiClient {
|
|
|
64
64
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
65
65
|
}, _options === null || _options === void 0 ? void 0 : _options.headers), clientId: "clientId" in _options.auth ? _options.auth.clientId : undefined, clientSecret: "clientSecret" in _options.auth ? _options.auth.clientSecret : undefined, token: "accessToken" in _options.auth ? _options.auth.accessToken : undefined, environment: getEnvironment(_options.environment) });
|
|
66
66
|
/**
|
|
67
|
-
* Patch: if `
|
|
67
|
+
* Patch: if `clientId` is provided, use OAuthTokenProvider, otherwise use BearerProvider
|
|
68
68
|
*/
|
|
69
|
-
this._oauthTokenProvider = "
|
|
69
|
+
this._oauthTokenProvider = "clientId" in _options.auth ?
|
|
70
70
|
new core.OAuthTokenProvider({
|
|
71
71
|
clientId: _options.auth.clientId,
|
|
72
72
|
clientSecret: _options.auth.clientSecret,
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import * as core from "../core/index.mjs";
|
|
5
5
|
import * as api from "../api/index.mjs";
|
|
6
|
-
type
|
|
6
|
+
type ExpectedTokenResponse = Omit<api.GetTokenResponse, 'tokenType'> & {
|
|
7
|
+
tokenType?: string;
|
|
8
|
+
};
|
|
9
|
+
type RefreshAccessTokenFunction = (refreshToken?: string) => Promise<ExpectedTokenResponse> | ExpectedTokenResponse;
|
|
7
10
|
export type BearerOptions = Partial<Omit<api.GetTokenResponse, 'accessToken'>> & ({
|
|
8
11
|
refreshAccessToken?: RefreshAccessTokenFunction;
|
|
9
12
|
accessToken: core.Supplier<string>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RefreshBearerProvider.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./RefreshBearerProvider.mjs";
|