@posiwise/user-module 0.0.176 → 0.0.178

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@posiwise/user-module",
3
- "version": "0.0.176",
3
+ "version": "0.0.178",
4
4
  "peerDependencies": {
5
5
  "@airwallex/components-sdk": "^1.35.2",
6
6
  "@angular/cdk": "^22.2.0",
@@ -1,44 +1,44 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, Injector, OnDestroy, OnInit, PipeTransform, Renderer2, TemplateRef } from "@angular/core";
3
- import * as i36 from "@angular/router";
3
+ import * as i37 from "@angular/router";
4
4
  import { Router } from "@angular/router";
5
5
  import { LazyLoadEvent, MenuItem } from "primeng/api";
6
- import * as i37 from "@angular/forms";
6
+ import * as i38 from "@angular/forms";
7
7
  import { NgControl, UntypedFormArray, UntypedFormBuilder, UntypedFormGroup } from "@angular/forms";
8
- import * as i40 from "@angular-magic/ngx-gp-autocomplete";
8
+ import * as i41 from "@angular-magic/ngx-gp-autocomplete";
9
9
  import { NgxGpAutocompleteDirective } from "@angular-magic/ngx-gp-autocomplete";
10
10
  import { AppBaseComponent } from "@posiwise/app-base-component";
11
11
  import { AuthService, CommonService, CustomToastService, GeoService, PermissionService, ProductService, ProfileService, QualificationService, ScriptLoaderService, SubscriptionService, TagService, UserService } from "@posiwise/common-services";
12
12
  import { Country, PRODUCT_CATEGORY, Product, Project, Subscription, TAG_ENTITY, TAG_TYPE, User } from "@posiwise/common-utilities";
13
- import * as i41 from "@posiwise/shared-components";
13
+ import * as i42 from "@posiwise/shared-components";
14
14
  import { ConfirmDialogService, PasswordValidationComponent } from "@posiwise/shared-components";
15
15
  import { Observable, Subscription as Subscription$1 } from "rxjs";
16
- import * as i54 from "@ng-bootstrap/ng-bootstrap";
16
+ import * as i55 from "@ng-bootstrap/ng-bootstrap";
17
17
  import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
18
18
  import { TranslocoService } from "@jsverse/transloco";
19
19
  import { AppState } from "@posiwise/app-store";
20
20
  import { Store } from "@ngrx/store";
21
21
  import { Clipboard } from "@angular/cdk/clipboard";
22
22
  import { AdminService } from "@posiwise/admin-module-utils";
23
- import * as i49 from "primeng/fileupload";
23
+ import * as i50 from "primeng/fileupload";
24
24
  import { FileUpload } from "primeng/fileupload";
25
- import * as i32 from "primeng/inputtext";
26
- import * as i33 from "@posiwise/app-loader";
27
- import * as i34 from "@posiwise/directives";
28
- import * as i35 from "@angular/common";
29
- import * as i38 from "@posiwise/core-guards";
30
- import * as i39 from "@posiwise/core-transloco";
31
- import * as i42 from "@posiwise/pipes";
32
- import * as i43 from "ngx-ui-switch";
33
- import * as i44 from "ngx-captcha";
34
- import * as i45 from "primeng/datepicker";
35
- import * as i46 from "primeng/multiselect";
36
- import * as i47 from "primeng/progressspinner";
37
- import * as i48 from "primeng/accordion";
38
- import * as i50 from "primeng/select";
39
- import * as i51 from "primeng/rating";
40
- import * as i52 from "primeng/selectbutton";
41
- import * as i53 from "primeng/tooltip";
25
+ import * as i33 from "primeng/inputtext";
26
+ import * as i34 from "@posiwise/app-loader";
27
+ import * as i35 from "@posiwise/directives";
28
+ import * as i36 from "@angular/common";
29
+ import * as i39 from "@posiwise/core-guards";
30
+ import * as i40 from "@posiwise/core-transloco";
31
+ import * as i43 from "@posiwise/pipes";
32
+ import * as i44 from "ngx-ui-switch";
33
+ import * as i45 from "ngx-captcha";
34
+ import * as i46 from "primeng/datepicker";
35
+ import * as i47 from "primeng/multiselect";
36
+ import * as i48 from "primeng/progressspinner";
37
+ import * as i49 from "primeng/accordion";
38
+ import * as i51 from "primeng/select";
39
+ import * as i52 from "primeng/rating";
40
+ import * as i53 from "primeng/selectbutton";
41
+ import * as i54 from "primeng/tooltip";
42
42
  declare namespace account_component_d_exports {
43
43
  export { AccountComponent };
44
44
  }
@@ -187,6 +187,11 @@ export declare class AddSubscriptionComponent extends AppBaseComponent implement
187
187
  constructor(productService: ProductService, injector: Injector, cdr: ChangeDetectorRef);
