@fern-api/venus-api-sdk 0.19.5 → 0.19.6-2-gdf02bc4

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 (43) hide show
  1. package/dist/cjs/Client.js +1 -1
  2. package/dist/cjs/api/resources/user/client/Client.d.ts +14 -0
  3. package/dist/cjs/api/resources/user/client/Client.js +61 -0
  4. package/dist/cjs/api/resources/user/client/index.d.ts +1 -0
  5. package/dist/cjs/api/resources/user/client/index.js +2 -1
  6. package/dist/cjs/api/resources/user/client/linkAccounts.d.ts +22 -0
  7. package/dist/cjs/api/resources/user/client/linkAccounts.js +57 -0
  8. package/dist/cjs/api/resources/user/types/LinkAccountsRequest.d.ts +7 -0
  9. package/dist/cjs/api/resources/user/types/LinkAccountsRequest.js +5 -0
  10. package/dist/cjs/api/resources/user/types/LinkAccountsResponse.d.ts +8 -0
  11. package/dist/cjs/api/resources/user/types/LinkAccountsResponse.js +5 -0
  12. package/dist/cjs/api/resources/user/types/index.d.ts +2 -0
  13. package/dist/cjs/api/resources/user/types/index.js +2 -0
  14. package/dist/cjs/serialization/resources/user/types/LinkAccountsRequest.d.ts +13 -0
  15. package/dist/cjs/serialization/resources/user/types/LinkAccountsRequest.js +44 -0
  16. package/dist/cjs/serialization/resources/user/types/LinkAccountsResponse.d.ts +14 -0
  17. package/dist/cjs/serialization/resources/user/types/LinkAccountsResponse.js +45 -0
  18. package/dist/cjs/serialization/resources/user/types/index.d.ts +2 -0
  19. package/dist/cjs/serialization/resources/user/types/index.js +2 -0
  20. package/dist/cjs/version.d.ts +1 -1
  21. package/dist/cjs/version.js +1 -1
  22. package/dist/esm/Client.mjs +1 -1
  23. package/dist/esm/api/resources/user/client/Client.d.mts +14 -0
  24. package/dist/esm/api/resources/user/client/Client.mjs +61 -0
  25. package/dist/esm/api/resources/user/client/index.d.mts +1 -0
  26. package/dist/esm/api/resources/user/client/index.mjs +1 -0
  27. package/dist/esm/api/resources/user/client/linkAccounts.d.mts +22 -0
  28. package/dist/esm/api/resources/user/client/linkAccounts.mjs +21 -0
  29. package/dist/esm/api/resources/user/types/LinkAccountsRequest.d.mts +7 -0
  30. package/dist/esm/api/resources/user/types/LinkAccountsRequest.mjs +4 -0
  31. package/dist/esm/api/resources/user/types/LinkAccountsResponse.d.mts +8 -0
  32. package/dist/esm/api/resources/user/types/LinkAccountsResponse.mjs +4 -0
  33. package/dist/esm/api/resources/user/types/index.d.mts +2 -0
  34. package/dist/esm/api/resources/user/types/index.mjs +2 -0
  35. package/dist/esm/serialization/resources/user/types/LinkAccountsRequest.d.mts +13 -0
  36. package/dist/esm/serialization/resources/user/types/LinkAccountsRequest.mjs +8 -0
  37. package/dist/esm/serialization/resources/user/types/LinkAccountsResponse.d.mts +14 -0
  38. package/dist/esm/serialization/resources/user/types/LinkAccountsResponse.mjs +9 -0
  39. package/dist/esm/serialization/resources/user/types/index.d.mts +2 -0
  40. package/dist/esm/serialization/resources/user/types/index.mjs +2 -0
  41. package/dist/esm/version.d.mts +1 -1
  42. package/dist/esm/version.mjs +1 -1
  43. 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.5",
