bruce-models 1.3.9 → 1.4.1

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.
@@ -3556,7 +3556,9 @@ var EntityTag;
3556
3556
  try {
3557
3557
  const tags = yield prom;
3558
3558
  const tag = tags.find((t) => t.ID === id);
3559
- res(tag);
3559
+ res({
3560
+ tag: tag
3561
+ });
3560
3562
  }
3561
3563
  catch (e) {
3562
3564
  rej(e);
@@ -3567,7 +3569,7 @@ var EntityTag;
3567
3569
  }
3568
3570
  }
3569
3571
  return {
3570
- tags: (yield Promise.all(reqs)).filter(x => !!x)
3572
+ tags: (yield Promise.all(reqs)).map(x => x === null || x === void 0 ? void 0 : x.tag).filter(x => !!x)
3571
3573
  };
3572
3574
  });
3573
3575
  }
@@ -6064,11 +6066,19 @@ var User;
6064
6066
  if (cacheData) {
6065
6067
  return cacheData;
6066
6068
  }
6067
- const req = yield api.GET(`user/${id}${accountId ? `?clientAccountID=${accountId}` : ""}`, reqParams);
6068
- api.Cache.Set(GetCacheKey(id, accountId), req, Api.DEFAULT_CACHE_DURATION);
6069
- return {
6070
- user: req
6071
- };
6069
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
6070
+ try {
6071
+ const data = yield api.GET(`user/${id}${accountId ? `?clientAccountID=${accountId}` : ""}`, reqParams);
6072
+ res({
6073
+ user: data
6074
+ });
6075
+ }
6076
+ catch (e) {
6077
+ rej(e);
6078
+ }
6079
+ }));
6080
+ api.Cache.Set(GetCacheKey(id, accountId), prom, Api.DEFAULT_CACHE_DURATION);
6081
+ return prom;
6072
6082
  });
6073
6083
  }
6074
6084
  User.Get = Get;
@@ -6209,11 +6219,19 @@ var User;
6209
6219
  if (cacheData) {
6210
6220
  return cacheData;
6211
6221
  }
6212
- const req = yield api.GET(`userByEmail/${email}${accountId ? `?clientAccountID=${accountId}` : ""}`, reqParams);
6213
- api.Cache.Set(GetEmailCacheKey(email, accountId), req, Api.DEFAULT_CACHE_DURATION);
6214
- return {
6215
- user: req
6216
- };
6222
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
6223
+ try {
6224
+ const data = yield api.GET(`userByEmail/${email}${accountId ? `?clientAccountID=${accountId}` : ""}`, reqParams);
6225
+ res({
6226
+ user: data
6227
+ });
6228
+ }
6229
+ catch (e) {
6230
+ rej(e);
6231
+ }
6232
+ }));
6233
+ api.Cache.Set(GetEmailCacheKey(email, accountId), prom, Api.DEFAULT_CACHE_DURATION);
6234
+ return prom;
6217
6235
  });
6218
6236
  }
6219
6237
  LoginUser.GetByEmail = GetByEmail;
@@ -6244,7 +6262,9 @@ var User;
6244
6262
  req.then((data) => {
6245
6263
  const users = data.users;
6246
6264
  for (let i = 0; i < users.length; i++) {
6247
- api.Cache.Set(GetCacheKey(users[i].ID, accountId), users[i]);
6265
+ api.Cache.Set(GetCacheKey(users[i].ID, accountId), {
6266
+ user: users[i]
6267
+ });
6248
6268
  }
6249
6269
  });
6250
6270
  if (!exclusive) {
@@ -6386,7 +6406,7 @@ var User;
6386
6406
  try {
6387
6407
  const data = yield api.GET("usersByClientAccount/accessTokens", reqParams);
6388
6408
  res({
6389
- tokens: data.Items
6409
+ users: data.Items
6390
6410
  });
6391
6411
  }
6392
6412
  catch (e) {
@@ -6396,7 +6416,9 @@ var User;
6396
6416
  req.then((data) => {
6397
6417
  const users = data.tokens;
6398
6418
  for (let i = 0; i < users.length; i++) {
6399
- api.Cache.Set(GetCacheKey(users[i].ID, accountId), users[i]);
6419
+ api.Cache.Set(GetCacheKey(users[i].ID, accountId), {
6420
+ user: users[i]
6421
+ });
6400
6422
  }
6401
6423
  });
6402
6424
  api.Cache.Set(GetListCacheKey(accountId), req, Api.DEFAULT_CACHE_DURATION);
@@ -6428,7 +6450,7 @@ var User;
6428
6450
  data = yield api.POST("accessToken", data, reqParams);
6429
6451
  api.Cache.RemoveByStartsWith(Api.ECacheKey.AccessToken + Api.ECacheKey.Account);
6430
6452
  return {
6431
- token: data
6453
+ user: data
6432
6454
  };
6433
6455
  });
6434
6456
  }