@lifeready/core 1.1.20 → 1.1.21

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.
@@ -2915,6 +2915,13 @@ var LinkTypeField;
2915
2915
  LinkTypeField["HARD"] = "HARD";
2916
2916
  LinkTypeField["SOFT"] = "SOFT";
2917
2917
  })(LinkTypeField || (LinkTypeField = {}));
2918
+ var PlanStateField;
2919
+ (function (PlanStateField) {
2920
+ PlanStateField["TRIALLING"] = "TRIALLING";
2921
+ PlanStateField["ACTIVE"] = "ACTIVE";
2922
+ PlanStateField["CANCELLED"] = "CANCELLED";
2923
+ PlanStateField["EXPIRED"] = "EXPIRED";
2924
+ })(PlanStateField || (PlanStateField = {}));
2918
2925
 
2919
2926
  function handleCognitoCallback(method) {
2920
2927
  return new Promise((resolve, reject) => method((err, result) => (err ? reject(err) : resolve(result))));
@@ -9712,6 +9719,227 @@ class StripeCheckoutSession {
9712
9719
  class StripeBillingPortalSession {
9713
9720
  }
9714
9721
 
9722
+ const InitiateStripePaymentMethodCaptureMutation = gqlTyped `
9723
+ mutation InitiateStripePaymentMethodCaptureMutation {
9724
+ initiateStripePaymentMethodCapture(input: {}) {
9725
+ paymentCapture {
9726
+ stripeIntentId
9727
+ stripeClientSecret
9728
+ }
9729
+ }
9730
+ }
9731
+ `;
9732
+ const CompleteStripePaymentMethodCaptureMutation = gqlTyped `
9733
+ mutation CompleteStripePaymentMethodCaptureMutation($input: CompleteStripePaymentMethodCaptureInput!) {
9734
+ completeStripePaymentMethodCapture(input: $input) {
9735
+ paymentMethod {
9736
+ id
9737
+ created
9738
+ modified
9739
+ card {
9740
+ brand
9741
+ lastFourDigits
9742
+ expiryYear
9743
+ expiryMonth
9744
+ }
9745
+ isDefault
9746
+ }
9747
+ }
9748
+ }
9749
+ `;
9750
+ const RemovePaymentMethodMutation = gqlTyped `
9751
+ mutation RemovePaymentMethodMutation($input: RemovePaymentMethodInput!) {
9752
+ removePaymentMethod(input: $input) {
9753
+ id
9754
+ }
9755
+ }
9756
+ `;
9757
+ const SetDefaultPaymentMethodMutation = gqlTyped `
9758
+ mutation SetDefaultPaymentMethodMutation($input: SetDefaultPaymentMethodInput!) {
9759
+ setDefaultPaymentMethod(input: $input) {
9760
+ paymentMethod {
9761
+ id
9762
+ }
9763
+ }
9764
+ }
9765
+ `;
9766
+ const RemoveDefaultPaymentMethodMutation = gqlTyped `
9767
+ mutation RemoveDefaultPaymentMethodMutation {
9768
+ removeDefaultPaymentMethod(input: {}) {
9769
+ paymentMethod {
9770
+ id
9771
+ }
9772
+ }
9773
+ }
9774
+ `;
9775
+ const IssuePlanMutation = gqlTyped `
9776
+ mutation IssuePlanMutation($input: IssuePlanInput!) {
9777
+ issuePlan(input: $input) {
9778
+ plan {
9779
+ id
9780
+ }
9781
+ }
9782
+ }
9783
+ `;
9784
+ const CancelPlanMutation = gqlTyped `
9785
+ mutation CancelPlanMutation($input: CancelPlanInput!) {
9786
+ cancelPlan(input: $input) {
9787
+ plan {
9788
+ id
9789
+ }
9790
+ }
9791
+ }
9792
+ `;
9793
+
9794
+ let Plan2Service = class Plan2Service extends LrService {
9795
+ constructor(ngZone, injector) {
9796
+ super(injector);
9797
+ this.ngZone = ngZone;
9798
+ this.injector = injector;
9799
+ }
9800
+ initiateStripePaymentMethodCapture() {
9801
+ return this.mutate(this.initiateStripePaymentMethodCaptureMutation());
9802
+ }
9803
+ /**
9804
+ * Starts a stripe payment capture intent. On intent can only add one card.
9805
+ * @returns Promise that resolves to a mutation
9806
+ */
9807
+ initiateStripePaymentMethodCaptureMutation() {
9808
+ return new LrMutation({
9809
+ mutation: InitiateStripePaymentMethodCaptureMutation,
9810
+ variables: {
9811
+ input: {},
9812
+ },
9813
+ });
9814
+ }
9815
+ completeStripePaymentMethodCapture(stripeIntentId) {
9816
+ return this.mutate(this.completeStripePaymentMethodCaptureMutation(stripeIntentId));
9817
+ }
9818
+ /**
9819
+ * Completes the payment capture intent. Call this after calling stripe.confirmCardSetup.
9820
+ *
9821
+ * The return result of this mutation can be used to update the UI. Because this is a mutation
9822
+ * we always get the most up to date data from the BD.
9823
+ *
9824
+ * @returns Promise that resolves to a mutation with the just created PaymentMethodNode
9825
+ */
9826
+ completeStripePaymentMethodCaptureMutation(stripeIntentId) {
9827
+ return new LrMutation({
9828
+ mutation: CompleteStripePaymentMethodCaptureMutation,
9829
+ variables: {
9830
+ input: { stripeIntentId },
9831
+ },
9832
+ });
9833
+ }
9834
+ setDefaultPaymentMethod(paymentMethodId) {
9835
+ return this.mutate(this.setDefaultPaymentMethodMutation(paymentMethodId));
9836
+ }
9837
+ /**
9838
+ * Mutation that sets the default payment method for the current user.
9839
+ *
9840
+ * @param paymentMethodId The id from PaymentMethodNode
9841
+ * @returns Promise that resolves to a mutation
9842
+ */
9843
+ setDefaultPaymentMethodMutation(paymentMethodId) {
9844
+ return new LrMutation({
9845
+ mutation: SetDefaultPaymentMethodMutation,
9846
+ variables: {
9847
+ input: {
9848
+ paymentMethodId,
9849
+ },
9850
+ },
9851
+ });
9852
+ }
9853
+ removeDefaultPaymentMethod() {
9854
+ return this.mutate(this.removeDefaultPaymentMethodMutation());
9855
+ }
9856
+ /**
9857
+ * Mutation that removes a the default payment method
9858
+ *
9859
+ * @returns Promise that resolves to a mutation
9860
+ */
9861
+ removeDefaultPaymentMethodMutation() {
9862
+ return new LrMutation({
9863
+ mutation: RemoveDefaultPaymentMethodMutation,
9864
+ variables: {
9865
+ input: {},
9866
+ },
9867
+ });
9868
+ }
9869
+ issuePlan(options) {
9870
+ return this.mutate(this.issuePlanMutation(options));
9871
+ }
9872
+ /**
9873
+ * Mutation that issues a new plan for the current user.
9874
+ *
9875
+ * @param options.issuerUid The same issuerUid that is in the AvailablePlanField returned by queries such as availablePublicPlans
9876
+ * @param options.planUid The same planUid that is in the AvailablePlanField returned by queries such as availablePublicPlans
9877
+ * @param options.priceId The priceId from PriceOptionField, which is nested in side AvailablePlanField
9878
+ * @param options.promotionalCode promotion code where applicable
9879
+ * @returns Promise that resolves to a mutation
9880
+ */
9881
+ issuePlanMutation(options) {
9882
+ return new LrMutation({
9883
+ mutation: IssuePlanMutation,
9884
+ variables: {
9885
+ input: options,
9886
+ },
9887
+ });
9888
+ }
9889
+ removePaymentMethod(paymentMethodId) {
9890
+ return this.mutate(this.removePaymentMethodMutation(paymentMethodId));
9891
+ }
9892
+ /**
9893
+ * Mutation that removes a payment method for the current user
9894
+ *
9895
+ * @param paymentMethodId The id from PaymentMethodNode
9896
+ * @returns Promise that resolves to a mutation
9897
+ */
9898
+ removePaymentMethodMutation(paymentMethodId) {
9899
+ return new LrMutation({
9900
+ mutation: RemovePaymentMethodMutation,
9901
+ variables: {
9902
+ input: {
9903
+ paymentMethodId,
9904
+ },
9905
+ },
9906
+ });
9907
+ }
9908
+ cancelPlan(options) {
9909
+ return this.mutate(this.cancelPlanMutation(options));
9910
+ }
9911
+ /**
9912
+ * Mutation that removes a payment method for the current user
9913
+ *
9914
+ * @param options.planId The id from IssuedPlanNode
9915
+ * @param options.immediate If true, cancel plan effective immediately. Default false.
9916
+ * @returns Promise that resolves to a mutation
9917
+ */
9918
+ cancelPlanMutation(options) {
9919
+ return new LrMutation({
9920
+ mutation: CancelPlanMutation,
9921
+ variables: {
9922
+ input: options,
9923
+ },
9924
+ });
9925
+ }
9926
+ };
9927
+ Plan2Service.ɵprov = ɵɵdefineInjectable({ factory: function Plan2Service_Factory() { return new Plan2Service(ɵɵinject(NgZone), ɵɵinject(INJECTOR)); }, token: Plan2Service, providedIn: "root" });
9928
+ Plan2Service.decorators = [
9929
+ { type: Injectable, args: [{
9930
+ providedIn: 'root',
9931
+ },] }
9932
+ ];
9933
+ Plan2Service.ctorParameters = () => [
9934
+ { type: NgZone },
9935
+ { type: Injector }
9936
+ ];
9937
+ Plan2Service = __decorate([
9938
+ RunOutsideAngular({
9939
+ ngZoneName: 'ngZone',
9940
+ })
9941
+ ], Plan2Service);
9942
+
9715
9943
  const SharedContactCardFields = `
9716
9944
  id
9717
9945
  owner {
@@ -12782,5 +13010,5 @@ TwoFactorService.ctorParameters = () => [
12782
13010
  * Generated bundle index. Do not edit.
12783
13011
  */
12784
13012
 
12785
- export { AccessLevel, AccessRoleChoice, AccessRoleMethodChoice, ApiContactCard, ApiCurrentUser, ArchiveDirectoryMutation, 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, FeatureAction, Features, FetchKeyGraphField, FileOperationField, FileQuery, FileType, FileUploadService, GetCategoriesQuery, GetCategoryKeyIdQuery, GetCategoryQuery, GetMySharedCategoriesQuery, GetRecordQuery, GetRootDirectoryIdsQuery, GetTrustedPartyCategoriesQuery, GetVaultsQuery, IdleService, InitiateOtkMutation, Item2Service, KC_CONFIG, KeyExchange2Service, KeyExchangeFields, KeyExchangeMode, KeyExchangeOtkState, KeyExchangeQuery, KeyExchangeService, KeyExchangeState, KeyExchangeTokenQuery, KeyExchangesQuery, KeyGraphField, KeyGraphFragment, LbopQuery, LbopService, LbopsQuery, LifeReadyAuthService, LifeReadyModule, LinkTypeField, LoadedCategoryTree, LockService, LockState, LoginHistoryQuery, LoginResult, LrApiErrorCode, LrApolloService, LrAuthException, LrBadArgumentException, LrBadLogicException, LrBadRequestException, LrBadStateException, LrCodeMismatchException, LrConcurrentAccessException, LrEncryptionException, LrError, LrErrorCode, LrException, LrExpiredCodeException, LrExpiredException, LrGraphQLService, LrLockedException, LrMergedMutation, LrMutation, LrMutationBase, LrNotFoundException, LrRecord, LrService, LrSuspiciousException, LrUnsupportedException, MainContactCard, MainContactCardFields, MainContactCardPlainFields, MainContactCardProperty, MessageService, MoveDirectoryQuery, MoveFileQuery, NewAttachment, NewCategory, NewOrUpdatedAttachment, NewRecord, NotificationService, OtkState, OwnerPlainDataJson, PassIdpApiResult, PasswordChangeStatus, PasswordCheck, PasswordService, PermissionChoice, PersistService, Plan, PlanService, PlanState, ProfileDetailsService, ProfileService, QueryProcessorService, RecordAttachment, RecordAttachmentFilter, RecordAttachmentService, RecordContentFilter, RecordField, RecordFieldType, RecordFilter, RecordService, RecordType, RecordTypeField, RecordTypeFieldOption, RecordTypeService, RecordTypeSummary, RecoveryStatus, RegisterResult, 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, 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 };
13013
+ export { AccessLevel, AccessRoleChoice, AccessRoleMethodChoice, ApiContactCard, ApiCurrentUser, ArchiveDirectoryMutation, 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, FeatureAction, Features, FetchKeyGraphField, FileOperationField, FileQuery, FileType, FileUploadService, GetCategoriesQuery, GetCategoryKeyIdQuery, GetCategoryQuery, GetMySharedCategoriesQuery, GetRecordQuery, GetRootDirectoryIdsQuery, GetTrustedPartyCategoriesQuery, GetVaultsQuery, IdleService, InitiateOtkMutation, Item2Service, KC_CONFIG, KeyExchange2Service, KeyExchangeFields, KeyExchangeMode, KeyExchangeOtkState, KeyExchangeQuery, KeyExchangeService, KeyExchangeState, KeyExchangeTokenQuery, KeyExchangesQuery, KeyGraphField, KeyGraphFragment, LbopQuery, LbopService, LbopsQuery, LifeReadyAuthService, LifeReadyModule, LinkTypeField, LoadedCategoryTree, LockService, LockState, LoginHistoryQuery, LoginResult, LrApiErrorCode, LrApolloService, LrAuthException, LrBadArgumentException, LrBadLogicException, LrBadRequestException, LrBadStateException, LrCodeMismatchException, LrConcurrentAccessException, LrEncryptionException, LrError, LrErrorCode, LrException, LrExpiredCodeException, LrExpiredException, LrGraphQLService, LrLockedException, LrMergedMutation, LrMutation, LrMutationBase, LrNotFoundException, LrRecord, LrService, LrSuspiciousException, LrUnsupportedException, 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, RegisterResult, 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, 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 };
12786
13014
  //# sourceMappingURL=lifeready-core.js.map