@lifeready/core 5.0.11 → 5.0.13

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.
@@ -2168,6 +2168,11 @@ let QueryProcessorService = class QueryProcessorService {
2168
2168
  plainFieldName: 'config',
2169
2169
  }),
2170
2170
  ]));
2171
+ this.registerProcessor('ReminderNode', common.series([
2172
+ common.makeJsonParseProcessor({
2173
+ plainFieldName: 'plain',
2174
+ }),
2175
+ ]));
2171
2176
  }
2172
2177
  processQuery(fields, options) {
2173
2178
  return __awaiter(this, void 0, void 0, function* () {
@@ -2591,6 +2596,11 @@ class LrMergedMutation extends LrMutationBase {
2591
2596
  // Just wait for everything to resolve because we have to
2592
2597
  // merge the doc synchronously.
2593
2598
  this.lrMutations.forEach((lrMutation, idx) => {
2599
+ // Sometimes typing won't catch everything. So need to dynamically check the
2600
+ // type to be sure.
2601
+ if (!(lrMutation instanceof LrMutationBase)) {
2602
+ throw new KcBadLogicException('An mutation in the array is not of type LrMutationBase.');
2603
+ }
2594
2604
  const { mutation, variables } = lrMutation.lrMutationData;
2595
2605
  const childMutationNode = getMutation(mutation);
2596
2606
  // Prefixing all mutation fields so they don't conflict.
@@ -6684,6 +6694,13 @@ let Auth2Service = Auth2Service_1 = class Auth2Service extends LrService {
6684
6694
  debugClearUser() {
6685
6695
  this.user = null;
6686
6696
  }
6697
+ getCurrentUserAttibutes() {
6698
+ return __awaiter(this, void 0, void 0, function* () {
6699
+ const cognitoUser = yield this.cognito.currentAuthenticatedUser();
6700
+ const userAttributes = yield this.cognito.userAttributes(cognitoUser);
6701
+ return userAttributes;
6702
+ });
6703
+ }
6687
6704
  };
6688
6705
  Auth2Service.CHALLENGE_TIMEOUT = 1000 * 60 * 5;
6689
6706
  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" });
@@ -12020,6 +12037,110 @@ RegisterService.ctorParameters = () => [
12020
12037
  { type: PasswordService }
12021
12038
  ];
12022
12039
 
12040
+ const CreateReminderMutation = gqlTyped `
12041
+ mutation CreateReminderMutation($input: CreateReminderInput!) {
12042
+ createReminder(input: $input) {
12043
+ reminder {
12044
+ id
12045
+ }
12046
+ }
12047
+ }
12048
+ `;
12049
+ const UpdateReminderMutation = gqlTyped `
12050
+ mutation UpdateReminderMutation($input: UpdateReminderInput!) {
12051
+ updateReminder(input: $input) {
12052
+ reminder {
12053
+ id
12054
+ }
12055
+ }
12056
+ }
12057
+ `;
12058
+ const DeleteReminderMutation = gqlTyped `
12059
+ mutation DeleteReminderMutation($input: DeleteReminderInput!) {
12060
+ deleteReminder(input: $input) {
12061
+ id
12062
+ }
12063
+ }
12064
+ `;
12065
+
12066
+ let ReminderService = class ReminderService extends LrService {
12067
+ constructor(ngZone, injector) {
12068
+ super(injector);
12069
+ this.ngZone = ngZone;
12070
+ this.injector = injector;
12071
+ }
12072
+ createReminder(options) {
12073
+ return this.mutate(this.createReminderMutation(options));
12074
+ }
12075
+ createReminderMutation(options) {
12076
+ var _a, _b;
12077
+ return __awaiter(this, void 0, void 0, function* () {
12078
+ return new LrMutation({
12079
+ mutation: CreateReminderMutation,
12080
+ variables: {
12081
+ input: {
12082
+ directoryId: options.directoryId,
12083
+ firstEvent: options.firstEvent.toISOString(),
12084
+ plain: JSON.stringify((_a = options.plainJson) !== null && _a !== void 0 ? _a : {}),
12085
+ notifyAheadSeconds: (_b = options.notifyAheadSeconds) !== null && _b !== void 0 ? _b : 0,
12086
+ },
12087
+ },
12088
+ });
12089
+ });
12090
+ }
12091
+ updateReminder(options) {
12092
+ return this.mutate(this.updateReminderMutation(options));
12093
+ }
12094
+ updateReminderMutation(options) {
12095
+ var _a, _b;
12096
+ return __awaiter(this, void 0, void 0, function* () {
12097
+ return new LrMutation({
12098
+ mutation: UpdateReminderMutation,
12099
+ variables: {
12100
+ input: {
12101
+ id: options.id,
12102
+ firstEvent: (_a = options.firstEvent) === null || _a === void 0 ? void 0 : _a.toISOString(),
12103
+ // Ok to use undefined in side JSON.stringify: JSON.stringify(undefined) === undefined
12104
+ // Passing in undefined to plain means don't update the plain field.
12105
+ plain: JSON.stringify((_b = options.plainJson) !== null && _b !== void 0 ? _b : undefined),
12106
+ notifyAheadSeconds: options.notifyAheadSeconds,
12107
+ },
12108
+ },
12109
+ });
12110
+ });
12111
+ }
12112
+ deleteReminder(id) {
12113
+ return this.mutate(this.deleteReminderMutation(id));
12114
+ }
12115
+ deleteReminderMutation(id) {
12116
+ return __awaiter(this, void 0, void 0, function* () {
12117
+ return new LrMutation({
12118
+ mutation: DeleteReminderMutation,
12119
+ variables: {
12120
+ input: {
12121
+ id,
12122
+ },
12123
+ },
12124
+ });
12125
+ });
12126
+ }
12127
+ };
12128
+ ReminderService.ɵprov = ɵɵdefineInjectable({ factory: function ReminderService_Factory() { return new ReminderService(ɵɵinject(NgZone), ɵɵinject(INJECTOR)); }, token: ReminderService, providedIn: "root" });
12129
+ ReminderService.decorators = [
12130
+ { type: Injectable, args: [{
12131
+ providedIn: 'root',
12132
+ },] }
12133
+ ];
12134
+ ReminderService.ctorParameters = () => [
12135
+ { type: NgZone },
12136
+ { type: Injector }
12137
+ ];
12138
+ ReminderService = __decorate([
12139
+ RunOutsideAngular({
12140
+ ngZoneName: 'ngZone',
12141
+ })
12142
+ ], ReminderService);
12143
+
12023
12144
  const SCENARIO_SLIP39_PASSPHRASE = 'lifeready';
12024
12145
 
12025
12146
  let ScenarioAssemblyController = class ScenarioAssemblyController extends TpAssemblyController {
@@ -13798,5 +13919,5 @@ TwoFactorService.ctorParameters = () => [
13798
13919
  * Generated bundle index. Do not edit.
13799
13920
  */
13800
13921
 
13801
- export { AccessLevel, AccessRoleChoice, AccessRoleMethodChoice, ApiContactCard, ApiCurrentUser, ArchiveDirectoryMutation, Auth2Service, auth2_types as AuthTypes, CancelUserDeleteMutation, Category, CategoryFields, CategoryFilter, CategoryMetaService, CategoryService, ClaimApproverState, ClaimState, CognitoChallengeUser, CommonProcessorsService, CompleteOtkMutation, Config, ContactCard2Service, ContactCardAddress, ContactCardName, CreateCategoryMutation, CreateContactCardMutation$1 as CreateContactCardMutation, CreateFileMutation, CreateFileQuery, CreateLbopQuery, CreateRecordContainerMutation, CreateRecordMutation, CreateVaultMutation, CurrentCategory, CurrentUser, CurrentUserKey, CurrentUserQuery, CurrentUserSharedKeyQuery, DEFAULT_BREADCRUMB_DEPTH, DEFAULT_DESCENDANTS_DEPTH, DefaultCategory, DefaultProcessorOptions, DefaultVaultFilter, DeleteCategoryMutation, DeleteFileMutation, DeleteLbopQuery, DeleteRecordMutation, DirectoryQuery, DirectoryType, ERROR_SOURCE, FeatureAction, Features, FetchKeyGraphField, FileOperationField, FileQuery, FileType, FileUploadService, GetCategoriesQuery, GetCategoryKeyIdQuery, GetCategoryQuery, GetMySharedCategoriesQuery, GetRecordQuery, GetRootDirectoryIdsQuery, GetTrustedPartyCategoriesQuery, GetVaultsQuery, IdleService, InitiateOtkMutation, 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, KeyExchangeQuery, KeyExchangeService, KeyExchangeState, KeyExchangeTokenQuery, KeyExchangesQuery, KeyGraphField, KeyGraphFragment, LbopQuery, LbopService, LbopsQuery, LifeReadyAuthService, LifeReadyModule, LinkTypeField, LoadedCategoryTree, LockService, LockState, LoginHistoryQuery, LoginResult, LrApolloService, LrGraphQLService, LrMergedMutation, LrMutation, LrMutationBase, LrRecord, LrService, MainContactCard, MainContactCardFields, MainContactCardPlainFields, MainContactCardProperty, MessageService, MoveDirectoryQuery, MoveFileQuery, NewAttachment, NewCategory, NewOrUpdatedAttachment, NewRecord, NotificationService, OtkState, OwnerPlainDataJson, PassIdpApiResult, PasswordChangeStatus, PasswordCheck, PasswordService, PermissionChoice, PersistService, Plan, Plan2Service, PlanService, PlanState, PlanStateField, ProfileDetailsService, ProfileService, QueryProcessorService, RecordAttachment, RecordAttachmentFilter, RecordAttachmentService, RecordContentFilter, RecordField, RecordFieldType, RecordFilter, RecordService, RecordType, RecordTypeField, RecordTypeFieldOption, RecordTypeService, RecordTypeSummary, RecoveryStatus, RegisterService, RequestUserDeleteMutation, RespondOtkMutation, RevertFileQuery, ScenarioLastClaimState, ScenarioService, ScenarioState, ServerConfigService, ServerTimeQuery, SharedAccess, SharedContactCard2Service, StripeBillingPortalSession, StripeCheckoutSession, Subscription, TimeService, TpAssemblyState, TpClaimApproverState, TpClaimState, TpPasswordResetRequestService, TpPasswordResetService, TpPasswordResetUserService, TrustedParty2Service, TrustedPartyDetails, TwoFactorService, UnarchiveDirectoryMutation, UpdateCategoryMutation, UpdateContactCardMutation$1 as UpdateContactCardMutation, UpdateFileQuery, UpdateLbopQuery, UpdateRecordContainerMutation, UpdateRecordMutation, UpdatedCategory, UpdatedRecord, UserDeleteState, UserPlan, UserService, UserSharedKeyFields, Vault, VaultCategory, VaultFields, VaultRecord, VaultRecordType, WebCryptoService, awsFetch, configureAmplifyAuth, configureApollo, fragmentSpreadAstSelection, gqlTyped, handleApolloError, handleCognitoCallback, httpOptions, initialiseAuth, mapEdges, mapUserPlans, parentCategoriesField, processConnection, throwClaimIdMismatch, throwClaimNotApproved, ɵ0, KeyGraphService as ɵa, EncryptionService as ɵb, KeyService as ɵc, KeyFactoryService as ɵd, KeyMetaService as ɵe, LrGraphQLService as ɵf, TpPasswordResetProcessorService as ɵg, RunOutsideAngular as ɵh, TpPasswordResetAssemblyController as ɵi, TpAssemblyController as ɵj, LrService as ɵk, SharedContactCardService as ɵl, TrustedPartyService as ɵm, ScenarioAssemblyController as ɵn, TpPasswordResetPrivateService as ɵo };
13922
+ export { AccessLevel, AccessRoleChoice, AccessRoleMethodChoice, ApiContactCard, ApiCurrentUser, ArchiveDirectoryMutation, Auth2Service, auth2_types as AuthTypes, CancelUserDeleteMutation, Category, CategoryFields, CategoryFilter, CategoryMetaService, CategoryService, ClaimApproverState, ClaimState, CognitoChallengeUser, CommonProcessorsService, CompleteOtkMutation, Config, ContactCard2Service, ContactCardAddress, ContactCardName, CreateCategoryMutation, CreateContactCardMutation$1 as CreateContactCardMutation, CreateFileMutation, CreateFileQuery, CreateLbopQuery, CreateRecordContainerMutation, CreateRecordMutation, CreateVaultMutation, CurrentCategory, CurrentUser, CurrentUserKey, CurrentUserQuery, CurrentUserSharedKeyQuery, DEFAULT_BREADCRUMB_DEPTH, DEFAULT_DESCENDANTS_DEPTH, DefaultCategory, DefaultProcessorOptions, DefaultVaultFilter, DeleteCategoryMutation, DeleteFileMutation, DeleteLbopQuery, DeleteRecordMutation, DirectoryQuery, DirectoryType, ERROR_SOURCE, FeatureAction, Features, FetchKeyGraphField, FileOperationField, FileQuery, FileType, FileUploadService, GetCategoriesQuery, GetCategoryKeyIdQuery, GetCategoryQuery, GetMySharedCategoriesQuery, GetRecordQuery, GetRootDirectoryIdsQuery, GetTrustedPartyCategoriesQuery, GetVaultsQuery, IdleService, InitiateOtkMutation, 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, KeyExchangeQuery, KeyExchangeService, KeyExchangeState, KeyExchangeTokenQuery, KeyExchangesQuery, KeyGraphField, KeyGraphFragment, LbopQuery, LbopService, LbopsQuery, LifeReadyAuthService, LifeReadyModule, LinkTypeField, LoadedCategoryTree, LockService, LockState, LoginHistoryQuery, LoginResult, LrApolloService, LrGraphQLService, LrMergedMutation, LrMutation, LrMutationBase, LrRecord, LrService, MainContactCard, MainContactCardFields, MainContactCardPlainFields, MainContactCardProperty, MessageService, MoveDirectoryQuery, MoveFileQuery, NewAttachment, NewCategory, NewOrUpdatedAttachment, NewRecord, NotificationService, OtkState, OwnerPlainDataJson, PassIdpApiResult, PasswordChangeStatus, PasswordCheck, PasswordService, PermissionChoice, PersistService, Plan, Plan2Service, PlanService, PlanState, PlanStateField, ProfileDetailsService, ProfileService, QueryProcessorService, RecordAttachment, RecordAttachmentFilter, RecordAttachmentService, RecordContentFilter, RecordField, RecordFieldType, RecordFilter, RecordService, RecordType, RecordTypeField, RecordTypeFieldOption, RecordTypeService, RecordTypeSummary, RecoveryStatus, RegisterService, ReminderService, RequestUserDeleteMutation, RespondOtkMutation, RevertFileQuery, ScenarioLastClaimState, ScenarioService, ScenarioState, ServerConfigService, ServerTimeQuery, SharedAccess, SharedContactCard2Service, StripeBillingPortalSession, StripeCheckoutSession, Subscription, TimeService, TpAssemblyState, TpClaimApproverState, TpClaimState, TpPasswordResetRequestService, TpPasswordResetService, TpPasswordResetUserService, TrustedParty2Service, TrustedPartyDetails, TwoFactorService, UnarchiveDirectoryMutation, UpdateCategoryMutation, UpdateContactCardMutation$1 as UpdateContactCardMutation, UpdateFileQuery, UpdateLbopQuery, UpdateRecordContainerMutation, UpdateRecordMutation, UpdatedCategory, UpdatedRecord, UserDeleteState, UserPlan, UserService, UserSharedKeyFields, Vault, VaultCategory, VaultFields, VaultRecord, VaultRecordType, WebCryptoService, awsFetch, configureAmplifyAuth, configureApollo, fragmentSpreadAstSelection, gqlTyped, handleApolloError, handleCognitoCallback, httpOptions, initialiseAuth, mapEdges, mapUserPlans, parentCategoriesField, processConnection, throwClaimIdMismatch, throwClaimNotApproved, ɵ0, KeyGraphService as ɵa, EncryptionService as ɵb, KeyService as ɵc, KeyFactoryService as ɵd, KeyMetaService as ɵe, LrGraphQLService as ɵf, TpPasswordResetProcessorService as ɵg, RunOutsideAngular as ɵh, TpPasswordResetAssemblyController as ɵi, TpAssemblyController as ɵj, LrService as ɵk, SharedContactCardService as ɵl, TrustedPartyService as ɵm, ScenarioAssemblyController as ɵn, TpPasswordResetPrivateService as ɵo };
13802
13923
  //# sourceMappingURL=lifeready-core.js.map