@descope/angular-sdk 0.20.4 → 0.20.5

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 (21) hide show
  1. package/README.md +4 -1
  2. package/dist/esm2022/environment.mjs +2 -2
  3. package/dist/esm2022/lib/components/access-key-management/access-key-management.component.mjs +16 -3
  4. package/dist/esm2022/lib/components/applications-portal/applications-portal.component.mjs +15 -2
  5. package/dist/esm2022/lib/components/audit-management/audit-management.component.mjs +16 -3
  6. package/dist/esm2022/lib/components/descope/descope.component.mjs +4 -1
  7. package/dist/esm2022/lib/components/role-management/role-management.component.mjs +16 -3
  8. package/dist/esm2022/lib/components/user-management/user-management.component.mjs +16 -3
  9. package/dist/esm2022/lib/components/user-profile/user-profile.component.mjs +15 -2
  10. package/dist/esm2022/lib/types/types.mjs +1 -1
  11. package/dist/fesm2022/descope-angular-sdk.mjs +88 -7
  12. package/dist/fesm2022/descope-angular-sdk.mjs.map +1 -1
  13. package/dist/lib/components/access-key-management/access-key-management.component.d.ts +6 -3
  14. package/dist/lib/components/applications-portal/applications-portal.component.d.ts +6 -3
  15. package/dist/lib/components/audit-management/audit-management.component.d.ts +6 -3
  16. package/dist/lib/components/descope/descope.component.d.ts +2 -1
  17. package/dist/lib/components/role-management/role-management.component.d.ts +6 -3
  18. package/dist/lib/components/user-management/user-management.component.d.ts +6 -3
  19. package/dist/lib/components/user-profile/user-profile.component.d.ts +6 -3
  20. package/dist/lib/types/types.d.ts +2 -0
  21. package/package.json +11 -11
@@ -39,7 +39,7 @@ function observabilify(value) {
39
39
  }
40
40
 
41
41
  const environment = {
42
- buildVersion: '0.20.4'
42
+ buildVersion: '0.20.5'
43
43
  };
44
44
 
45
45
  const baseHeaders = {
@@ -295,6 +295,7 @@ class DescopeComponent {
295
295
  this.baseStaticUrl = descopeConfig.baseStaticUrl;
296
296
  this.baseCdnUrl = descopeConfig.baseCdnUrl;
297
297
  this.storeLastAuthenticatedUser = descopeConfig.storeLastAuthenticatedUser;
298
+ this.customStorage = descopeConfig.customStorage;
298
299
  }
299
300
  ngOnInit() {
300
301
  const sdk = this.authService.descopeSdk;
@@ -392,6 +393,7 @@ class DescopeComponent {
392
393
  [attr.nonce]="nonceString"
393
394
  [attr.dismiss-screen-error-on-input]="dismissScreenErrorOnInput"
394
395
  [attr.form]="formString"
396
+ [customStorage]="customStorage"
395
397
  >
396
398
  <ng-content></ng-content>
397
399
  </descope-wc>
@@ -426,6 +428,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
426
428
  [attr.nonce]="nonceString"
427
429
  [attr.dismiss-screen-error-on-input]="dismissScreenErrorOnInput"
428
430
  [attr.form]="formString"
431
+ [customStorage]="customStorage"
429
432
  >
430
433
  <ng-content></ng-content>
431
434
  </descope-wc>
@@ -637,6 +640,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
637
640
  class UserManagementComponent {
638
641
  constructor(elementRef, descopeConfig) {
639
642
  this.elementRef = elementRef;
643
+ this.ready = new EventEmitter();
640
644
  this.webComponent = new DescopeUserManagementWidget();
641
645
  this.projectId = descopeConfig.projectId;
642
646
  this.baseUrl = descopeConfig.baseUrl;
@@ -650,6 +654,9 @@ class UserManagementComponent {
650
654
  ngOnChanges() {
651
655
  this.setupWebComponent();
652
656
  }
657
+ ngAfterViewInit() {
658
+ this.setupEventListeners();
659
+ }
653
660
  setupWebComponent() {
654
661
  this.webComponent.setAttribute('project-id', this.projectId);
655
662
  this.webComponent.setAttribute('tenant', this.tenant);
@@ -676,8 +683,15 @@ class UserManagementComponent {
676
683
  this.webComponent.logger = this.logger;
677
684
  }
678
685
  }
686
+ setupEventListeners() {
687
+ if (this.ready) {
688
+ this.webComponent.addEventListener('ready', () => {
689
+ this.ready?.emit();
690
+ });
691
+ }
692
+ }
679
693
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: UserManagementComponent, deps: [{ token: i0.ElementRef }, { token: DescopeAuthConfig }], target: i0.ɵɵFactoryTarget.Component }); }
680
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: UserManagementComponent, isStandalone: true, selector: "user-management[tenant]", inputs: { tenant: "tenant", widgetId: "widgetId", theme: "theme", debug: "debug", logger: "logger", styleId: "styleId" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true }); }
694
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: UserManagementComponent, isStandalone: true, selector: "user-management[tenant]", inputs: { tenant: "tenant", widgetId: "widgetId", theme: "theme", debug: "debug", logger: "logger", styleId: "styleId" }, outputs: { ready: "ready" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true }); }
681
695
  }
