@posiwise/user-module 0.0.178 → 0.0.180

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.178",
3
+ "version": "0.0.180",
4
4
  "peerDependencies": {
5
5
  "@airwallex/components-sdk": "^1.35.2",
6
6
  "@angular/cdk": "^22.2.0",
@@ -1,16 +1,16 @@
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 i37 from "@angular/router";
3
+ import * as i38 from "@angular/router";
4
4
  import { Router } from "@angular/router";
5
5
  import { LazyLoadEvent, MenuItem } from "primeng/api";
6
- import * as i38 from "@angular/forms";
7
- import { NgControl, UntypedFormArray, UntypedFormBuilder, UntypedFormGroup } from "@angular/forms";
8
- import * as i41 from "@angular-magic/ngx-gp-autocomplete";
6
+ import * as i39 from "@angular/forms";
7
+ import { NgControl, UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators } from "@angular/forms";
8
+ import * as i42 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 i42 from "@posiwise/shared-components";
13
+ import * as i33 from "@posiwise/shared-components";
14
14
  import { ConfirmDialogService, PasswordValidationComponent } from "@posiwise/shared-components";
15
15
  import { Observable, Subscription as Subscription$1 } from "rxjs";
16
16
  import * as i55 from "@ng-bootstrap/ng-bootstrap";
@@ -22,12 +22,12 @@ import { Clipboard } from "@angular/cdk/clipboard";
22
22
  import { AdminService } from "@posiwise/admin-module-utils";
23
23
  import * as i50 from "primeng/fileupload";
24
24
  import { FileUpload } from "primeng/fileupload";
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";
25
+ import * as i34 from "primeng/inputtext";
26
+ import * as i35 from "@posiwise/app-loader";
27
+ import * as i36 from "@posiwise/directives";
28
+ import * as i37 from "@angular/common";
29
+ import * as i40 from "@posiwise/core-guards";
30
+ import * as i41 from "@posiwise/core-transloco";
31
31
  import * as i43 from "@posiwise/pipes";
32
32
  import * as i44 from "ngx-ui-switch";
33
33
  import * as i45 from "ngx-captcha";
@@ -253,7 +253,7 @@ interface CredentialData {
253
253
  }
254
254
  interface SubscriptionCredentialGroup {
255
255
  credential_name: string;
256
- credentials: Credential[];
256
+ credentials: CredentialData[];
257
257
  }
258
258
  interface CardDetails {
259
259
  card_number?: string;
@@ -385,58 +385,86 @@ interface CurrentItem {
385
385
  api_access_token?: string;
386
386
  masked?: string;
387
387
  }
388
+ interface CredentialFormValue {
389
+ credential_id: number;
390
+ value: string;
391
+ id?: number;
392
+ }
393
+ declare function uniqueByName(credentials: CredentialData[]): CredentialData[];
394
+ declare function groupByCredentialName(credentialTypes: CredentialData[], stored: CredentialData[]): SubscriptionCredentialGroup[];
395
+ declare function credentialFormRow(credentialType: CredentialData, stored?: CredentialData): {
396
+ subscription_id: (number | (typeof Validators.required)[])[];
397
+ credential_id: number[];
398
+ field: string[];
399
+ description: string[];
400
+ value: (string | (typeof Validators.required)[])[];
401
+ id: number[];
402
+ };
403
+ declare function changedCredentials(rows: CredentialFormValue[]): CredentialFormValue[];
404
+ /** After a partly failed save, gives rows that did save their new id so a retry edits them. */
405
+ declare function applyStoredIds(rows: UntypedFormArray, stored: CredentialData[]): void;
406
+ declare class SubscriptionCredentialActionsService {
407
+ private readonly confirmDialog;
408
+ private readonly subscriptionService;
409
+ private readonly humanize;
410
+ constructor(confirmDialog: ConfirmDialogService, subscriptionService: SubscriptionService);
411
+ /** The subscription's stored values and the credential types it can configure, fetched together. */
412
+ load(subscriptionId: number): Observable<{
413
+ stored: CredentialData[];
414
+ types: CredentialData[];
415
+ }>;
416
+ storedCredentials(subscriptionId: number): Observable<CredentialData[]>;
417
+ /**
418
+ * Emits the saved responses once every changed value is saved, or [] when nothing changed.
419
+ * Every request runs to completion before a failure is reported: forkJoin would otherwise
420
+ * cancel the rest client-side while the server still saves them, and a retry would then
421
+ * create those rows again.
422
+ */
423
+ saveChanged(rows: CredentialFormValue[], subscriptionId: number): Observable<unknown[]>;
424
+ /** Emits once every stored field of the integration is deleted; completes empty on cancel. */
425
+ confirmAndDelete(group: SubscriptionCredentialGroup, subscriptionId: number): Observable<void>;
426
+ private deleteAll;
427
+ static ɵfac: i0.ɵɵFactoryDeclaration<SubscriptionCredentialActionsService, never>;
428
+ static ɵprov: i0.ɵɵInjectableDeclaration<any>;
429
+ }
388
430
  declare namespace subscription_credential_component_d_exports {
389
431
  export { SubscriptionCredentialComponent };
390
432
  }
391
433
  export declare class SubscriptionCredentialComponent extends AppBaseComponent implements OnInit, OnDestroy {
392
434
  private readonly fb;
393
- private readonly subscriptionService;
435
+ private readonly credentialActions;
394
436
  private readonly cdr;
395
437
  private credentialToEdit;
396
- passwordValidationModalForRevealCredential: PasswordValidationComponent;
438
+ private credentialToDelete;
397
439
  passwordValidationModalForEditCredential: PasswordValidationComponent;
398
440
  passwordValidationModalForAddCredential: PasswordValidationComponent;
441
+ passwordValidationModalForDeleteCredential: PasswordValidationComponent;
399
442
  form: UntypedFormGroup;
400
- data: any[];
401
443
  subscriptionId: number;
402
- totalRecords: number;
403
444
  allSubscriptionCredentials: CredentialData[];
404
445
  availableCredentials: CredentialData[];
405
446
  credentialsSelect: CredentialData[];
406
- updatedCredential: CredentialData;
407
- uniqueCredential: any[];
447
+ uniqueCredential: CredentialData[];
448
+ credentials: SubscriptionCredentialGroup[];
408
449
  isEdit: boolean;
409
450
  submitted: boolean;
410
451
  buttonBusy: boolean;
411
452
  isLoaded: boolean;
412
- credentials: any[];
413
453
  showForm: boolean;
414
- credentialSaved: string;
415
- credentialName: string;
416
- credentialToReveal: any;
417
- constructor(fb: UntypedFormBuilder, subscriptionService: SubscriptionService, injector: Injector, cdr: ChangeDetectorRef);
454
+ constructor(fb: UntypedFormBuilder, credentialActions: SubscriptionCredentialActionsService, injector: Injector, cdr: ChangeDetectorRef);
418
455
  ngOnInit(): void;
419
456
  get credentialsGroup(): UntypedFormArray;
420
- /** Function to get all credentials */
421
457
  private getAllCredentials;
422
- /** Function to get available Credentials */
423
- private getAllAvailableCredentials;
424
- /** Function to get credential on select */
425
458
  selectedOption(event: any): void;
426
- /** Function to post credentials */
427
459
  saveCredentials(): void;
428
- revealCredentials(credential: any): void;
429
- hideCredentials(): void;
430
- showCredentials(): void;
431
- /** Function to get form controls */
432
- get f(): {
433
- [key: string]: import("@angular/forms").AbstractControl<any, any, any>;
434
- };
435
460
  onCancel(): void;
436
461
  openCredentialsForAdd(): void;
437
- openCredentialsForEdit(credential: any): void;
462
+ openCredentialsForEdit(credentialName: string): void;
463
+ openCredentialsForDelete(credential: SubscriptionCredentialGroup): void;
438
464
  editCredentials(): void;
465
+ deleteCredentials(): void;
439
466
  showEditForm(): void;
467
+ private notify;
440
468
  static ɵfac: i0.ɵɵFactoryDeclaration<SubscriptionCredentialComponent, never>;
441
469
  static ɵcmp: i0.ɵɵComponentDeclaration<SubscriptionCredentialComponent, "pw-subscription-credential", never, {}, {}, never, never, false, never>;
442
470
  }
@@ -1445,6 +1473,6 @@ export declare class SupportDetailsComponent extends AppBaseComponent implements
1445
1473
  }
1446
1474
  export declare class UserModuleModule {
1447
1475
  static ɵfac: i0.ɵɵFactoryDeclaration<UserModuleModule, never>;
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]>;
1476
+ 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.PwStickyActionsComponent, typeof i34.InputTextModule, typeof i35.AppLoaderModule, typeof i36.DirectivesModule, typeof i37.CommonModule, typeof i38.RouterModule, typeof i39.ReactiveFormsModule, typeof i40.TrackDirtyFormDirective, typeof i41.CoreTranslocoModule, typeof i42.NgxGpAutocompleteModule, typeof i33.SharedComponentsModule, typeof i43.PipesModule, typeof i44.UiSwitchModule, typeof i45.NgxCaptchaModule, typeof i39.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]>;
1449
1477
  static ɵinj: i0.ɵɵInjectorDeclaration<UserModuleModule>;
1450
1478
  }