188
188
  ngOnInit(): void;
189
189
  private getProducts;
190
+ /**
191
+ * An add-on joins the subscription it is bought from, so it is offered — and counted as
192
+ * subscribed — by what this subscription holds, not the user's other subscriptions.
193
+ */
194
+ private addonPermissionKeys;
190
195
  private getSingleCategoryProducts;
191
196
  onChangeCategory(category: any): void;
192
197
  onSelection(product: any): void;
@@ -612,6 +617,8 @@ export declare class UpgradeSubscriptionComponent extends AppBaseComponent imple
612
617
  showNewCard: boolean;
613
618
  passwordModalVisible: boolean;
614
619
  errorMsg: any;
620
+ /** No Stripe plan and no price: nothing to charge, so no card is asked for. */
621
+ get isFree(): boolean;
615
622
  get totalAmount(): number;
616
623
  constructor(injector: Injector, productService: ProductService, fb: UntypedFormBuilder, modalService: NgbModal, subscriptionService: SubscriptionService, store: Store<AppState>, scriptLoader: ScriptLoaderService, cdr: ChangeDetectorRef, confirmDialog: ConfirmDialogService);
617
624
  ngOnInit(): void;
@@ -697,14 +704,52 @@ export declare class UserSubscriptionDetailsComponent extends AppBaseComponent i
697
704
  static ɵfac: i0.ɵɵFactoryDeclaration<UserSubscriptionDetailsComponent, never>;
698
705
  static ɵcmp: i0.ɵɵComponentDeclaration<UserSubscriptionDetailsComponent, "ng-component", never, {}, {}, never, never, false, never>;
699
706
  }
707
+ declare namespace subscription_removal_component_d_exports {
708
+ export { SubscriptionRemovalComponent, SubscriptionRemovalTarget };
709
+ }
710
+ /** No productId = delete the whole subscription. */
711
+ interface SubscriptionRemovalTarget {
712
+ subscriptionId: number;
713
+ productId?: number;
714
+ }
715
+ /** Password check → reason → delete one product, or the whole subscription. */
716
+ declare class SubscriptionRemovalComponent {
717
+ private readonly subscriptionService;
718
+ private readonly modalService;
719
+ private readonly store;
720
+ private readonly toast;
721
+ private readonly translation;
722
+ private readonly confirmDialog;
723
+ private readonly cdr;
724
+ user: User;
725
+ removed: EventEmitter<void>;
726
+ passwordValidation: PasswordValidationComponent;
727
+ reasonModal: TemplateRef<unknown>;
728
+ target: SubscriptionRemovalTarget;
729
+ reasonToCancel: string;
730
+ constructor(subscriptionService: SubscriptionService, modalService: NgbModal, store: Store<AppState>, toast: CustomToastService, translation: TranslocoService, confirmDialog: ConfirmDialogService, cdr: ChangeDetectorRef);
731
+ get isWholeSubscription(): boolean;
732
+ start(target: SubscriptionRemovalTarget): void;
733
+ onPasswordValidated(isSuccess: boolean): void;
734
+ onConfirm(): void;
735
+ reset(): void;
736
+ private request;
737
+ static ɵfac: i0.ɵɵFactoryDeclaration<SubscriptionRemovalComponent, never>;
738
+ static ɵcmp: i0.ɵɵComponentDeclaration<SubscriptionRemovalComponent, "pw-subscription-removal", never, {
739
+ "user": {
740
+ "alias": "user";
741
+ "required": false;
742
+ };
743
+ }, {
744
+ "removed": "removed";
745
+ }, never, never, false, never>;
746
+ }
700
747
  declare namespace user_subscriptions_list_component_d_exports {
701
748
  export { UserSubscriptionListComponent };
702
749
  }
703
750
  export declare class UserSubscriptionListComponent extends AppBaseComponent implements OnInit, OnDestroy {
704
751
  private readonly subscriptionService;
705
752
  private readonly adminService;
706
- private readonly modalService;
707
- private readonly store;
708
753
  private readonly clipboard;
709
754
  private readonly cdr;
710
755
  private readonly confirmDialog;
@@ -712,8 +757,7 @@ export declare class UserSubscriptionListComponent extends AppBaseComponent impl
712
757
  changeSubscriptionRef: AddSubscriptionComponent;
713
758
  passwordValidationModalForAccountDelete: PasswordValidationComponent;
714
759
  passwordValidationModalForKey: PasswordValidationComponent;
715
- passwordValidationForUnsubscribe: PasswordValidationComponent;
716
- cancelSubscriptionModal: TemplateRef<unknown>;
760
+ removal: SubscriptionRemovalComponent;
717
761
  showApiKey: boolean;
718
762
  password: string;
719
763
  productName: string;
@@ -728,7 +772,6 @@ export declare class UserSubscriptionListComponent extends AppBaseComponent impl
728
772
  };
