@lifeready/core 1.1.5 → 1.1.7

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.
@@ -1994,10 +1994,8 @@
1994
1994
  if (!!path_1_1.done) return [3 /*break*/, 4];
1995
1995
  link = path_1_1.value;
1996
1996
  dstKey = this.key(link.data.keyId);
1997
- // console.log("key: ", link.data.keyId);
1998
1997
  if (dstKey.jwk) {
1999
1998
  key = dstKey.jwk;
2000
- // console.log("Returning cached key: ", link.data.keyId);
2001
1999
  return [3 /*break*/, 3];
2002
2000
  }
2003
2001
  if (!dstKey.task) {
@@ -5633,7 +5631,6 @@
5633
5631
  case 0: return [4 /*yield*/, this.keyFactory.createKey()];
5634
5632
  case 1:
5635
5633
  assemblyKey = _c.sent();
5636
- console.log('prepareAssembly assemblyKey', assemblyKey);
5637
5634
  _a = assemblyKey.toJSON(true), rawAssemblyKey = _a.k, assemblyKeyParams = __rest(_a, ["k"]);
5638
5635
  return [4 /*yield*/, this.keyFactory.createPkcSignKey()];
5639
5636
  case 2:
@@ -6004,7 +6001,6 @@
6004
6001
  },
6005
6002
  assemblyKeyParams: assemblyKeyParams,
6006
6003
  };
6007
- console.log('partialAssemblyKey', partialAssemblyKey);
6008
6004
  return [4 /*yield*/, this.encryptionService.encryptToString(sharedKey, tp.sharedCipherDataClearJson || '')];
6009
6005
  case 5:
6010
6006
  sharedCipherData = _c.sent();
@@ -6622,13 +6618,13 @@
6622
6618
  cognitoUser = _b.sent();
6623
6619
  refreshToken = cognitoUser.getSignInUserSession().getRefreshToken();
6624
6620
  return [2 /*return*/, new Promise(function (resolve, reject) {
6625
- cognitoUser.refreshSession(refreshToken, function (err, data) {
6621
+ cognitoUser.refreshSession(refreshToken, function (err) {
6626
6622
  if (err) {
6627
6623
  console.error('Error refreshing token: ', err);
6628
6624
  reject(err);
6629
6625
  }
6630
6626
  else {
6631
- console.log('Token refresh complete: ', data);
6627
+ console.log('Token refresh complete');
6632
6628
  resolve(0);
6633
6629
  }
6634
6630
  });
@@ -6655,7 +6651,6 @@
6655
6651
  return [4 /*yield*/, this.encryptionService.decrypt(assemblyKey, resetUser.assemblyCipherData)];
6656
6652
  case 3:
6657
6653
  rootKey = (_b.sent()).rootKey;
6658
- console.log(rootKey);
6659
6654
  return [4 /*yield*/, nodeJose.JWK.asKey(rootKey)];
6660
6655
  case 4:
6661
6656
  rootKeyJwk = _b.sent();
@@ -6679,11 +6674,9 @@
6679
6674
  })];
6680
6675
  case 8:
6681
6676
  challenge = (_b.sent()).createTpAssemblyKeyChallenge.challenge;
6682
- console.log(challenge);
6683
6677
  // Sign the challenge
6684
6678
  // Generate a client side nonce that's no in the server's control.
6685
6679
  challenge.clientNonce = this.keyFactory.randomString(TP_PASSWORD_RESET_CLIENT_NONCE_LENGTH);
6686
- console.log(challenge);
6687
6680
  return [4 /*yield*/, this.encryptionService.decrypt(assemblyKey, resetUser.wrappedAssemblyKeyVerifierPrk)];
6688
6681
  case 9:
6689
6682
  assemblyKeyVerifierPrk = _b.sent();
@@ -6711,7 +6704,6 @@
6711
6704
  return [2 /*return*/];
6712
6705
  }
6713
6706
  core$1.Hub.remove('auth', listener);
6714
- console.log(data.payload);
6715
6707
  return [4 /*yield*/, this.auth.signIn(resetUser.username, newIdpPassword)];
6716
6708
  case 1:
6717
6709
  _b.sent();
@@ -8453,7 +8445,7 @@
8453
8445
  _l.label = 3;
8454
8446
  case 3:
8455
8447
  fileContent = _c;
8456
- if (!fileContent) return [3 /*break*/, 9];
8448
+ if (!fileContent) return [3 /*break*/, 8];
8457
8449
  return [4 /*yield*/, this.keyGraph.encryptToString(fileStateKey, fileContent)];
8458
8450
  case 4:
8459
8451
  cipherFileContent = _l.sent();
@@ -8469,18 +8461,15 @@
8469
8461
  contentResource = _l.sent();
8470
8462
  _l.label = 8;
8471
8463
  case 8:
8472
- console.log('contentResource', contentResource);
8473
- _l.label = 9;
8474
- case 9:
8475
8464
  _e = (_d = Object).assign;
8476
8465
  _g = (_f = Object).assign;
8477
8466
  _h = [{}];
8478
8467
  return [4 /*yield*/, this.prepareItem(fileStateKey, options)];
8479
- case 10:
8468
+ case 9:
8480
8469
  _j = [_g.apply(_f, _h.concat([(_l.sent())]))];
8481
8470
  _k = {};
8482
8471
  return [4 /*yield*/, this.keyGraph.wrapKey(fileKey, fileStateKey)];
8483
- case 11: return [2 /*return*/, _e.apply(_d, _j.concat([(_k.wrappedStateKey = _l.sent(), _k.contentResource = contentResource, _k)]))];
8472
+ case 10: return [2 /*return*/, _e.apply(_d, _j.concat([(_k.wrappedStateKey = _l.sent(), _k.contentResource = contentResource, _k)]))];
8484
8473
  }
