@fern-api/venus-api-sdk 2.1.0 → 3.0.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.
Files changed (74) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/BaseClient.d.ts +2 -8
  3. package/dist/cjs/BaseClient.js +2 -14
  4. package/dist/cjs/Client.d.ts +2 -2
  5. package/dist/cjs/Client.js +1 -1
  6. package/dist/cjs/api/resources/apiKeys/client/Client.d.ts +2 -2
  7. package/dist/cjs/api/resources/apiKeys/client/Client.js +6 -11
  8. package/dist/cjs/api/resources/auth/client/Client.d.ts +2 -2
  9. package/dist/cjs/api/resources/auth/client/Client.js +3 -5
  10. package/dist/cjs/api/resources/organization/client/Client.d.ts +2 -2
  11. package/dist/cjs/api/resources/organization/client/Client.js +13 -25
  12. package/dist/cjs/api/resources/registry/client/Client.d.ts +2 -2
  13. package/dist/cjs/api/resources/registry/client/Client.js +3 -5
  14. package/dist/cjs/api/resources/user/client/Client.d.ts +2 -2
  15. package/dist/cjs/api/resources/user/client/Client.js +4 -7
  16. package/dist/cjs/core/index.d.ts +0 -2
  17. package/dist/cjs/core/index.js +0 -2
  18. package/dist/cjs/version.d.ts +1 -1
  19. package/dist/cjs/version.js +1 -1
  20. package/dist/esm/BaseClient.d.mts +2 -8
  21. package/dist/esm/BaseClient.mjs +2 -13
  22. package/dist/esm/Client.d.mts +2 -2
  23. package/dist/esm/Client.mjs +2 -2
  24. package/dist/esm/api/resources/apiKeys/client/Client.d.mts +2 -2
  25. package/dist/esm/api/resources/apiKeys/client/Client.mjs +7 -12
  26. package/dist/esm/api/resources/auth/client/Client.d.mts +2 -2
  27. package/dist/esm/api/resources/auth/client/Client.mjs +4 -6
  28. package/dist/esm/api/resources/organization/client/Client.d.mts +2 -2
  29. package/dist/esm/api/resources/organization/client/Client.mjs +14 -26
  30. package/dist/esm/api/resources/registry/client/Client.d.mts +2 -2
  31. package/dist/esm/api/resources/registry/client/Client.mjs +4 -6
  32. package/dist/esm/api/resources/user/client/Client.d.mts +2 -2
  33. package/dist/esm/api/resources/user/client/Client.mjs +5 -8
  34. package/dist/esm/core/index.d.mts +0 -2
  35. package/dist/esm/core/index.mjs +0 -2
  36. package/dist/esm/version.d.mts +1 -1
  37. package/dist/esm/version.mjs +1 -1
  38. package/package.json +1 -1
  39. package/dist/cjs/auth/BearerAuthProvider.d.ts +0 -20
  40. package/dist/cjs/auth/BearerAuthProvider.js +0 -76
  41. package/dist/cjs/auth/index.d.ts +0 -1
  42. package/dist/cjs/auth/index.js +0 -5
  43. package/dist/cjs/core/auth/AuthProvider.d.ts +0 -7
  44. package/dist/cjs/core/auth/AuthProvider.js +0 -2
  45. package/dist/cjs/core/auth/AuthRequest.d.ts +0 -9
  46. package/dist/cjs/core/auth/AuthRequest.js +0 -2
  47. package/dist/cjs/core/auth/BasicAuth.d.ts +0 -8
  48. package/dist/cjs/core/auth/BasicAuth.js +0 -27
  49. package/dist/cjs/core/auth/BearerToken.d.ts +0 -7
  50. package/dist/cjs/core/auth/BearerToken.js +0 -16
  51. package/dist/cjs/core/auth/NoOpAuthProvider.d.ts +0 -5
  52. package/dist/cjs/core/auth/NoOpAuthProvider.js +0 -9
  53. package/dist/cjs/core/auth/index.d.ts +0 -5
  54. package/dist/cjs/core/auth/index.js +0 -9
  55. package/dist/cjs/core/base64.d.ts +0 -2
  56. package/dist/cjs/core/base64.js +0 -26
  57. package/dist/esm/auth/BearerAuthProvider.d.mts +0 -20
  58. package/dist/esm/auth/BearerAuthProvider.mjs +0 -39
  59. package/dist/esm/auth/index.d.mts +0 -1
  60. package/dist/esm/auth/index.mjs +0 -1
  61. package/dist/esm/core/auth/AuthProvider.d.mts +0 -7
  62. package/dist/esm/core/auth/AuthProvider.mjs +0 -1
  63. package/dist/esm/core/auth/AuthRequest.d.mts +0 -9
  64. package/dist/esm/core/auth/AuthRequest.mjs +0 -1
  65. package/dist/esm/core/auth/BasicAuth.d.mts +0 -8
  66. package/dist/esm/core/auth/BasicAuth.mjs +0 -24
  67. package/dist/esm/core/auth/BearerToken.d.mts +0 -7
  68. package/dist/esm/core/auth/BearerToken.mjs +0 -13
  69. package/dist/esm/core/auth/NoOpAuthProvider.d.mts +0 -5
  70. package/dist/esm/core/auth/NoOpAuthProvider.mjs +0 -5
  71. package/dist/esm/core/auth/index.d.mts +0 -5
  72. package/dist/esm/core/auth/index.mjs +0 -3
  73. package/dist/esm/core/base64.d.mts +0 -2
  74. package/dist/esm/core/base64.mjs +0 -22
