@lifeready/core 1.1.23 → 1.1.25
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 +56 -56
- 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/plan2/plan2.gql.js +7 -38
- package/esm2015/lib/profile/profile-details.service.js +3 -2
- package/esm2015/lib/profile/profile.types.js +1 -1
- package/fesm2015/lifeready-core.js +8 -38
- package/fesm2015/lifeready-core.js.map +1 -1
- package/lib/api/types/lr-graphql.types.d.ts +8 -0
- package/lib/plan2/plan2.gql.d.ts +13 -10
- package/lib/profile/profile.types.d.ts +2 -0
- package/package.json +1 -1
|
@@ -11203,16 +11203,15 @@
|
|
|
11203
11203
|
return StripeBillingPortalSession;
|
|
11204
11204
|
}());
|
|
11205
11205
|
|
|
11206
|
-
var PlanFields = "\n id\n created\n modified\n name\n description\n currentStates {\n id\n created\n modified\n periodStart\n periodEnd\n state\n }\n currentPriceOption {\n priceId\n name\n amount\n currency\n intervalUnit\n intervalCount\n }\n alternativePriceOptions {\n priceId\n name\n amount\n currency\n intervalUnit\n intervalCount\n }\n";
|
|
11207
11206
|
var InitiateStripePaymentMethodCaptureMutation = gqlTyped(templateObject_1$o || (templateObject_1$o = __makeTemplateObject(["\nmutation InitiateStripePaymentMethodCaptureMutation {\n initiateStripePaymentMethodCapture(input: {}) {\n paymentCapture {\n stripeIntentId\n stripeClientSecret\n }\n }\n}\n"], ["\nmutation InitiateStripePaymentMethodCaptureMutation {\n initiateStripePaymentMethodCapture(input: {}) {\n paymentCapture {\n stripeIntentId\n stripeClientSecret\n }\n }\n}\n"])));
|
|
11208
11207
|
var CompleteStripePaymentMethodCaptureMutation = gqlTyped(templateObject_2$l || (templateObject_2$l = __makeTemplateObject(["\nmutation CompleteStripePaymentMethodCaptureMutation($input: CompleteStripePaymentMethodCaptureInput!) {\n completeStripePaymentMethodCapture(input: $input) {\n paymentMethod {\n id\n created\n modified\n card {\n brand\n lastFourDigits\n expiryYear\n expiryMonth\n }\n isDefault \n }\n }\n}\n"], ["\nmutation CompleteStripePaymentMethodCaptureMutation($input: CompleteStripePaymentMethodCaptureInput!) {\n completeStripePaymentMethodCapture(input: $input) {\n paymentMethod {\n id\n created\n modified\n card {\n brand\n lastFourDigits\n expiryYear\n expiryMonth\n }\n isDefault \n }\n }\n}\n"])));
|
|
11209
11208
|
var RemovePaymentMethodMutation = gqlTyped(templateObject_3$i || (templateObject_3$i = __makeTemplateObject(["\nmutation RemovePaymentMethodMutation($input: RemovePaymentMethodInput!) {\n removePaymentMethod(input: $input) {\n id\n }\n}\n"], ["\nmutation RemovePaymentMethodMutation($input: RemovePaymentMethodInput!) {\n removePaymentMethod(input: $input) {\n id\n }\n}\n"])));
|
|
11210
11209
|
var SetDefaultPaymentMethodMutation = gqlTyped(templateObject_4$d || (templateObject_4$d = __makeTemplateObject(["\nmutation SetDefaultPaymentMethodMutation($input: SetDefaultPaymentMethodInput!) {\n setDefaultPaymentMethod(input: $input) {\n paymentMethod {\n id\n } \n }\n}\n"], ["\nmutation SetDefaultPaymentMethodMutation($input: SetDefaultPaymentMethodInput!) {\n setDefaultPaymentMethod(input: $input) {\n paymentMethod {\n id\n } \n }\n}\n"])));
|
|
11211
11210
|
var RemoveDefaultPaymentMethodMutation = gqlTyped(templateObject_5$c || (templateObject_5$c = __makeTemplateObject(["\nmutation RemoveDefaultPaymentMethodMutation {\n removeDefaultPaymentMethod(input: {}) {\n paymentMethod {\n id\n } \n }\n}\n"], ["\nmutation RemoveDefaultPaymentMethodMutation {\n removeDefaultPaymentMethod(input: {}) {\n paymentMethod {\n id\n } \n }\n}\n"])));
|
|
11212
|
-
var IssuePlanMutation = gqlTyped(templateObject_6$9 || (templateObject_6$9 = __makeTemplateObject(["\nmutation IssuePlanMutation($input: IssuePlanInput!) {\n issuePlan(input: $input) {\n plan {\n
|
|
11213
|
-
var CancelPlanMutation = gqlTyped(templateObject_7$8 || (templateObject_7$8 = __makeTemplateObject(["\nmutation CancelPlanMutation($input: CancelPlanInput!) {\n cancelPlan(input: $input) {\n plan {\n
|
|
11214
|
-
var ChangePriceOptionMutation = gqlTyped(templateObject_8$7 || (templateObject_8$7 = __makeTemplateObject(["\nmutation ChangePriceOptionMutation($input: ChangePriceOptionInput!) {\n changePriceOption(input: $input) {\n plan {\n
|
|
11215
|
-
var ReactivatePlanMutation = gqlTyped(templateObject_9$5 || (templateObject_9$5 = __makeTemplateObject(["\nmutation ReactivatePlanMutation($input: ReactivatePlanInput!) {\n reactivatePlan(input: $input) {\n plan {\n
|
|
11211
|
+
var IssuePlanMutation = gqlTyped(templateObject_6$9 || (templateObject_6$9 = __makeTemplateObject(["\nmutation IssuePlanMutation($input: IssuePlanInput!) {\n issuePlan(input: $input) {\n plan {\n id\n }\n }\n}\n"], ["\nmutation IssuePlanMutation($input: IssuePlanInput!) {\n issuePlan(input: $input) {\n plan {\n id\n }\n }\n}\n"])));
|
|
11212
|
+
var CancelPlanMutation = gqlTyped(templateObject_7$8 || (templateObject_7$8 = __makeTemplateObject(["\nmutation CancelPlanMutation($input: CancelPlanInput!) {\n cancelPlan(input: $input) {\n plan {\n id\n } \n }\n}\n"], ["\nmutation CancelPlanMutation($input: CancelPlanInput!) {\n cancelPlan(input: $input) {\n plan {\n id\n } \n }\n}\n"])));
|
|
11213
|
+
var ChangePriceOptionMutation = gqlTyped(templateObject_8$7 || (templateObject_8$7 = __makeTemplateObject(["\nmutation ChangePriceOptionMutation($input: ChangePriceOptionInput!) {\n changePriceOption(input: $input) {\n plan {\n id\n }\n }\n}\n"], ["\nmutation ChangePriceOptionMutation($input: ChangePriceOptionInput!) {\n changePriceOption(input: $input) {\n plan {\n id\n }\n }\n}\n"])));
|
|
11214
|
+
var ReactivatePlanMutation = gqlTyped(templateObject_9$5 || (templateObject_9$5 = __makeTemplateObject(["\nmutation ReactivatePlanMutation($input: ReactivatePlanInput!) {\n reactivatePlan(input: $input) {\n plan {\n id\n }\n }\n}\n"], ["\nmutation ReactivatePlanMutation($input: ReactivatePlanInput!) {\n reactivatePlan(input: $input) {\n plan {\n id\n }\n }\n}\n"])));
|
|
11216
11215
|
var templateObject_1$o, templateObject_2$l, templateObject_3$i, templateObject_4$d, templateObject_5$c, templateObject_6$9, templateObject_7$8, templateObject_8$7, templateObject_9$5;
|
|
11217
11216
|
|
|
11218
11217
|
exports.Plan2Service = /** @class */ (function (_super) {
|
|
@@ -12062,29 +12061,29 @@
|
|
|
12062
12061
|
ProfileDetailsService.prototype.updateDetails = function (fields) {
|
|
12063
12062
|
return __awaiter(this, void 0, void 0, function () {
|
|
12064
12063
|
var user;
|
|
12065
|
-
return __generator(this, function (
|
|
12066
|
-
switch (
|
|
12064
|
+
return __generator(this, function (_b) {
|
|
12065
|
+
switch (_b.label) {
|
|
12067
12066
|
case 0: return [4 /*yield*/, this.authService.getUser()];
|
|
12068
12067
|
case 1:
|
|
12069
|
-
user =
|
|
12068
|
+
user = _b.sent();
|
|
12070
12069
|
return [4 /*yield*/, this.profileService.updateDetails(user.contactCard.id, user.contactCard.keyId, fields)];
|
|
12071
12070
|
case 2:
|
|
12072
|
-
|
|
12071
|
+
_b.sent();
|
|
12073
12072
|
return [4 /*yield*/, this.synchronizeContactCards(fields, user.contactCard)];
|
|
12074
12073
|
case 3:
|
|
12075
|
-
|
|
12074
|
+
_b.sent();
|
|
12076
12075
|
return [4 /*yield*/, this.authService.getUser(true)];
|
|
12077
|
-
case 4: return [2 /*return*/,
|
|
12076
|
+
case 4: return [2 /*return*/, _b.sent()];
|
|
12078
12077
|
}
|
|
12079
12078
|
});
|
|
12080
12079
|
});
|
|
12081
12080
|
};
|
|
12082
12081
|
ProfileDetailsService.prototype.synchronizeContactCards = function (newFields, oldFields) {
|
|
12083
12082
|
return __awaiter(this, void 0, void 0, function () {
|
|
12084
|
-
var changes, trustedParties,
|
|
12085
|
-
var e_1,
|
|
12086
|
-
return __generator(this, function (
|
|
12087
|
-
switch (
|
|
12083
|
+
var changes, trustedParties, _b, _c, details, e_1_1;
|
|
12084
|
+
var e_1, _d;
|
|
12085
|
+
return __generator(this, function (_e) {
|
|
12086
|
+
switch (_e.label) {
|
|
12088
12087
|
case 0:
|
|
12089
12088
|
if (!oldFields)
|
|
12090
12089
|
return [2 /*return*/];
|
|
@@ -12093,32 +12092,32 @@
|
|
|
12093
12092
|
return [2 /*return*/];
|
|
12094
12093
|
return [4 /*yield*/, this.trustedPartyService.getTrustedParties()];
|
|
12095
12094
|
case 1:
|
|
12096
|
-
trustedParties =
|
|
12095
|
+
trustedParties = _e.sent();
|
|
12097
12096
|
if (trustedParties.length === 0)
|
|
12098
12097
|
return [2 /*return*/];
|
|
12099
|
-
|
|
12098
|
+
_e.label = 2;
|
|
12100
12099
|
case 2:
|
|
12101
|
-
|
|
12102
|
-
|
|
12103
|
-
|
|
12100
|
+
_e.trys.push([2, 7, 8, 9]);
|
|
12101
|
+
_b = __values(trustedParties.map(function (x) { return x.mySharedDetails; })), _c = _b.next();
|
|
12102
|
+
_e.label = 3;
|
|
12104
12103
|
case 3:
|
|
12105
|
-
if (!!
|
|
12106
|
-
details =
|
|
12104
|
+
if (!!_c.done) return [3 /*break*/, 6];
|
|
12105
|
+
details = _c.value;
|
|
12107
12106
|
return [4 /*yield*/, this.synchronizeSharedContactCard(details, changes)];
|
|
12108
12107
|
case 4:
|
|
12109
|
-
|
|
12110
|
-
|
|
12108
|
+
_e.sent();
|
|
12109
|
+
_e.label = 5;
|
|
12111
12110
|
case 5:
|
|
12112
|
-
|
|
12111
|
+
_c = _b.next();
|
|
12113
12112
|
return [3 /*break*/, 3];
|
|
12114
12113
|
case 6: return [3 /*break*/, 9];
|
|
12115
12114
|
case 7:
|
|
12116
|
-
e_1_1 =
|
|
12115
|
+
e_1_1 = _e.sent();
|
|
12117
12116
|
e_1 = { error: e_1_1 };
|
|
12118
12117
|
return [3 /*break*/, 9];
|
|
12119
12118
|
case 8:
|
|
12120
12119
|
try {
|
|
12121
|
-
if (
|
|
12120
|
+
if (_c && !_c.done && (_d = _b.return)) _d.call(_b);
|
|
12122
12121
|
}
|
|
12123
12122
|
finally { if (e_1) throw e_1.error; }
|
|
12124
12123
|
return [7 /*endfinally*/];
|
|
@@ -12128,7 +12127,8 @@
|
|
|
12128
12127
|
});
|
|
12129
12128
|
};
|
|
12130
12129
|
ProfileDetailsService.prototype.getChanges = function (newFields, oldFields) {
|
|
12131
|
-
var e_2,
|
|
12130
|
+
var e_2, _b, e_3, _c;
|
|
12131
|
+
var _a;
|
|
12132
12132
|
var changes = [];
|
|
12133
12133
|
try {
|
|
12134
12134
|
for (var FieldNames_1 = __values(FieldNames), FieldNames_1_1 = FieldNames_1.next(); !FieldNames_1_1.done; FieldNames_1_1 = FieldNames_1.next()) {
|
|
@@ -12136,7 +12136,7 @@
|
|
|
12136
12136
|
var oldField = oldFields[field];
|
|
12137
12137
|
if (oldField && oldField.values) {
|
|
12138
12138
|
var _loop_1 = function (oldValue) {
|
|
12139
|
-
var newValue = newFields[field].values.find(function (x) { return x.id === oldValue.id; });
|
|
12139
|
+
var newValue = (_a = newFields[field].values) === null || _a === void 0 ? void 0 : _a.find(function (x) { return x.id === oldValue.id; });
|
|
12140
12140
|
if (!newValue) {
|
|
12141
12141
|
changes.push({
|
|
12142
12142
|
field: field,
|
|
@@ -12156,15 +12156,15 @@
|
|
|
12156
12156
|
}
|
|
12157
12157
|
};
|
|
12158
12158
|
try {
|
|
12159
|
-
for (var
|
|
12160
|
-
var oldValue =
|
|
12159
|
+
for (var _d = (e_3 = void 0, __values(oldField.values)), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
12160
|
+
var oldValue = _e.value;
|
|
12161
12161
|
_loop_1(oldValue);
|
|
12162
12162
|
}
|
|
12163
12163
|
}
|
|
12164
12164
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
12165
12165
|
finally {
|
|
12166
12166
|
try {
|
|
12167
|
-
if (
|
|
12167
|
+
if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
|
|
12168
12168
|
}
|
|
12169
12169
|
finally { if (e_3) throw e_3.error; }
|
|
12170
12170
|
}
|
|
@@ -12174,7 +12174,7 @@
|
|
|
12174
12174
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
12175
12175
|
finally {
|
|
12176
12176
|
try {
|
|
12177
|
-
if (FieldNames_1_1 && !FieldNames_1_1.done && (
|
|
12177
|
+
if (FieldNames_1_1 && !FieldNames_1_1.done && (_b = FieldNames_1.return)) _b.call(FieldNames_1);
|
|
12178
12178
|
}
|
|
12179
12179
|
finally { if (e_2) throw e_2.error; }
|
|
12180
12180
|
}
|
|
@@ -12183,9 +12183,9 @@
|
|
|
12183
12183
|
ProfileDetailsService.prototype.synchronizeSharedContactCard = function (details, changes) {
|
|
12184
12184
|
return __awaiter(this, void 0, void 0, function () {
|
|
12185
12185
|
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 (
|
|
12186
|
+
var e_4, _b;
|
|
12187
|
+
return __generator(this, function (_c) {
|
|
12188
|
+
switch (_c.label) {
|
|
12189
12189
|
case 0:
|
|
12190
12190
|
hasChanged = false;
|
|
12191
12191
|
_loop_2 = function (change) {
|
|
@@ -12228,7 +12228,7 @@
|
|
|
12228
12228
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
12229
12229
|
finally {
|
|
12230
12230
|
try {
|
|
12231
|
-
if (changes_1_1 && !changes_1_1.done && (
|
|
12231
|
+
if (changes_1_1 && !changes_1_1.done && (_b = changes_1.return)) _b.call(changes_1);
|
|
12232
12232
|
}
|
|
12233
12233
|
finally { if (e_4) throw e_4.error; }
|
|
12234
12234
|
}
|
|
@@ -12236,8 +12236,8 @@
|
|
|
12236
12236
|
id = details.id, ownedKeyId = details.ownedKeyId, sharedKeyId = details.sharedKeyId, contactCard = __rest(details, ["id", "ownedKeyId", "sharedKeyId"]);
|
|
12237
12237
|
return [4 /*yield*/, this.sharedContactCardService.updateMySharedContactCard(id, ownedKeyId, sharedKeyId, contactCard)];
|
|
12238
12238
|
case 1:
|
|
12239
|
-
|
|
12240
|
-
|
|
12239
|
+
_c.sent();
|
|
12240
|
+
_c.label = 2;
|
|
12241
12241
|
case 2: return [2 /*return*/];
|
|
12242
12242
|
}
|
|
12243
12243
|
});
|
|
@@ -12246,16 +12246,16 @@
|
|
|
12246
12246
|
ProfileDetailsService.prototype.updateTrustedPartyDetails = function (details) {
|
|
12247
12247
|
return __awaiter(this, void 0, void 0, function () {
|
|
12248
12248
|
var id, ownedKeyId, sharedKeyId, contactCard;
|
|
12249
|
-
return __generator(this, function (
|
|
12250
|
-
switch (
|
|
12249
|
+
return __generator(this, function (_b) {
|
|
12250
|
+
switch (_b.label) {
|
|
12251
12251
|
case 0:
|
|
12252
12252
|
id = details.id, ownedKeyId = details.ownedKeyId, sharedKeyId = details.sharedKeyId, contactCard = __rest(details, ["id", "ownedKeyId", "sharedKeyId"]);
|
|
12253
12253
|
return [4 /*yield*/, this.sharedContactCardService.updateMySharedContactCard(id, ownedKeyId, sharedKeyId, contactCard)];
|
|
12254
12254
|
case 1:
|
|
12255
|
-
|
|
12255
|
+
_b.sent();
|
|
12256
12256
|
return [4 /*yield*/, this.synchronizeSharedDetails(details)];
|
|
12257
12257
|
case 2:
|
|
12258
|
-
|
|
12258
|
+
_b.sent();
|
|
12259
12259
|
return [2 /*return*/];
|
|
12260
12260
|
}
|
|
12261
12261
|
});
|
|
@@ -12263,13 +12263,13 @@
|
|
|
12263
12263
|
};
|
|
12264
12264
|
ProfileDetailsService.prototype.synchronizeSharedDetails = function (details) {
|
|
12265
12265
|
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 (
|
|
12266
|
+
var contactCard, hasNewValues, property, property, property, _b, _c, phone, property, _d, _e, address, property;
|
|
12267
|
+
var e_5, _f, e_6, _g;
|
|
12268
|
+
return __generator(this, function (_h) {
|
|
12269
|
+
switch (_h.label) {
|
|
12270
12270
|
case 0: return [4 /*yield*/, this.authService.getUser()];
|
|
12271
12271
|
case 1:
|
|
12272
|
-
contactCard = (
|
|
12272
|
+
contactCard = (_h.sent()).contactCard;
|
|
12273
12273
|
hasNewValues = false;
|
|
12274
12274
|
contactCard = Object.assign({}, contactCard);
|
|
12275
12275
|
if (details.name) {
|
|
@@ -12295,8 +12295,8 @@
|
|
|
12295
12295
|
}
|
|
12296
12296
|
if (details.phones && details.phones.length) {
|
|
12297
12297
|
try {
|
|
12298
|
-
for (
|
|
12299
|
-
phone =
|
|
12298
|
+
for (_b = __values(details.phones), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
12299
|
+
phone = _c.value;
|
|
12300
12300
|
property = this.checkField(phone.value, contactCard.phone, phone.label);
|
|
12301
12301
|
if (property) {
|
|
12302
12302
|
contactCard.phone = property;
|
|
@@ -12307,15 +12307,15 @@
|
|
|
12307
12307
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
12308
12308
|
finally {
|
|
12309
12309
|
try {
|
|
12310
|
-
if (
|
|
12310
|
+
if (_c && !_c.done && (_f = _b.return)) _f.call(_b);
|
|
12311
12311
|
}
|
|
12312
12312
|
finally { if (e_5) throw e_5.error; }
|
|
12313
12313
|
}
|
|
12314
12314
|
}
|
|
12315
12315
|
if (details.addresses && details.addresses.length) {
|
|
12316
12316
|
try {
|
|
12317
|
-
for (
|
|
12318
|
-
address =
|
|
12317
|
+
for (_d = __values(details.addresses), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
12318
|
+
address = _e.value;
|
|
12319
12319
|
property = this.checkField(address.value, contactCard.address, address.label);
|
|
12320
12320
|
if (property) {
|
|
12321
12321
|
contactCard.address = property;
|
|
@@ -12326,7 +12326,7 @@
|
|
|
12326
12326
|
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
12327
12327
|
finally {
|
|
12328
12328
|
try {
|
|
12329
|
-
if (
|
|
12329
|
+
if (_e && !_e.done && (_g = _d.return)) _g.call(_d);
|
|
12330
12330
|
}
|
|
12331
12331
|
finally { if (e_6) throw e_6.error; }
|
|
12332
12332
|
}
|
|
@@ -12334,8 +12334,8 @@
|
|
|
12334
12334
|
if (!hasNewValues) return [3 /*break*/, 3];
|
|
12335
12335
|
return [4 /*yield*/, this.profileService.updateDetails(contactCard.id, contactCard.keyId, contactCard)];
|
|
12336
12336
|
case 2:
|
|
12337
|
-
|
|
12338
|
-
|
|
12337
|
+
_h.sent();
|
|
12338
|
+
_h.label = 3;
|
|
12339
12339
|
case 3: return [2 /*return*/];
|
|
12340
12340
|
}
|
|
12341
12341
|
});
|