8485
8474
  });
8486
8475
  });
@@ -12811,7 +12800,9 @@
12811
12800
  var RejectScenarioClaimMutation = gqlTyped(templateObject_6$a || (templateObject_6$a = __makeTemplateObject(["\nmutation RejectScenarioClaimMutation($input: RejectScenarioClaimInput!) {\n rejectScenarioClaim(input: $input) {\n claimApprover {\n id\n }\n }\n}\n"], ["\nmutation RejectScenarioClaimMutation($input: RejectScenarioClaimInput!) {\n rejectScenarioClaim(input: $input) {\n claimApprover {\n id\n }\n }\n}\n"])));
12812
12801
  var ApproveScenarioClaimMutation = gqlTyped(templateObject_7$9 || (templateObject_7$9 = __makeTemplateObject(["\nmutation ApproveScenarioClaimMutation($input: ApproveScenarioClaimInput!) {\n approveScenarioClaim(input: $input) {\n claimApprover {\n id\n }\n }\n}\n"], ["\nmutation ApproveScenarioClaimMutation($input: ApproveScenarioClaimInput!) {\n approveScenarioClaim(input: $input) {\n claimApprover {\n id\n }\n }\n}\n"])));
12813
12802
  var ReceiveScenarioClaimMutation = gqlTyped(templateObject_8$8 || (templateObject_8$8 = __makeTemplateObject(["\nmutation ReceiveScenarioClaimMutation($input: ReceiveScenarioClaimInput!) {\n receiveScenarioClaim(input: $input) {\n sharedClaim {\n id\n }\n }\n}\n"], ["\nmutation ReceiveScenarioClaimMutation($input: ReceiveScenarioClaimInput!) {\n receiveScenarioClaim(input: $input) {\n sharedClaim {\n id\n }\n }\n}\n"])));
12814
- var templateObject_1$q, templateObject_2$m, templateObject_3$j, templateObject_4$f, templateObject_5$d, templateObject_6$a, templateObject_7$9, templateObject_8$8;
12803
+ var DebugExpireScenarioClaimMutation = gqlTyped(templateObject_9$5 || (templateObject_9$5 = __makeTemplateObject(["\nmutation DebugExpireScenarioClaimMutation($input: DebugExpireScenarioClaimInput!) {\n debugExpireScenarioClaim(input: $input) {\n scenarioClaim {\n id\n }\n }\n}\n"], ["\nmutation DebugExpireScenarioClaimMutation($input: DebugExpireScenarioClaimInput!) {\n debugExpireScenarioClaim(input: $input) {\n scenarioClaim {\n id\n }\n }\n}\n"])));
12804
+ var DebugExpireTpPasswordResetRequestMutation = gqlTyped(templateObject_10$4 || (templateObject_10$4 = __makeTemplateObject(["\nmutation DebugExpireTpPasswordResetRequestMutation($input: DebugExpireTpPasswordResetRequestInput!) {\n debugExpireTpPasswordResetRequest(input: $input) {\n passwordResetRequest {\n id\n }\n }\n}\n"], ["\nmutation DebugExpireTpPasswordResetRequestMutation($input: DebugExpireTpPasswordResetRequestInput!) {\n debugExpireTpPasswordResetRequest(input: $input) {\n passwordResetRequest {\n id\n }\n }\n}\n"])));
12805
+ var templateObject_1$q, templateObject_2$m, templateObject_3$j, templateObject_4$f, templateObject_5$d, templateObject_6$a, templateObject_7$9, templateObject_8$8, templateObject_9$5, templateObject_10$4;
12815
12806
 
