@lifeready/core 6.1.2 → 6.1.4

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.
Files changed (76) hide show
  1. package/bundles/lifeready-core.umd.js +359 -344
  2. package/bundles/lifeready-core.umd.js.map +1 -1
  3. package/bundles/lifeready-core.umd.min.js +1 -1
  4. package/bundles/lifeready-core.umd.min.js.map +1 -1
  5. package/esm2015/lib/auth/auth.config.js +57 -0
  6. package/esm2015/lib/auth/auth.gql.private.js +85 -0
  7. package/esm2015/lib/auth/auth.service.js +602 -0
  8. package/esm2015/lib/auth/auth.types.js +21 -0
  9. package/esm2015/lib/item/item.gql.js +164 -0
  10. package/esm2015/lib/item/item.gql.private.js +23 -0
  11. package/esm2015/lib/item/item.service.js +592 -0
  12. package/esm2015/lib/item/item.types.js +2 -0
  13. package/esm2015/lib/key-exchange/key-exchange.gql.js +174 -0
  14. package/esm2015/lib/key-exchange/key-exchange.service.js +480 -0
  15. package/esm2015/lib/lbop/lbop.service.js +7 -15
  16. package/esm2015/lib/life-ready.module.js +2 -2
  17. package/esm2015/lib/password/password.service.js +1 -1
  18. package/esm2015/lib/plan/plan.gql.js +91 -0
  19. package/esm2015/lib/plan/plan.service.js +191 -0
  20. package/esm2015/lib/plan/plan.types.js +2 -0
  21. package/esm2015/lib/profile/profile.gql.js +2 -64
  22. package/esm2015/lib/profile/profile.service.js +1 -8
  23. package/esm2015/lib/profile/profile.types.js +1 -8
  24. package/esm2015/lib/scenario/scenario.service.js +8 -8
  25. package/esm2015/lib/shared-contact-card/shared-contact-card2.service.js +1 -1
  26. package/esm2015/lib/trusted-party/trusted-party.gql.js +64 -0
  27. package/esm2015/lib/trusted-party/trusted-party.gql.private.js +25 -0
  28. package/esm2015/lib/trusted-party/trusted-party.service.js +240 -0
  29. package/esm2015/lib/trusted-party/trusted-party.types.js +2 -0
  30. package/esm2015/public-api.js +17 -11
  31. package/fesm2015/lifeready-core.js +373 -456
  32. package/fesm2015/lifeready-core.js.map +1 -1
  33. package/lib/{auth2/auth2.service.d.ts → auth/auth.service.d.ts} +2 -2
  34. package/lib/{item2/item2.service.d.ts → item/item.service.d.ts} +39 -39
  35. package/lib/key-exchange/{key-exchange2.gql.d.ts → key-exchange.gql.d.ts} +27 -13
  36. package/lib/key-exchange/{key-exchange2.service.d.ts → key-exchange.service.d.ts} +5 -5
  37. package/lib/lbop/lbop.service.d.ts +1 -5
  38. package/lib/password/password.service.d.ts +1 -1
  39. package/lib/{plan2/plan2.service.d.ts → plan/plan.service.d.ts} +20 -20
  40. package/lib/profile/profile.gql.d.ts +0 -2
  41. package/lib/profile/profile.service.d.ts +1 -2
  42. package/lib/profile/profile.types.d.ts +2 -15
  43. package/lib/scenario/scenario.service.d.ts +3 -3
  44. package/lib/shared-contact-card/shared-contact-card2.service.d.ts +1 -1
  45. package/lib/trusted-party/{trusted-party2.service.d.ts → trusted-party.service.d.ts} +6 -6
  46. package/lifeready-core.metadata.json +1 -1
  47. package/package.json +1 -1
  48. package/public-api.d.ts +16 -10
  49. package/esm2015/lib/auth2/auth.config.js +0 -57
  50. package/esm2015/lib/auth2/auth2.gql.private.js +0 -85
  51. package/esm2015/lib/auth2/auth2.service.js +0 -602
  52. package/esm2015/lib/auth2/auth2.types.js +0 -21
  53. package/esm2015/lib/item2/item2.gql.js +0 -164
  54. package/esm2015/lib/item2/item2.gql.private.js +0 -23
  55. package/esm2015/lib/item2/item2.service.js +0 -592
  56. package/esm2015/lib/item2/item2.types.js +0 -2
  57. package/esm2015/lib/key-exchange/key-exchange2.gql.js +0 -172
  58. package/esm2015/lib/key-exchange/key-exchange2.service.js +0 -480
  59. package/esm2015/lib/plan2/plan2.gql.js +0 -91
  60. package/esm2015/lib/plan2/plan2.service.js +0 -191
  61. package/esm2015/lib/plan2/plan2.types.js +0 -2
  62. package/esm2015/lib/trusted-party/trusted-party2.gql.js +0 -64
  63. package/esm2015/lib/trusted-party/trusted-party2.gql.private.js +0 -25
  64. package/esm2015/lib/trusted-party/trusted-party2.service.js +0 -240
  65. package/esm2015/lib/trusted-party/trusted-party2.types.js +0 -2
  66. /package/lib/{auth2 → auth}/auth.config.d.ts +0 -0
  67. /package/lib/{auth2/auth2.gql.private.d.ts → auth/auth.gql.private.d.ts} +0 -0
  68. /package/lib/{auth2/auth2.types.d.ts → auth/auth.types.d.ts} +0 -0
  69. /package/lib/{item2/item2.gql.d.ts → item/item.gql.d.ts} +0 -0
  70. /package/lib/{item2/item2.gql.private.d.ts → item/item.gql.private.d.ts} +0 -0
  71. /package/lib/{item2/item2.types.d.ts → item/item.types.d.ts} +0 -0
  72. /package/lib/{plan2/plan2.gql.d.ts → plan/plan.gql.d.ts} +0 -0
  73. /package/lib/{plan2/plan2.types.d.ts → plan/plan.types.d.ts} +0 -0
  74. /package/lib/trusted-party/{trusted-party2.gql.d.ts → trusted-party.gql.d.ts} +0 -0
  75. /package/lib/trusted-party/{trusted-party2.gql.private.d.ts → trusted-party.gql.private.d.ts} +0 -0
  76. /package/lib/trusted-party/{trusted-party2.types.d.ts → trusted-party.types.d.ts} +0 -0
@@ -3378,6 +3378,179 @@ KeyMetaService.ctorParameters = () => [
3378
3378
  { type: KeyFactoryService }
3379
3379
  ];
3380
3380
 
