@fern-api/venus-api-sdk 0.19.7 → 0.19.8-1-g4e79e5b

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 (27) hide show
  1. package/dist/cjs/Client.js +1 -1
  2. package/dist/cjs/api/resources/organization/client/Client.d.ts +11 -0
  3. package/dist/cjs/api/resources/organization/client/Client.js +66 -0
  4. package/dist/cjs/api/resources/organization/client/delete.d.ts +32 -0
  5. package/dist/cjs/api/resources/organization/client/delete.js +77 -0
  6. package/dist/cjs/api/resources/organization/client/index.d.ts +1 -0
  7. package/dist/cjs/api/resources/organization/client/index.js +2 -1
  8. package/dist/cjs/serialization/resources/organization/client/delete.d.ts +16 -0
  9. package/dist/cjs/serialization/resources/organization/client/delete.js +71 -0
  10. package/dist/cjs/serialization/resources/organization/client/index.d.ts +1 -0
  11. package/dist/cjs/serialization/resources/organization/client/index.js +2 -1
  12. package/dist/cjs/version.d.ts +1 -1
  13. package/dist/cjs/version.js +1 -1
  14. package/dist/esm/Client.mjs +1 -1
  15. package/dist/esm/api/resources/organization/client/Client.d.mts +11 -0
  16. package/dist/esm/api/resources/organization/client/Client.mjs +66 -0
  17. package/dist/esm/api/resources/organization/client/delete.d.mts +32 -0
  18. package/dist/esm/api/resources/organization/client/delete.mjs +41 -0
  19. package/dist/esm/api/resources/organization/client/index.d.mts +1 -0
  20. package/dist/esm/api/resources/organization/client/index.mjs +1 -0
  21. package/dist/esm/serialization/resources/organization/client/delete.d.mts +16 -0
  22. package/dist/esm/serialization/resources/organization/client/delete.mjs +35 -0
  23. package/dist/esm/serialization/resources/organization/client/index.d.mts +1 -0
  24. package/dist/esm/serialization/resources/organization/client/index.mjs +1 -0
  25. package/dist/esm/version.d.mts +1 -1
  26. package/dist/esm/version.mjs +1 -1
  27. package/package.json +1 -1
@@ -47,7 +47,7 @@ class FernVenusApiClient {
47
47
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
48
48
  "X-Fern-Language": "JavaScript",
49
49
  "X-Fern-SDK-Name": "@fern-api/venus-api-sdk",
50
- "X-Fern-SDK-Version": "0.19.7",
50
+ "X-Fern-SDK-Version": "0.19.8-1-g4e79e5b",
51
51
  "X-Fern-Runtime": core.RUNTIME.type,
52
52
  "X-Fern-Runtime-Version": core.RUNTIME.version,
53
53
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -145,5 +145,16 @@ export declare class Organization {
145
145
  */
146
146
  removeUser(request: FernVenusApi.RemoveUserFromOrgRequest, requestOptions?: Organization.RequestOptions): core.HttpResponsePromise<core.APIResponse<void, FernVenusApi.organization.removeUser.Error>>;
147
147
  private __removeUser;
148
+ /**
149
+ * Deletes an organization. Only users with admin role can delete organizations.
150
+ *
151
+ * @param {FernVenusApi.OrganizationId} orgId
152
+ * @param {Organization.RequestOptions} requestOptions - Request-specific configuration.
153
+ *
154
+ * @example
155
+ * await client.organization.delete(FernVenusApi.OrganizationId("orgId"))
156
+ */
157
+ delete(orgId: FernVenusApi.OrganizationId, requestOptions?: Organization.RequestOptions): core.HttpResponsePromise<core.APIResponse<void, FernVenusApi.organization.delete.Error>>;
158
+ private __delete;
148
159
  protected _getAuthorizationHeader(): Promise<string | undefined>;
149
160
  }
@@ -694,6 +694,72 @@ class Organization {
694
694
  };
695
695
  });
696
696
  }