12816
12807
  var ScenarioQuery = gqlTyped(templateObject_1$r || (templateObject_1$r = __makeTemplateObject(["\nquery ScenarioQuery(\n $scenarioId: LrRelayIdInput!\n) {\n scenario(id: $scenarioId) {\n id\n state\n assembly {\n quorum\n singleReject\n assemblyKey {\n id\n }\n subjectKey {\n id\n }\n subjectCipherData\n subAssemblies {\n edges {\n node {\n id\n subjectKey {\n id\n }\n subjectCipherData\n quorum\n singleReject\n approvers {\n edges {\n node {\n id\n tp {\n id\n }\n sharedKey {\n id\n }\n }\n }\n }\n }\n }\n }\n }\n claimants {\n edges {\n node {\n tp {\n id\n }\n sharedKey {\n id\n }\n }\n }\n }\n receivers {\n edges {\n node {\n tp {\n id\n }\n sharedKey {\n id\n }\n sharedCipherData\n receiverDirectories {\n edges {\n node {\n id\n sharedCipherData\n sharedKey {\n id\n }\n accessRole\n itemKey {\n id\n }\n directory {\n id\n keyId\n }\n }\n }\n }\n receiverFiles {\n edges {\n node {\n id\n sharedCipherData\n sharedKey {\n id\n }\n accessRole\n itemKey {\n id\n }\n }\n }\n }\n }\n }\n }\n }\n}"], ["\nquery ScenarioQuery(\n $scenarioId: LrRelayIdInput!\n) {\n scenario(id: $scenarioId) {\n id\n state\n assembly {\n quorum\n singleReject\n assemblyKey {\n id\n }\n subjectKey {\n id\n }\n subjectCipherData\n subAssemblies {\n edges {\n node {\n id\n subjectKey {\n id\n }\n subjectCipherData\n quorum\n singleReject\n approvers {\n edges {\n node {\n id\n tp {\n id\n }\n sharedKey {\n id\n }\n }\n }\n }\n }\n }\n }\n }\n claimants {\n edges {\n node {\n tp {\n id\n }\n sharedKey {\n id\n }\n }\n }\n }\n receivers {\n edges {\n node {\n tp {\n id\n }\n sharedKey {\n id\n }\n sharedCipherData\n receiverDirectories {\n edges {\n node {\n id\n sharedCipherData\n sharedKey {\n id\n }\n accessRole\n itemKey {\n id\n }\n directory {\n id\n keyId\n }\n }\n }\n }\n receiverFiles {\n edges {\n node {\n id\n sharedCipherData\n sharedKey {\n id\n }\n accessRole\n itemKey {\n id\n }\n }\n }\n }\n }\n }\n }\n }\n}"])));
