@riocrypto/common 1.0.500 → 1.0.501
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
2
|
import { BusinessUser } from "../types/business-user";
|
|
3
3
|
import { User } from "../types/user";
|
|
4
|
-
export declare const getUserFromClientHelper: (client: AxiosInstance) => Promise<User | BusinessUser | null>;
|
|
4
|
+
export declare const getUserFromClientHelper: (client: AxiosInstance, includeDeleted?: boolean) => Promise<User | BusinessUser | null | undefined>;
|
|
@@ -11,7 +11,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getUserFromClientHelper = void 0;
|
|
13
13
|
const rio_client_1 = require("../clients/rio-client");
|
|
14
|
-
const
|
|
14
|
+
const user_attribute_1 = require("../types/user-attribute");
|
|
15
|
+
const getUserFromClientHelper = (client, includeDeleted) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
var _a;
|
|
15
17
|
let individualUser;
|
|
16
18
|
let businessUser;
|
|
17
19
|
try {
|
|
@@ -27,6 +29,13 @@ const getUserFromClientHelper = (client) => __awaiter(void 0, void 0, void 0, fu
|
|
|
27
29
|
businessUser = null;
|
|
28
30
|
}
|
|
29
31
|
const user = individualUser || businessUser;
|
|
30
|
-
|
|
32
|
+
if (includeDeleted) {
|
|
33
|
+
return user;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
if ((_a = user === null || user === void 0 ? void 0 : user.attributes) === null || _a === void 0 ? void 0 : _a.includes(user_attribute_1.UserAttribute.deleted)) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
31
40
|
});
|
|
32
41
|
exports.getUserFromClientHelper = getUserFromClientHelper;
|