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.
@@ -3457,7 +3457,9 @@
3457
3457
  try {
3458
3458
  const tags = yield prom;
3459
3459
  const tag = tags.find((t) => t.ID === id);
3460
- res(tag);
3460
+ res({
3461
+ tag: tag
3462
+ });
3461
3463
  }
3462
3464
  catch (e) {
3463
3465
  rej(e);
@@ -3468,7 +3470,7 @@
3468
3470
  }
3469
3471
  }
3470
3472
  return {
3471
- tags: (yield Promise.all(reqs)).filter(x => !!x)
3473
+ tags: (yield Promise.all(reqs)).map(x => x === null || x === void 0 ? void 0 : x.tag).filter(x => !!x)
3472
3474
  };
3473
3475
  });
3474
3476
  }
@@ -5861,11 +5863,19 @@
5861
5863
  if (cacheData) {
5862
5864
  return cacheData;
5863
5865
  }
5864
- const req = yield api.GET(`user/${id}${accountId ? `?clientAccountID=${accountId}` : ""}`, reqParams);
5865
- api.Cache.Set(GetCacheKey(id, accountId), req, exports.Api.DEFAULT_CACHE_DURATION);
5866
- return {
5867
- user: req
5868
- };
5866
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
5867
+ try {
5868
+ const data = yield api.GET(`user/${id}${accountId ? `?clientAccountID=${accountId}` : ""}`, reqParams);
5869
+ res({
5870
+ user: data
5871
+ });
5872
+ }
5873
+ catch (e) {
5874
+ rej(e);
5875
+ }
5876
+ }));
5877
+ api.Cache.Set(GetCacheKey(id, accountId), prom, exports.Api.DEFAULT_CACHE_DURATION);
5878
+ return prom;
5869
5879
  });
5870
5880
  }
5871
5881
  User.Get = Get;
@@ -6006,11 +6016,19 @@
6006
6016
  if (cacheData) {
6007
6017
  return cacheData;
6008
6018
  }
6009
- const req = yield api.GET(`userByEmail/${email}${accountId ? `?clientAccountID=${accountId}` : ""}`, reqParams);
6010
- api.Cache.Set(GetEmailCacheKey(email, accountId), req, exports.Api.DEFAULT_CACHE_DURATION);
6011
- return {
6012
- user: req
6013
- };
6019
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
6020
+ try {
6021
+ const data = yield api.GET(`userByEmail/${email}${accountId ? `?clientAccountID=${accountId}` : ""}`, reqParams);
6022
+ res({
6023
+ user: data
6024
+ });
6025
+ }
6026
+ catch (e) {
6027
+ rej(e);
6028
+ }
6029
+ }));
6030
+ api.Cache.Set(GetEmailCacheKey(email, accountId), prom, exports.Api.DEFAULT_CACHE_DURATION);
6031
+ return prom;
6014
6032
  });
6015
6033
  }
6016
6034
  LoginUser.GetByEmail = GetByEmail;
@@ -6041,7 +6059,9 @@
6041
6059
  req.then((data) => {
6042
6060
  const users = data.users;
6043
6061
  for (let i = 0; i < users.length; i++) {
6044
- api.Cache.Set(GetCacheKey(users[i].ID, accountId), users[i]);
6062
+ api.Cache.Set(GetCacheKey(users[i].ID, accountId), {
6063
+ user: users[i]
6064
+ });
6045
6065
  }
6046
6066
  });
6047
6067
  if (!exclusive) {
@@ -6183,7 +6203,7 @@
6183
6203
  try {
6184
6204
  const data = yield api.GET("usersByClientAccount/accessTokens", reqParams);
6185
6205
  res({
6186
- tokens: data.Items
6206
+ users: data.Items
6187
6207
  });
6188
6208
  }
6189
6209
  catch (e) {
@@ -6193,7 +6213,9 @@
6193
6213
  req.then((data) => {
6194
6214
  const users = data.tokens;
6195
6215
  for (let i = 0; i < users.length; i++) {
6196
- api.Cache.Set(GetCacheKey(users[i].ID, accountId), users[i]);
6216
+ api.Cache.Set(GetCacheKey(users[i].ID, accountId), {
6217
+ user: users[i]
6218
+ });
6197
6219
  }
6198
6220
  });
6199
6221
  api.Cache.Set(GetListCacheKey(accountId), req, exports.Api.DEFAULT_CACHE_DURATION);
@@ -6225,7 +6247,7 @@
6225
6247
  data = yield api.POST("accessToken", data, reqParams);
6226
6248
  api.Cache.RemoveByStartsWith(exports.Api.ECacheKey.AccessToken + exports.Api.ECacheKey.Account);
6227
6249
  return {
6228
- token: data
6250
+ user: data
6229
6251
  };
6230
6252
  });
6231
6253
  }