@fern-api/venus-api-sdk 0.19.6 → 0.19.7-1-g2d547ca

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 (63) 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/api/resources/user/client/Client.d.ts +14 -0
  9. package/dist/cjs/api/resources/user/client/Client.js +61 -0
  10. package/dist/cjs/api/resources/user/client/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/user/client/index.js +2 -1
  12. package/dist/cjs/api/resources/user/client/linkAccounts.d.ts +22 -0
  13. package/dist/cjs/api/resources/user/client/linkAccounts.js +57 -0
  14. package/dist/cjs/api/resources/user/types/LinkAccountsRequest.d.ts +7 -0
  15. package/dist/cjs/api/resources/user/types/LinkAccountsRequest.js +5 -0
  16. package/dist/cjs/api/resources/user/types/LinkAccountsResponse.d.ts +8 -0
  17. package/dist/cjs/api/resources/user/types/LinkAccountsResponse.js +5 -0
  18. package/dist/cjs/api/resources/user/types/index.d.ts +2 -0
  19. package/dist/cjs/api/resources/user/types/index.js +2 -0
  20. package/dist/cjs/serialization/resources/organization/client/delete.d.ts +16 -0
  21. package/dist/cjs/serialization/resources/organization/client/delete.js +71 -0
  22. package/dist/cjs/serialization/resources/organization/client/index.d.ts +1 -0
  23. package/dist/cjs/serialization/resources/organization/client/index.js +2 -1
  24. package/dist/cjs/serialization/resources/user/types/LinkAccountsRequest.d.ts +13 -0
  25. package/dist/cjs/serialization/resources/user/types/LinkAccountsRequest.js +44 -0
  26. package/dist/cjs/serialization/resources/user/types/LinkAccountsResponse.d.ts +14 -0
  27. package/dist/cjs/serialization/resources/user/types/LinkAccountsResponse.js +45 -0
  28. package/dist/cjs/serialization/resources/user/types/index.d.ts +2 -0
  29. package/dist/cjs/serialization/resources/user/types/index.js +2 -0
  30. package/dist/cjs/version.d.ts +1 -1
  31. package/dist/cjs/version.js +1 -1
  32. package/dist/esm/Client.mjs +1 -1
  33. package/dist/esm/api/resources/organization/client/Client.d.mts +11 -0
  34. package/dist/esm/api/resources/organization/client/Client.mjs +66 -0
  35. package/dist/esm/api/resources/organization/client/delete.d.mts +32 -0
  36. package/dist/esm/api/resources/organization/client/delete.mjs +41 -0
  37. package/dist/esm/api/resources/organization/client/index.d.mts +1 -0
  38. package/dist/esm/api/resources/organization/client/index.mjs +1 -0
  39. package/dist/esm/api/resources/user/client/Client.d.mts +14 -0
  40. package/dist/esm/api/resources/user/client/Client.mjs +61 -0
  41. package/dist/esm/api/resources/user/client/index.d.mts +1 -0
  42. package/dist/esm/api/resources/user/client/index.mjs +1 -0
  43. package/dist/esm/api/resources/user/client/linkAccounts.d.mts +22 -0
  44. package/dist/esm/api/resources/user/client/linkAccounts.mjs +21 -0
  45. package/dist/esm/api/resources/user/types/LinkAccountsRequest.d.mts +7 -0
  46. package/dist/esm/api/resources/user/types/LinkAccountsRequest.mjs +4 -0
  47. package/dist/esm/api/resources/user/types/LinkAccountsResponse.d.mts +8 -0
  48. package/dist/esm/api/resources/user/types/LinkAccountsResponse.mjs +4 -0
  49. package/dist/esm/api/resources/user/types/index.d.mts +2 -0
  50. package/dist/esm/api/resources/user/types/index.mjs +2 -0
  51. package/dist/esm/serialization/resources/organization/client/delete.d.mts +16 -0
  52. package/dist/esm/serialization/resources/organization/client/delete.mjs +35 -0
  53. package/dist/esm/serialization/resources/organization/client/index.d.mts +1 -0
  54. package/dist/esm/serialization/resources/organization/client/index.mjs +1 -0
  55. package/dist/esm/serialization/resources/user/types/LinkAccountsRequest.d.mts +13 -0
  56. package/dist/esm/serialization/resources/user/types/LinkAccountsRequest.mjs +8 -0
  57. package/dist/esm/serialization/resources/user/types/LinkAccountsResponse.d.mts +14 -0
  58. package/dist/esm/serialization/resources/user/types/LinkAccountsResponse.mjs +9 -0
  59. package/dist/esm/serialization/resources/user/types/index.d.mts +2 -0
  60. package/dist/esm/serialization/resources/user/types/index.mjs +2 -0
  61. package/dist/esm/version.d.mts +1 -1
  62. package/dist/esm/version.mjs +1 -1
  63. 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.6",
