@fern-api/venus-api-sdk 2.0.0 → 2.1.0
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/README.md +1 -1
- package/dist/cjs/BaseClient.d.ts +8 -2
- package/dist/cjs/BaseClient.js +14 -2
- package/dist/cjs/Client.d.ts +2 -2
- package/dist/cjs/Client.js +1 -1
- package/dist/cjs/api/resources/apiKeys/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/apiKeys/client/Client.js +11 -6
- package/dist/cjs/api/resources/auth/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/auth/client/Client.js +5 -3
- package/dist/cjs/api/resources/organization/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/organization/client/Client.js +25 -13
- package/dist/cjs/api/resources/registry/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/registry/client/Client.js +5 -3
- package/dist/cjs/api/resources/user/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/user/client/Client.js +7 -4
- package/dist/cjs/auth/BearerAuthProvider.d.ts +20 -0
- package/dist/cjs/auth/BearerAuthProvider.js +76 -0
- package/dist/cjs/auth/index.d.ts +1 -0
- package/dist/cjs/auth/index.js +5 -0
- package/dist/cjs/core/auth/AuthProvider.d.ts +7 -0
- package/dist/cjs/core/auth/AuthProvider.js +2 -0
- package/dist/cjs/core/auth/AuthRequest.d.ts +9 -0
- package/dist/cjs/core/auth/AuthRequest.js +2 -0
- package/dist/cjs/core/auth/BasicAuth.d.ts +8 -0
- package/dist/cjs/core/auth/BasicAuth.js +27 -0
- package/dist/cjs/core/auth/BearerToken.d.ts +7 -0
- package/dist/cjs/core/auth/BearerToken.js +16 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/cjs/core/auth/NoOpAuthProvider.js +9 -0
- package/dist/cjs/core/auth/index.d.ts +5 -0
- package/dist/cjs/core/auth/index.js +9 -0
- package/dist/cjs/core/base64.d.ts +2 -0
- package/dist/cjs/core/base64.js +26 -0
- package/dist/cjs/core/index.d.ts +2 -0
- package/dist/cjs/core/index.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +8 -2
- package/dist/esm/BaseClient.mjs +13 -2
- package/dist/esm/Client.d.mts +2 -2
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/apiKeys/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/apiKeys/client/Client.mjs +12 -7
- package/dist/esm/api/resources/auth/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/auth/client/Client.mjs +6 -4
- package/dist/esm/api/resources/organization/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/organization/client/Client.mjs +26 -14
- package/dist/esm/api/resources/registry/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/registry/client/Client.mjs +6 -4
- package/dist/esm/api/resources/user/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/user/client/Client.mjs +8 -5
- package/dist/esm/auth/BearerAuthProvider.d.mts +20 -0
- package/dist/esm/auth/BearerAuthProvider.mjs +39 -0
- package/dist/esm/auth/index.d.mts +1 -0
- package/dist/esm/auth/index.mjs +1 -0
- package/dist/esm/core/auth/AuthProvider.d.mts +7 -0
- package/dist/esm/core/auth/AuthProvider.mjs +1 -0
- package/dist/esm/core/auth/AuthRequest.d.mts +9 -0
- package/dist/esm/core/auth/AuthRequest.mjs +1 -0
- package/dist/esm/core/auth/BasicAuth.d.mts +8 -0
- package/dist/esm/core/auth/BasicAuth.mjs +24 -0
- package/dist/esm/core/auth/BearerToken.d.mts +7 -0
- package/dist/esm/core/auth/BearerToken.mjs +13 -0
- package/dist/esm/core/auth/NoOpAuthProvider.d.mts +5 -0
- package/dist/esm/core/auth/NoOpAuthProvider.mjs +5 -0
- package/dist/esm/core/auth/index.d.mts +5 -0
- package/dist/esm/core/auth/index.mjs +3 -0
- package/dist/esm/core/base64.d.mts +2 -0
- package/dist/esm/core/base64.mjs +22 -0
- package/dist/esm/core/index.d.mts +2 -0
- package/dist/esm/core/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BasicAuth = void 0;
|
|
4
|
+
const base64_js_1 = require("../base64.js");
|
|
5
|
+
const BASIC_AUTH_HEADER_PREFIX = /^Basic /i;
|
|
6
|
+
exports.BasicAuth = {
|
|
7
|
+
toAuthorizationHeader: (basicAuth) => {
|
|
8
|
+
if (basicAuth == null) {
|
|
9
|
+
return undefined;
|
|
10
|
+
}
|
|
11
|
+
const token = (0, base64_js_1.base64Encode)(`${basicAuth.username}:${basicAuth.password}`);
|
|
12
|
+
return `Basic ${token}`;
|
|
13
|
+
},
|
|
14
|
+
fromAuthorizationHeader: (header) => {
|
|
15
|
+
const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, "");
|
|
16
|
+
const decoded = (0, base64_js_1.base64Decode)(credentials);
|
|
17
|
+
const [username, ...passwordParts] = decoded.split(":");
|
|
18
|
+
const password = passwordParts.length > 0 ? passwordParts.join(":") : undefined;
|
|
19
|
+
if (username == null || password == null) {
|
|
20
|
+
throw new Error("Invalid basic auth");
|
|
21
|
+
}
|
|
22
|
+
return {
|
|
23
|
+
username,
|
|
24
|
+
password,
|
|
25
|
+
};
|
|
26
|
+
},
|
|
27
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type BearerToken = string;
|
|
2
|
+
declare function toAuthorizationHeader(token: string | undefined): string | undefined;
|
|
3
|
+
export declare const BearerToken: {
|
|
4
|
+
toAuthorizationHeader: typeof toAuthorizationHeader;
|
|
5
|
+
fromAuthorizationHeader: (header: string) => BearerToken;
|
|
6
|
+
};
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BearerToken = void 0;
|
|
4
|
+
const BEARER_AUTH_HEADER_PREFIX = /^Bearer /i;
|
|
5
|
+
function toAuthorizationHeader(token) {
|
|
6
|
+
if (token == null) {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
return `Bearer ${token}`;
|
|
10
|
+
}
|
|
11
|
+
exports.BearerToken = {
|
|
12
|
+
toAuthorizationHeader: toAuthorizationHeader,
|
|
13
|
+
fromAuthorizationHeader: (header) => {
|
|
14
|
+
return header.replace(BEARER_AUTH_HEADER_PREFIX, "").trim();
|
|
15
|
+
},
|
|
16
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NoOpAuthProvider = exports.BearerToken = exports.BasicAuth = void 0;
|
|
4
|
+
var BasicAuth_js_1 = require("./BasicAuth.js");
|
|
5
|
+
Object.defineProperty(exports, "BasicAuth", { enumerable: true, get: function () { return BasicAuth_js_1.BasicAuth; } });
|
|
6
|
+
var BearerToken_js_1 = require("./BearerToken.js");
|
|
7
|
+
Object.defineProperty(exports, "BearerToken", { enumerable: true, get: function () { return BearerToken_js_1.BearerToken; } });
|
|
8
|
+
var NoOpAuthProvider_js_1 = require("./NoOpAuthProvider.js");
|
|
9
|
+
Object.defineProperty(exports, "NoOpAuthProvider", { enumerable: true, get: function () { return NoOpAuthProvider_js_1.NoOpAuthProvider; } });
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.base64Encode = base64Encode;
|
|
4
|
+
exports.base64Decode = base64Decode;
|
|
5
|
+
function base64ToBytes(base64) {
|
|
6
|
+
const binString = atob(base64);
|
|
7
|
+
return Uint8Array.from(binString, (m) => m.codePointAt(0));
|
|
8
|
+
}
|
|
9
|
+
function bytesToBase64(bytes) {
|
|
10
|
+
const binString = String.fromCodePoint(...bytes);
|
|
11
|
+
return btoa(binString);
|
|
12
|
+
}
|
|
13
|
+
function base64Encode(input) {
|
|
14
|
+
if (typeof Buffer !== "undefined") {
|
|
15
|
+
return Buffer.from(input, "utf8").toString("base64");
|
|
16
|
+
}
|
|
17
|
+
const bytes = new TextEncoder().encode(input);
|
|
18
|
+
return bytesToBase64(bytes);
|
|
19
|
+
}
|
|
20
|
+
function base64Decode(input) {
|
|
21
|
+
if (typeof Buffer !== "undefined") {
|
|
22
|
+
return Buffer.from(input, "base64").toString("utf8");
|
|
23
|
+
}
|
|
24
|
+
const bytes = base64ToBytes(input);
|
|
25
|
+
return new TextDecoder().decode(bytes);
|
|
26
|
+
}
|
package/dist/cjs/core/index.d.ts
CHANGED
package/dist/cjs/core/index.js
CHANGED
|
@@ -37,6 +37,8 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.url = exports.serialization = exports.logging = void 0;
|
|
40
|
+
__exportStar(require("./auth/index.js"), exports);
|
|
41
|
+
__exportStar(require("./base64.js"), exports);
|
|
40
42
|
__exportStar(require("./fetcher/index.js"), exports);
|
|
41
43
|
exports.logging = __importStar(require("./logging/index.js"));
|
|
42
44
|
__exportStar(require("./runtime/index.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.
|
|
1
|
+
export declare const SDK_VERSION = "2.1.0";
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { BearerAuthProvider } from "./auth/BearerAuthProvider.mjs";
|
|
1
2
|
import * as core from "./core/index.mjs";
|
|
2
|
-
export
|
|
3
|
+
export type BaseClientOptions = {
|
|
3
4
|
environment: core.Supplier<string>;
|
|
4
5
|
/** Specify a custom URL to connect the client to. */
|
|
5
6
|
baseUrl?: core.Supplier<string>;
|
|
@@ -13,7 +14,7 @@ export interface BaseClientOptions {
|
|
|
13
14
|
fetch?: typeof fetch;
|
|
14
15
|
/** Configure logging for the client. */
|
|
15
16
|
logging?: core.logging.LogConfig | core.logging.Logger;
|
|
16
|
-
}
|
|
17
|
+
} & BearerAuthProvider.AuthOptions;
|
|
17
18
|
export interface BaseRequestOptions {
|
|
18
19
|
/** The maximum time to wait for a response in seconds. */
|
|
19
20
|
timeoutInSeconds?: number;
|
|
@@ -28,5 +29,10 @@ export interface BaseRequestOptions {
|
|
|
28
29
|
}
|
|
29
30
|
export type NormalizedClientOptions<T extends BaseClientOptions = BaseClientOptions> = T & {
|
|
30
31
|
logging: core.logging.Logger;
|
|
32
|
+
authProvider?: core.AuthProvider;
|
|
33
|
+
};
|
|
34
|
+
export type NormalizedClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions> = NormalizedClientOptions<T> & {
|
|
35
|
+
authProvider: core.AuthProvider;
|
|
31
36
|
};
|
|
32
37
|
export declare function normalizeClientOptions<T extends BaseClientOptions = BaseClientOptions>(options: T): NormalizedClientOptions<T>;
|
|
38
|
+
export declare function normalizeClientOptionsWithAuth<T extends BaseClientOptions = BaseClientOptions>(options: T): NormalizedClientOptionsWithAuth<T>;
|
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import { BearerAuthProvider } from "./auth/BearerAuthProvider.mjs";
|
|
2
3
|
import { mergeHeaders } from "./core/headers.mjs";
|
|
3
4
|
import * as core from "./core/index.mjs";
|
|
4
5
|
export function normalizeClientOptions(options) {
|
|
5
6
|
const headers = mergeHeaders({
|
|
6
7
|
"X-Fern-Language": "JavaScript",
|
|
7
8
|
"X-Fern-SDK-Name": "@fern-api/venus-api-sdk",
|
|
8
|
-
"X-Fern-SDK-Version": "2.
|
|
9
|
-
"User-Agent": "@fern-api/venus-api-sdk/2.
|
|
9
|
+
"X-Fern-SDK-Version": "2.1.0",
|
|
10
|
+
"User-Agent": "@fern-api/venus-api-sdk/2.1.0",
|
|
10
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
11
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
12
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
13
14
|
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
|
|
14
15
|
}
|
|
16
|
+
export function normalizeClientOptionsWithAuth(options) {
|
|
17
|
+
var _a;
|
|
18
|
+
const normalized = normalizeClientOptions(options);
|
|
19
|
+
const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized);
|
|
20
|
+
(_a = normalized.authProvider) !== null && _a !== void 0 ? _a : (normalized.authProvider = new BearerAuthProvider(normalizedWithNoOpAuthProvider));
|
|
21
|
+
return normalized;
|
|
22
|
+
}
|
|
23
|
+
function withNoOpAuthProvider(options) {
|
|
24
|
+
return Object.assign(Object.assign({}, options), { authProvider: new core.NoOpAuthProvider() });
|
|
25
|
+
}
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -5,7 +5,7 @@ import { OrganizationClient } from "./api/resources/organization/client/Client.m
|
|
|
5
5
|
import { RegistryClient } from "./api/resources/registry/client/Client.mjs";
|
|
6
6
|
import { UserClient } from "./api/resources/user/client/Client.mjs";
|
|
7
7
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
8
|
-
import { type
|
|
8
|
+
import { type NormalizedClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
9
9
|
import * as core from "./core/index.mjs";
|
|
10
10
|
export declare namespace FernApiClient {
|
|
11
11
|
type Options = BaseClientOptions;
|
|
@@ -13,7 +13,7 @@ export declare namespace FernApiClient {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
export declare class FernApiClient {
|
|
16
|
-
protected readonly _options:
|
|
16
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<FernApiClient.Options>;
|
|
17
17
|
protected _apiKeys: ApiKeysClient | undefined;
|
|
18
18
|
protected _auth: AuthClient | undefined;
|
|
19
19
|
protected _organization: OrganizationClient | undefined;
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -14,12 +14,12 @@ import { AuthClient } from "./api/resources/auth/client/Client.mjs";
|
|
|
14
14
|
import { OrganizationClient } from "./api/resources/organization/client/Client.mjs";
|
|
15
15
|
import { RegistryClient } from "./api/resources/registry/client/Client.mjs";
|
|
16
16
|
import { UserClient } from "./api/resources/user/client/Client.mjs";
|
|
17
|
-
import {
|
|
17
|
+
import { normalizeClientOptionsWithAuth } from "./BaseClient.mjs";
|
|
18
18
|
import { mergeHeaders } from "./core/headers.mjs";
|
|
19
19
|
import * as core from "./core/index.mjs";
|
|
20
20
|
export class FernApiClient {
|
|
21
21
|
constructor(options) {
|
|
22
|
-
this._options =
|
|
22
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
23
23
|
}
|
|
24
24
|
get apiKeys() {
|
|
25
25
|
var _a;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
-
import { type
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import * as FernApi from "../../../index.mjs";
|
|
5
5
|
export declare namespace ApiKeysClient {
|
|
@@ -8,7 +8,7 @@ export declare namespace ApiKeysClient {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
export declare class ApiKeysClient {
|
|
11
|
-
protected readonly _options:
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ApiKeysClient.Options>;
|
|
12
12
|
constructor(options: ApiKeysClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {FernApi.CreateApiKeyRequest} request
|
|
@@ -8,14 +8,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
import {
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
12
|
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../core/index.mjs";
|
|
14
14
|
import * as serializers from "../../../../serialization/index.mjs";
|
|
15
15
|
import * as FernApi from "../../../index.mjs";
|
|
16
16
|
export class ApiKeysClient {
|
|
17
17
|
constructor(options) {
|
|
18
|
-
this._options =
|
|
18
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* @param {FernApi.CreateApiKeyRequest} request
|
|
@@ -32,7 +32,8 @@ export class ApiKeysClient {
|
|
|
32
32
|
__create(request, requestOptions) {
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
34
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
35
|
-
const
|
|
35
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
36
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
36
37
|
const _response = yield core.fetcher({
|
|
37
38
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "api-keys/create"),
|
|
38
39
|
method: "POST",
|
|
@@ -111,7 +112,8 @@ export class ApiKeysClient {
|
|
|
111
112
|
__getTokenMetadata(request, requestOptions) {
|
|
112
113
|
return __awaiter(this, void 0, void 0, function* () {
|
|
113
114
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
114
|
-
const
|
|
115
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
116
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
115
117
|
const _response = yield core.fetcher({
|
|
116
118
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "api-keys/metadata"),
|
|
117
119
|
method: "POST",
|
|
@@ -191,7 +193,8 @@ export class ApiKeysClient {
|
|
|
191
193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
192
194
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
193
195
|
const { organizationId } = request;
|
|
194
|
-
const
|
|
196
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
197
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
195
198
|
const _response = yield core.fetcher({
|
|
196
199
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `api-keys/organization/${core.url.encodePathParam(organizationId)}`),
|
|
197
200
|
method: "GET",
|
|
@@ -265,7 +268,8 @@ export class ApiKeysClient {
|
|
|
265
268
|
return __awaiter(this, void 0, void 0, function* () {
|
|
266
269
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
267
270
|
const { tokenId } = request;
|
|
268
|
-
const
|
|
271
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
272
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
269
273
|
const _response = yield core.fetcher({
|
|
270
274
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `api-keys/revoke/${core.url.encodePathParam(tokenId)}`),
|
|
271
275
|
method: "POST",
|
|
@@ -332,7 +336,8 @@ export class ApiKeysClient {
|
|
|
332
336
|
__revokeToken(request, requestOptions) {
|
|
333
337
|
return __awaiter(this, void 0, void 0, function* () {
|
|
334
338
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
335
|
-
const
|
|
339
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
340
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
336
341
|
const _response = yield core.fetcher({
|
|
337
342
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "api-keys/revoke"),
|
|
338
343
|
method: "POST",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
-
import { type
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import * as FernApi from "../../../index.mjs";
|
|
5
5
|
export declare namespace AuthClient {
|
|
@@ -8,7 +8,7 @@ export declare namespace AuthClient {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
export declare class AuthClient {
|
|
11
|
-
protected readonly _options:
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<AuthClient.Options>;
|
|
12
12
|
constructor(options: AuthClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Look up the Fern organization ID for a GitHub owner.
|
|
@@ -8,14 +8,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
import {
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
12
|
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../core/index.mjs";
|
|
14
14
|
import * as serializers from "../../../../serialization/index.mjs";
|
|
15
15
|
import * as FernApi from "../../../index.mjs";
|
|
16
16
|
export class AuthClient {
|
|
17
17
|
constructor(options) {
|
|
18
|
-
this._options =
|
|
18
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* Look up the Fern organization ID for a GitHub owner.
|
|
@@ -116,7 +116,8 @@ export class AuthClient {
|
|
|
116
116
|
__getAutopilotToken(request, requestOptions) {
|
|
117
117
|
return __awaiter(this, void 0, void 0, function* () {
|
|
118
118
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
119
|
-
const
|
|
119
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
120
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
120
121
|
const _response = yield core.fetcher({
|
|
121
122
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "auth/autopilot-token"),
|
|
122
123
|
method: "POST",
|
|
@@ -199,7 +200,8 @@ export class AuthClient {
|
|
|
199
200
|
__getJwt(request, requestOptions) {
|
|
200
201
|
return __awaiter(this, void 0, void 0, function* () {
|
|
201
202
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
202
|
-
const
|
|
203
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
204
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
203
205
|
const _response = yield core.fetcher({
|
|
204
206
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "auth/jwt"),
|
|
205
207
|
method: "POST",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
-
import { type
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import * as FernApi from "../../../index.mjs";
|
|
5
5
|
export declare namespace OrganizationClient {
|
|
@@ -8,7 +8,7 @@ export declare namespace OrganizationClient {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
export declare class OrganizationClient {
|
|
11
|
-
protected readonly _options:
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<OrganizationClient.Options>;
|
|
12
12
|
constructor(options: OrganizationClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {FernApi.CreateOrganizationRequest} request
|
|
@@ -19,14 +19,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
19
19
|
}
|
|
20
20
|
return t;
|
|
21
21
|
};
|
|
22
|
-
import {
|
|
22
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
23
23
|
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
24
24
|
import * as core from "../../../../core/index.mjs";
|
|
25
25
|
import * as serializers from "../../../../serialization/index.mjs";
|
|
26
26
|
import * as FernApi from "../../../index.mjs";
|
|
27
27
|
export class OrganizationClient {
|
|
28
28
|
constructor(options) {
|
|
29
|
-
this._options =
|
|
29
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* @param {FernApi.CreateOrganizationRequest} request
|
|
@@ -43,7 +43,8 @@ export class OrganizationClient {
|
|
|
43
43
|
__create(request, requestOptions) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
45
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
46
|
-
const
|
|
46
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
47
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
47
48
|
const _response = yield core.fetcher({
|
|
48
49
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "organizations/create"),
|
|
49
50
|
method: "POST",
|
|
@@ -123,7 +124,8 @@ export class OrganizationClient {
|
|
|
123
124
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
125
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
125
126
|
const { orgId } = request, _body = __rest(request, ["orgId"]);
|
|
126
|
-
const
|
|
127
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
128
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
127
129
|
const _response = yield core.fetcher({
|
|
128
130
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `organizations/${core.url.encodePathParam(orgId)}/update`),
|
|
129
131
|
method: "POST",
|
|
@@ -200,7 +202,8 @@ export class OrganizationClient {
|
|
|
200
202
|
const _queryParams = {
|
|
201
203
|
shouldIncludeFernUsers,
|
|
202
204
|
};
|
|
203
|
-
const
|
|
205
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
206
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
204
207
|
const _response = yield core.fetcher({
|
|
205
208
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `organizations/${core.url.encodePathParam(orgId)}`),
|
|
206
209
|
method: "GET",
|
|
@@ -276,7 +279,8 @@ export class OrganizationClient {
|
|
|
276
279
|
return __awaiter(this, void 0, void 0, function* () {
|
|
277
280
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
278
281
|
const { orgId } = request;
|
|
279
|
-
const
|
|
282
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
283
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
280
284
|
const _response = yield core.fetcher({
|
|
281
285
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `organizations/${core.url.encodePathParam(orgId)}`),
|
|
282
286
|
method: "DELETE",
|
|
@@ -346,7 +350,8 @@ export class OrganizationClient {
|
|
|
346
350
|
return __awaiter(this, void 0, void 0, function* () {
|
|
347
351
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
348
352
|
const { postmanTeamId } = request;
|
|
349
|
-
const
|
|
353
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
354
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
350
355
|
const _response = yield core.fetcher({
|
|
351
356
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `organizations/postman-team/${core.url.encodePathParam(postmanTeamId)}`),
|
|
352
357
|
method: "GET",
|
|
@@ -422,7 +427,8 @@ export class OrganizationClient {
|
|
|
422
427
|
return __awaiter(this, void 0, void 0, function* () {
|
|
423
428
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
424
429
|
const { orgId } = request;
|
|
425
|
-
const
|
|
430
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
431
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
426
432
|
const _response = yield core.fetcher({
|
|
427
433
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `organizations/${core.url.encodePathParam(orgId)}/postman-team-id`),
|
|
428
434
|
method: "GET",
|
|
@@ -496,7 +502,8 @@ export class OrganizationClient {
|
|
|
496
502
|
return __awaiter(this, void 0, void 0, function* () {
|
|
497
503
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
498
504
|
const { organizationId } = request;
|
|
499
|
-
const
|
|
505
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
506
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
500
507
|
const _response = yield core.fetcher({
|
|
501
508
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), `organizations/belongs-to-organization/${core.url.encodePathParam(organizationId)}`),
|
|
502
509
|
method: "POST",
|
|
@@ -573,7 +580,8 @@ export class OrganizationClient {
|
|
|
573
580
|
const _queryParams = {
|
|
574
581
|
shouldIncludeFernUsers,
|
|
575
582
|
};
|
|
576
|
-
const
|
|
583
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
584
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
577
585
|
const _response = yield core.fetcher({
|
|
578
586
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "organizations/myself"),
|
|
579
587
|
method: "POST",
|
|
@@ -643,7 +651,8 @@ export class OrganizationClient {
|
|
|
643
651
|
__getOrgIdsFromToken(requestOptions) {
|
|
644
652
|
return __awaiter(this, void 0, void 0, function* () {
|
|
645
653
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
646
|
-
const
|
|
654
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
655
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
647
656
|
const _response = yield core.fetcher({
|
|
648
657
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "organizations"),
|
|
649
658
|
method: "POST",
|
|
@@ -698,7 +707,8 @@ export class OrganizationClient {
|
|
|
698
707
|
__addUser(request, requestOptions) {
|
|
699
708
|
return __awaiter(this, void 0, void 0, function* () {
|
|
700
709
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
701
|
-
const
|
|
710
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
711
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
702
712
|
const _response = yield core.fetcher({
|
|
703
713
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "organizations/add-user"),
|
|
704
714
|
method: "POST",
|
|
@@ -772,7 +782,8 @@ export class OrganizationClient {
|
|
|
772
782
|
__inviteUser(request, requestOptions) {
|
|
773
783
|
return __awaiter(this, void 0, void 0, function* () {
|
|
774
784
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
775
|
-
const
|
|
785
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
786
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
776
787
|
const _response = yield core.fetcher({
|
|
777
788
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "organizations/invite"),
|
|
778
789
|
method: "POST",
|
|
@@ -846,7 +857,8 @@ export class OrganizationClient {
|
|
|
846
857
|
__removeUser(request, requestOptions) {
|
|
847
858
|
return __awaiter(this, void 0, void 0, function* () {
|
|
848
859
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
849
|
-
const
|
|
860
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
861
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
850
862
|
const _response = yield core.fetcher({
|
|
851
863
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "organizations/user"),
|
|
852
864
|
method: "DELETE",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
-
import { type
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import * as FernApi from "../../../index.mjs";
|
|
5
5
|
export declare namespace RegistryClient {
|
|
@@ -8,7 +8,7 @@ export declare namespace RegistryClient {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
export declare class RegistryClient {
|
|
11
|
-
protected readonly _options:
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<RegistryClient.Options>;
|
|
12
12
|
constructor(options: RegistryClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {FernApi.GenerateRegistryTokensRequest} request
|
|
@@ -8,14 +8,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
|
-
import {
|
|
11
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
12
12
|
import { mergeHeaders } from "../../../../core/headers.mjs";
|
|
13
13
|
import * as core from "../../../../core/index.mjs";
|
|
14
14
|
import * as serializers from "../../../../serialization/index.mjs";
|
|
15
15
|
import * as FernApi from "../../../index.mjs";
|
|
16
16
|
export class RegistryClient {
|
|
17
17
|
constructor(options) {
|
|
18
|
-
this._options =
|
|
18
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
21
|
* @param {FernApi.GenerateRegistryTokensRequest} request
|
|
@@ -32,7 +32,8 @@ export class RegistryClient {
|
|
|
32
32
|
__generateRegistryTokens(request, requestOptions) {
|
|
33
33
|
return __awaiter(this, void 0, void 0, function* () {
|
|
34
34
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
35
|
-
const
|
|
35
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
36
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
36
37
|
const _response = yield core.fetcher({
|
|
37
38
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "registry/generate-tokens"),
|
|
38
39
|
method: "POST",
|
|
@@ -191,7 +192,8 @@ export class RegistryClient {
|
|
|
191
192
|
__revokeToken(request, requestOptions) {
|
|
192
193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
193
194
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
194
|
-
const
|
|
195
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
196
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
195
197
|
const _response = yield core.fetcher({
|
|
196
198
|
url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "registry/revoke-token"),
|
|
197
199
|
method: "POST",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
|
-
import { type
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
|
|
3
3
|
import * as core from "../../../../core/index.mjs";
|
|
4
4
|
import * as FernApi from "../../../index.mjs";
|
|
5
5
|
export declare namespace UserClient {
|
|
@@ -8,7 +8,7 @@ export declare namespace UserClient {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
export declare class UserClient {
|
|
11
|
-
protected readonly _options:
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<UserClient.Options>;
|
|
12
12
|
constructor(options: UserClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
|