@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.
- package/dist/cjs/Client.js +1 -1
- package/dist/cjs/api/resources/organization/client/Client.d.ts +11 -0
- package/dist/cjs/api/resources/organization/client/Client.js +66 -0
- package/dist/cjs/api/resources/organization/client/delete.d.ts +32 -0
- package/dist/cjs/api/resources/organization/client/delete.js +77 -0
- package/dist/cjs/api/resources/organization/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/organization/client/index.js +2 -1
- package/dist/cjs/api/resources/user/client/Client.d.ts +14 -0
- package/dist/cjs/api/resources/user/client/Client.js +61 -0
- package/dist/cjs/api/resources/user/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/user/client/index.js +2 -1
- package/dist/cjs/api/resources/user/client/linkAccounts.d.ts +22 -0
- package/dist/cjs/api/resources/user/client/linkAccounts.js +57 -0
- package/dist/cjs/api/resources/user/types/LinkAccountsRequest.d.ts +7 -0
- package/dist/cjs/api/resources/user/types/LinkAccountsRequest.js +5 -0
- package/dist/cjs/api/resources/user/types/LinkAccountsResponse.d.ts +8 -0
- package/dist/cjs/api/resources/user/types/LinkAccountsResponse.js +5 -0
- package/dist/cjs/api/resources/user/types/index.d.ts +2 -0
- package/dist/cjs/api/resources/user/types/index.js +2 -0
- package/dist/cjs/serialization/resources/organization/client/delete.d.ts +16 -0
- package/dist/cjs/serialization/resources/organization/client/delete.js +71 -0
- package/dist/cjs/serialization/resources/organization/client/index.d.ts +1 -0
- package/dist/cjs/serialization/resources/organization/client/index.js +2 -1
- package/dist/cjs/serialization/resources/user/types/LinkAccountsRequest.d.ts +13 -0
- package/dist/cjs/serialization/resources/user/types/LinkAccountsRequest.js +44 -0
- package/dist/cjs/serialization/resources/user/types/LinkAccountsResponse.d.ts +14 -0
- package/dist/cjs/serialization/resources/user/types/LinkAccountsResponse.js +45 -0
- package/dist/cjs/serialization/resources/user/types/index.d.ts +2 -0
- package/dist/cjs/serialization/resources/user/types/index.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +1 -1
- package/dist/esm/api/resources/organization/client/Client.d.mts +11 -0
- package/dist/esm/api/resources/organization/client/Client.mjs +66 -0
- package/dist/esm/api/resources/organization/client/delete.d.mts +32 -0
- package/dist/esm/api/resources/organization/client/delete.mjs +41 -0
- package/dist/esm/api/resources/organization/client/index.d.mts +1 -0
- package/dist/esm/api/resources/organization/client/index.mjs +1 -0
- package/dist/esm/api/resources/user/client/Client.d.mts +14 -0
- package/dist/esm/api/resources/user/client/Client.mjs +61 -0
- package/dist/esm/api/resources/user/client/index.d.mts +1 -0
- package/dist/esm/api/resources/user/client/index.mjs +1 -0
- package/dist/esm/api/resources/user/client/linkAccounts.d.mts +22 -0
- package/dist/esm/api/resources/user/client/linkAccounts.mjs +21 -0
- package/dist/esm/api/resources/user/types/LinkAccountsRequest.d.mts +7 -0
- package/dist/esm/api/resources/user/types/LinkAccountsRequest.mjs +4 -0
- package/dist/esm/api/resources/user/types/LinkAccountsResponse.d.mts +8 -0
- package/dist/esm/api/resources/user/types/LinkAccountsResponse.mjs +4 -0
- package/dist/esm/api/resources/user/types/index.d.mts +2 -0
- package/dist/esm/api/resources/user/types/index.mjs +2 -0
- package/dist/esm/serialization/resources/organization/client/delete.d.mts +16 -0
- package/dist/esm/serialization/resources/organization/client/delete.mjs +35 -0
- package/dist/esm/serialization/resources/organization/client/index.d.mts +1 -0
- package/dist/esm/serialization/resources/organization/client/index.mjs +1 -0
- package/dist/esm/serialization/resources/user/types/LinkAccountsRequest.d.mts +13 -0
- package/dist/esm/serialization/resources/user/types/LinkAccountsRequest.mjs +8 -0
- package/dist/esm/serialization/resources/user/types/LinkAccountsResponse.d.mts +14 -0
- package/dist/esm/serialization/resources/user/types/LinkAccountsResponse.mjs +9 -0
- package/dist/esm/serialization/resources/user/types/index.d.mts +2 -0
- package/dist/esm/serialization/resources/user/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,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
|
+
});
|
|
@@ -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);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.19.
|
|
1
|
+
export declare const SDK_VERSION = "0.19.7-1-g2d547ca";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -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.
|
|
14
|
+
"X-Fern-SDK-Version": "0.19.7-1-g2d547ca",
|
|
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";
|
|
@@ -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);
|
|
@@ -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,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";
|
|
@@ -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
|
+
});
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.19.
|
|
1
|
+
export declare const SDK_VERSION = "0.19.7-1-g2d547ca";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.19.
|
|
1
|
+
export const SDK_VERSION = "0.19.7-1-g2d547ca";
|