50
+ "X-Fern-SDK-Version": "0.19.7-1-g2d547ca",
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);
@@ -48,5 +48,19 @@ export declare class User {
48
48
  */
49
49
  getMyOrganizations(request: FernVenusApi.GetUserOrganizationsRequest, requestOptions?: User.RequestOptions): core.HttpResponsePromise<core.APIResponse<FernVenusApi.OrganizationsPage, FernVenusApi.user.getMyOrganizations.Error>>;
50
50
  private __getMyOrganizations;
51
+ /**
52
+ * Link user accounts with the same verified email address.
53
+ * Requires admin token authentication.
54
+ *
55
+ * @param {FernVenusApi.LinkAccountsRequest} request
56
+ * @param {User.RequestOptions} requestOptions - Request-specific configuration.
57
+ *
58
+ * @example
59
+ * await client.user.linkAccounts({
60
+ * userId: FernVenusApi.UserId("userId")
61
+ * })
62
+ */
63
+ linkAccounts(request: FernVenusApi.LinkAccountsRequest, requestOptions?: User.RequestOptions): core.HttpResponsePromise<core.APIResponse<FernVenusApi.LinkAccountsResponse, FernVenusApi.user.linkAccounts.Error>>;
64
+ private __linkAccounts;
51
65
  protected _getAuthorizationHeader(): Promise<string | undefined>;
52
66
  }
@@ -159,6 +159,67 @@ class User {
159
159
  };
160
160
  });
161
161
  }