682
696
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: UserManagementComponent, decorators: [{
683
697
  type: Component,
@@ -699,11 +713,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
699
713
  type: Input
700
714
  }], styleId: [{
701
715
  type: Input
716
+ }], ready: [{
717
+ type: Output
702
718
  }] } });
703
719
 
704
720
  class RoleManagementComponent {
705
721
  constructor(elementRef, descopeConfig) {
706
722
  this.elementRef = elementRef;
723
+ this.ready = new EventEmitter();
707
724
  this.webComponent = new DescopeRoleManagementWidget();
708
725
  this.projectId = descopeConfig.projectId;
709
726
  this.baseUrl = descopeConfig.baseUrl;
@@ -717,6 +734,9 @@ class RoleManagementComponent {
717
734
  ngOnChanges() {
718
735
  this.setupWebComponent();
719
736
  }
737
+ ngAfterViewInit() {
738
+ this.setupEventListeners();
739
+ }
720
740
  setupWebComponent() {
721
741
  this.webComponent.setAttribute('project-id', this.projectId);
722
742
  this.webComponent.setAttribute('tenant', this.tenant);
@@ -743,8 +763,15 @@ class RoleManagementComponent {
743
763
  this.webComponent.logger = this.logger;
744
764
  }
745
765
  }
766
+ setupEventListeners() {
767
+ if (this.ready) {
768
+ this.webComponent.addEventListener('ready', () => {
769
+ this.ready?.emit();
770
+ });
771
+ }
772
+ }
746
773
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: RoleManagementComponent, deps: [{ token: i0.ElementRef }, { token: DescopeAuthConfig }], target: i0.ɵɵFactoryTarget.Component }); }
747
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: RoleManagementComponent, isStandalone: true, selector: "role-management[tenant]", inputs: { tenant: "tenant", widgetId: "widgetId", theme: "theme", debug: "debug", logger: "logger", styleId: "styleId" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true }); }
774
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: RoleManagementComponent, isStandalone: true, selector: "role-management[tenant]", inputs: { tenant: "tenant", widgetId: "widgetId", theme: "theme", debug: "debug", logger: "logger", styleId: "styleId" }, outputs: { ready: "ready" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true }); }
748
775
  }
749
776
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: RoleManagementComponent, decorators: [{
750
777
  type: Component,
@@ -766,11 +793,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
766
793
  type: Input
767
794
  }], styleId: [{
768
795
  type: Input
796
+ }], ready: [{
797
+ type: Output
769
798
  }] } });
770
799
 
771
800
  class AccessKeyManagementComponent {
772
801
  constructor(elementRef, descopeConfig) {
773
802
  this.elementRef = elementRef;
803
+ this.ready = new EventEmitter();
774
804
  this.webComponent = new DescopeAccessKeyManagementWidget();
775
805
  this.projectId = descopeConfig.projectId;
776
806
  this.baseUrl = descopeConfig.baseUrl;
@@ -784,6 +814,9 @@ class AccessKeyManagementComponent {
784
814
  ngOnChanges() {
785
815
  this.setupWebComponent();
786
816
  }
817
+ ngAfterViewInit() {
818
+ this.setupEventListeners();
819
+ }
787
820
  setupWebComponent() {
788
821
  this.webComponent.setAttribute('project-id', this.projectId);
789
822
  this.webComponent.setAttribute('tenant', this.tenant);
@@ -807,8 +840,15 @@ class AccessKeyManagementComponent {
807
840
  this.webComponent.logger = this.logger;
808
841
  }
809
842
  }
843
+ setupEventListeners() {
844
+ if (this.ready) {
845
+ this.webComponent.addEventListener('ready', () => {
846
+ this.ready?.emit();
847
+ });
848
+ }
849
+ }
810
850
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AccessKeyManagementComponent, deps: [{ token: i0.ElementRef }, { token: DescopeAuthConfig }], target: i0.ɵɵFactoryTarget.Component }); }
811
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: AccessKeyManagementComponent, isStandalone: true, selector: "access-key-management[tenant]", inputs: { tenant: "tenant", widgetId: "widgetId", theme: "theme", debug: "debug", logger: "logger", styleId: "styleId" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true }); }
851
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: AccessKeyManagementComponent, isStandalone: true, selector: "access-key-management[tenant]", inputs: { tenant: "tenant", widgetId: "widgetId", theme: "theme", debug: "debug", logger: "logger", styleId: "styleId" }, outputs: { ready: "ready" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true }); }
812
852
  }