729
773
  editing: boolean;
730
774
  isLoaded: boolean;
731
- reasonToCancel: string;
732
775
  currentItem: CurrentItem;
733
776
  showTos: boolean;
734
777
  objectKeys: {
@@ -737,19 +780,17 @@ export declare class UserSubscriptionListComponent extends AppBaseComponent impl
737
780
  };
738
781
  items: MenuItem[];
739
782
  productId: number;
740
- constructor(subscriptionService: SubscriptionService, adminService: AdminService, modalService: NgbModal, store: Store<AppState>, clipboard: Clipboard, injector: Injector, cdr: ChangeDetectorRef, confirmDialog: ConfirmDialogService);
783
+ constructor(subscriptionService: SubscriptionService, adminService: AdminService, clipboard: Clipboard, injector: Injector, cdr: ChangeDetectorRef, confirmDialog: ConfirmDialogService);
741
784
  ngOnInit(): void;
742
785
  onClipboardCopy(accessCode: string): void;
743
- attemptUnsubscribe(item: any, productId: number): void;
744
- openCancelSubscriptionModal(): void;
786
+ deleteSubscription(subscription: Subscription): void;
787
+ deleteProduct(subscription: Subscription, product: Product): void;
788
+ onRemoved(): void;
745
789
  private getSubscribedProduct;
746
790
  updateApiKey(subscription: any, product: any): void;
747
791
  showKey(item: any): void;
748
792
  displayApiKey(): void;
749
793
  activateMenu(): void;
750
- onUnsubscribe(item: any, reasonToCancel: string): void;
751
- onValidatePassword(isSuccess: boolean): void;
752
- onConfirmCancel(): void;
753
794
  discardEdit(): void;
754
795
  onSaveDetails(): void;
755
796
  onUpdatePaymentDetailsCancel(): void;
@@ -1404,6 +1445,6 @@ export declare class SupportDetailsComponent extends AppBaseComponent implements
1404
1445
  }