50
+ "X-Fern-SDK-Version": "0.19.6-2-gdf02bc4",
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) });
@@ -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,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
+ });
@@ -0,0 +1,14 @@
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 LinkAccountsResponse: core.serialization.ObjectSchema<serializers.LinkAccountsResponse.Raw, FernVenusApi.LinkAccountsResponse>;
9
+ export declare namespace LinkAccountsResponse {
10
+ interface Raw {
11
+ linkedAccounts: UserId.Raw[];
12
+ totalLinked: number;
13
+ }
14
+ }
@@ -0,0 +1,45 @@
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.LinkAccountsResponse = void 0;
40
+ const core = __importStar(require("../../../../core/index.js"));
41
+ const UserId_js_1 = require("../../commons/types/UserId.js");
42
+ exports.LinkAccountsResponse = core.serialization.object({
43
+ linkedAccounts: core.serialization.list(UserId_js_1.UserId),
44
+ totalLinked: core.serialization.number(),
45
+ });
@@ -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);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.19.5";
1
+ export declare const SDK_VERSION = "0.19.6-2-gdf02bc4";
@@ -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.5";
4
+ exports.SDK_VERSION = "0.19.6-2-gdf02bc4";
@@ -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.5",
14
+ "X-Fern-SDK-Version": "0.19.6-2-gdf02bc4",
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) });
@@ -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
  }
@@ -123,6 +123,67 @@ export class User {
123
123
  };
124
124
  });
125
125
  }