813
853
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AccessKeyManagementComponent, decorators: [{
814
854
  type: Component,
@@ -830,11 +870,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
830
870
  type: Input
831
871
  }], styleId: [{
832
872
  type: Input
873
+ }], ready: [{
874
+ type: Output
833
875
  }] } });
834
876
 
835
877
  class AuditManagementComponent {
836
878
  constructor(elementRef, descopeConfig) {
837
879
  this.elementRef = elementRef;
880
+ this.ready = new EventEmitter();
838
881
  this.webComponent = new DescopeAuditManagementWidget();
839
882
  this.projectId = descopeConfig.projectId;
840
883
  this.baseUrl = descopeConfig.baseUrl;
@@ -848,6 +891,9 @@ class AuditManagementComponent {
848
891
  ngOnChanges() {
849
892
  this.setupWebComponent();
850
893
  }
894
+ ngAfterViewInit() {
895
+ this.setupEventListeners();
896
+ }
851
897
  setupWebComponent() {
852
898
  this.webComponent.setAttribute('project-id', this.projectId);
853
899
  this.webComponent.setAttribute('tenant', this.tenant);
@@ -874,8 +920,15 @@ class AuditManagementComponent {
874
920
  this.webComponent.logger = this.logger;
875
921
  }
876
922
  }
923
+ setupEventListeners() {
924
+ if (this.ready) {
925
+ this.webComponent.addEventListener('ready', () => {
926
+ this.ready?.emit();
927
+ });
928
+ }
929
+ }
877
930
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AuditManagementComponent, deps: [{ token: i0.ElementRef }, { token: DescopeAuthConfig }], target: i0.ɵɵFactoryTarget.Component }); }
878
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: AuditManagementComponent, isStandalone: true, selector: "audit-management[tenant]", inputs: { tenant: "tenant", widgetId: "widgetId", theme: "theme", debug: "debug", logger: "logger", styleId: "styleId" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true }); }
931
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: AuditManagementComponent, isStandalone: true, selector: "audit-management[tenant]", inputs: { tenant: "tenant", widgetId: "widgetId", theme: "theme", debug: "debug", logger: "logger", styleId: "styleId" }, outputs: { ready: "ready" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true }); }
879
932
  }
880
933
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: AuditManagementComponent, decorators: [{
881
934
  type: Component,
@@ -897,6 +950,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
897
950
  type: Input
898
951
  }], styleId: [{
899
952
  type: Input
953
+ }], ready: [{
954
+ type: Output
900
955
  }] } });
901
956
 
