bruce-models 0.2.6 → 0.2.7
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/bruce-models.es5.js +28 -0
- package/dist/bruce-models.es5.js.map +1 -1
- package/dist/bruce-models.umd.js +28 -0
- package/dist/bruce-models.umd.js.map +1 -1
- package/dist/lib/api/api.js +1 -0
- package/dist/lib/api/api.js.map +1 -1
- package/dist/lib/user/user.js +27 -0
- package/dist/lib/user/user.js.map +1 -1
- package/dist/types/api/api.d.ts +1 -0
- package/dist/types/user/user.d.ts +3 -1
- package/package.json +1 -1
package/dist/bruce-models.umd.js
CHANGED
|
@@ -111,6 +111,7 @@
|
|
|
111
111
|
ECacheKey["Style"] = "style";
|
|
112
112
|
ECacheKey["PublishTileset"] = "publishtileset";
|
|
113
113
|
ECacheKey["User"] = "user";
|
|
114
|
+
ECacheKey["UserEmail"] = "useremail";
|
|
114
115
|
ECacheKey["AccessToken"] = "accesstoken";
|
|
115
116
|
ECacheKey["UserGroup"] = "usergroup";
|
|
116
117
|
ECacheKey["Account"] = "account";
|
|
@@ -4830,6 +4831,10 @@
|
|
|
4830
4831
|
return exports.Api.ECacheKey.User + exports.Api.ECacheKey.Id + userId + exports.Api.ECacheKey.Id + accountId;
|
|
4831
4832
|
}
|
|
4832
4833
|
User.GetCacheKey = GetCacheKey;
|
|
4834
|
+
function GetEmailCacheKey(email, accountId) {
|
|
4835
|
+
return exports.Api.ECacheKey.User + exports.Api.ECacheKey.UserEmail + email + exports.Api.ECacheKey.Id + accountId;
|
|
4836
|
+
}
|
|
4837
|
+
User.GetEmailCacheKey = GetEmailCacheKey;
|
|
4833
4838
|
var EType;
|
|
4834
4839
|
(function (EType) {
|
|
4835
4840
|
EType["User"] = "LOGIN_USER";
|
|
@@ -4921,6 +4926,29 @@
|
|
|
4921
4926
|
return exports.Api.ECacheKey.User + exports.Api.ECacheKey.Account + exports.Api.ECacheKey.Id + accountId;
|
|
4922
4927
|
}
|
|
4923
4928
|
LoginUser.GetListCacheKey = GetListCacheKey;
|
|
4929
|
+
function GetByEmail(api, email, accountId) {
|
|
4930
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
4931
|
+
var cacheData, req;
|
|
4932
|
+
return __generator(this, function (_a) {
|
|
4933
|
+
switch (_a.label) {
|
|
4934
|
+
case 0:
|
|
4935
|
+
if (!email) {
|
|
4936
|
+
throw ("Email is required.");
|
|
4937
|
+
}
|
|
4938
|
+
cacheData = api.Cache.Get(GetEmailCacheKey(email, accountId));
|
|
4939
|
+
if (cacheData) {
|
|
4940
|
+
return [2 /*return*/, cacheData];
|
|
4941
|
+
}
|
|
4942
|
+
return [4 /*yield*/, api.GET("userByEmail/" + email + (accountId ? "?clientAccountID=" + accountId : ""))];
|
|
4943
|
+
case 1:
|
|
4944
|
+
req = _a.sent();
|
|
4945
|
+
api.Cache.Set(GetEmailCacheKey(email, accountId), req, exports.Api.DEFAULT_CACHE_DURATION);
|
|
4946
|
+
return [2 /*return*/, req];
|
|
4947
|
+
}
|
|
4948
|
+
});
|
|
4949
|
+
});
|
|
4950
|
+
}
|
|
4951
|
+
LoginUser.GetByEmail = GetByEmail;
|
|
4924
4952
|
function GetList(api, accountId, exclusive) {
|
|
4925
4953
|
return __awaiter(this, void 0, void 0, function () {
|
|
4926
4954
|
var cacheData, req;
|