162
+ /**
163
+ * Link user accounts with the same verified email address.
164
+ * Requires admin token authentication.
165
+ *
166
+ * @param {FernVenusApi.LinkAccountsRequest} request
167
+ * @param {User.RequestOptions} requestOptions - Request-specific configuration.
168
+ *
169
+ * @example
170
+ * await client.user.linkAccounts({
171
+ * userId: FernVenusApi.UserId("userId")
172
+ * })
173
+ */
174
+ linkAccounts(request, requestOptions) {
175
+ return core.HttpResponsePromise.fromPromise(this.__linkAccounts(request, requestOptions));
176
+ }
177
+ __linkAccounts(request, requestOptions) {
178
+ return __awaiter(this, void 0, void 0, function* () {
179
+ var _a, _b, _c;
180
+ 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);
181
+ const _response = yield core.fetcher({
182
+ 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, "/users/link-accounts"),
183
+ method: "POST",
184
+ headers: _headers,
185
+ contentType: "application/json",
186
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
187
+ requestType: "json",
188
+ body: serializers.LinkAccountsRequest.jsonOrThrow(request, {
189
+ unrecognizedObjectKeys: "strip",
190
+ omitUndefined: true,
191
+ }),
192
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
193
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
194
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
195
+ });
196
+ if (_response.ok) {
197
+ return {
198
+ data: {
199
+ ok: true,
200
+ body: serializers.LinkAccountsResponse.parseOrThrow(_response.body, {
201
+ unrecognizedObjectKeys: "passthrough",
202
+ allowUnrecognizedUnionMembers: true,
203
+ allowUnrecognizedEnumValues: true,
204
+ skipValidation: true,
205
+ breadcrumbsPrefix: ["response"],
206
+ }),
207
+ headers: _response.headers,
208
+ rawResponse: _response.rawResponse,
209
+ },
210
+ rawResponse: _response.rawResponse,
211
+ };
212
+ }
213
+ return {
214
+ data: {
215
+ ok: false,
216
+ error: FernVenusApi.user.linkAccounts.Error._unknown(_response.error),
217
+ rawResponse: _response.rawResponse,
218
+ },
219
+ rawResponse: _response.rawResponse,
220
+ };
221
+ });
222
+ }
162
223
  _getAuthorizationHeader() {
163
224
  return __awaiter(this, void 0, void 0, function* () {
164
225
  const bearer = yield core.Supplier.get(this._options.token);
@@ -1,3 +1,4 @@
1
1
  export * as getMyself from "./getMyself.js";
2
2
  export * as getMyOrganizations from "./getMyOrganizations.js";
3
+ export * as linkAccounts from "./linkAccounts.js";
3
4
  export * from "./requests/index.js";
@@ -36,7 +36,8 @@ 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.getMyOrganizations = exports.getMyself = void 0;
39
+ exports.linkAccounts = exports.getMyOrganizations = exports.getMyself = void 0;
40
40
  exports.getMyself = __importStar(require("./getMyself.js"));
41
41
  exports.getMyOrganizations = __importStar(require("./getMyOrganizations.js"));
42
+ exports.linkAccounts = __importStar(require("./linkAccounts.js"));
42
43
  __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,22 @@
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.user.linkAccounts.Error._Unknown;
7
+ export declare namespace Error {
8
+ interface _Unknown extends _Utils {
9
+ error: void;
10
+ content: core.Fetcher.Error;
11
+ }
12
+ interface _Utils {
13
+ _visit: <_Result>(visitor: FernVenusApi.user.linkAccounts.Error._Visitor<_Result>) => _Result;
14
+ }
15
+ interface _Visitor<_Result> {
16
+ _other: (value: core.Fetcher.Error) => _Result;
17
+ }
18
+ }
19
+ export declare const Error: {
20
+ readonly _unknown: (fetcherError: core.Fetcher.Error) => FernVenusApi.user.linkAccounts.Error._Unknown;
21
+ readonly _visit: <_Result>(value: FernVenusApi.user.linkAccounts.Error, visitor: FernVenusApi.user.linkAccounts.Error._Visitor<_Result>) => _Result;
22
+ };
@@ -0,0 +1,57 @@
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
+ _unknown: (fetcherError) => {
43
+ return {
44
+ error: undefined,
45
+ content: fetcherError,
46
+ _visit: function (visitor) {
47
+ return FernVenusApi.user.linkAccounts.Error._visit(this, visitor);
48
+ },
49
+ };
50
+ },
51
+ _visit: (value, visitor) => {
52
+ switch (value.error) {
53
+ default:
54
+ return visitor._other(value);
55
+ }
56
+ },
57
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as FernVenusApi from "../../../index.js";
5
+ export interface LinkAccountsRequest {
6
+ userId: FernVenusApi.UserId;
7
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as FernVenusApi from "../../../index.js";
5
+ export interface LinkAccountsResponse {
6
+ linkedAccounts: FernVenusApi.UserId[];
7
+ totalLinked: number;
8
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,4 @@
1
1
  export * from "./User.js";
2
2
  export * from "./OrganizationsPage.js";
3
+ export * from "./LinkAccountsRequest.js";
4
+ export * from "./LinkAccountsResponse.js";
@@ -16,3 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./User.js"), exports);
18
18
  __exportStar(require("./OrganizationsPage.js"), exports);
19
+ __exportStar(require("./LinkAccountsRequest.js"), exports);
20
+ __exportStar(require("./LinkAccountsResponse.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);
@@ -0,0 +1,13 @@
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
+ import { UserId } from "../../commons/types/UserId.js";
8
+ export declare const LinkAccountsRequest: core.serialization.ObjectSchema<serializers.LinkAccountsRequest.Raw, FernVenusApi.LinkAccountsRequest>;
9
+ export declare namespace LinkAccountsRequest {
10
+ interface Raw {
11
+ userId: UserId.Raw;
12
+ }
13
+ }
@@ -0,0 +1,44 @@
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.LinkAccountsRequest = void 0;
40
+ const core = __importStar(require("../../../../core/index.js"));
41
+ const UserId_js_1 = require("../../commons/types/UserId.js");
42
+ exports.LinkAccountsRequest = core.serialization.object({
43
+ userId: UserId_js_1.UserId,
44
+ });