@@ -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 { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
11
+ import { normalizeClientOptions } 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 = normalizeClientOptionsWithAuth(options);
18
+ this._options = normalizeClientOptions(options);
19
19
  }
20
20
  /**
21
21
  * @param {FernApi.CreateApiKeyRequest} request
@@ -32,8 +32,7 @@ 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 _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);
35
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
37
36
  const _response = yield core.fetcher({
38
37
  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"),
39
38
  method: "POST",
@@ -112,8 +111,7 @@ export class ApiKeysClient {
112
111
  __getTokenMetadata(request, requestOptions) {
113
112
  return __awaiter(this, void 0, void 0, function* () {
114
113
  var _a, _b, _c, _d, _e, _f, _g, _h;
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);
114
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
117
115
  const _response = yield core.fetcher({
118
116
  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"),
119
117
  method: "POST",
@@ -193,8 +191,7 @@ export class ApiKeysClient {
193
191
  return __awaiter(this, void 0, void 0, function* () {
194
192
  var _a, _b, _c, _d, _e, _f, _g, _h;
195
193
  const { organizationId } = request;
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);
194
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
198
195
  const _response = yield core.fetcher({
199
196
  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)}`),
200
197
  method: "GET",
@@ -268,8 +265,7 @@ export class ApiKeysClient {
268
265
  return __awaiter(this, void 0, void 0, function* () {
269
266
  var _a, _b, _c, _d, _e, _f, _g, _h;
270
267
  const { tokenId } = request;
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);
268
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
273
269
  const _response = yield core.fetcher({
274
270
  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)}`),
275
271
  method: "POST",
@@ -336,8 +332,7 @@ export class ApiKeysClient {
336
332
  __revokeToken(request, requestOptions) {
337
333
  return __awaiter(this, void 0, void 0, function* () {
338
334
  var _a, _b, _c, _d, _e, _f, _g, _h;
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);
335
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
341
336
  const _response = yield core.fetcher({
342
337
  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"),
343
338
  method: "POST",
@@ -1,5 +1,5 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
- import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptions } 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: NormalizedClientOptionsWithAuth<AuthClient.Options>;
11
+ protected readonly _options: NormalizedClientOptions<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 { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
11
+ import { normalizeClientOptions } 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 = normalizeClientOptionsWithAuth(options);
18
+ this._options = normalizeClientOptions(options);
19
19
  }
20
20
  /**
21
21
  * Look up the Fern organization ID for a GitHub owner.
@@ -116,8 +116,7 @@ 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 _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);
119
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
121
120
  const _response = yield core.fetcher({
122
121
  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"),
123
122
  method: "POST",
@@ -200,8 +199,7 @@ export class AuthClient {
200
199
  __getJwt(request, requestOptions) {
201
200
  return __awaiter(this, void 0, void 0, function* () {
202
201
  var _a, _b, _c, _d, _e, _f, _g, _h;
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);
202
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
205
203
  const _response = yield core.fetcher({
206
204
  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"),
207
205
  method: "POST",
@@ -1,5 +1,5 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
- import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptions } 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: NormalizedClientOptionsWithAuth<OrganizationClient.Options>;
11
+ protected readonly _options: NormalizedClientOptions<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 { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
22
+ import { normalizeClientOptions } 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 = normalizeClientOptionsWithAuth(options);
29
+ this._options = normalizeClientOptions(options);
30
30
  }
31
31
  /**
32
32
  * @param {FernApi.CreateOrganizationRequest} request
@@ -43,8 +43,7 @@ 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 _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);
46
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
48
47
  const _response = yield core.fetcher({
49
48
  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"),
50
49
  method: "POST",
@@ -124,8 +123,7 @@ export class OrganizationClient {
124
123
  return __awaiter(this, void 0, void 0, function* () {
125
124
  var _a, _b, _c, _d, _e, _f, _g, _h;
126
125
  const { orgId } = request, _body = __rest(request, ["orgId"]);
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);
126
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
129
127
  const _response = yield core.fetcher({
130
128
  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`),
131
129
  method: "POST",
@@ -202,8 +200,7 @@ export class OrganizationClient {
202
200
  const _queryParams = {
203
201
  shouldIncludeFernUsers,
204
202
  };
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);
203
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
207
204
  const _response = yield core.fetcher({
208
205
  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)}`),
209
206
  method: "GET",
@@ -279,8 +276,7 @@ export class OrganizationClient {
279
276
  return __awaiter(this, void 0, void 0, function* () {
280
277
  var _a, _b, _c, _d, _e, _f, _g, _h;
281
278
  const { orgId } = request;
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);
279
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
284
280
  const _response = yield core.fetcher({
285
281
  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)}`),
286
282
  method: "DELETE",
@@ -350,8 +346,7 @@ export class OrganizationClient {
350
346
  return __awaiter(this, void 0, void 0, function* () {
351
347
  var _a, _b, _c, _d, _e, _f, _g, _h;
352
348
  const { postmanTeamId } = request;
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);
349
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
355
350
  const _response = yield core.fetcher({
356
351
  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)}`),
357
352
  method: "GET",
@@ -427,8 +422,7 @@ export class OrganizationClient {
427
422
  return __awaiter(this, void 0, void 0, function* () {
428
423
  var _a, _b, _c, _d, _e, _f, _g, _h;
429
424
  const { orgId } = request;
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);
425
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
432
426
  const _response = yield core.fetcher({
433
427
  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`),
434
428
  method: "GET",
@@ -502,8 +496,7 @@ export class OrganizationClient {
502
496
  return __awaiter(this, void 0, void 0, function* () {
503
497
  var _a, _b, _c, _d, _e, _f, _g, _h;
504
498
  const { organizationId } = request;
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);
499
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
507
500
  const _response = yield core.fetcher({
508
501
  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)}`),
509
502
  method: "POST",
@@ -580,8 +573,7 @@ export class OrganizationClient {
580
573
  const _queryParams = {
581
574
  shouldIncludeFernUsers,
582
575
  };
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);
576
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
585
577
  const _response = yield core.fetcher({
586
578
  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"),
587
579
  method: "POST",
@@ -651,8 +643,7 @@ export class OrganizationClient {
651
643
  __getOrgIdsFromToken(requestOptions) {
652
644
  return __awaiter(this, void 0, void 0, function* () {
653
645
  var _a, _b, _c, _d, _e, _f, _g, _h;
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);
646
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
656
647
  const _response = yield core.fetcher({
657
648
  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"),
658
649
  method: "POST",
@@ -707,8 +698,7 @@ export class OrganizationClient {
707
698
  __addUser(request, requestOptions) {
708
699
  return __awaiter(this, void 0, void 0, function* () {
709
700
  var _a, _b, _c, _d, _e, _f, _g, _h;
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);
701
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
712
702
  const _response = yield core.fetcher({
713
703
  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"),
714
704
  method: "POST",
@@ -782,8 +772,7 @@ export class OrganizationClient {
782
772
  __inviteUser(request, requestOptions) {
783
773
  return __awaiter(this, void 0, void 0, function* () {
784
774
  var _a, _b, _c, _d, _e, _f, _g, _h;
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);
775
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
787
776
  const _response = yield core.fetcher({
788
777
  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"),
789
778
  method: "POST",
@@ -857,8 +846,7 @@ export class OrganizationClient {
857
846
  __removeUser(request, requestOptions) {
858
847
  return __awaiter(this, void 0, void 0, function* () {
859
848
  var _a, _b, _c, _d, _e, _f, _g, _h;
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);
849
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
862
850
  const _response = yield core.fetcher({
863
851
  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"),
864
852
  method: "DELETE",
@@ -1,5 +1,5 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
- import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptions } 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: NormalizedClientOptionsWithAuth<RegistryClient.Options>;
11
+ protected readonly _options: NormalizedClientOptions<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 { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
11
+ import { normalizeClientOptions } 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 = normalizeClientOptionsWithAuth(options);
18
+ this._options = normalizeClientOptions(options);
19
19
  }
20
20
  /**
21
21
  * @param {FernApi.GenerateRegistryTokensRequest} request
@@ -32,8 +32,7 @@ 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 _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);
35
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
37
36
  const _response = yield core.fetcher({
38
37
  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"),
39
38
  method: "POST",
@@ -192,8 +191,7 @@ export class RegistryClient {
192
191
  __revokeToken(request, requestOptions) {
193
192
  return __awaiter(this, void 0, void 0, function* () {
194
193
  var _a, _b, _c, _d, _e, _f, _g, _h;
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);
194
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
197
195
  const _response = yield core.fetcher({
198
196
  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"),
199
197
  method: "POST",
@@ -1,5 +1,5 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
- import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs";
2
+ import { type NormalizedClientOptions } 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: NormalizedClientOptionsWithAuth<UserClient.Options>;
11
+ protected readonly _options: NormalizedClientOptions<UserClient.Options>;
12
12
  constructor(options: UserClient.Options);
13
13
  /**
14
14
  * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -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 { normalizeClientOptionsWithAuth } from "../../../../BaseClient.mjs";
11
+ import { normalizeClientOptions } 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 UserClient {
17
17
  constructor(options) {
18
- this._options = normalizeClientOptionsWithAuth(options);
18
+ this._options = normalizeClientOptions(options);
19
19
  }
20
20
  /**
21
21
  * @param {UserClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -29,8 +29,7 @@ export class UserClient {
29
29
  __getMyself(requestOptions) {
30
30
  return __awaiter(this, void 0, void 0, function* () {
31
31
  var _a, _b, _c, _d, _e, _f, _g, _h;
32
- const _authRequest = yield this._options.authProvider.getAuthRequest();
33
- 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);
32
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
34
33
  const _response = yield core.fetcher({
35
34
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "users"),
36
35
  method: "GET",
@@ -88,8 +87,7 @@ export class UserClient {
88
87
  const _queryParams = {
89
88
  pageId,
90
89
  };
91
- const _authRequest = yield this._options.authProvider.getAuthRequest();
92
- 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);
90
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
93
91
  const _response = yield core.fetcher({
94
92
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "users/organizations"),
95
93
  method: "GET",
@@ -165,8 +163,7 @@ export class UserClient {
165
163
  __linkAccounts(request, requestOptions) {
166
164
  return __awaiter(this, void 0, void 0, function* () {
167
165
  var _a, _b, _c, _d, _e, _f, _g, _h;
168
- const _authRequest = yield this._options.authProvider.getAuthRequest();
169
- 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);
166
+ const _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
170
167
  const _response = yield core.fetcher({
171
168
  url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment)), "users/link-accounts"),
172
169
  method: "POST",
@@ -1,5 +1,3 @@
1
- export * from "./auth/index.mjs";
2
- export * from "./base64.mjs";
3
1
  export * from "./fetcher/index.mjs";
4
2
  export * as logging from "./logging/index.mjs";
5
3
  export * from "./runtime/index.mjs";
@@ -1,5 +1,3 @@
1
- export * from "./auth/index.mjs";
2
- export * from "./base64.mjs";
3
1
  export * from "./fetcher/index.mjs";
4
2
  export * as logging from "./logging/index.mjs";
5
3
  export * from "./runtime/index.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.1.0";
1
+ export declare const SDK_VERSION = "3.0.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "2.1.0";
1
+ export const SDK_VERSION = "3.0.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/venus-api-sdk",
3
- "version": "2.1.0",
3
+ "version": "3.0.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,20 +0,0 @@
1
- import * as core from "../core/index.js";
2
- declare const TOKEN_PARAM: "token";
3
- export declare class BearerAuthProvider implements core.AuthProvider {
4
- private readonly options;
5
- constructor(options: BearerAuthProvider.Options);
6
- static canCreate(options: Partial<BearerAuthProvider.Options>): boolean;
7
- getAuthRequest({ endpointMetadata, }?: {
8
- endpointMetadata?: core.EndpointMetadata;
9
- }): Promise<core.AuthRequest>;
10
- }
11
- export declare namespace BearerAuthProvider {
12
- const AUTH_SCHEME: "HTTPBearer";
13
- const AUTH_CONFIG_ERROR_MESSAGE: string;
14
- type Options = AuthOptions;
15
- type AuthOptions = {
16
- [TOKEN_PARAM]?: core.Supplier<core.BearerToken>;
17
- };
18
- function createInstance(options: Options): core.AuthProvider;
19
- }
20
- export {};
@@ -1,76 +0,0 @@
1
- "use strict";
2
- // This file was auto-generated by Fern from our API Definition.
3
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
- if (k2 === undefined) k2 = k;
5
- var desc = Object.getOwnPropertyDescriptor(m, k);
6
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
- desc = { enumerable: true, get: function() { return m[k]; } };
8
- }
9
- Object.defineProperty(o, k2, desc);
10
- }) : (function(o, m, k, k2) {
11
- if (k2 === undefined) k2 = k;
12
- o[k2] = m[k];
13
- }));
14
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
- Object.defineProperty(o, "default", { enumerable: true, value: v });
16
- }) : function(o, v) {
17
- o["default"] = v;
18
- });
19
- var __importStar = (this && this.__importStar) || (function () {
20
- var ownKeys = function(o) {
21
- ownKeys = Object.getOwnPropertyNames || function (o) {
22
- var ar = [];
23
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
- return ar;
25
- };
26
- return ownKeys(o);
27
- };
28
- return function (mod) {
29
- if (mod && mod.__esModule) return mod;
30
- var result = {};
31
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
- __setModuleDefault(result, mod);
33
- return result;
34
- };
35
- })();
36
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
37
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
38
- return new (P || (P = Promise))(function (resolve, reject) {
39
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
40
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
41
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
42
- step((generator = generator.apply(thisArg, _arguments || [])).next());
43
- });
44
- };
45
- Object.defineProperty(exports, "__esModule", { value: true });
46
- exports.BearerAuthProvider = void 0;
47
- const core = __importStar(require("../core/index.js"));
48
- const TOKEN_PARAM = "token";
49
- class BearerAuthProvider {
50
- constructor(options) {
51
- this.options = options;
52
- }
53
- static canCreate(options) {
54
- return (options === null || options === void 0 ? void 0 : options[TOKEN_PARAM]) != null;
55
- }
56
- getAuthRequest() {
57
- return __awaiter(this, arguments, void 0, function* ({ endpointMetadata, } = {}) {
58
- const token = yield core.Supplier.get(this.options[TOKEN_PARAM]);
59
- if (token == null) {
60
- return { headers: {} };
61
- }
62
- return {
63
- headers: { Authorization: `Bearer ${token}` },
64
- };
65
- });
66
- }
67
- }
68
- exports.BearerAuthProvider = BearerAuthProvider;
69
- (function (BearerAuthProvider) {
70
- BearerAuthProvider.AUTH_SCHEME = "HTTPBearer";
71
- BearerAuthProvider.AUTH_CONFIG_ERROR_MESSAGE = `Please provide '${TOKEN_PARAM}' when initializing the client`;
72
- function createInstance(options) {
73
- return new BearerAuthProvider(options);
74
- }
75
- BearerAuthProvider.createInstance = createInstance;
76
- })(BearerAuthProvider || (exports.BearerAuthProvider = BearerAuthProvider = {}));
@@ -1 +0,0 @@
1
- export { BearerAuthProvider } from "./BearerAuthProvider.js";
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BearerAuthProvider = void 0;
4
- var BearerAuthProvider_js_1 = require("./BearerAuthProvider.js");
5
- Object.defineProperty(exports, "BearerAuthProvider", { enumerable: true, get: function () { return BearerAuthProvider_js_1.BearerAuthProvider; } });
@@ -1,7 +0,0 @@
1
- import type { EndpointMetadata } from "../fetcher/EndpointMetadata.js";
2
- import type { AuthRequest } from "./AuthRequest.js";
3
- export interface AuthProvider {
4
- getAuthRequest(arg?: {
5
- endpointMetadata?: EndpointMetadata;
6
- }): Promise<AuthRequest>;
7
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +0,0 @@
1
- /**
2
- * Request parameters for authentication requests.
3
- */
4
- export interface AuthRequest {
5
- /**
6
- * The headers to be included in the request.
7
- */
8
- headers: Record<string, string>;
9
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +0,0 @@
1
- export interface BasicAuth {
2
- username: string;
3
- password: string;
4
- }
5
- export declare const BasicAuth: {
6
- toAuthorizationHeader: (basicAuth: BasicAuth | undefined) => string | undefined;
7
- fromAuthorizationHeader: (header: string) => BasicAuth;
8
- };
@@ -1,27 +0,0 @@
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
- };
@@ -1,7 +0,0 @@
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 {};