12817
12808
  var SharedScenarioQuery = gqlTyped(templateObject_2$n || (templateObject_2$n = __makeTemplateObject(["\nquery SharedScenarioQuery($scenarioId: LrRelayIdInput!) {\n sharedScenario(id: $scenarioId) {\n id\n state\n tp {\n id\n }\n asClaimant {\n sharedKey {\n id\n }\n sharedCipherData\n }\n asReceiver {\n sharedKey {\n id\n }\n sharedCipherData\n pbk {\n id\n }\n receiverDirectories {\n edges {\n node {\n id\n wrappedItemKey\n }\n }\n }\n }\n assembly {\n asApprovers {\n edges {\n node {\n id\n sharedKey {\n id\n }\n sharedCipherData\n }\n }\n }\n }\n sharedClaim {\n\t \t\tid\n isClaimant\n claim {\n state\n asClaimApprovers {\n edges {\n node {\n id\n state\n sharedKey {\n id\n }\n sharedCipherApprovalData\n sharedCipherPartialAssemblyKey\n receiverApprovals {\n edges {\n node {\n id\n pxk {\n id\n }\n }\n }\n }\n }\n }\n }\n }\n asClaimReceiver {\n received\n approvals {\n edges {\n node {\n receiverCipher\n receiverCipherPartialAssemblyKey\n pxk {\n id\n }\n }\n }\n }\n }\n }\n }\n}\n"], ["\nquery SharedScenarioQuery($scenarioId: LrRelayIdInput!) {\n sharedScenario(id: $scenarioId) {\n id\n state\n tp {\n id\n }\n asClaimant {\n sharedKey {\n id\n }\n sharedCipherData\n }\n asReceiver {\n sharedKey {\n id\n }\n sharedCipherData\n pbk {\n id\n }\n receiverDirectories {\n edges {\n node {\n id\n wrappedItemKey\n }\n }\n }\n }\n assembly {\n asApprovers {\n edges {\n node {\n id\n sharedKey {\n id\n }\n sharedCipherData\n }\n }\n }\n }\n sharedClaim {\n\t \t\tid\n isClaimant\n claim {\n state\n asClaimApprovers {\n edges {\n node {\n id\n state\n sharedKey {\n id\n }\n sharedCipherApprovalData\n sharedCipherPartialAssemblyKey\n receiverApprovals {\n edges {\n node {\n id\n pxk {\n id\n }\n }\n }\n }\n }\n }\n }\n }\n asClaimReceiver {\n received\n approvals {\n edges {\n node {\n receiverCipher\n receiverCipherPartialAssemblyKey\n pxk {\n id\n }\n }\n }\n }\n }\n }\n }\n}\n"])));
@@ -13062,6 +13053,25 @@
13062
13053
  });
13063
13054
  });
13064
13055
  };
13056
+ ScenarioService.prototype.debugExpireClaim = function (scenarioId) {
13057
+ return __awaiter(this, void 0, void 0, function () {
13058
+ return __generator(this, function (_a) {
13059
+ return [2 /*return*/, this.mutate(this.debugExpireClaimMutation(scenarioId))];
13060
+ });
13061
+ });
13062
+ };
13063
+ ScenarioService.prototype.debugExpireClaimMutation = function (scenarioId) {
13064
+ return __awaiter(this, void 0, void 0, function () {
13065
+ return __generator(this, function (_a) {
13066
+ return [2 /*return*/, new LrMutation({
13067
+ mutation: DebugExpireScenarioClaimMutation,
13068
+ variables: {
13069
+ input: { scenarioId: scenarioId },
13070
+ },
13071
+ })];
13072
+ });
13073
+ });
13074
+ };
13065
13075
  // --------------------------------------------------------------------------------
13066
13076
  // --------------------------------------------------------------------------------
13067
13077
  // Helpers
@@ -13274,7 +13284,7 @@
13274
13284
  case 0: return [4 /*yield*/, this.item2Service.getDirectoryKey(options.directoryId, options.directoryKeyId)];
13275
13285
  case 1:
13276
13286
  directoryKey = _a.sent();
13277
- return [4 /*yield*/, this.keyGraph.encryptToString(receiverSharedKey, options.sharedCipherDataClearJson)];
13287
+ return [4 /*yield*/, this.keyGraph.encryptToString(receiverSharedKey, options.sharedCipherDataClearJson || '')];
13278
13288
  case 2:
13279
13289
  sharedCipherData = _a.sent();
13280
13290
  return [4 /*yield*/, this.keyGraph.encryptToString(receiverSharedKey, directoryKey.jwk.toJSON(true))];
@@ -13393,7 +13403,7 @@
13393
13403
  var sharedKey;