126
+ /**
127
+ * Link user accounts with the same verified email address.
128
+ * Requires admin token authentication.
129
+ *
130
+ * @param {FernVenusApi.LinkAccountsRequest} request
131
+ * @param {User.RequestOptions} requestOptions - Request-specific configuration.
132
+ *
133
+ * @example
134
+ * await client.user.linkAccounts({
135
+ * userId: FernVenusApi.UserId("userId")
136
+ * })
137
+ */
138
+ linkAccounts(request, requestOptions) {
139
+ return core.HttpResponsePromise.fromPromise(this.__linkAccounts(request, requestOptions));
140
+ }
141
+ __linkAccounts(request, requestOptions) {
142
+ return __awaiter(this, void 0, void 0, function* () {
143
+ var _a, _b, _c;
144
+ 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);
145
+ const _response = yield core.fetcher({
146
+ 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"),
147
+ method: "POST",
148
+ headers: _headers,
149
+ contentType: "application/json",
150
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
151
+ requestType: "json",
152
+ body: serializers.LinkAccountsRequest.jsonOrThrow(request, {
153
+ unrecognizedObjectKeys: "strip",
154
+ omitUndefined: true,
155
+ }),
156
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
157
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
158
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
159
+ });
160
+ if (_response.ok) {
161
+ return {
162
+ data: {
163
+ ok: true,
164
+ body: serializers.LinkAccountsResponse.parseOrThrow(_response.body, {
165
+ unrecognizedObjectKeys: "passthrough",
166
+ allowUnrecognizedUnionMembers: true,
167
+ allowUnrecognizedEnumValues: true,
168
+ skipValidation: true,
169
+ breadcrumbsPrefix: ["response"],
170
+ }),
171
+ headers: _response.headers,
172
+ rawResponse: _response.rawResponse,
173
+ },
174
+ rawResponse: _response.rawResponse,
175
+ };
176
+ }
177
+ return {
178
+ data: {
179
+ ok: false,
180
+ error: FernVenusApi.user.linkAccounts.Error._unknown(_response.error),
181
+ rawResponse: _response.rawResponse,
182
+ },
183
+ rawResponse: _response.rawResponse,
184
+ };
185
+ });
186
+ }
126
187
  _getAuthorizationHeader() {
127
188
  return __awaiter(this, void 0, void 0, function* () {
128
189
  const bearer = yield core.Supplier.get(this._options.token);
@@ -1,3 +1,4 @@
1
1
  export * as getMyself from "./getMyself.mjs";
2
2
  export * as getMyOrganizations from "./getMyOrganizations.mjs";
3
+ export * as linkAccounts from "./linkAccounts.mjs";
3
4
  export * from "./requests/index.mjs";
@@ -1,3 +1,4 @@
1
1
  export * as getMyself from "./getMyself.mjs";
2
2
  export * as getMyOrganizations from "./getMyOrganizations.mjs";
3
+ export * as linkAccounts from "./linkAccounts.mjs";
3
4
  export * from "./requests/index.mjs";
@@ -0,0 +1,22 @@
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.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,21 @@
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
+ _unknown: (fetcherError) => {
7
+ return {
8
+ error: undefined,
9
+ content: fetcherError,
10
+ _visit: function (visitor) {
11
+ return FernVenusApi.user.linkAccounts.Error._visit(this, visitor);
12
+ },
13
+ };
14
+ },
15
+ _visit: (value, visitor) => {
16
+ switch (value.error) {
17
+ default:
18
+ return visitor._other(value);
19
+ }
20
+ },
21
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as FernVenusApi from "../../../index.mjs";
5
+ export interface LinkAccountsRequest {
6
+ userId: FernVenusApi.UserId;
7
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as FernVenusApi from "../../../index.mjs";
5
+ export interface LinkAccountsResponse {
6
+ linkedAccounts: FernVenusApi.UserId[];
7
+ totalLinked: number;
8
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -1,2 +1,4 @@
1
1
  export * from "./User.mjs";
2
2
  export * from "./OrganizationsPage.mjs";
3
+ export * from "./LinkAccountsRequest.mjs";
4
+ export * from "./LinkAccountsResponse.mjs";
@@ -1,2 +1,4 @@
1
1
  export * from "./User.mjs";
2
2
  export * from "./OrganizationsPage.mjs";
3
+ export * from "./LinkAccountsRequest.mjs";
4
+ export * from "./LinkAccountsResponse.mjs";
@@ -0,0 +1,13 @@
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
+ import { UserId } from "../../commons/types/UserId.mjs";
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,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../core/index.mjs";
5
+ import { UserId } from "../../commons/types/UserId.mjs";
6
+ export const LinkAccountsRequest = core.serialization.object({
7
+ userId: UserId,
8
+ });
@@ -0,0 +1,14 @@
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
+ import { UserId } from "../../commons/types/UserId.mjs";
8
+ export declare const LinkAccountsResponse: core.serialization.ObjectSchema<serializers.LinkAccountsResponse.Raw, FernVenusApi.LinkAccountsResponse>;
9
+ export declare namespace LinkAccountsResponse {
10
+ interface Raw {
11
+ linkedAccounts: UserId.Raw[];
12
+ totalLinked: number;
13
+ }
14
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../core/index.mjs";
5
+ import { UserId } from "../../commons/types/UserId.mjs";
6
+ export const LinkAccountsResponse = core.serialization.object({
7
+ linkedAccounts: core.serialization.list(UserId),
8
+ totalLinked: core.serialization.number(),
9
+ });
@@ -1,2 +1,4 @@
1
1
  export * from "./User.mjs";
2
2
  export * from "./OrganizationsPage.mjs";
3
+ export * from "./LinkAccountsRequest.mjs";
4
+ export * from "./LinkAccountsResponse.mjs";
@@ -1,2 +1,4 @@
1
1
  export * from "./User.mjs";
2
2
  export * from "./OrganizationsPage.mjs";
3
+ export * from "./LinkAccountsRequest.mjs";
4
+ export * from "./LinkAccountsResponse.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.19.5";
1
+ export declare const SDK_VERSION = "0.19.6-2-gdf02bc4";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.19.5";
1
+ export const SDK_VERSION = "0.19.6-2-gdf02bc4";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fern-api/venus-api-sdk",
3
- "version": "0.19.5",
3
+ "version": "0.19.6-2-gdf02bc4",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "main": "./dist/cjs/index.js",