3381
+ const KeyExchangeFields = `
3382
+ id
3383
+ token
3384
+ state
3385
+ mode
3386
+ isInitiator
3387
+ initiator {
3388
+ id
3389
+ username
3390
+ config
3391
+ }
3392
+ responder {
3393
+ id
3394
+ username
3395
+ }
3396
+ created
3397
+ modified
3398
+ tokenExpiryTime
3399
+ isExpired
3400
+ initiatorRootKeyCipher
3401
+ initiatorActionRequired
3402
+ responderActionRequired
3403
+ responderEmailAddress
3404
+ otk {
3405
+ state
3406
+ otKeyParams
3407
+ otKeyCipher
3408
+ sharedKey {
3409
+ id
3410
+ }
3411
+ mkSharedKey {
3412
+ id
3413
+ }
3414
+ initiatorSigPxk {
3415
+ id
3416
+ }
3417
+ responderSigPxk {
3418
+ id
3419
+ }
3420
+ initiatorOneTimePbkCipher
3421
+ responderPbkCipher
3422
+ }
3423
+ `;
3424
+ const UserSharedKeyFields = `
3425
+ userSigPrk {
3426
+ id
3427
+ }
3428
+ otherSigPbk {
3429
+ id
3430
+ }
3431
+ sharedKey {
3432
+ id
3433
+ }
3434
+ mkSharedKey {
3435
+ id
3436
+ }
3437
+ mkPxk {
3438
+ id
3439
+ pbk
3440
+ }
3441
+ mkReshareRequestCipher
3442
+ mkReshareResponseCipher
3443
+ mkReshareRequestSent
3444
+ mkReshareResponseSent
3445
+ `;
3446
+ const KeyExchangesQuery2 = gqlTyped `
3447
+ query KeyExchangesQuery2($state: String) {
3448
+ keyExchanges(state: $state) {
3449
+ edges {
3450
+ node {
3451
+ ${KeyExchangeFields}
3452
+ }
3453
+ }
3454
+ }
3455
+ }
3456
+ `;
3457
+ const KeyExchangeQuery2 = gqlTyped `
3458
+ query KeyExchangeQuery2($id: LrRelayIdInput!) {
3459
+ keyExchange(id: $id) {
3460
+ ${KeyExchangeFields}
3461
+ }
3462
+ }
3463
+ `;
3464
+ const KeyExchangeTokenQuery2 = gqlTyped `
3465
+ query KeyExchangeTokenQuery2($id: LrRelayIdInput!, $token: String) {
3466
+ keyExchange(id: $id, token: $token) {
3467
+ ${KeyExchangeFields}
3468
+ }
3469
+ }
3470
+ `;
3471
+ const CancelKeyExchangeMutation = gqlTyped `
3472
+ mutation CancelKeyExchangeMutation($input: CancelKeyExchangeInput!) {
3473
+ cancelKeyExchange(input: $input) {
3474
+ keyExchange {
3475
+ id
3476
+ }
3477
+ }
3478
+ }
3479
+ `;
3480
+ const DeclineKeyExchangeMutation = gqlTyped `
3481
+ mutation DeclineKeyExchangeMutation($input: DeclineKeyExchangeInput!) {
3482
+ declineKeyExchange(input: $input) {
3483
+ keyExchange {
3484
+ id
3485
+ }
3486
+ }
3487
+ }
3488
+ `;
3489
+ const InitiateKeyExchangeOtkMutation = gqlTyped `
3490
+ mutation InitiateKeyExchangeOtkMutation(
3491
+ $input: InitiateKeyExchangeOtkInput!
3492
+ ) {
3493
+ initiateKeyExchangeOtk(input: $input) {
3494
+ keyExchange {
3495
+ ${KeyExchangeFields}
3496
+ }
3497
+ }
3498
+ }
3499
+ `;
3500
+ const RespondKeyExchangeOtkMutation = gqlTyped `
3501
+ mutation RespondKeyExchangeOtkMutation($input: RespondKeyExchangeOtkInput!) {
3502
+ respondKeyExchangeOtk(input: $input) {
3503
+ keyExchange {
3504
+ ${KeyExchangeFields}
3505
+ }
3506
+ userSharedKey {
3507
+ ${UserSharedKeyFields}
3508
+ }
3509
+ tp {
3510
+ id
3511
+ user {
3512
+ config
3513
+ }
3514
+ }
3515
+ }
3516
+ }
3517
+ `;
3518
+ const CompleteKeyExchangeOtkMutation = gqlTyped `
3519
+ mutation CompleteKeyExchangeOtkMutation(
3520
+ $input: CompleteKeyExchangeOtkInput!
3521
+ ) {
3522
+ completeKeyExchangeOtk(input: $input) {
3523
+ keyExchange {
3524
+ ${KeyExchangeFields}
3525
+ }
3526
+ userSharedKey {
3527
+ ${UserSharedKeyFields}
3528
+ }
3529
+ tp {
3530
+ id
3531
+ user {
3532
+ config
3533
+ }
3534
+ }
3535
+ }
3536
+ }
3537
+ `;
3538
+ const CurrentUserSharedKeyQuery2 = gqlTyped `
3539
+ query CurrentUserSharedKeyQuery2(
3540
+ $username: String
3541
+ $userId: LrRelayIdInput
3542
+ ) {
3543
+ currentUserSharedKey(
3544
+ username: $username
3545
+ userId: $userId
3546
+ ) {
3547
+ userSharedKey {
3548
+ ${UserSharedKeyFields}
3549
+ }
3550
+ }
3551
+ }
3552
+ `;
3553
+
3381
3554
  var FeatureAction;
