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