@lifeready/core 1.1.22 → 1.1.24

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.
@@ -1385,6 +1385,7 @@
1385
1385
  errorPolicy: 'all',
1386
1386
  },
1387
1387
  mutate: {
1388
+ fetchPolicy: 'no-cache',
1388
1389
  errorPolicy: 'all',
1389
1390
  },
1390
1391
  };
@@ -12061,29 +12062,29 @@
12061
12062
  ProfileDetailsService.prototype.updateDetails = function (fields) {
12062
12063
  return __awaiter(this, void 0, void 0, function () {
12063
12064
  var user;
12064
- return __generator(this, function (_a) {
12065
- switch (_a.label) {
12065
+ return __generator(this, function (_b) {
12066
+ switch (_b.label) {
12066
12067
  case 0: return [4 /*yield*/, this.authService.getUser()];
12067
12068
  case 1:
12068
- user = _a.sent();
12069
+ user = _b.sent();
12069
12070
  return [4 /*yield*/, this.profileService.updateDetails(user.contactCard.id, user.contactCard.keyId, fields)];
12070
12071
  case 2:
12071
- _a.sent();
12072
+ _b.sent();
12072
12073
  return [4 /*yield*/, this.synchronizeContactCards(fields, user.contactCard)];
12073
12074
  case 3:
12074
- _a.sent();
12075
+ _b.sent();
12075
12076
  return [4 /*yield*/, this.authService.getUser(true)];
12076
- case 4: return [2 /*return*/, _a.sent()];
12077
+ case 4: return [2 /*return*/, _b.sent()];
12077
12078
  }
12078
12079
  });
12079
12080
  });
12080
12081
  };
12081
12082
  ProfileDetailsService.prototype.synchronizeContactCards = function (newFields, oldFields) {
12082
12083
  return __awaiter(this, void 0, void 0, function () {
12083
- var changes, trustedParties, _a, _b, details, e_1_1;
12084
- var e_1, _c;
12085
- return __generator(this, function (_d) {
12086
- switch (_d.label) {
12084
+ var changes, trustedParties, _b, _c, details, e_1_1;
12085
+ var e_1, _d;
12086
+ return __generator(this, function (_e) {
12087
+ switch (_e.label) {
12087
12088
  case 0:
12088
12089
  if (!oldFields)
12089
12090
  return [2 /*return*/];
@@ -12092,32 +12093,32 @@
12092
12093
  return [2 /*return*/];
12093
12094
  return [4 /*yield*/, this.trustedPartyService.getTrustedParties()];
12094
12095
  case 1:
12095
- trustedParties = _d.sent();
12096
+ trustedParties = _e.sent();
12096
12097
  if (trustedParties.length === 0)
12097
12098
  return [2 /*return*/];
12098
- _d.label = 2;
12099
+ _e.label = 2;
12099
12100
  case 2:
12100
- _d.trys.push([2, 7, 8, 9]);
12101
- _a = __values(trustedParties.map(function (x) { return x.mySharedDetails; })), _b = _a.next();
12102
- _d.label = 3;
12101
+ _e.trys.push([2, 7, 8, 9]);
12102
+ _b = __values(trustedParties.map(function (x) { return x.mySharedDetails; })), _c = _b.next();
12103
+ _e.label = 3;
12103
12104
  case 3:
12104
- if (!!_b.done) return [3 /*break*/, 6];
12105
- details = _b.value;
12105
+ if (!!_c.done) return [3 /*break*/, 6];
12106
+ details = _c.value;
12106
12107
  return [4 /*yield*/, this.synchronizeSharedContactCard(details, changes)];
12107
12108
  case 4:
12108
- _d.sent();
12109
- _d.label = 5;
12109
+ _e.sent();
12110
+ _e.label = 5;
12110
12111
  case 5:
12111
- _b = _a.next();
12112
+ _c = _b.next();
12112
12113
  return [3 /*break*/, 3];
12113
12114
  case 6: return [3 /*break*/, 9];
12114
12115
  case 7:
12115
- e_1_1 = _d.sent();
12116
+ e_1_1 = _e.sent();
12116
12117
  e_1 = { error: e_1_1 };
12117
12118
  return [3 /*break*/, 9];
12118
12119
  case 8:
12119
12120
  try {
12120
- if (_b && !_b.done && (_c = _a.return)) _c.call(_a);
12121
+ if (_c && !_c.done && (_d = _b.return)) _d.call(_b);
12121
12122
  }
12122
12123
  finally { if (e_1) throw e_1.error; }
12123
12124
  return [7 /*endfinally*/];
@@ -12127,7 +12128,8 @@
12127
12128
  });
12128
12129
  };
12129
12130
  ProfileDetailsService.prototype.getChanges = function (newFields, oldFields) {
12130
- var e_2, _a, e_3, _b;
12131
+ var e_2, _b, e_3, _c;
12132
+ var _a;
12131
12133
  var changes = [];
12132
12134
  try {
12133
12135
  for (var FieldNames_1 = __values(FieldNames), FieldNames_1_1 = FieldNames_1.next(); !FieldNames_1_1.done; FieldNames_1_1 = FieldNames_1.next()) {
@@ -12135,7 +12137,7 @@
12135
12137
  var oldField = oldFields[field];
12136
12138
  if (oldField && oldField.values) {
12137
12139
  var _loop_1 = function (oldValue) {
12138
- var newValue = newFields[field].values.find(function (x) { return x.id === oldValue.id; });
12140
+ var newValue = (_a = newFields[field].values) === null || _a === void 0 ? void 0 : _a.find(function (x) { return x.id === oldValue.id; });
12139
12141
  if (!newValue) {
12140
12142
  changes.push({
12141
12143
  field: field,
@@ -12155,15 +12157,15 @@
12155
12157
  }
12156
12158
  };
12157
12159
  try {
12158
- for (var _c = (e_3 = void 0, __values(oldField.values)), _d = _c.next(); !_d.done; _d = _c.next()) {
12159
- var oldValue = _d.value;
12160
+ for (var _d = (e_3 = void 0, __values(oldField.values)), _e = _d.next(); !_e.done; _e = _d.next()) {
12161
+ var oldValue = _e.value;
12160
12162
  _loop_1(oldValue);
12161
12163
  }
12162
12164
  }
12163
12165
  catch (e_3_1) { e_3 = { error: e_3_1 }; }
12164
12166
  finally {
12165
12167
  try {
12166
- if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
12168
+ if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
12167
12169
  }
12168
12170
  finally { if (e_3) throw e_3.error; }
12169
12171
  }
@@ -12173,7 +12175,7 @@
12173
12175
  catch (e_2_1) { e_2 = { error: e_2_1 }; }
12174
12176
  finally {
12175
12177
  try {
12176
- if (FieldNames_1_1 && !FieldNames_1_1.done && (_a = FieldNames_1.return)) _a.call(FieldNames_1);
12178
+ if (FieldNames_1_1 && !FieldNames_1_1.done && (_b = FieldNames_1.return)) _b.call(FieldNames_1);
12177
12179
  }
12178
12180
  finally { if (e_2) throw e_2.error; }
12179
12181
  }
@@ -12182,9 +12184,9 @@
12182
12184
  ProfileDetailsService.prototype.synchronizeSharedContactCard = function (details, changes) {
12183
12185
  return __awaiter(this, void 0, void 0, function () {
12184
12186
  var hasChanged, _loop_2, changes_1, changes_1_1, change, id, ownedKeyId, sharedKeyId, contactCard;
12185
- var e_4, _a;
12186
- return __generator(this, function (_b) {
12187
- switch (_b.label) {
12187
+ var e_4, _b;
12188
+ return __generator(this, function (_c) {
12189
+ switch (_c.label) {
12188
12190
  case 0:
12189
12191
  hasChanged = false;
12190
12192
  _loop_2 = function (change) {
@@ -12227,7 +12229,7 @@
12227
12229
  catch (e_4_1) { e_4 = { error: e_4_1 }; }
12228
12230
  finally {
12229
12231
  try {
12230
- if (changes_1_1 && !changes_1_1.done && (_a = changes_1.return)) _a.call(changes_1);
12232
+ if (changes_1_1 && !changes_1_1.done && (_b = changes_1.return)) _b.call(changes_1);
12231
12233
  }
12232
12234
  finally { if (e_4) throw e_4.error; }
12233
12235
  }
@@ -12235,8 +12237,8 @@
12235
12237
  id = details.id, ownedKeyId = details.ownedKeyId, sharedKeyId = details.sharedKeyId, contactCard = __rest(details, ["id", "ownedKeyId", "sharedKeyId"]);
12236
12238
  return [4 /*yield*/, this.sharedContactCardService.updateMySharedContactCard(id, ownedKeyId, sharedKeyId, contactCard)];
12237
12239
  case 1:
12238
- _b.sent();
12239
- _b.label = 2;
12240
+ _c.sent();
12241
+ _c.label = 2;
12240
12242
  case 2: return [2 /*return*/];
12241
12243
  }
12242
12244
  });
@@ -12245,16 +12247,16 @@
12245
12247
  ProfileDetailsService.prototype.updateTrustedPartyDetails = function (details) {
12246
12248
  return __awaiter(this, void 0, void 0, function () {
12247
12249
  var id, ownedKeyId, sharedKeyId, contactCard;
12248
- return __generator(this, function (_a) {
12249
- switch (_a.label) {
12250
+ return __generator(this, function (_b) {
12251
+ switch (_b.label) {
12250
12252
  case 0:
12251
12253
  id = details.id, ownedKeyId = details.ownedKeyId, sharedKeyId = details.sharedKeyId, contactCard = __rest(details, ["id", "ownedKeyId", "sharedKeyId"]);
12252
12254
  return [4 /*yield*/, this.sharedContactCardService.updateMySharedContactCard(id, ownedKeyId, sharedKeyId, contactCard)];
12253
12255
  case 1:
12254
- _a.sent();
12256
+ _b.sent();
12255
12257
  return [4 /*yield*/, this.synchronizeSharedDetails(details)];
12256
12258
  case 2:
12257
- _a.sent();
12259
+ _b.sent();
12258
12260
  return [2 /*return*/];
12259
12261
  }
12260
12262
  });
@@ -12262,13 +12264,13 @@
12262
12264
  };
12263
12265
  ProfileDetailsService.prototype.synchronizeSharedDetails = function (details) {
12264
12266
  return __awaiter(this, void 0, void 0, function () {
12265
- var contactCard, hasNewValues, property, property, property, _a, _b, phone, property, _c, _d, address, property;
12266
- var e_5, _e, e_6, _f;
12267
- return __generator(this, function (_g) {
12268
- switch (_g.label) {
12267
+ var contactCard, hasNewValues, property, property, property, _b, _c, phone, property, _d, _e, address, property;
12268
+ var e_5, _f, e_6, _g;
12269
+ return __generator(this, function (_h) {
12270
+ switch (_h.label) {
12269
12271
  case 0: return [4 /*yield*/, this.authService.getUser()];
12270
12272
  case 1:
12271
- contactCard = (_g.sent()).contactCard;
12273
+ contactCard = (_h.sent()).contactCard;
12272
12274
  hasNewValues = false;
12273
12275
  contactCard = Object.assign({}, contactCard);
12274
12276
  if (details.name) {
@@ -12294,8 +12296,8 @@
12294
12296
  }
12295
12297
  if (details.phones && details.phones.length) {
12296
12298
  try {
12297
- for (_a = __values(details.phones), _b = _a.next(); !_b.done; _b = _a.next()) {
12298
- phone = _b.value;
12299
+ for (_b = __values(details.phones), _c = _b.next(); !_c.done; _c = _b.next()) {
12300
+ phone = _c.value;
12299
12301
  property = this.checkField(phone.value, contactCard.phone, phone.label);
12300
12302
  if (property) {
12301
12303
  contactCard.phone = property;
@@ -12306,15 +12308,15 @@
12306
12308
  catch (e_5_1) { e_5 = { error: e_5_1 }; }
12307
12309
  finally {
12308
12310
  try {
12309
- if (_b && !_b.done && (_e = _a.return)) _e.call(_a);
12311
+ if (_c && !_c.done && (_f = _b.return)) _f.call(_b);
12310
12312
  }
12311
12313
  finally { if (e_5) throw e_5.error; }
12312
12314
  }
12313
12315
  }
12314
12316
  if (details.addresses && details.addresses.length) {
12315
12317
  try {
12316
- for (_c = __values(details.addresses), _d = _c.next(); !_d.done; _d = _c.next()) {
12317
- address = _d.value;
12318
+ for (_d = __values(details.addresses), _e = _d.next(); !_e.done; _e = _d.next()) {
12319
+ address = _e.value;
12318
12320
  property = this.checkField(address.value, contactCard.address, address.label);
12319
12321
  if (property) {
12320
12322
  contactCard.address = property;
@@ -12325,7 +12327,7 @@
12325
12327
  catch (e_6_1) { e_6 = { error: e_6_1 }; }
12326
12328
  finally {
12327
12329
  try {
12328
- if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
12330
+ if (_e && !_e.done && (_g = _d.return)) _g.call(_d);
12329
12331
  }
12330
12332
  finally { if (e_6) throw e_6.error; }
12331
12333
  }
@@ -12333,8 +12335,8 @@
12333
12335
  if (!hasNewValues) return [3 /*break*/, 3];
12334
12336
  return [4 /*yield*/, this.profileService.updateDetails(contactCard.id, contactCard.keyId, contactCard)];
12335
12337
  case 2:
12336
- _g.sent();
12337
- _g.label = 3;
12338
+ _h.sent();
12339
+ _h.label = 3;
12338
12340
  case 3: return [2 /*return*/];
12339
12341
  }
12340
12342
  });