902
957
  class UserProfileComponent {
@@ -904,6 +959,7 @@ class UserProfileComponent {
904
959
  this.elementRef = elementRef;
905
960
  this.descopeAuthService = descopeAuthService;
906
961
  this.logout = new EventEmitter();
962
+ this.ready = new EventEmitter();
907
963
  this.webComponent = new DescopeUserProfileWidget();
908
964
  this.projectId = descopeConfig.projectId;
909
965
  this.baseUrl = descopeConfig.baseUrl;
@@ -917,6 +973,9 @@ class UserProfileComponent {
917
973
  ngOnChanges() {
918
974
  this.setupWebComponent();
919
975
  }
976
+ ngAfterViewInit() {
977
+ this.setupEventListeners();
978
+ }
920
979
  setupWebComponent() {
921
980
  this.webComponent.setAttribute('project-id', this.projectId);
922
981
  this.webComponent.setAttribute('widget-id', this.widgetId);
@@ -941,15 +1000,22 @@ class UserProfileComponent {
941
1000
  if (this.logger) {
942
1001
  this.webComponent.logger = this.logger;
943
1002
  }
1003
+ }
1004
+ setupEventListeners() {
944
1005
  this.webComponent.addEventListener('logout', (e) => {
945
1006
  this.logout?.emit(e);
946
1007
  this.descopeAuthService.setSession('');
947
1008
  this.descopeAuthService.setIsAuthenticated(false);
948
1009
  this.descopeAuthService.setUser(null);
949
1010
  });
1011
+ if (this.ready) {
1012
+ this.webComponent.addEventListener('ready', () => {
1013
+ this.ready?.emit();
1014
+ });
1015
+ }
950
1016
  }
951
1017
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: UserProfileComponent, deps: [{ token: i0.ElementRef }, { token: DescopeAuthConfig }, { token: DescopeAuthService }], target: i0.ɵɵFactoryTarget.Component }); }
952
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: UserProfileComponent, isStandalone: true, selector: "user-profile", inputs: { widgetId: "widgetId", theme: "theme", debug: "debug", logger: "logger", styleId: "styleId" }, outputs: { logout: "logout" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true }); }
1018
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: UserProfileComponent, isStandalone: true, selector: "user-profile", inputs: { widgetId: "widgetId", theme: "theme", debug: "debug", logger: "logger", styleId: "styleId" }, outputs: { logout: "logout", ready: "ready" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true }); }
953
1019
  }
954
1020
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: UserProfileComponent, decorators: [{
955
1021
  type: Component,
@@ -970,12 +1036,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
970
1036
  type: Input
971
1037
  }], logout: [{
972
1038
  type: Output
1039
+ }], ready: [{
1040
+ type: Output
973
1041
  }] } });
974
1042
 
975
1043
  class ApplicationsPortalComponent {
976
1044
  constructor(elementRef, descopeConfig) {
977
1045
  this.elementRef = elementRef;
978
1046
  this.logout = new EventEmitter();
1047
+ this.ready = new EventEmitter();
979
1048
  this.webComponent = new DescopeApplicationsPortalWidget();
980
1049
  this.projectId = descopeConfig.projectId;
981
1050
  this.baseUrl = descopeConfig.baseUrl;
@@ -989,6 +1058,9 @@ class ApplicationsPortalComponent {
989
1058
  ngOnChanges() {
990
1059
  this.setupWebComponent();
991
1060
  }
1061
+ ngAfterViewInit() {
1062
+ this.setupEventListeners();
1063
+ }
992
1064
  setupWebComponent() {
993
1065
  this.webComponent.setAttribute('project-id', this.projectId);
994
1066
  this.webComponent.setAttribute('widget-id', this.widgetId);
@@ -1013,14 +1085,21 @@ class ApplicationsPortalComponent {
1013
1085
  if (this.styleId) {
1014
1086
  this.webComponent.setAttribute('style-id', this.styleId);
1015
1087
  }
1088
+ }
1089
+ setupEventListeners() {
1016
1090
  if (this.logout) {
1017
1091
  this.webComponent.addEventListener('logout', (e) => {
1018
1092
  this.logout?.emit(e);
1019
1093
  });
1020
1094
  }
1095
+ if (this.ready) {
1096
+ this.webComponent.addEventListener('ready', () => {
1097
+ this.ready?.emit();
1098
+ });
1099
+ }
1021
1100
  }
1022
1101
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ApplicationsPortalComponent, deps: [{ token: i0.ElementRef }, { token: DescopeAuthConfig }], target: i0.ɵɵFactoryTarget.Component }); }
1023
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: ApplicationsPortalComponent, isStandalone: true, selector: "applications-portal", inputs: { widgetId: "widgetId", theme: "theme", debug: "debug", logger: "logger", styleId: "styleId" }, outputs: { logout: "logout" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true }); }
1102
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.4", type: ApplicationsPortalComponent, isStandalone: true, selector: "applications-portal", inputs: { widgetId: "widgetId", theme: "theme", debug: "debug", logger: "logger", styleId: "styleId" }, outputs: { logout: "logout", ready: "ready" }, usesOnChanges: true, ngImport: i0, template: '', isInline: true }); }
1024
1103
  }
1025
1104
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImport: i0, type: ApplicationsPortalComponent, decorators: [{
1026
1105
  type: Component,
@@ -1041,6 +1120,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.4", ngImpor
1041
1120
  type: Input
1042
1121
  }], logout: [{
1043
1122
  type: Output
1123
+ }], ready: [{
1124
+ type: Output
1044
1125
  }] } });
1045
1126
 
1046
1127
  class DescopeAuthModule {