1405
1446
  export declare class UserModuleModule {
1406
1447
  static ɵfac: i0.ɵɵFactoryDeclaration<UserModuleModule, never>;
1407
- static ɵmod: i0.ɵɵNgModuleDeclaration<UserModuleModule, [typeof AccountComponent, typeof AccountDetailsComponent, typeof AddSubscriptionComponent, typeof SavedCardDetailsComponent, typeof SubscriptionCredentialComponent, typeof HumanizeCredentialNamePipe, typeof CredentialAvatarHuePipe, typeof SubscriptionNameByIdPipe, typeof ClearMaskedOnFocusDirective, typeof UpdatePaymentDetailsComponent, typeof SecondaryPaymentMethodComponent, typeof UpgradeSubscriptionComponent, typeof UserSubscriptionDetailsComponent, typeof UserSubscriptionListComponent, typeof UserInvoiceComponent, typeof AiKnowledgeTabComponent, typeof CommunicationTabComponent, typeof OthersTabComponent, typeof SecurityTabComponent, typeof SettingsComponent, typeof SupportComponent, typeof EditPortfoliosComponent, typeof EditProjectModalComponent, typeof EditQualificationsModalComponent, typeof EditRecommendationModalComponent, typeof EditSkillsModalComponent, typeof EditSocialLinksComponent, typeof EditUserProfileModalComponent, typeof UserAboutComponent, typeof PortfoliosComponent, typeof UserProfilePageComponent, typeof UserProjectsComponent, typeof SupportDetailsComponent], [typeof i32.InputTextModule, typeof i33.AppLoaderModule, typeof i34.DirectivesModule, typeof i35.CommonModule, typeof i36.RouterModule, typeof i37.ReactiveFormsModule, typeof i38.TrackDirtyFormDirective, typeof i39.CoreTranslocoModule, typeof i40.NgxGpAutocompleteModule, typeof i41.SharedComponentsModule, typeof i42.PipesModule, typeof i43.UiSwitchModule, typeof i44.NgxCaptchaModule, typeof i37.FormsModule, typeof i45.DatePickerModule, typeof i46.MultiSelectModule, typeof i47.ProgressSpinnerModule, typeof i48.AccordionModule, typeof i49.FileUploadModule, typeof i50.SelectModule, typeof i51.RatingModule, typeof i52.SelectButtonModule, typeof i53.TooltipModule, typeof i54.NgbModalModule, typeof i54.NgbDatepickerModule], [typeof AccountComponent, typeof AccountDetailsComponent, typeof AddSubscriptionComponent, typeof SavedCardDetailsComponent, typeof SubscriptionCredentialComponent, typeof HumanizeCredentialNamePipe, typeof CredentialAvatarHuePipe, typeof SubscriptionNameByIdPipe, typeof ClearMaskedOnFocusDirective, typeof UpdatePaymentDetailsComponent, typeof UpgradeSubscriptionComponent, typeof UserSubscriptionDetailsComponent, typeof UserSubscriptionListComponent, typeof UserInvoiceComponent, typeof AiKnowledgeTabComponent, typeof CommunicationTabComponent, typeof OthersTabComponent, typeof SecurityTabComponent, typeof SettingsComponent, typeof SupportComponent, typeof EditPortfoliosComponent, typeof EditProjectModalComponent, typeof EditQualificationsModalComponent, typeof EditRecommendationModalComponent, typeof EditSkillsModalComponent, typeof EditSocialLinksComponent, typeof EditUserProfileModalComponent, typeof UserAboutComponent, typeof PortfoliosComponent, typeof UserProfilePageComponent, typeof UserProjectsComponent, typeof SupportDetailsComponent]>;
1448
+ static ɵmod: i0.ɵɵNgModuleDeclaration<UserModuleModule, [typeof AccountComponent, typeof AccountDetailsComponent, typeof AddSubscriptionComponent, typeof SavedCardDetailsComponent, typeof SubscriptionCredentialComponent, typeof HumanizeCredentialNamePipe, typeof CredentialAvatarHuePipe, typeof SubscriptionNameByIdPipe, typeof ClearMaskedOnFocusDirective, typeof UpdatePaymentDetailsComponent, typeof SecondaryPaymentMethodComponent, typeof UpgradeSubscriptionComponent, typeof UserSubscriptionDetailsComponent, typeof UserSubscriptionListComponent, typeof SubscriptionRemovalComponent, typeof UserInvoiceComponent, typeof AiKnowledgeTabComponent, typeof CommunicationTabComponent, typeof OthersTabComponent, typeof SecurityTabComponent, typeof SettingsComponent, typeof SupportComponent, typeof EditPortfoliosComponent, typeof EditProjectModalComponent, typeof EditQualificationsModalComponent, typeof EditRecommendationModalComponent, typeof EditSkillsModalComponent, typeof EditSocialLinksComponent, typeof EditUserProfileModalComponent, typeof UserAboutComponent, typeof PortfoliosComponent, typeof UserProfilePageComponent, typeof UserProjectsComponent, typeof SupportDetailsComponent], [typeof i33.InputTextModule, typeof i34.AppLoaderModule, typeof i35.DirectivesModule, typeof i36.CommonModule, typeof i37.RouterModule, typeof i38.ReactiveFormsModule, typeof i39.TrackDirtyFormDirective, typeof i40.CoreTranslocoModule, typeof i41.NgxGpAutocompleteModule, typeof i42.SharedComponentsModule, typeof i43.PipesModule, typeof i44.UiSwitchModule, typeof i45.NgxCaptchaModule, typeof i38.FormsModule, typeof i46.DatePickerModule, typeof i47.MultiSelectModule, typeof i48.ProgressSpinnerModule, typeof i49.AccordionModule, typeof i50.FileUploadModule, typeof i51.SelectModule, typeof i52.RatingModule, typeof i53.SelectButtonModule, typeof i54.TooltipModule, typeof i55.NgbModalModule, typeof i55.NgbDatepickerModule], [typeof AccountComponent, typeof AccountDetailsComponent, typeof AddSubscriptionComponent, typeof SavedCardDetailsComponent, typeof SubscriptionCredentialComponent, typeof HumanizeCredentialNamePipe, typeof CredentialAvatarHuePipe, typeof SubscriptionNameByIdPipe, typeof ClearMaskedOnFocusDirective, typeof UpdatePaymentDetailsComponent, typeof UpgradeSubscriptionComponent, typeof UserSubscriptionDetailsComponent, typeof UserSubscriptionListComponent, typeof UserInvoiceComponent, typeof AiKnowledgeTabComponent, typeof CommunicationTabComponent, typeof OthersTabComponent, typeof SecurityTabComponent, typeof SettingsComponent, typeof SupportComponent, typeof EditPortfoliosComponent, typeof EditProjectModalComponent, typeof EditQualificationsModalComponent, typeof EditRecommendationModalComponent, typeof EditSkillsModalComponent, typeof EditSocialLinksComponent, typeof EditUserProfileModalComponent, typeof UserAboutComponent, typeof PortfoliosComponent, typeof UserProfilePageComponent, typeof UserProjectsComponent, typeof SupportDetailsComponent]>;
1408
1449
  static ɵinj: i0.ɵɵInjectorDeclaration<UserModuleModule>;
1409
1450
  }