13394
13404
  return __generator(this, function (_a) {
13395
13405
  switch (_a.label) {
13396
- case 0: return [4 /*yield*/, this.keyGraph.encryptWithNewKey(options.tpSharedKeyId, options.sharedCipherDataClearJson)];
13406
+ case 0: return [4 /*yield*/, this.keyGraph.encryptWithNewKey(options.tpSharedKeyId, options.sharedCipherDataClearJson || '')];
13397
13407
  case 1:
13398
13408
  sharedKey = _a.sent();
13399
13409
  return [2 /*return*/, {
@@ -13417,7 +13427,7 @@
13417
13427
  case 0: return [4 /*yield*/, this.keyGraph.getJwkKey(sharedKeyId)];
13418
13428
  case 1:
13419
13429
  sharedKey = _a.sent();
13420
- return [4 /*yield*/, this.keyGraph.encryptToString(sharedKey, options.sharedCipherDataClearJson)];
13430
+ return [4 /*yield*/, this.keyGraph.encryptToString(sharedKey, options.sharedCipherDataClearJson || '')];
13421
13431
  case 2:
13422
13432
  sharedCipherData = _a.sent();
13423
13433
  return [2 /*return*/, {
@@ -13474,7 +13484,6 @@
13474
13484
  return [4 /*yield*/, this.recoverAssemblyKey(approvals)];
13475
13485
  case 2:
13476
13486
  assemblyKey = _a.sent();
13477
- console.log('receiveClaimMutation assemblyKey', assemblyKey);
13478
13487
  return [4 /*yield*/, Promise.all(sharedScenario.asReceiver.receiverDirectories.edges
13479
13488
  .map(function (edge) { return edge.node; })
13480
13489
  .map(function (receiverDirectory) { return __awaiter(_this, void 0, void 0, function () {
@@ -13933,7 +13942,6 @@
13933
13942
  return [4 /*yield*/, nodeJose.JWK.asKey(JSON.parse(sharedReset.sharedRequest.pxk.pbk))];
13934
13943
  case 2:
13935
13944
  pbk = _c.sent();
13936
- console.log(pbk.toJSON());
13937
13945
  claimApprovers = sharedReset.sharedRequest.claim.asClaimApprovers.edges.filter(function (edge) { return edge.node.state === exports.TpClaimApproverState.CLAIMED; });
13938
13946
  _b = (_a = LrMergedMutation).create;
13939
13947
  return [4 /*yield*/, Promise.all(claimApprovers.map(function (approverEdge) { return __awaiter(_this, void 0, void 0, function () {
@@ -13965,7 +13973,6 @@
13965
13973
  case 1:
13966
13974
  input = (_a.receiverApprovals = _b.sent(),
13967
13975
  _a);
13968
- console.log(input);
13969
13976
  return [2 /*return*/, new LrMutation({
13970
13977
  mutation: ApproveTpPasswordResetRequestMutation,
13971
13978
  variables: {
@@ -14084,8 +14091,7 @@
14084
14091
  .toPromise()];
14085
14092
  case 6:
14086
14093
  requestResetResult = _a.sent();
14087
- console.log(requestResetResult);
14088
- console.log('Using new password: ', this.passwordService.getPassIdpString(passKeyBundle.passIdp));
14094
+ console.log('Using new password');
14089
14095
  return [4 /*yield*/, this.auth.signUp({
14090
14096
  username: requestResetResult.reset_username,
14091
14097
  password: this.passwordService.getPassIdpString(passKeyBundle.passIdp),
@@ -14098,7 +14104,7 @@
14098
14104
  })];
14099
14105
  case 7:
14100
14106
  signUpResult = _a.sent();
14101
- console.log('requestRest done: ', signUpResult);
14107
+ console.log('requestRest done');
14102
14108
  return [2 /*return*/, {
14103
14109
  requestResetResult: requestResetResult,
14104
14110
  signUpResult: signUpResult,
@@ -14210,6 +14216,25 @@
14210
14216
  });
14211
14217
  });
14212
14218
  };
14219
+ TpPasswordResetService.prototype.debugExpireResetRequest = function (username) {
14220
+ return this.mutate(this.debugExpireResetRequestMutation(username), {
14221
+ includeKeyGraph: false,
14222
+ });
14223
+ };
14224
+ TpPasswordResetService.prototype.debugExpireResetRequestMutation = function (username) {
14225
+ return __awaiter(this, void 0, void 0, function () {
14226
+ return __generator(this, function (_a) {
14227
+ return [2 /*return*/, new LrMutation({
14228
+ mutation: DebugExpireTpPasswordResetRequestMutation,
14229
+ variables: {
14230
+ input: {
14231
+ username: username,
14232
+ },
14233
+ },
14234
+ })];
14235
+ });
14236
+ });
14237
+ };
14213
14238
  return TpPasswordResetService;
14214
14239
  }(LrService));
14215
14240
  exports.TpPasswordResetService.ɵprov = i0.ɵɵdefineInjectable({ factory: function TpPasswordResetService_Factory() { return new exports.TpPasswordResetService(i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(i0.INJECTOR), i0.ɵɵinject(exports.ɵr), i0.ɵɵinject(exports.ɵl)); }, token: exports.TpPasswordResetService, providedIn: "root" });