3382
3555
  (function (FeatureAction) {
3383
3556
  // Just the one for now
@@ -3407,13 +3580,6 @@ class MainContactCardFields {
3407
3580
  }
3408
3581
  class MainContactCardPlainFields {
3409
3582
  }
3410
- var PasswordChangeStatus;
3411
- (function (PasswordChangeStatus) {
3412
- PasswordChangeStatus["InProgress"] = "IN_PROGRESS";
3413
- PasswordChangeStatus["Recovery"] = "RECOVERY";
3414
- })(PasswordChangeStatus || (PasswordChangeStatus = {}));
3415
- class PassIdpApiResult {
3416
- }
3417
3583
  class TrustedPartyDetails {
3418
3584
  }
3419
3585
  class SharedTrustedPartyDetails extends TrustedPartyDetails {
@@ -3537,69 +3703,6 @@ SharedContactCardService.ctorParameters = () => [
3537
3703
  ];
3538
3704
 
3539
3705
  /* eslint-disable @typescript-eslint/no-explicit-any */
3540
- const UserSharedKeyFields = `
3541
- userSigPrk {
3542
- id
3543
- }
3544
- otherSigPbk {
3545
- id
3546
- }
3547
- sharedKey {
3548
- id
3549
- }
3550
- mkSharedKey {
3551
- id
3552
- }
3553
- mkPxk {
3554
- id
3555
- pbk
3556
- }
3557
- mkReshareRequestCipher
3558
- mkReshareResponseCipher
3559
- mkReshareRequestSent
3560
- mkReshareResponseSent
3561
- `;
3562
- const KeyExchangeFields = `
3563
- id
3564
- token
3565
- state
3566
- mode
3567
- isInitiator
3568
- initiator {
3569
- id
3570
- username
3571
- }
3572
- responder {
3573
- id
3574
- username
3575
- }
3576
- created
3577
- modified
3578
- tokenExpiryTime
3579
- isExpired
3580
- initiatorRootKeyCipher
3581
- initiatorActionRequired
3582
- responderActionRequired
3583
- responderEmailAddress
3584
- otk {
3585
- state
3586
- otKeyParams
3587
- otKeyCipher
3588
- sharedKey {
3589
- id
3590
- }
3591
- mkSharedKey {
3592
- id
3593
- }
3594
- initiatorSigPxk {
3595
- id
3596
- }
3597
- responderSigPxk {
3598
- id
3599
- }
3600
- initiatorOneTimePbkCipher
3601
- responderPbkCipher
3602
- }`;
3603
3706
  const TrustedPartyProperties = `
3604
3707
  id
3605
3708
  user {
@@ -3774,13 +3877,6 @@ class ProfileService {
3774
3877
  this.keyGraph = keyGraph;
3775
3878
  this.encryptionService = encryptionService;
3776
3879
  }
3777
- getPassIdpParams(emailOrPhone) {
3778
- return __awaiter(this, void 0, void 0, function* () {
3779
- return yield this.http
3780
- .get(`${this.config.authUrl}users/pass-idp-params/?login_name=${encodeURIComponent(emailOrPhone)}`)
3781
- .toPromise();
3782
- });
3783
- }
3784
3880
  getCurrentUser() {
3785
3881
  return __awaiter(this, void 0, void 0, function* () {
3786
3882
  const { currentUser, contactCards } = yield this.lrApollo.query({
@@ -4988,11 +5084,11 @@ var RecoveryStatus;
4988
5084
  })(RecoveryStatus || (RecoveryStatus = {}));
4989
5085
  // TODO restrict this type
4990
5086
  // export type AuthResetUser = TpPasswordResetUserNode;
4991
- var PasswordChangeStatus$1;
5087
+ var PasswordChangeStatus;
4992
5088
  (function (PasswordChangeStatus) {
4993
5089
  PasswordChangeStatus["IN_PROGRESS"] = "IN_PROGRESS";
4994
5090
  PasswordChangeStatus["RECOVERY"] = "RECOVERY";
4995
- })(PasswordChangeStatus$1 || (PasswordChangeStatus$1 = {}));
5091
+ })(PasswordChangeStatus || (PasswordChangeStatus = {}));
4996
5092
  var CognitoChallengeName;
4997
5093
  (function (CognitoChallengeName) {
4998
5094
  CognitoChallengeName["NEW_PASSWORD_REQUIRED"] = "NEW_PASSWORD_REQUIRED";
@@ -5001,15 +5097,8 @@ var CognitoChallengeName;
5001
5097
  CognitoChallengeName["MFA_SETUP"] = "MFA_SETUP";
5002
5098
  })(CognitoChallengeName || (CognitoChallengeName = {}));
5003
5099
 
5004
- var auth2_types = /*#__PURE__*/Object.freeze({
5005
- __proto__: null,
5006
- get RecoveryStatus () { return RecoveryStatus; },
5007
- get PasswordChangeStatus () { return PasswordChangeStatus$1; },
5008
- get CognitoChallengeName () { return CognitoChallengeName; }
5009
- });
5010
-
5011
- var Auth2Service_1;
5012
- let Auth2Service = Auth2Service_1 = class Auth2Service extends LrService {
5100
+ var AuthService_1;
5101
+ let AuthService = AuthService_1 = class AuthService extends LrService {
5013
5102
  constructor(ngZone, injector, http, cognito, api, keyService, keyGraphService, keyFactoryService, passwordService, idleService, persistService, encryptionService, assemblyController, kcConfig) {
5014
5103
  super(injector);
5015
5104
  this.ngZone = ngZone;
@@ -5067,7 +5156,7 @@ let Auth2Service = Auth2Service_1 = class Auth2Service extends LrService {
5067
5156
  let loginResult = yield this.loginImpl(emailOrPhone, password);
5068
5157
  // Save the password for use after meeting challenge.
5069
5158
  if (loginResult.challenge) {
5070
- this.password = new KeyContainer(password, Auth2Service_1.CHALLENGE_TIMEOUT);
5159
+ this.password = new KeyContainer(password, AuthService_1.CHALLENGE_TIMEOUT);
5071
5160
  return loginResult;
5072
5161
  }
5073
5162
  if (tpPasswordResetAutoComplete &&
@@ -5204,10 +5293,10 @@ let Auth2Service = Auth2Service_1 = class Auth2Service extends LrService {
5204
5293
  return __awaiter(this, void 0, void 0, function* () {
5205
5294
  // Download the salt needed to derive the PassIdp
5206
5295
  const passIdpApiResult = yield this.fetchPassIdpParams(emailOrPhone);
5207
- if (passIdpApiResult.passwordChangeStatus === PasswordChangeStatus$1.IN_PROGRESS) {
5296
+ if (passIdpApiResult.passwordChangeStatus === PasswordChangeStatus.IN_PROGRESS) {
5208
5297
  throw new KcConcurrentAccessException('A password change is in progress');
5209
5298
  }
5210
- if (passIdpApiResult.passwordChangeStatus === PasswordChangeStatus$1.RECOVERY) {
5299
+ if (passIdpApiResult.passwordChangeStatus === PasswordChangeStatus.RECOVERY) {
5211
5300
  console.log('In recovery mode.');
5212
5301
  // Let's say we don't know if the password is the new one or the old one. We just have to try both.
5213
5302
  try {
@@ -5543,14 +5632,14 @@ let Auth2Service = Auth2Service_1 = class Auth2Service extends LrService {
5543
5632
  });
5544
5633
  }
5545
5634
  };
5546
- Auth2Service.CHALLENGE_TIMEOUT = 1000 * 60 * 5;
5547
- Auth2Service.ɵprov = ɵɵdefineInjectable({ factory: function Auth2Service_Factory() { return new Auth2Service(ɵɵinject(NgZone), ɵɵinject(INJECTOR), ɵɵinject(HttpClient), ɵɵinject(AuthClass), ɵɵinject(LrGraphQLService), ɵɵinject(KeyService), ɵɵinject(KeyGraphService), ɵɵinject(KeyFactoryService), ɵɵinject(PasswordService), ɵɵinject(IdleService), ɵɵinject(PersistService), ɵɵinject(EncryptionService), ɵɵinject(TpPasswordResetAssemblyController), ɵɵinject(KC_CONFIG)); }, token: Auth2Service, providedIn: "root" });
5548
- Auth2Service.decorators = [
5635
+ AuthService.CHALLENGE_TIMEOUT = 1000 * 60 * 5;
5636
+ AuthService.ɵprov = ɵɵdefineInjectable({ factory: function AuthService_Factory() { return new AuthService(ɵɵinject(NgZone), ɵɵinject(INJECTOR), ɵɵinject(HttpClient), ɵɵinject(AuthClass), ɵɵinject(LrGraphQLService), ɵɵinject(KeyService), ɵɵinject(KeyGraphService), ɵɵinject(KeyFactoryService), ɵɵinject(PasswordService), ɵɵinject(IdleService), ɵɵinject(PersistService), ɵɵinject(EncryptionService), ɵɵinject(TpPasswordResetAssemblyController), ɵɵinject(KC_CONFIG)); }, token: AuthService, providedIn: "root" });
5637
+ AuthService.decorators = [
5549
5638
  { type: Injectable, args: [{
5550
5639
  providedIn: 'root',
5551
5640
  },] }
5552
5641
  ];
5553
- Auth2Service.ctorParameters = () => [
5642
+ AuthService.ctorParameters = () => [
5554
5643
  { type: NgZone },
5555
5644
  { type: Injector },
5556
5645
  { type: HttpClient },
@@ -5566,11 +5655,11 @@ Auth2Service.ctorParameters = () => [
5566
5655
  { type: TpPasswordResetAssemblyController },
5567
5656
  { type: undefined, decorators: [{ type: Inject, args: [KC_CONFIG,] }] }
5568
5657
  ];
5569
- Auth2Service = Auth2Service_1 = __decorate([
5658
+ AuthService = AuthService_1 = __decorate([
5570
5659
  RunOutsideAngular({
5571
5660
  ngZoneName: 'ngZone',
5572
5661
  })
5573
- ], Auth2Service);
5662
+ ], AuthService);
5574
5663
 
5575
5664
  const CreateContactCardMutation$2 = gqlTyped `
5576
5665
  mutation CreateContactCardMutation(
@@ -5747,102 +5836,6 @@ FileUploadService.ctorParameters = () => [
5747
5836
  { type: AuthClass }
5748
5837
  ];
5749
5838
 
5750
- const LockFragment = gqlTyped `
5751
- fragment LockFragment on LockField {
5752
- created
5753
- modified
5754
- version
5755
- expiryTime
5756
- state
5757
- }`;
5758
- const UpdateLockMutation = gqlTyped `
5759
- mutation UpdateLockMutation($input: UpdateLockInput!) {
5760
- updateLock(input: $input) {
5761
- lock {
5762
- ...LockFragment
5763
- }
5764
- }
5765
- }
5766
- ${LockFragment}
5767
- `;
5768
- const AcquireLockMutation = gqlTyped `
5769
- mutation AcquireLockMutation($input: AcquireLockInput!) {
5770
- acquireLock(input: $input) {
5771
- lock {
5772
- ...LockFragment
5773
- }
5774
- }
5775
- }
5776
- ${LockFragment}
5777
- `;
5778
- const ReleaseLockMutation = gqlTyped `
5779
- mutation ReleaseLockMutation($input: ReleaseLockInput!) {
5780
- releaseLock(input: $input) {
5781
- lock {
5782
- ...LockFragment
5783
- }
5784
- }
5785
- }
5786
- ${LockFragment}
5787
- `;
5788
-
5789
- let LockService = class LockService extends LrService {
5790
- constructor(ngZone, injector) {
5791
- super(injector);
5792
- this.ngZone = ngZone;
5793
- this.injector = injector;
5794
- }
5795
- // Updating the lock version is always to be down along with another mutation.
5796
- updateLockMutation(options) {
5797
- return new LrMutation({
5798
- mutation: UpdateLockMutation,
5799
- variables: {
5800
- input: {
5801
- resourceId: options.resourceId,
5802
- version: options.version,
5803
- },
5804
- },
5805
- });
5806
- }
5807
- acquireLockMutation(options) {
5808
- return new LrMutation({
5809
- mutation: AcquireLockMutation,
5810
- variables: {
5811
- input: {
5812
- resourceId: options.resourceId,
5813
- timeoutMs: options.timeoutMs,
5814
- },
5815
- },
5816
- });
5817
- }
5818
- releaseLockMutation(options) {
5819
- return new LrMutation({
5820
- mutation: ReleaseLockMutation,
5821
- variables: {
5822
- input: {
5823
- resourceId: options.resourceId,
5824
- version: options.version,
5825
- },
5826
- },
5827
- });
5828
- }
5829
- };
5830
- LockService.ɵprov = ɵɵdefineInjectable({ factory: function LockService_Factory() { return new LockService(ɵɵinject(NgZone), ɵɵinject(INJECTOR)); }, token: LockService, providedIn: "root" });
5831
- LockService.decorators = [
5832
- { type: Injectable, args: [{
5833
- providedIn: 'root',
5834
- },] }
5835
- ];
5836
- LockService.ctorParameters = () => [
5837
- { type: NgZone },
5838
- { type: Injector }
5839
- ];
5840
- LockService = __decorate([
5841
- RunOutsideAngular({
5842
- ngZoneName: 'ngZone',
5843
- })
5844
- ], LockService);
5845
-
5846
5839
  const CreateDirectoryMutation = gqlTyped `
5847
5840
  mutation CreateDirectoryMutation($input: CreateDirectoryInput!) {
5848
5841
  createDirectory(input: $input) {
@@ -5993,18 +5986,114 @@ mutation SetFileConfidentialMutation($input: SetFileConfidentialInput!) {
5993
5986
  file {
5994
5987
  id
5995
5988
  }
5996
- }
5997
- }
5998
- `;
5999
- const SetDirectoryConfidentialMutation = gqlTyped `
6000
- mutation SetDirectoryConfidentialMutation($input: SetDirectoryConfidentialInput!) {
6001
- setDirectoryConfidential(input: $input) {
6002
- directory {
6003
- id
5989
+ }
5990
+ }
5991
+ `;
5992
+ const SetDirectoryConfidentialMutation = gqlTyped `
5993
+ mutation SetDirectoryConfidentialMutation($input: SetDirectoryConfidentialInput!) {
5994
+ setDirectoryConfidential(input: $input) {
5995
+ directory {
5996
+ id
5997
+ }
5998
+ }
5999
+ }
6000
+ `;
6001
+
6002
+ const LockFragment = gqlTyped `
6003
+ fragment LockFragment on LockField {
6004
+ created
6005
+ modified
6006
+ version
6007
+ expiryTime
6008
+ state
6009
+ }`;
6010
+ const UpdateLockMutation = gqlTyped `
6011
+ mutation UpdateLockMutation($input: UpdateLockInput!) {
6012
+ updateLock(input: $input) {
6013
+ lock {
6014
+ ...LockFragment
6015
+ }
6016
+ }
6017
+ }
6018
+ ${LockFragment}
6019
+ `;
6020
+ const AcquireLockMutation = gqlTyped `
6021
+ mutation AcquireLockMutation($input: AcquireLockInput!) {
6022
+ acquireLock(input: $input) {
6023
+ lock {
6024
+ ...LockFragment
6025
+ }
6026
+ }
6027
+ }
6028
+ ${LockFragment}
6029
+ `;
6030
+ const ReleaseLockMutation = gqlTyped `
6031
+ mutation ReleaseLockMutation($input: ReleaseLockInput!) {
6032
+ releaseLock(input: $input) {
6033
+ lock {
6034
+ ...LockFragment
6035
+ }
6036
+ }
6037
+ }
6038
+ ${LockFragment}
6039
+ `;
6040
+
6041
+ let LockService = class LockService extends LrService {
6042
+ constructor(ngZone, injector) {
6043
+ super(injector);
6044
+ this.ngZone = ngZone;
6045
+ this.injector = injector;
6046
+ }
6047
+ // Updating the lock version is always to be down along with another mutation.
6048
+ updateLockMutation(options) {
6049
+ return new LrMutation({
6050
+ mutation: UpdateLockMutation,
6051
+ variables: {
6052
+ input: {
6053
+ resourceId: options.resourceId,
6054
+ version: options.version,
6055
+ },
6056
+ },
6057
+ });
6058
+ }
6059
+ acquireLockMutation(options) {
6060
+ return new LrMutation({
6061
+ mutation: AcquireLockMutation,
6062
+ variables: {
6063
+ input: {
6064
+ resourceId: options.resourceId,
6065
+ timeoutMs: options.timeoutMs,
6066
+ },
6067
+ },
6068
+ });
6069
+ }
6070
+ releaseLockMutation(options) {
6071
+ return new LrMutation({
6072
+ mutation: ReleaseLockMutation,
6073
+ variables: {
6074
+ input: {
6075
+ resourceId: options.resourceId,
6076
+ version: options.version,
6077
+ },
6078
+ },
6079
+ });
6004
6080
  }
6005
- }
6006
- }
6007
- `;
6081
+ };
6082
+ LockService.ɵprov = ɵɵdefineInjectable({ factory: function LockService_Factory() { return new LockService(ɵɵinject(NgZone), ɵɵinject(INJECTOR)); }, token: LockService, providedIn: "root" });
6083
+ LockService.decorators = [
6084
+ { type: Injectable, args: [{
6085
+ providedIn: 'root',
6086
+ },] }
6087
+ ];
6088
+ LockService.ctorParameters = () => [
6089
+ { type: NgZone },
6090
+ { type: Injector }
6091
+ ];
6092
+ LockService = __decorate([
6093
+ RunOutsideAngular({
6094
+ ngZoneName: 'ngZone',
6095
+ })
6096
+ ], LockService);
6008
6097
 
6009
6098
  const DirectoryKeyQuery$1 = gqlTyped `
6010
6099
  query DirectoryKeyQuery($id: LrRelayIdInput!) {
@@ -6028,9 +6117,9 @@ query FileStateKeyQuery($id: LrRelayIdInput!) {
6028
6117
  }
6029
6118
  `;
6030
6119
 
6031
- var Item2Service_1;
6032
- let Item2Service = Item2Service_1 = class Item2Service extends LrService {
6033
- constructor(ngZone, injector, fileUploadService, keyService, keyFactory, keyGraph, lockService, auth2Service) {
6120
+ var ItemService_1;
6121
+ let ItemService = ItemService_1 = class ItemService extends LrService {
6122
+ constructor(ngZone, injector, fileUploadService, keyService, keyFactory, keyGraph, lockService, authService) {
6034
6123
  super(injector);
6035
6124
  this.ngZone = ngZone;
6036
6125
  this.injector = injector;
@@ -6039,10 +6128,10 @@ let Item2Service = Item2Service_1 = class Item2Service extends LrService {
6039
6128
  this.keyFactory = keyFactory;
6040
6129
  this.keyGraph = keyGraph;
6041
6130
  this.lockService = lockService;
6042
- this.auth2Service = auth2Service;
6131
+ this.authService = authService;
6043
6132
  // Caching the temp directory.
6044
6133
  this.tempDirectory = null;
6045
- this.auth2Service.addLogoutListener(() => this.onLogout());
6134
+ this.authService.addLogoutListener(() => this.onLogout());
6046
6135
  }
6047
6136
  downloadFileContent(options) {
6048
6137
  return __awaiter(this, void 0, void 0, function* () {
@@ -6299,17 +6388,17 @@ let Item2Service = Item2Service_1 = class Item2Service extends LrService {
6299
6388
  const existing = yield this.query({
6300
6389
  query: TempDirectoryQuery,
6301
6390
  variables: {
6302
- plainMeta: Item2Service_1.TEMP_DIRECTORY_PLAIN_META_FILTER,
6391
+ plainMeta: ItemService_1.TEMP_DIRECTORY_PLAIN_META_FILTER,
6303
6392
  },
6304
6393
  });
6305
6394
  if (existing.rootDirectories.edges.length > 1) {
6306
- console.error(`There is more than 1 temp directory (plainMeta filter: ${Item2Service_1.TEMP_DIRECTORY_PLAIN_META_FILTER})`);
6395
+ console.error(`There is more than 1 temp directory (plainMeta filter: ${ItemService_1.TEMP_DIRECTORY_PLAIN_META_FILTER})`);
6307
6396
  }
6308
6397
  if (existing.rootDirectories.edges.length === 0) {
6309
6398
  // Doesn't exist yet, create it
6310
6399
  const createDirectory = yield this.createDirectoryMutation({
6311
6400
  asRootDirectory: true,
6312
- plainMetaJson: Item2Service_1.TEMP_DIRECTORY_PLAIN_META,
6401
+ plainMetaJson: ItemService_1.TEMP_DIRECTORY_PLAIN_META,
6313
6402
  });
6314
6403
  // Optimistic lock on the current user.
6315
6404
  const updateLock = this.lockService.updateLockMutation({
@@ -6568,21 +6657,21 @@ let Item2Service = Item2Service_1 = class Item2Service extends LrService {
6568
6657
  this.tempDirectory = null;
6569
6658
  }
6570
6659
  };
6571
- Item2Service.TEMP_DIRECTORY_PLAIN_META = { kcType: 'temp' };
6572
- Item2Service.TEMP_DIRECTORY_PLAIN_META_FILTER = JSON.stringify({
6660
+ ItemService.TEMP_DIRECTORY_PLAIN_META = { kcType: 'temp' };
6661
+ ItemService.TEMP_DIRECTORY_PLAIN_META_FILTER = JSON.stringify({
6573
6662
  filter: [
6574
6663
  {
6575
- contains: Item2Service_1.TEMP_DIRECTORY_PLAIN_META,
6664
+ contains: ItemService_1.TEMP_DIRECTORY_PLAIN_META,
6576
6665
  },
6577
6666
  ],
6578
6667
  });
6579
- Item2Service.ɵprov = ɵɵdefineInjectable({ factory: function Item2Service_Factory() { return new Item2Service(ɵɵinject(NgZone), ɵɵinject(INJECTOR), ɵɵinject(FileUploadService), ɵɵinject(KeyService), ɵɵinject(KeyFactoryService), ɵɵinject(KeyGraphService), ɵɵinject(LockService), ɵɵinject(Auth2Service)); }, token: Item2Service, providedIn: "root" });
6580
- Item2Service.decorators = [
6668
+ ItemService.ɵprov = ɵɵdefineInjectable({ factory: function ItemService_Factory() { return new ItemService(ɵɵinject(NgZone), ɵɵinject(INJECTOR), ɵɵinject(FileUploadService), ɵɵinject(KeyService), ɵɵinject(KeyFactoryService), ɵɵinject(KeyGraphService), ɵɵinject(LockService), ɵɵinject(AuthService)); }, token: ItemService, providedIn: "root" });
6669
+ ItemService.decorators = [
6581
6670
  { type: Injectable, args: [{
6582
6671
  providedIn: 'root',
6583
6672
  },] }
6584
6673
  ];
6585
- Item2Service.ctorParameters = () => [
6674
+ ItemService.ctorParameters = () => [
6586
6675
  { type: NgZone },
6587
6676
  { type: Injector },
6588
6677
  { type: FileUploadService },
@@ -6590,186 +6679,15 @@ Item2Service.ctorParameters = () => [
6590
6679
  { type: KeyFactoryService },
6591
6680
  { type: KeyGraphService },
6592
6681
  { type: LockService },
6593
- { type: Auth2Service }
6682
+ { type: AuthService }
6594
6683
  ];
6595
- Item2Service = Item2Service_1 = __decorate([
6684
+ ItemService = ItemService_1 = __decorate([
6596
6685
  RunOutsideAngular({
6597
6686
  ngZoneName: 'ngZone',
6598
6687
  })
6599
- ], Item2Service);
6600
-
6601
- const KeyExchangeFragment = gqlTyped `
6602
- fragment KeyExchangeFragment on KeyExchangeNode {
6603
- id
6604
- token
6605
- state
6606
- mode
6607
- isInitiator
6608
- initiator {
6609
- id
6610
- username
6611
- config
6612
- }
6613
- responder {
6614
- id
6615
- username
6616
- }
6617
- created
6618
- modified
6619
- tokenExpiryTime
6620
- isExpired
6621
- initiatorRootKeyCipher
6622
- initiatorActionRequired
6623
- responderActionRequired
6624
- responderEmailAddress
6625
- otk {
6626
- state
6627
- otKeyParams
6628
- otKeyCipher
6629
- sharedKey {
6630
- id
6631
- }
6632
- mkSharedKey {
6633
- id
6634
- }
6635
- initiatorSigPxk {
6636
- id
6637
- }
6638
- responderSigPxk {
6639
- id
6640
- }
6641
- initiatorOneTimePbkCipher
6642
- responderPbkCipher
6643
- }
6644
- }
6645
- `;
6646
- const UserSharedKeyFragment = gqlTyped `
6647
- fragment UserSharedKeyFragment on UserSharedKeyNode {
6648
- userSigPrk {
6649
- id
6650
- }
6651
- otherSigPbk {
6652
- id
6653
- }
6654
- sharedKey {
6655
- id
6656
- }
6657
- mkSharedKey {
6658
- id
6659
- }
6660
- }`;
6661
- const KeyExchangesQuery2 = gqlTyped `
6662
- query KeyExchangesQuery2($state: String) {
6663
- keyExchanges(state: $state) {
6664
- edges {
6665
- node {
6666
- ...KeyExchangeFragment
6667
- }
6668
- }
6669
- }
6670
- }
6671
- ${KeyExchangeFragment}
6672
- `;
6673
- const KeyExchangeQuery2 = gqlTyped `
6674
- query KeyExchangeQuery2($id: LrRelayIdInput!) {
6675
- keyExchange(id: $id) {
6676
- ...KeyExchangeFragment
6677
- }
6678
- }
6679
- ${KeyExchangeFragment}
6680
- `;
6681
- const KeyExchangeTokenQuery2 = gqlTyped `
6682
- query KeyExchangeTokenQuery2($id: LrRelayIdInput!, $token: String) {
6683
- keyExchange(id: $id, token: $token) {
6684
- ...KeyExchangeFragment
6685
- }
6686
- }
6687
- ${KeyExchangeFragment}
6688
- `;
6689
- const CancelKeyExchangeMutation = gqlTyped `
6690
- mutation CancelKeyExchangeMutation($input: CancelKeyExchangeInput!) {
6691
- cancelKeyExchange(input: $input) {
6692
- keyExchange {
6693
- id
6694
- }
6695
- }
6696
- }
6697
- `;
6698
- const DeclineKeyExchangeMutation = gqlTyped `
6699
- mutation DeclineKeyExchangeMutation($input: DeclineKeyExchangeInput!) {
6700
- declineKeyExchange(input: $input) {
6701
- keyExchange {
6702
- id
6703
- }
6704
- }
6705
- }
6706
- `;
6707
- const InitiateKeyExchangeOtkMutation = gqlTyped `
6708
- mutation InitiateKeyExchangeOtkMutation(
6709
- $input: InitiateKeyExchangeOtkInput!
6710
- ) {
6711
- initiateKeyExchangeOtk(input: $input) {
6712
- keyExchange {
6713
- ...KeyExchangeFragment
6714
- }
6715
- }
6716
- }
6717
- ${KeyExchangeFragment}
6718
- `;
6719
- const RespondKeyExchangeOtkMutation = gqlTyped `
6720
- mutation RespondKeyExchangeOtkMutation($input: RespondKeyExchangeOtkInput!) {
6721
- respondKeyExchangeOtk(input: $input) {
6722
- keyExchange {
6723
- ...KeyExchangeFragment
6724
- }
6725
- userSharedKey {
6726
- ...UserSharedKeyFragment
6727
- }
6728
- tp {
6729
- id
6730
- }
6731
- }
6732
- }
6733
- ${KeyExchangeFragment}
6734
- ${UserSharedKeyFragment}
6735
- `;
6736
- const CompleteKeyExchangeOtkMutation = gqlTyped `
6737
- mutation CompleteKeyExchangeOtkMutation(
6738
- $input: CompleteKeyExchangeOtkInput!
6739
- ) {
6740
- completeKeyExchangeOtk(input: $input) {
6741
- keyExchange {
6742
- ...KeyExchangeFragment
6743
- }
6744
- userSharedKey {
6745
- ...UserSharedKeyFragment
6746
- }
6747
- tp {
6748
- id
6749
- }
6750
- }
6751
- }
6752
- ${KeyExchangeFragment}
6753
- ${UserSharedKeyFragment}
6754
- `;
6755
- const CurrentUserSharedKeyQuery2 = gqlTyped `
6756
- query CurrentUserSharedKeyQuery2(
6757
- $username: String
6758
- $userId: LrRelayIdInput
6759
- ) {
6760
- currentUserSharedKey(
6761
- username: $username
6762
- userId: $userId
6763
- ) {
6764
- userSharedKey {
6765
- ...UserSharedKeyFragment
6766
- }
6767
- }
6768
- }
6769
- ${UserSharedKeyFragment}
6770
- `;
6688
+ ], ItemService);
6771
6689
 
6772
- let KeyExchange2Service = class KeyExchange2Service extends LrService {
6690
+ let KeyExchangeService = class KeyExchangeService extends LrService {
6773
6691
  constructor(ngZone, injector, keyFactory, keyService, encryptionService, keyGraph) {
6774
6692
  super(injector);
6775
6693
  this.ngZone = ngZone;
@@ -7213,13 +7131,13 @@ let KeyExchange2Service = class KeyExchange2Service extends LrService {
7213
7131
  });
7214
7132
  }
7215
7133
  };
7216
- KeyExchange2Service.ɵprov = ɵɵdefineInjectable({ factory: function KeyExchange2Service_Factory() { return new KeyExchange2Service(ɵɵinject(NgZone), ɵɵinject(INJECTOR), ɵɵinject(KeyFactoryService), ɵɵinject(KeyService), ɵɵinject(EncryptionService), ɵɵinject(KeyGraphService)); }, token: KeyExchange2Service, providedIn: "root" });
7217
- KeyExchange2Service.decorators = [
7134
+ KeyExchangeService.ɵprov = ɵɵdefineInjectable({ factory: function KeyExchangeService_Factory() { return new KeyExchangeService(ɵɵinject(NgZone), ɵɵinject(INJECTOR), ɵɵinject(KeyFactoryService), ɵɵinject(KeyService), ɵɵinject(EncryptionService), ɵɵinject(KeyGraphService)); }, token: KeyExchangeService, providedIn: "root" });
7135
+ KeyExchangeService.decorators = [
7218
7136
  { type: Injectable, args: [{
7219
7137
  providedIn: 'root',
7220
7138
  },] }
7221
7139
  ];
7222
- KeyExchange2Service.ctorParameters = () => [
7140
+ KeyExchangeService.ctorParameters = () => [
7223
7141
  { type: NgZone },
7224
7142
  { type: Injector },
7225
7143
  { type: KeyFactoryService },
@@ -7227,11 +7145,11 @@ KeyExchange2Service.ctorParameters = () => [
7227
7145
  { type: EncryptionService },
7228
7146
  { type: KeyGraphService }
7229
7147
  ];
7230
- KeyExchange2Service = __decorate([
7148
+ KeyExchangeService = __decorate([
7231
7149
  RunOutsideAngular({
7232
7150
  ngZoneName: 'ngZone',
7233
7151
  })
7234
- ], KeyExchange2Service);
7152
+ ], KeyExchangeService);
7235
7153
 
7236
7154
  const ERROR_SOURCE = 'LBOP';
7237
7155
  var KcLbopErrorCode;
@@ -7284,16 +7202,14 @@ const LbopsQuery = gql `
7284
7202
  }
7285
7203
  `;
7286
7204
  class LbopService {
7287
- constructor(config, http, lrApollo, auth, auth2Service, keyFactory, keyService, encryptionService, keyGraph, passwordService) {
7205
+ constructor(config, http, lrApollo, auth, keyFactory, keyService, encryptionService, passwordService) {
7288
7206
  this.config = config;
7289
7207
  this.http = http;
7290
7208
  this.lrApollo = lrApollo;
7291
7209
  this.auth = auth;
7292
- this.auth2Service = auth2Service;
7293
7210
  this.keyFactory = keyFactory;
7294
7211
  this.keyService = keyService;
7295
7212
  this.encryptionService = encryptionService;
7296
- this.keyGraph = keyGraph;
7297
7213
  this.passwordService = passwordService;
7298
7214
  this.CLIENT_NONCE_LENGTH = 32;
7299
7215
  // There are 1024 words (10 bits), so 25 words should give ~256 bits of entropy.
@@ -7546,7 +7462,7 @@ class LbopService {
7546
7462
  });
7547
7463
  }
7548
7464
  }
7549
- LbopService.ɵprov = ɵɵdefineInjectable({ factory: function LbopService_Factory() { return new LbopService(ɵɵinject(KC_CONFIG), ɵɵinject(HttpClient), ɵɵinject(LrApolloService), ɵɵinject(AuthClass), ɵɵinject(Auth2Service), ɵɵinject(KeyFactoryService), ɵɵinject(KeyService), ɵɵinject(EncryptionService), ɵɵinject(KeyGraphService), ɵɵinject(PasswordService)); }, token: LbopService, providedIn: "root" });
7465
+ LbopService.ɵprov = ɵɵdefineInjectable({ factory: function LbopService_Factory() { return new LbopService(ɵɵinject(KC_CONFIG), ɵɵinject(HttpClient), ɵɵinject(LrApolloService), ɵɵinject(AuthClass), ɵɵinject(KeyFactoryService), ɵɵinject(KeyService), ɵɵinject(EncryptionService), ɵɵinject(PasswordService)); }, token: LbopService, providedIn: "root" });
7550
7466
  LbopService.decorators = [
7551
7467
  { type: Injectable, args: [{
7552
7468
  providedIn: 'root',
@@ -7557,11 +7473,9 @@ LbopService.ctorParameters = () => [
7557
7473
  { type: HttpClient },
7558
7474
  { type: LrApolloService },
7559
7475
  { type: AuthClass },
7560
- { type: Auth2Service },
7561
7476
  { type: KeyFactoryService },
7562
7477
  { type: KeyService },
7563
7478
  { type: EncryptionService },
7564
- { type: KeyGraphService },
7565
7479
  { type: PasswordService }
7566
7480
  ];
7567
7481
 
@@ -7842,7 +7756,7 @@ mutation ReactivatePlanMutation($input: ReactivatePlanInput!) {
7842
7756
  }
7843
7757
  `;
7844
7758
 
7845
- let Plan2Service = class Plan2Service extends LrService {
7759
+ let PlanService = class PlanService extends LrService {
7846
7760
  constructor(ngZone, injector) {
7847
7761
  super(injector);
7848
7762
  this.ngZone = ngZone;
@@ -8010,21 +7924,21 @@ let Plan2Service = class Plan2Service extends LrService {
8010
7924
  });
8011
7925
  }
8012
7926
  };
8013
- Plan2Service.ɵprov = ɵɵdefineInjectable({ factory: function Plan2Service_Factory() { return new Plan2Service(ɵɵinject(NgZone), ɵɵinject(INJECTOR)); }, token: Plan2Service, providedIn: "root" });
8014
- Plan2Service.decorators = [
7927
+ PlanService.ɵprov = ɵɵdefineInjectable({ factory: function PlanService_Factory() { return new PlanService(ɵɵinject(NgZone), ɵɵinject(INJECTOR)); }, token: PlanService, providedIn: "root" });
7928
+ PlanService.decorators = [
8015
7929
  { type: Injectable, args: [{
8016
7930
  providedIn: 'root',
8017
7931
  },] }
8018
7932
  ];
8019
- Plan2Service.ctorParameters = () => [
7933
+ PlanService.ctorParameters = () => [
8020
7934
  { type: NgZone },
8021
7935
  { type: Injector }
8022
7936
  ];
8023
- Plan2Service = __decorate([
7937
+ PlanService = __decorate([
8024
7938
  RunOutsideAngular({
8025
7939
  ngZoneName: 'ngZone',
8026
7940
  })
8027
- ], Plan2Service);
7941
+ ], PlanService);
8028
7942
 
8029
7943
  var ContactFields;
8030
7944
  (function (ContactFields) {
@@ -8431,6 +8345,9 @@ RegisterService.ctorParameters = () => [
8431
8345
  { type: PasswordService }
8432
8346
  ];
8433
8347
 
8348
+ class RegisterResult {
8349
+ }
8350
+
8434
8351
  const CreateReminderMutation = gqlTyped `
8435
8352
  mutation CreateReminderMutation($input: CreateReminderInput!) {
8436
8353
  createReminder(input: $input) {
@@ -8535,35 +8452,6 @@ ReminderService = __decorate([
8535
8452
  })
8536
8453
  ], ReminderService);
8537
8454
 
8538
- const SCENARIO_SLIP39_PASSPHRASE = 'lifeready';
8539
-
8540
- let ScenarioAssemblyController = class ScenarioAssemblyController extends TpAssemblyController {
8541
- constructor(ngZone, injector) {
8542
- super(injector);
8543
- this.ngZone = ngZone;
8544
- this.injector = injector;
8545
- this.slip39Passphrase = SCENARIO_SLIP39_PASSPHRASE;
8546
- }
8547
- getTpWrappingKeyId(tp) {
8548
- return tp.currentUserSharedKey.userSharedKey.sharedKey.id;
8549
- }
8550
- };
8551
- ScenarioAssemblyController.ɵprov = ɵɵdefineInjectable({ factory: function ScenarioAssemblyController_Factory() { return new ScenarioAssemblyController(ɵɵinject(NgZone), ɵɵinject(INJECTOR)); }, token: ScenarioAssemblyController, providedIn: "root" });
8552
- ScenarioAssemblyController.decorators = [
8553
- { type: Injectable, args: [{
8554
- providedIn: 'root',
8555
- },] }
8556
- ];
8557
- ScenarioAssemblyController.ctorParameters = () => [
8558
- { type: NgZone },
8559
- { type: Injector }
8560
- ];
8561
- ScenarioAssemblyController = __decorate([
8562
- RunOutsideAngular({
8563
- ngZoneName: 'ngZone',
8564
- })
8565
- ], ScenarioAssemblyController);
8566
-
8567
8455
  const CreateScenarioMutation = gqlTyped `
8568
8456
  mutation CreateScenarioMutation($input: CreateScenarioInput!) {
8569
8457
  createScenario(input: $input) {
@@ -8653,6 +8541,35 @@ mutation DebugExpireTpPasswordResetRequestMutation($input: DebugExpireTpPassword
8653
8541
  }
8654
8542
  `;
8655
8543
 
8544
+ const SCENARIO_SLIP39_PASSPHRASE = 'lifeready';
8545
+
8546
+ let ScenarioAssemblyController = class ScenarioAssemblyController extends TpAssemblyController {
8547
+ constructor(ngZone, injector) {
8548
+ super(injector);
8549
+ this.ngZone = ngZone;
8550
+ this.injector = injector;
8551
+ this.slip39Passphrase = SCENARIO_SLIP39_PASSPHRASE;
8552
+ }
8553
+ getTpWrappingKeyId(tp) {
8554
+ return tp.currentUserSharedKey.userSharedKey.sharedKey.id;
8555
+ }
8556
+ };
8557
+ ScenarioAssemblyController.ɵprov = ɵɵdefineInjectable({ factory: function ScenarioAssemblyController_Factory() { return new ScenarioAssemblyController(ɵɵinject(NgZone), ɵɵinject(INJECTOR)); }, token: ScenarioAssemblyController, providedIn: "root" });
8558
+ ScenarioAssemblyController.decorators = [
8559
+ { type: Injectable, args: [{
8560
+ providedIn: 'root',
8561
+ },] }
8562
+ ];
8563
+ ScenarioAssemblyController.ctorParameters = () => [
8564
+ { type: NgZone },
8565
+ { type: Injector }
8566
+ ];
8567
+ ScenarioAssemblyController = __decorate([
8568
+ RunOutsideAngular({
8569
+ ngZoneName: 'ngZone',
8570
+ })
8571
+ ], ScenarioAssemblyController);
8572
+
8656
8573
  const ScenarioQuery = gqlTyped `
8657
8574
  query ScenarioQuery(
8658
8575
  $scenarioId: LrRelayIdInput!
@@ -8857,12 +8774,12 @@ function throwClaimNotApproved() {
8857
8774
  throw new KcBadStateException('Scenario claim has not been approved');
8858
8775
  }
8859
8776
  let ScenarioService = class ScenarioService extends LrService {
8860
- constructor(ngZone, injector, keyGraph, item2Service, assemblyController, encryptionService) {
8777
+ constructor(ngZone, injector, keyGraph, itemService, assemblyController, encryptionService) {
8861
8778
  super(injector);
8862
8779
  this.ngZone = ngZone;
8863
8780
  this.injector = injector;
8864
8781
  this.keyGraph = keyGraph;
8865
- this.item2Service = item2Service;
8782
+ this.itemService = itemService;
8866
8783
  this.assemblyController = assemblyController;
8867
8784
  this.encryptionService = encryptionService;
8868
8785
  this.prepareAddReceiverDirectory = this.prepareReceiverDirectory;
@@ -9162,7 +9079,7 @@ let ScenarioService = class ScenarioService extends LrService {
9162
9079
  prepareReceiverDirectory(options, receiverSharedKey, assemblyKey) {
9163
9080
  return __awaiter(this, void 0, void 0, function* () {
9164
9081
  // TODO this should be batched
9165
- const directoryKey = yield this.item2Service.getDirectoryKey(options.directoryId, options.directoryKeyId);
9082
+ const directoryKey = yield this.itemService.getDirectoryKey(options.directoryId, options.directoryKeyId);
9166
9083
  const sharedCipherData = yield this.keyGraph.encryptToString(receiverSharedKey, options.sharedCipherDataClearJson || '');
9167
9084
  let wrappedItemKey = yield this.keyGraph.encryptToString(receiverSharedKey, directoryKey.jwk.toJSON(true));
9168
9085
  // TODO fetch assemblyKeyId. We are changing it such that there is always an assembly
@@ -9364,7 +9281,7 @@ let ScenarioService = class ScenarioService extends LrService {
9364
9281
  }
9365
9282
  };
9366
9283
  ScenarioService.SLIP39_PASSPHRASE = 'lifeready';
9367
- ScenarioService.ɵprov = ɵɵdefineInjectable({ factory: function ScenarioService_Factory() { return new ScenarioService(ɵɵinject(NgZone), ɵɵinject(INJECTOR), ɵɵinject(KeyGraphService), ɵɵinject(Item2Service), ɵɵinject(ScenarioAssemblyController), ɵɵinject(EncryptionService)); }, token: ScenarioService, providedIn: "root" });
9284
+ ScenarioService.ɵprov = ɵɵdefineInjectable({ factory: function ScenarioService_Factory() { return new ScenarioService(ɵɵinject(NgZone), ɵɵinject(INJECTOR), ɵɵinject(KeyGraphService), ɵɵinject(ItemService), ɵɵinject(ScenarioAssemblyController), ɵɵinject(EncryptionService)); }, token: ScenarioService, providedIn: "root" });
9368
9285
  ScenarioService.decorators = [
9369
9286
  { type: Injectable, args: [{
9370
9287
  providedIn: 'root',
@@ -9374,7 +9291,7 @@ ScenarioService.ctorParameters = () => [
9374
9291
  { type: NgZone },
9375
9292
  { type: Injector },
9376
9293
  { type: KeyGraphService },
9377
- { type: Item2Service },
9294
+ { type: ItemService },
9378
9295
  { type: ScenarioAssemblyController },
9379
9296
  { type: EncryptionService }
9380
9297
  ];
@@ -10178,13 +10095,13 @@ query TpCurrentUserSharedKeyQuery($id: LrRelayIdInput!) {
10178
10095
  }
10179
10096
  `;
10180
10097
 
10181
- let TrustedParty2Service = class TrustedParty2Service extends LrService {
10182
- constructor(ngZone, injector, keyGraph, item2Service, keyService, keyFactory, encryptionService) {
10098
+ let TrustedPartyService = class TrustedPartyService extends LrService {
10099
+ constructor(ngZone, injector, keyGraph, itemService, keyService, keyFactory, encryptionService) {
10183
10100
  super(injector);
10184
10101
  this.ngZone = ngZone;
10185
10102
  this.injector = injector;
10186
10103
  this.keyGraph = keyGraph;
10187
- this.item2Service = item2Service;
10104
+ this.itemService = itemService;
10188
10105
  this.keyService = keyService;
10189
10106
  this.keyFactory = keyFactory;
10190
10107
  this.encryptionService = encryptionService;
@@ -10225,8 +10142,8 @@ let TrustedParty2Service = class TrustedParty2Service extends LrService {
10225
10142
  shareItemMutation({ itemId, itemKeyId, tpId, tpSharedKeyId, accessRole, isDirectory, }) {
10226
10143
  return __awaiter(this, void 0, void 0, function* () {
10227
10144
  const itemKey = yield this.keyGraph.getKey(itemKeyId, () => isDirectory
10228
- ? this.item2Service.getDirectoryKeyId(itemId)
10229
- : this.item2Service.getFileKeyId(itemId));
10145
+ ? this.itemService.getDirectoryKeyId(itemId)
10146
+ : this.itemService.getFileKeyId(itemId));
10230
10147
  const wrappingKey = yield this.keyGraph.getKey(tpSharedKeyId, () => this.getTpCurrentUserSharedKey(tpId).then((res) => res.sharedKey.id));
10231
10148
  const wrappedKey = yield this.keyGraph.wrapKey(wrappingKey, itemKey.jwk);
10232
10149
  return new LrMutation({
@@ -10377,26 +10294,26 @@ let TrustedParty2Service = class TrustedParty2Service extends LrService {
10377
10294
  });
10378
10295
  }
10379
10296
  };
10380
- TrustedParty2Service.ɵprov = ɵɵdefineInjectable({ factory: function TrustedParty2Service_Factory() { return new TrustedParty2Service(ɵɵinject(NgZone), ɵɵinject(INJECTOR), ɵɵinject(KeyGraphService), ɵɵinject(Item2Service), ɵɵinject(KeyService), ɵɵinject(KeyFactoryService), ɵɵinject(EncryptionService)); }, token: TrustedParty2Service, providedIn: "root" });
10381
- TrustedParty2Service.decorators = [
10297
+ TrustedPartyService.ɵprov = ɵɵdefineInjectable({ factory: function TrustedPartyService_Factory() { return new TrustedPartyService(ɵɵinject(NgZone), ɵɵinject(INJECTOR), ɵɵinject(KeyGraphService), ɵɵinject(ItemService), ɵɵinject(KeyService), ɵɵinject(KeyFactoryService), ɵɵinject(EncryptionService)); }, token: TrustedPartyService, providedIn: "root" });
10298
+ TrustedPartyService.decorators = [
10382
10299
  { type: Injectable, args: [{
10383
10300
  providedIn: 'root',
10384
10301
  },] }
10385
10302
  ];
10386
- TrustedParty2Service.ctorParameters = () => [
10303
+ TrustedPartyService.ctorParameters = () => [
10387
10304
  { type: NgZone },
10388
10305
  { type: Injector },
10389
10306
  { type: KeyGraphService },
10390
- { type: Item2Service },
10307
+ { type: ItemService },
10391
10308
  { type: KeyService },
10392
10309
  { type: KeyFactoryService },
10393
10310
  { type: EncryptionService }
10394
10311
  ];
10395
- TrustedParty2Service = __decorate([
10312
+ TrustedPartyService = __decorate([
10396
10313
  RunOutsideAngular({
10397
10314
  ngZoneName: 'ngZone',
10398
10315
  })
10399
- ], TrustedParty2Service);
10316
+ ], TrustedPartyService);
10400
10317
 
10401
10318
  class TwoFactorService {
10402
10319
  constructor(auth) {
@@ -10556,5 +10473,5 @@ UserService.ctorParameters = () => [
10556
10473
  * Generated bundle index. Do not edit.
10557
10474
  */
10558
10475
 
10559
- export { AccessRoleChoice, AccessRoleMethodChoice, ApiContactCard, ApiCurrentUser, Auth2Service, auth2_types as AuthTypes, CancelUserDeleteMutation, ClaimApproverState, ClaimState, CommonProcessorsService, Config, ContactCard2Service, ContactCardAddress, ContactCardName, ContactCardsQuery, CreateContactCardMutation$1 as CreateContactCardMutation, CreateFileQuery, CreateLbopQuery, CurrentUserKey, CurrentUserQuery, DefaultProcessorOptions, DeleteLbopQuery, DirectoryQuery, ERROR_SOURCE, FeatureAction, Features, FetchKeyGraphField, FileOperationField, FileQuery, FileUploadService, IdleService, Item2Service, KC_CONFIG, KcAuthException, KcBadArgumentException, KcBadLogicException, KcBadRequestException, KcBadSignatureException, KcBadStateException, KcBadTimeSyncException, KcCodeMismatchException, KcConcurrentAccessException, KcEncryptionException, KcError, KcErrorCode, KcException, KcInternalErrorException, KcLbopErrorCode, KcLockedException, KcNotFoundException, KcSuspiciousOperationException, KcUnsupportedException, KeyExchange2Service, KeyExchangeFields, KeyExchangeMode, KeyExchangeOtkState, KeyExchangeState, KeyGraphField, KeyGraphFragment, LbopQuery, LbopService, LbopsQuery, LifeReadyModule, LinkTypeField, LockService, LockState, LoginHistoryQuery, LrApolloService, LrGraphQLService, LrMergedMutation, LrMutation, LrMutationBase, LrService, MainContactCardFields, MainContactCardPlainFields, MainContactCardProperty, MoveDirectoryQuery, MoveFileQuery, NotificationService, OwnerPlainDataJson, PassIdpApiResult, PasswordChangeStatus, PasswordCheck, PasswordService, PermissionChoice, PersistService, Plan2Service, PlanState, PlanStateField, ProfileDetailsService, ProfileService, QueryProcessorService, RegisterService, ReminderService, RequestUserDeleteMutation, RevertFileQuery, ScenarioLastClaimState, ScenarioService, ScenarioState, ServerConfigService, ServerTimeQuery, SharedContactCard2Service, SharedTrustedPartyDetails, SharedVaultFeature, TPFeatures, TimeService, TpAssemblyState, TpClaimApproverState, TpClaimState, TpPasswordResetRequestService, TpPasswordResetService, TpPasswordResetUserService, TrustedPartiesQuery, TrustedParty, TrustedParty2Service, TrustedPartyDetails, TrustedPartyProperties, TrustedPartyType, TwoFactorService, UpdateContactCardMutation$1 as UpdateContactCardMutation, UpdateFileQuery, UpdateLbopQuery, UserDeleteState, UserService, UserSharedKeyFields, WebCryptoService, awsFetch, configureAmplifyAuth, configureApollo, fragmentSpreadAstSelection, gqlTyped, handleApolloError, handleCognitoCallback, httpOptions, mapEdges, processConnection, throwClaimIdMismatch, throwClaimNotApproved, KeyGraphService as ɵa, EncryptionService as ɵb, KeyService as ɵc, KeyFactoryService as ɵd, LrService as ɵe, RunOutsideAngular as ɵf, LrGraphQLService as ɵg, KeyMetaService as ɵh, TpPasswordResetAssemblyController as ɵi, TpAssemblyController as ɵj, SharedContactCardFields as ɵk, SharedContactCardService as ɵl, ScenarioAssemblyController as ɵm, TpPasswordResetPrivateService as ɵn };
10476
+ export { AccessRoleChoice, AccessRoleMethodChoice, ApiContactCard, ApiCurrentUser, ApproveScenarioClaimMutation, ApproveTpPasswordResetRequestMutation, ArchiveDirectoryMutation, ArchiveFileMutation, AuthService, BeginDeleteChildItemLinksWindowMutation, CancelKeyExchangeMutation, CancelScenarioClaimMutation, CancelTpPasswordResetRequestMutation, CancelUserDeleteMutation, ChangeDirectoryParentsMutation, ChangeFileParentsMutation, ClaimApproverState, ClaimState, CognitoChallengeName, CommonProcessorsService, CompleteKeyExchangeOtkMutation, CompleteTpPasswordResetRequestMutation, Config, ContactCard2Service, ContactCardAddress, ContactCardName, ContactCardsQuery, CreateContactCardMutation$1 as CreateContactCardMutation, CreateDirectoryMutation, CreateFileMutation, CreateFileQuery, CreateLbopQuery, CreateScenarioClaimMutation, CreateScenarioMutation, CreateTpAssemblyKeyChallengeMutation, CreateTpPasswordResetMutation, CurrentUserKey, CurrentUserQuery, CurrentUserSharedKeyQuery2, DebugExpireScenarioClaimMutation, DebugExpireTpPasswordResetRequestMutation, DeclineKeyExchangeMutation, DefaultProcessorOptions, DeleteDirectoryMutation, DeleteFileMutation, DeleteLbopQuery, DeleteScenarioMutation, DeleteTpPasswordResetMutation, DirectoryQuery, ERROR_SOURCE, FeatureAction, Features, FetchKeyGraphField, FileOperationField, FileQuery, FileUploadService, GetOwnedContactCardKeyIdsQuery, GetReceivedContactCardKeyIdQuery, IdleService, InitiateKeyExchangeOtkMutation, ItemService, KC_CONFIG, KcAuthException, KcBadArgumentException, KcBadLogicException, KcBadRequestException, KcBadSignatureException, KcBadStateException, KcBadTimeSyncException, KcCodeMismatchException, KcConcurrentAccessException, KcEncryptionException, KcError, KcErrorCode, KcException, KcInternalErrorException, KcLbopErrorCode, KcLockedException, KcNotFoundException, KcSuspiciousOperationException, KcUnsupportedException, KeyExchangeFields, KeyExchangeMode, KeyExchangeOtkState, KeyExchangeQuery2, KeyExchangeService, KeyExchangeState, KeyExchangeTokenQuery2, KeyExchangesQuery2, KeyGraphField, KeyGraphFragment, LbopQuery, LbopService, LbopsQuery, LifeReadyModule, LinkTypeField, LockService, LockState, LoginHistoryQuery, LrApolloService, LrGraphQLService, LrMergedMutation, LrMutation, LrMutationBase, LrService, MainContactCardFields, MainContactCardPlainFields, MainContactCardProperty, MoveDirectoryQuery, MoveFileQuery, NotificationService, OwnerPlainDataJson, PasswordChangeStatus, PasswordCheck, PasswordService, PermissionChoice, PersistService, PlanService, PlanState, PlanStateField, PreCompleteTpPasswordResetRequestMutation, ProfileDetailsService, ProfileService, QueryProcessorService, ReceiveScenarioClaimMutation, RecoveryStatus, RegisterResult, RegisterService, RejectScenarioClaimMutation, RejectTpPasswordResetRequestMutation, ReminderService, RequestUserDeleteMutation, RespondKeyExchangeOtkMutation, RevertFileMutation, RevertFileQuery, ScenarioLastClaimState, ScenarioService, ScenarioState, ServerConfigService, ServerTimeQuery, SetDirectoryConfidentialMutation, SetFileConfidentialMutation, SharedContactCard2Service, SharedTrustedPartyDetails, SharedVaultFeature, TPFeatures, TempDirectoryQuery, TimeService, TpAssemblyState, TpClaimApproverState, TpClaimState, TpPasswordResetRequestService, TpPasswordResetService, TpPasswordResetUserService, TrustedPartiesQuery, TrustedParty, TrustedPartyDetails, TrustedPartyProperties, TrustedPartyService, TrustedPartyType, TwoFactorService, UnarchiveDirectoryMutation, UnarchiveFileMutation, UpdateContactCardMutation$1 as UpdateContactCardMutation, UpdateDirectoryMutation, UpdateFileMutation, UpdateFileQuery, UpdateLbopQuery, UpdateOwnedContactCardMutation, UpdateReceivedContactCardMutation, UpdateScenarioMutation, UpdateTpPasswordResetMutation, UserDeleteState, UserService, UserSharedKeyFields, WebCryptoService, awsFetch, configureAmplifyAuth, configureApollo, fragmentSpreadAstSelection, gqlTyped, handleApolloError, handleCognitoCallback, httpOptions, mapEdges, processConnection, throwClaimIdMismatch, throwClaimNotApproved, KeyGraphService as ɵa, EncryptionService as ɵb, KeyService as ɵc, KeyFactoryService as ɵd, LrService as ɵe, RunOutsideAngular as ɵf, LrGraphQLService as ɵg, KeyMetaService as ɵh, TpPasswordResetAssemblyController as ɵi, TpAssemblyController as ɵj, SharedContactCardFields as ɵk, SharedContactCardService as ɵl, ScenarioAssemblyController as ɵm, TpPasswordResetPrivateService as ɵn };
10560
10477
  //# sourceMappingURL=lifeready-core.js.map