@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.
@@ -1,3 +1,7 @@
1
1
  export * from "./resources/index.js";
2
2
  export * from "./types/index.js";
3
3
  export * from "./errors/index.js";
4
+ /**
5
+ * Patch: including custom types to main export of types
6
+ */
7
+ export * from "../custom/index.js";
@@ -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 `accessToken` is provided, use BearerProvider, otherwise use OAuthTokenProvider
103
+ * Patch: if `clientId` is provided, use OAuthTokenProvider, otherwise use BearerProvider
104
104
  */
105
- this._oauthTokenProvider = "clientSecret" in _options.auth ?
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 RefreshAccessTokenFunction = (refreshToken?: string) => Promise<api.GetTokenResponse> | api.GetTokenResponse;
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);
@@ -1,3 +1,7 @@
1
1
  export * from "./resources/index.mjs";
2
2
  export * from "./types/index.mjs";
3
3
  export * from "./errors/index.mjs";
4
+ /**
5
+ * Patch: including custom types to main export of types
6
+ */
7
+ export * from "../custom/index.mjs";
@@ -1,3 +1,7 @@
1
1
  export * from "./resources/index.mjs";
2
2
  export * from "./types/index.mjs";
3
3
  export * from "./errors/index.mjs";
4
+ /**
5
+ * Patch: including custom types to main export of types
6
+ */
7
+ export * from "../custom/index.mjs";
@@ -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 `accessToken` is provided, use BearerProvider, otherwise use OAuthTokenProvider
67
+ * Patch: if `clientId` is provided, use OAuthTokenProvider, otherwise use BearerProvider
68
68
  */
69
- this._oauthTokenProvider = "clientSecret" in _options.auth ?
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 RefreshAccessTokenFunction = (refreshToken?: string) => Promise<api.GetTokenResponse> | api.GetTokenResponse;
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";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corti/sdk",
3
- "version": "0.1.2-rc",
3
+ "version": "0.1.2-rc.4",
4
4
  "private": false,
5
5
  "repository": "github:corticph/corti-sdk-javascript",
6
6
  "license": "MIT",