@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.
@@ -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 ", "\n }\n }\n}\n"], ["\nmutation IssuePlanMutation($input: IssuePlanInput!) {\n issuePlan(input: $input) {\n plan {\n ", "\n }\n }\n}\n"])), PlanFields);
11213
- var CancelPlanMutation = gqlTyped(templateObject_7$8 || (templateObject_7$8 = __makeTemplateObject(["\nmutation CancelPlanMutation($input: CancelPlanInput!) {\n cancelPlan(input: $input) {\n plan {\n ", "\n } \n }\n}\n"], ["\nmutation CancelPlanMutation($input: CancelPlanInput!) {\n cancelPlan(input: $input) {\n plan {\n ", "\n } \n }\n}\n"])), PlanFields);
11214
- var ChangePriceOptionMutation = gqlTyped(templateObject_8$7 || (templateObject_8$7 = __makeTemplateObject(["\nmutation ChangePriceOptionMutation($input: ChangePriceOptionInput!) {\n changePriceOption(input: $input) {\n plan {\n ", "\n } \n }\n}\n"], ["\nmutation ChangePriceOptionMutation($input: ChangePriceOptionInput!) {\n changePriceOption(input: $input) {\n plan {\n ", "\n } \n }\n}\n"])), PlanFields);
11215
- var ReactivatePlanMutation = gqlTyped(templateObject_9$5 || (templateObject_9$5 = __makeTemplateObject(["\nmutation ReactivatePlanMutation($input: ReactivatePlanInput!) {\n reactivatePlan(input: $input) {\n plan {\n ", "\n } \n }\n}\n"], ["\nmutation ReactivatePlanMutation($input: ReactivatePlanInput!) {\n reactivatePlan(input: $input) {\n plan {\n ", "\n } \n }\n}\n"])), PlanFields);
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 (_a) {
12066
- switch (_a.label) {
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 = _a.sent();
12068
+ user = _b.sent();
12070
12069
  return [4 /*yield*/, this.profileService.updateDetails(user.contactCard.id, user.contactCard.keyId, fields)];
12071
12070
  case 2:
12072
- _a.sent();
12071
+ _b.sent();
12073
12072
  return [4 /*yield*/, this.synchronizeContactCards(fields, user.contactCard)];
12074
12073
  case 3:
12075
- _a.sent();
12074
+ _b.sent();
12076
12075
  return [4 /*yield*/, this.authService.getUser(true)];
12077
- case 4: return [2 /*return*/, _a.sent()];
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, _a, _b, details, e_1_1;
12085
- var e_1, _c;
12086
- return __generator(this, function (_d) {
12087
- switch (_d.label) {
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 = _d.sent();
12095
+ trustedParties = _e.sent();
12097
12096
  if (trustedParties.length === 0)
12098
12097
  return [2 /*return*/];
12099
- _d.label = 2;
12098
+ _e.label = 2;
12100
12099
  case 2:
12101
- _d.trys.push([2, 7, 8, 9]);
12102
- _a = __values(trustedParties.map(function (x) { return x.mySharedDetails; })), _b = _a.next();
12103
- _d.label = 3;
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 (!!_b.done) return [3 /*break*/, 6];
12106
- details = _b.value;
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
- _d.sent();
12110
- _d.label = 5;
12108
+ _e.sent();
12109
+ _e.label = 5;
12111
12110
  case 5:
12112
- _b = _a.next();
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 = _d.sent();
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 (_b && !_b.done && (_c = _a.return)) _c.call(_a);
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, _a, e_3, _b;
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 _c = (e_3 = void 0, __values(oldField.values)), _d = _c.next(); !_d.done; _d = _c.next()) {
12160
- var oldValue = _d.value;
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 (_d && !_d.done && (_b = _c.return)) _b.call(_c);
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 && (_a = FieldNames_1.return)) _a.call(FieldNames_1);
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, _a;
12187
- return __generator(this, function (_b) {
12188
- switch (_b.label) {
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 && (_a = changes_1.return)) _a.call(changes_1);
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
- _b.sent();
12240
- _b.label = 2;
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 (_a) {
12250
- switch (_a.label) {
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
- _a.sent();
12255
+ _b.sent();
12256
12256
  return [4 /*yield*/, this.synchronizeSharedDetails(details)];
12257
12257
  case 2:
12258
- _a.sent();
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, _a, _b, phone, property, _c, _d, address, property;
12267
- var e_5, _e, e_6, _f;
12268
- return __generator(this, function (_g) {
12269
- switch (_g.label) {
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 = (_g.sent()).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 (_a = __values(details.phones), _b = _a.next(); !_b.done; _b = _a.next()) {
12299
- phone = _b.value;
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 (_b && !_b.done && (_e = _a.return)) _e.call(_a);
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 (_c = __values(details.addresses), _d = _c.next(); !_d.done; _d = _c.next()) {
12318
- address = _d.value;
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 (_d && !_d.done && (_f = _c.return)) _f.call(_c);
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
- _g.sent();
12338
- _g.label = 3;
12337
+ _h.sent();
12338
+ _h.label = 3;
12339
12339
  case 3: return [2 /*return*/];
12340
12340
  }
12341
12341
  });