697
+ /**
698
+ * Deletes an organization. Only users with admin role can delete organizations.
699
+ *
700
+ * @param {FernVenusApi.OrganizationId} orgId
701
+ * @param {Organization.RequestOptions} requestOptions - Request-specific configuration.
702
+ *
703
+ * @example
704
+ * await client.organization.delete(FernVenusApi.OrganizationId("orgId"))
705
+ */
706
+ delete(orgId, requestOptions) {
707
+ return core.HttpResponsePromise.fromPromise(this.__delete(orgId, requestOptions));
708
+ }
709
+ __delete(orgId, requestOptions) {
710
+ return __awaiter(this, void 0, void 0, function* () {
711
+ var _a, _b, _c, _d;
712
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
713
+ const _response = yield core.fetcher({
714
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, `/organizations/${encodeURIComponent(serializers.OrganizationId.jsonOrThrow(orgId, { omitUndefined: true }))}`),
715
+ method: "DELETE",
716
+ headers: _headers,
717
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
718
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
719
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
720
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
721
+ });
722
+ if (_response.ok) {
723
+ return {
724
+ data: {
725
+ ok: true,
726
+ body: undefined,
727
+ headers: _response.headers,
728
+ rawResponse: _response.rawResponse,
729
+ },
730
+ rawResponse: _response.rawResponse,
731
+ };
732
+ }
733
+ if (_response.error.reason === "status-code") {
734
+ switch ((_d = _response.error.body) === null || _d === void 0 ? void 0 : _d.error) {
735
+ case "UnauthorizedError":
736
+ case "OrganizationNotFoundError":
737
+ return {
738
+ data: {
739
+ ok: false,
740
+ error: serializers.organization.delete.Error.parseOrThrow(_response.error.body, {
741
+ unrecognizedObjectKeys: "passthrough",
742
+ allowUnrecognizedUnionMembers: true,
743
+ allowUnrecognizedEnumValues: true,
744
+ skipValidation: true,
745
+ breadcrumbsPrefix: ["response"],
746
+ }),
747
+ rawResponse: _response.rawResponse,
748
+ },
749
+ rawResponse: _response.rawResponse,
750
+ };
751
+ }
752
+ }
753
+ return {
754
+ data: {
755
+ ok: false,
756
+ error: FernVenusApi.organization.delete.Error._unknown(_response.error),
757
+ rawResponse: _response.rawResponse,
758
+ },
759
+ rawResponse: _response.rawResponse,
760
+ };
761
+ });
762
+ }
697
763
  _getAuthorizationHeader() {
698
764
  return __awaiter(this, void 0, void 0, function* () {
699
765
  const bearer = yield core.Supplier.get(this._options.token);
@@ -0,0 +1,32 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as FernVenusApi from "../../../index.js";
5
+ import * as core from "../../../../core/index.js";
6
+ export type Error = FernVenusApi.organization.delete.Error.UnauthorizedError | FernVenusApi.organization.delete.Error.OrganizationNotFoundError | FernVenusApi.organization.delete.Error._Unknown;
7
+ export declare namespace Error {
8
+ interface UnauthorizedError extends _Utils {
9
+ error: "UnauthorizedError";
10
+ }
11
+ interface OrganizationNotFoundError extends _Utils {
12
+ error: "OrganizationNotFoundError";
13
+ }
14
+ interface _Unknown extends _Utils {
15
+ error: void;
16
+ content: core.Fetcher.Error;
17
+ }
18
+ interface _Utils {
19
+ _visit: <_Result>(visitor: FernVenusApi.organization.delete.Error._Visitor<_Result>) => _Result;
20
+ }
21
+ interface _Visitor<_Result> {
22
+ unauthorizedError: () => _Result;
23
+ organizationNotFoundError: () => _Result;
24
+ _other: (value: core.Fetcher.Error) => _Result;
25
+ }
26
+ }
27
+ export declare const Error: {
28
+ readonly unauthorizedError: () => FernVenusApi.organization.delete.Error.UnauthorizedError;
29
+ readonly organizationNotFoundError: () => FernVenusApi.organization.delete.Error.OrganizationNotFoundError;
30
+ readonly _unknown: (fetcherError: core.Fetcher.Error) => FernVenusApi.organization.delete.Error._Unknown;
31
+ readonly _visit: <_Result>(value: FernVenusApi.organization.delete.Error, visitor: FernVenusApi.organization.delete.Error._Visitor<_Result>) => _Result;
32
+ };
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.Error = void 0;
40
+ const FernVenusApi = __importStar(require("../../../index.js"));
41
+ exports.Error = {
42
+ unauthorizedError: () => {
43
+ return {
44
+ error: "UnauthorizedError",
45
+ _visit: function (visitor) {
46
+ return FernVenusApi.organization.delete.Error._visit(this, visitor);
47
+ },
48
+ };
49
+ },
50
+ organizationNotFoundError: () => {
51
+ return {
52
+ error: "OrganizationNotFoundError",
53
+ _visit: function (visitor) {
54
+ return FernVenusApi.organization.delete.Error._visit(this, visitor);
55
+ },
56
+ };
57
+ },
58
+ _unknown: (fetcherError) => {
59
+ return {
60
+ error: undefined,
61
+ content: fetcherError,
62
+ _visit: function (visitor) {
63
+ return FernVenusApi.organization.delete.Error._visit(this, visitor);
64
+ },
65
+ };
66
+ },
67
+ _visit: (value, visitor) => {
68
+ switch (value.error) {
69
+ case "UnauthorizedError":
70
+ return visitor.unauthorizedError();
71
+ case "OrganizationNotFoundError":
72
+ return visitor.organizationNotFoundError();
73
+ default:
74
+ return visitor._other(value);
75
+ }
76
+ },
77
+ };
@@ -7,4 +7,5 @@ export * as getOrgIdsFromToken from "./getOrgIdsFromToken.js";
7
7
  export * as addUser from "./addUser.js";
8
8
  export * as inviteUser from "./inviteUser.js";
9
9
  export * as removeUser from "./removeUser.js";
10
+ export * as delete from "./delete.js";
10
11
  export * from "./requests/index.js";
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.removeUser = exports.inviteUser = exports.addUser = exports.getOrgIdsFromToken = exports.getMyOrganizationFromScopedToken = exports.isMember = exports.get = exports.update = exports.create = void 0;
39
+ exports.delete = exports.removeUser = exports.inviteUser = exports.addUser = exports.getOrgIdsFromToken = exports.getMyOrganizationFromScopedToken = exports.isMember = exports.get = exports.update = exports.create = void 0;
40
40
  exports.create = __importStar(require("./create.js"));
41
41
  exports.update = __importStar(require("./update.js"));
42
42
  exports.get = __importStar(require("./get.js"));
@@ -46,4 +46,5 @@ exports.getOrgIdsFromToken = __importStar(require("./getOrgIdsFromToken.js"));
46
46
  exports.addUser = __importStar(require("./addUser.js"));
47
47
  exports.inviteUser = __importStar(require("./inviteUser.js"));
48
48
  exports.removeUser = __importStar(require("./removeUser.js"));
49
+ exports.delete = __importStar(require("./delete.js"));
49
50
  __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index.js";
5
+ import * as FernVenusApi from "../../../../api/index.js";
6
+ import * as core from "../../../../core/index.js";
7
+ export declare const Error: core.serialization.Schema<serializers.organization.delete.Error.Raw, FernVenusApi.organization.delete.Error>;
8
+ export declare namespace Error {
9
+ type Raw = Error.UnauthorizedError | Error.OrganizationNotFoundError;
10
+ interface UnauthorizedError {
11
+ error: "UnauthorizedError";
12
+ }
13
+ interface OrganizationNotFoundError {
14
+ error: "OrganizationNotFoundError";
15
+ }
16
+ }
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || (function () {
22
+ var ownKeys = function(o) {
23
+ ownKeys = Object.getOwnPropertyNames || function (o) {
24
+ var ar = [];
25
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
+ return ar;
27
+ };
28
+ return ownKeys(o);
29
+ };
30
+ return function (mod) {
31
+ if (mod && mod.__esModule) return mod;
32
+ var result = {};
33
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
+ __setModuleDefault(result, mod);
35
+ return result;
36
+ };
37
+ })();
38
+ var __rest = (this && this.__rest) || function (s, e) {
39
+ var t = {};
40
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
41
+ t[p] = s[p];
42
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
43
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
44
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
45
+ t[p[i]] = s[p[i]];
46
+ }
47
+ return t;
48
+ };
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.Error = void 0;
51
+ const FernVenusApi = __importStar(require("../../../../api/index.js"));
52
+ const core = __importStar(require("../../../../core/index.js"));
53
+ exports.Error = core.serialization
54
+ .union("error", {
55
+ UnauthorizedError: core.serialization.object({}),
56
+ OrganizationNotFoundError: core.serialization.object({}),
57
+ })
58
+ .transform({
59
+ transform: (value) => {
60
+ switch (value.error) {
61
+ case "UnauthorizedError":
62
+ return FernVenusApi.organization.delete.Error.unauthorizedError();
63
+ case "OrganizationNotFoundError":
64
+ return FernVenusApi.organization.delete.Error.organizationNotFoundError();
65
+ }
66
+ },
67
+ untransform: (_a) => {
68
+ var { _visit } = _a, value = __rest(_a, ["_visit"]);
69
+ return value;
70
+ },
71
+ });
@@ -7,4 +7,5 @@ export * as getOrgIdsFromToken from "./getOrgIdsFromToken.js";
7
7
  export * as addUser from "./addUser.js";
8
8
  export * as inviteUser from "./inviteUser.js";
9
9
  export * as removeUser from "./removeUser.js";
10
+ export * as delete from "./delete.js";
10
11
  export * from "./requests/index.js";
@@ -36,7 +36,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
36
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.removeUser = exports.inviteUser = exports.addUser = exports.getOrgIdsFromToken = exports.getMyOrganizationFromScopedToken = exports.isMember = exports.get = exports.update = exports.create = void 0;
39
+ exports.delete = exports.removeUser = exports.inviteUser = exports.addUser = exports.getOrgIdsFromToken = exports.getMyOrganizationFromScopedToken = exports.isMember = exports.get = exports.update = exports.create = void 0;
40
40
  exports.create = __importStar(require("./create.js"));
41
41
  exports.update = __importStar(require("./update.js"));
42
42
  exports.get = __importStar(require("./get.js"));
@@ -46,4 +46,5 @@ exports.getOrgIdsFromToken = __importStar(require("./getOrgIdsFromToken.js"));
46
46
  exports.addUser = __importStar(require("./addUser.js"));
47
47
  exports.inviteUser = __importStar(require("./inviteUser.js"));
48
48
  exports.removeUser = __importStar(require("./removeUser.js"));
49
+ exports.delete = __importStar(require("./delete.js"));
49
50
  __exportStar(require("./requests/index.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.19.7";
1
+ export declare const SDK_VERSION = "0.19.8-1-g4e79e5b";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.19.7";
4
+ exports.SDK_VERSION = "0.19.8-1-g4e79e5b";
@@ -11,7 +11,7 @@ export class FernVenusApiClient {
11
11
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
12
12
  "X-Fern-Language": "JavaScript",
13
13
  "X-Fern-SDK-Name": "@fern-api/venus-api-sdk",
14
- "X-Fern-SDK-Version": "0.19.7",
14
+ "X-Fern-SDK-Version": "0.19.8-1-g4e79e5b",
15
15
  "X-Fern-Runtime": core.RUNTIME.type,
16
16
  "X-Fern-Runtime-Version": core.RUNTIME.version,
17
17
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -145,5 +145,16 @@ export declare class Organization {
145
145
  */
146
146
  removeUser(request: FernVenusApi.RemoveUserFromOrgRequest, requestOptions?: Organization.RequestOptions): core.HttpResponsePromise<core.APIResponse<void, FernVenusApi.organization.removeUser.Error>>;
147
147
  private __removeUser;
148
+ /**
149
+ * Deletes an organization. Only users with admin role can delete organizations.
150
+ *
151
+ * @param {FernVenusApi.OrganizationId} orgId
152
+ * @param {Organization.RequestOptions} requestOptions - Request-specific configuration.
153
+ *
154
+ * @example
155
+ * await client.organization.delete(FernVenusApi.OrganizationId("orgId"))
156
+ */
157
+ delete(orgId: FernVenusApi.OrganizationId, requestOptions?: Organization.RequestOptions): core.HttpResponsePromise<core.APIResponse<void, FernVenusApi.organization.delete.Error>>;
158
+ private __delete;
148
159
  protected _getAuthorizationHeader(): Promise<string | undefined>;
149
160
  }
@@ -658,6 +658,72 @@ export class Organization {
658
658
  };
659
659
  });
660
660
  }
661
+ /**
662
+ * Deletes an organization. Only users with admin role can delete organizations.
663
+ *
664
+ * @param {FernVenusApi.OrganizationId} orgId
665
+ * @param {Organization.RequestOptions} requestOptions - Request-specific configuration.
666
+ *
667
+ * @example
668
+ * await client.organization.delete(FernVenusApi.OrganizationId("orgId"))
669
+ */
670
+ delete(orgId, requestOptions) {
671
+ return core.HttpResponsePromise.fromPromise(this.__delete(orgId, requestOptions));
672
+ }
673
+ __delete(orgId, requestOptions) {
674
+ return __awaiter(this, void 0, void 0, function* () {
675
+ var _a, _b, _c, _d;
676
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
677
+ const _response = yield core.fetcher({
678
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.FernVenusApiEnvironment.Prod, `/organizations/${encodeURIComponent(serializers.OrganizationId.jsonOrThrow(orgId, { omitUndefined: true }))}`),
679
+ method: "DELETE",
680
+ headers: _headers,
681
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
682
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
683
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
684
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
685
+ });
686
+ if (_response.ok) {
687
+ return {
688
+ data: {
689
+ ok: true,
690
+ body: undefined,
691
+ headers: _response.headers,
692
+ rawResponse: _response.rawResponse,
693
+ },
694
+ rawResponse: _response.rawResponse,
695
+ };
696
+ }
697
+ if (_response.error.reason === "status-code") {
698
+ switch ((_d = _response.error.body) === null || _d === void 0 ? void 0 : _d.error) {
699
+ case "UnauthorizedError":
700
+ case "OrganizationNotFoundError":
701
+ return {
702
+ data: {
703
+ ok: false,
704
+ error: serializers.organization.delete.Error.parseOrThrow(_response.error.body, {
705
+ unrecognizedObjectKeys: "passthrough",
706
+ allowUnrecognizedUnionMembers: true,
707
+ allowUnrecognizedEnumValues: true,
708
+ skipValidation: true,
709
+ breadcrumbsPrefix: ["response"],
710
+ }),
711
+ rawResponse: _response.rawResponse,
712
+ },
713
+ rawResponse: _response.rawResponse,
714
+ };
715
+ }
716
+ }
717
+ return {
718
+ data: {
719
+ ok: false,
720
+ error: FernVenusApi.organization.delete.Error._unknown(_response.error),
721
+ rawResponse: _response.rawResponse,
722
+ },
723
+ rawResponse: _response.rawResponse,
724
+ };
725
+ });
726
+ }
661
727
  _getAuthorizationHeader() {
662
728
  return __awaiter(this, void 0, void 0, function* () {
663
729
  const bearer = yield core.Supplier.get(this._options.token);
@@ -0,0 +1,32 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as FernVenusApi from "../../../index.mjs";
5
+ import * as core from "../../../../core/index.mjs";
6
+ export type Error = FernVenusApi.organization.delete.Error.UnauthorizedError | FernVenusApi.organization.delete.Error.OrganizationNotFoundError | FernVenusApi.organization.delete.Error._Unknown;
7
+ export declare namespace Error {
8
+ interface UnauthorizedError extends _Utils {
9
+ error: "UnauthorizedError";
10
+ }
11
+ interface OrganizationNotFoundError extends _Utils {
12
+ error: "OrganizationNotFoundError";
13
+ }
14
+ interface _Unknown extends _Utils {
15
+ error: void;
16
+ content: core.Fetcher.Error;
17
+ }
18
+ interface _Utils {
19
+ _visit: <_Result>(visitor: FernVenusApi.organization.delete.Error._Visitor<_Result>) => _Result;
20
+ }
21
+ interface _Visitor<_Result> {
22
+ unauthorizedError: () => _Result;
23
+ organizationNotFoundError: () => _Result;
24
+ _other: (value: core.Fetcher.Error) => _Result;
25
+ }
26
+ }
27
+ export declare const Error: {
28
+ readonly unauthorizedError: () => FernVenusApi.organization.delete.Error.UnauthorizedError;
29
+ readonly organizationNotFoundError: () => FernVenusApi.organization.delete.Error.OrganizationNotFoundError;
30
+ readonly _unknown: (fetcherError: core.Fetcher.Error) => FernVenusApi.organization.delete.Error._Unknown;
31
+ readonly _visit: <_Result>(value: FernVenusApi.organization.delete.Error, visitor: FernVenusApi.organization.delete.Error._Visitor<_Result>) => _Result;
32
+ };
@@ -0,0 +1,41 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as FernVenusApi from "../../../index.mjs";
5
+ export const Error = {
6
+ unauthorizedError: () => {
7
+ return {
8
+ error: "UnauthorizedError",
9
+ _visit: function (visitor) {
10
+ return FernVenusApi.organization.delete.Error._visit(this, visitor);
11
+ },
12
+ };
13
+ },
14
+ organizationNotFoundError: () => {
15
+ return {
16
+ error: "OrganizationNotFoundError",
17
+ _visit: function (visitor) {
18
+ return FernVenusApi.organization.delete.Error._visit(this, visitor);
19
+ },
20
+ };
21
+ },
22
+ _unknown: (fetcherError) => {
23
+ return {
24
+ error: undefined,
25
+ content: fetcherError,
26
+ _visit: function (visitor) {
27
+ return FernVenusApi.organization.delete.Error._visit(this, visitor);
28
+ },
29
+ };
30
+ },
31
+ _visit: (value, visitor) => {
32
+ switch (value.error) {
33
+ case "UnauthorizedError":
34
+ return visitor.unauthorizedError();
35
+ case "OrganizationNotFoundError":
36
+ return visitor.organizationNotFoundError();
37
+ default:
38
+ return visitor._other(value);
39
+ }
40
+ },
41
+ };
@@ -7,4 +7,5 @@ export * as getOrgIdsFromToken from "./getOrgIdsFromToken.mjs";
7
7
  export * as addUser from "./addUser.mjs";
8
8
  export * as inviteUser from "./inviteUser.mjs";
9
9
  export * as removeUser from "./removeUser.mjs";
10
+ export * as delete from "./delete.mjs";
10
11
  export * from "./requests/index.mjs";
@@ -7,4 +7,5 @@ export * as getOrgIdsFromToken from "./getOrgIdsFromToken.mjs";
7
7
  export * as addUser from "./addUser.mjs";
8
8
  export * as inviteUser from "./inviteUser.mjs";
9
9
  export * as removeUser from "./removeUser.mjs";
10
+ export * as delete from "./delete.mjs";
10
11
  export * from "./requests/index.mjs";
@@ -0,0 +1,16 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../../../index.mjs";
5
+ import * as FernVenusApi from "../../../../api/index.mjs";
6
+ import * as core from "../../../../core/index.mjs";
7
+ export declare const Error: core.serialization.Schema<serializers.organization.delete.Error.Raw, FernVenusApi.organization.delete.Error>;
8
+ export declare namespace Error {
9
+ type Raw = Error.UnauthorizedError | Error.OrganizationNotFoundError;
10
+ interface UnauthorizedError {
11
+ error: "UnauthorizedError";
12
+ }
13
+ interface OrganizationNotFoundError {
14
+ error: "OrganizationNotFoundError";
15
+ }
16
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ var __rest = (this && this.__rest) || function (s, e) {
5
+ var t = {};
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
7
+ t[p] = s[p];
8
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
9
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
10
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
11
+ t[p[i]] = s[p[i]];
12
+ }
13
+ return t;
14
+ };
15
+ import * as FernVenusApi from "../../../../api/index.mjs";
16
+ import * as core from "../../../../core/index.mjs";
17
+ export const Error = core.serialization
18
+ .union("error", {
19
+ UnauthorizedError: core.serialization.object({}),
20
+ OrganizationNotFoundError: core.serialization.object({}),
21
+ })
22
+ .transform({
23
+ transform: (value) => {
24
+ switch (value.error) {
25
+ case "UnauthorizedError":
26
+ return FernVenusApi.organization.delete.Error.unauthorizedError();
27
+ case "OrganizationNotFoundError":
28
+ return FernVenusApi.organization.delete.Error.organizationNotFoundError();
29
+ }
30
+ },
31
+ untransform: (_a) => {
32
+ var { _visit } = _a, value = __rest(_a, ["_visit"]);
33
+ return value;
34
+ },
35
+ });
@@ -7,4 +7,5 @@ export * as getOrgIdsFromToken from "./getOrgIdsFromToken.mjs";
7
7
  export * as addUser from "./addUser.mjs";
8
8
  export * as inviteUser from "./inviteUser.mjs";
9
9
  export * as removeUser from "./removeUser.mjs";
10
+ export * as delete from "./delete.mjs";
10
11
  export * from "./requests/index.mjs";
@@ -7,4 +7,5 @@ export * as getOrgIdsFromToken from "./getOrgIdsFromToken.mjs";
7
7
  export * as addUser from "./addUser.mjs";
8
8
  export * as inviteUser from "./inviteUser.mjs";
9
9
  export * as removeUser from "./removeUser.mjs";
10
+ export * as delete from "./delete.mjs";
10
11
  export * from "./requests/index.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.19.7";
1
+ export declare const SDK_VERSION = "0.19.8-1-g4e79e5b";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.19.7";
1
+ export const SDK_VERSION = "0.19.8-1-g4e79e5b";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/venus-api-sdk",
3
- "version": "0.19.7",
3
+ "version": "0.19.8-1-g4e79e5b",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "main": "./dist/cjs/index.js",