@volo/abp.ng.openiddictpro 6.0.0-rc.1

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 (131) hide show
  1. package/README.md +7 -0
  2. package/config/enums/index.d.ts +2 -0
  3. package/config/enums/policy-names.d.ts +5 -0
  4. package/config/enums/route-names.d.ts +5 -0
  5. package/config/openiddictpro-config.module.d.ts +8 -0
  6. package/config/package.json +10 -0
  7. package/config/providers/index.d.ts +1 -0
  8. package/config/providers/route.provider.d.ts +8 -0
  9. package/config/public-api.d.ts +3 -0
  10. package/config/volo-abp.ng.openiddictpro-config.d.ts +5 -0
  11. package/esm2020/config/enums/index.mjs +3 -0
  12. package/esm2020/config/enums/policy-names.mjs +2 -0
  13. package/esm2020/config/enums/route-names.mjs +2 -0
  14. package/esm2020/config/openiddictpro-config.module.mjs +18 -0
  15. package/esm2020/config/providers/index.mjs +2 -0
  16. package/esm2020/config/providers/route.provider.mjs +39 -0
  17. package/esm2020/config/public-api.mjs +4 -0
  18. package/esm2020/config/volo-abp.ng.openiddictpro-config.mjs +5 -0
  19. package/esm2020/lib/components/application-form-modal/application-form-modal.component.mjs +87 -0
  20. package/esm2020/lib/components/applications/applications.component.mjs +85 -0
  21. package/esm2020/lib/components/index.mjs +6 -0
  22. package/esm2020/lib/components/scope-form-modal/scope-form-modal.component.mjs +66 -0
  23. package/esm2020/lib/components/scopes/allow-flow.mjs +4 -0
  24. package/esm2020/lib/components/scopes/scopes.component.mjs +74 -0
  25. package/esm2020/lib/defaults/default-applications-consent-type.mjs +19 -0
  26. package/esm2020/lib/defaults/default-applications-entity-actions.mjs +38 -0
  27. package/esm2020/lib/defaults/default-applications-entity-props.mjs +22 -0
  28. package/esm2020/lib/defaults/default-applications-form-props.mjs +181 -0
  29. package/esm2020/lib/defaults/default-applications-toolbar-actions.mjs +14 -0
  30. package/esm2020/lib/defaults/default-applications-types.mjs +15 -0
  31. package/esm2020/lib/defaults/default-scope-entity-actions.mjs +31 -0
  32. package/esm2020/lib/defaults/default-scope-entity-props.mjs +22 -0
  33. package/esm2020/lib/defaults/default-scope-form-props.mjs +31 -0
  34. package/esm2020/lib/defaults/default-scope-toolbar-actions.mjs +14 -0
  35. package/esm2020/lib/defaults/default-uri-pattern.mjs +2 -0
  36. package/esm2020/lib/defaults/index.mjs +12 -0
  37. package/esm2020/lib/enums/components.mjs +2 -0
  38. package/esm2020/lib/enums/index.mjs +2 -0
  39. package/esm2020/lib/guards/extensions.guard.mjs +38 -0
  40. package/esm2020/lib/guards/index.mjs +2 -0
  41. package/esm2020/lib/models/applications-service-state.mjs +2 -0
  42. package/esm2020/lib/models/config-options.mjs +2 -0
  43. package/esm2020/lib/models/index.mjs +4 -0
  44. package/esm2020/lib/models/scopes-service-state.mjs +2 -0
  45. package/esm2020/lib/openiddictpro-routing.module.mjs +53 -0
  46. package/esm2020/lib/openiddictpro.module.mjs +104 -0
  47. package/esm2020/lib/services/applications.service.mjs +14 -0
  48. package/esm2020/lib/services/index.mjs +3 -0
  49. package/esm2020/lib/services/scopes.service.mjs +14 -0
  50. package/esm2020/lib/tokens/extensions.token.mjs +35 -0
  51. package/esm2020/lib/tokens/index.mjs +2 -0
  52. package/esm2020/lib/utils/hashset-parser.mjs +15 -0
  53. package/esm2020/lib/utils/new-line-regex.mjs +2 -0
  54. package/esm2020/lib/utils/uris-validator.mjs +24 -0
  55. package/esm2020/proxy/lib/proxy/application.service.mjs +43 -0
  56. package/esm2020/proxy/lib/proxy/applications/dtos/index.mjs +2 -0
  57. package/esm2020/proxy/lib/proxy/applications/dtos/models.mjs +2 -0
  58. package/esm2020/proxy/lib/proxy/applications/index.mjs +3 -0
  59. package/esm2020/proxy/lib/proxy/index.mjs +6 -0
  60. package/esm2020/proxy/lib/proxy/scope.service.mjs +47 -0
  61. package/esm2020/proxy/lib/proxy/scopes/dtos/index.mjs +2 -0
  62. package/esm2020/proxy/lib/proxy/scopes/dtos/models.mjs +2 -0
  63. package/esm2020/proxy/lib/proxy/scopes/index.mjs +3 -0
  64. package/esm2020/proxy/public-api.mjs +2 -0
  65. package/esm2020/proxy/volo-abp.ng.openiddictpro-proxy.mjs +5 -0
  66. package/esm2020/public-api.mjs +6 -0
  67. package/esm2020/volo-abp.ng.openiddictpro.mjs +5 -0
  68. package/fesm2015/volo-abp.ng.openiddictpro-config.mjs +62 -0
  69. package/fesm2015/volo-abp.ng.openiddictpro-config.mjs.map +1 -0
  70. package/fesm2015/volo-abp.ng.openiddictpro-proxy.mjs +110 -0
  71. package/fesm2015/volo-abp.ng.openiddictpro-proxy.mjs.map +1 -0
  72. package/fesm2015/volo-abp.ng.openiddictpro.mjs +903 -0
  73. package/fesm2015/volo-abp.ng.openiddictpro.mjs.map +1 -0
  74. package/fesm2020/volo-abp.ng.openiddictpro-config.mjs +62 -0
  75. package/fesm2020/volo-abp.ng.openiddictpro-config.mjs.map +1 -0
  76. package/fesm2020/volo-abp.ng.openiddictpro-proxy.mjs +110 -0
  77. package/fesm2020/volo-abp.ng.openiddictpro-proxy.mjs.map +1 -0
  78. package/fesm2020/volo-abp.ng.openiddictpro.mjs +909 -0
  79. package/fesm2020/volo-abp.ng.openiddictpro.mjs.map +1 -0
  80. package/lib/components/application-form-modal/application-form-modal.component.d.ts +31 -0
  81. package/lib/components/applications/applications.component.d.ts +27 -0
  82. package/lib/components/index.d.ts +5 -0
  83. package/lib/components/scope-form-modal/scope-form-modal.component.d.ts +22 -0
  84. package/lib/components/scopes/allow-flow.d.ts +2 -0
  85. package/lib/components/scopes/scopes.component.d.ts +23 -0
  86. package/lib/defaults/default-applications-consent-type.d.ts +4 -0
  87. package/lib/defaults/default-applications-entity-actions.d.ts +3 -0
  88. package/lib/defaults/default-applications-entity-props.d.ts +3 -0
  89. package/lib/defaults/default-applications-form-props.d.ts +4 -0
  90. package/lib/defaults/default-applications-toolbar-actions.d.ts +3 -0
  91. package/lib/defaults/default-applications-types.d.ts +8 -0
  92. package/lib/defaults/default-scope-entity-actions.d.ts +3 -0
  93. package/lib/defaults/default-scope-entity-props.d.ts +3 -0
  94. package/lib/defaults/default-scope-form-props.d.ts +4 -0
  95. package/lib/defaults/default-scope-toolbar-actions.d.ts +3 -0
  96. package/lib/defaults/default-uri-pattern.d.ts +1 -0
  97. package/lib/defaults/index.d.ts +11 -0
  98. package/lib/enums/components.d.ts +4 -0
  99. package/lib/enums/index.d.ts +1 -0
  100. package/lib/guards/extensions.guard.d.ts +11 -0
  101. package/lib/guards/index.d.ts +1 -0
  102. package/lib/models/applications-service-state.d.ts +3 -0
  103. package/lib/models/config-options.d.ts +26 -0
  104. package/lib/models/index.d.ts +3 -0
  105. package/lib/models/scopes-service-state.d.ts +3 -0
  106. package/lib/openiddictpro-routing.module.d.ts +7 -0
  107. package/lib/openiddictpro.module.d.ts +22 -0
  108. package/lib/services/applications.service.d.ts +6 -0
  109. package/lib/services/index.d.ts +2 -0
  110. package/lib/services/scopes.service.d.ts +6 -0
  111. package/lib/tokens/extensions.token.d.ts +39 -0
  112. package/lib/tokens/index.d.ts +1 -0
  113. package/lib/utils/hashset-parser.d.ts +1 -0
  114. package/lib/utils/new-line-regex.d.ts +1 -0
  115. package/lib/utils/uris-validator.d.ts +2 -0
  116. package/package.json +51 -0
  117. package/proxy/lib/proxy/application.service.d.ts +16 -0
  118. package/proxy/lib/proxy/applications/dtos/index.d.ts +1 -0
  119. package/proxy/lib/proxy/applications/dtos/models.d.ts +48 -0
  120. package/proxy/lib/proxy/applications/index.d.ts +2 -0
  121. package/proxy/lib/proxy/index.d.ts +5 -0
  122. package/proxy/lib/proxy/scope.service.d.ts +17 -0
  123. package/proxy/lib/proxy/scopes/dtos/index.d.ts +1 -0
  124. package/proxy/lib/proxy/scopes/dtos/models.d.ts +20 -0
  125. package/proxy/lib/proxy/scopes/index.d.ts +2 -0
  126. package/proxy/package.json +10 -0
  127. package/proxy/public-api.d.ts +1 -0
  128. package/proxy/src/lib/proxy/README.md +17 -0
  129. package/proxy/volo-abp.ng.openiddictpro-proxy.d.ts +5 -0
  130. package/public-api.d.ts +5 -0
  131. package/volo-abp.ng.openiddictpro.d.ts +5 -0
@@ -0,0 +1,903 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, Component, Output, Input, InjectionToken, Injectable, NgModule } from '@angular/core';
3
+ import * as i4$1 from '@abp/ng.core';
4
+ import { InternalStore, ListService, ConfigStateService, RouterOutletComponent, AuthGuard, PermissionGuard, ReplaceableRouteContainerComponent, LazyModuleFactory, CoreModule } from '@abp/ng.core';
5
+ import * as i1$1 from '@angular/router';
6
+ import { RouterModule } from '@angular/router';
7
+ import * as i3 from '@abp/ng.theme.shared';
8
+ import { Confirmation, ThemeSharedModule } from '@abp/ng.theme.shared';
9
+ import * as i4 from '@abp/ng.theme.shared/extensions';
10
+ import { FormPropData, generateFormFromProps, EXTENSIONS_IDENTIFIER, EntityAction, EntityProp, ToolbarAction, FormProp, ExtensionsService, getObjectExtensionEntitiesFromStore, mapEntitiesToContributors, mergeWithDefaultActions, mergeWithDefaultProps } from '@abp/ng.theme.shared/extensions';
11
+ import * as i1 from '@volo/abp.ng.openiddictpro/proxy';
12
+ import { ScopeService } from '@volo/abp.ng.openiddictpro/proxy';
13
+ import * as i5$1 from '@abp/ng.components/page';
14
+ import { PageModule } from '@abp/ng.components/page';
15
+ import * as i6 from '@volo/abp.commercial.ng.ui';
16
+ import { SHOW_ENTITY_HISTORY, CommercialUiModule, AdvancedEntityFiltersModule } from '@volo/abp.commercial.ng.ui';
17
+ import { of } from 'rxjs';
18
+ import * as i5 from '@angular/forms';
19
+ import { Validators } from '@angular/forms';
20
+ import * as i7 from '@ngx-validate/core';
21
+ import { NgxValidateCoreModule } from '@ngx-validate/core';
22
+ import * as i8 from '@angular/common';
23
+ import * as i9 from '@abp/ng.permission-management';
24
+ import { PermissionManagementModule } from '@abp/ng.permission-management';
25
+ import { map, tap, mapTo } from 'rxjs/operators';
26
+ import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
27
+
28
+ class ApplicationsService {
29
+ constructor() {
30
+ this.state = new InternalStore({ isModalVisible: false });
31
+ this.isModalVisible$ = this.state.sliceState(x => x.isModalVisible);
32
+ }
33
+ openModal() {
34
+ this.setModalState(true);
35
+ }
36
+ setModalState(value) {
37
+ this.state.patch({ isModalVisible: value });
38
+ }
39
+ }
40
+
41
+ const defaultApplicationsTypeList = [
42
+ {
43
+ key: 'Confidential client',
44
+ value: 'confidential',
45
+ },
46
+ {
47
+ key: 'Public client',
48
+ value: 'public',
49
+ },
50
+ ];
51
+ const defaultApplicationTypes = {
52
+ public: 'public',
53
+ confidential: 'confidential',
54
+ };
55
+
56
+ const separatorRegex = /\r?\n/;
57
+ const separator = '\n';
58
+ function hashSetParser(stringOrArray) {
59
+ if (Array.isArray(stringOrArray)) {
60
+ return stringOrArray.join(separator);
61
+ }
62
+ if (typeof stringOrArray === 'string') {
63
+ if (!stringOrArray) {
64
+ return null;
65
+ }
66
+ return stringOrArray.split(separatorRegex);
67
+ }
68
+ return stringOrArray;
69
+ }
70
+
71
+ const DefaultApplicationsConsentType = [
72
+ {
73
+ key: 'Explicit consent',
74
+ value: 'explicit',
75
+ },
76
+ {
77
+ key: 'External consent',
78
+ value: 'external',
79
+ },
80
+ {
81
+ key: 'Implicit consent',
82
+ value: 'implicit',
83
+ },
84
+ {
85
+ key: 'Systematic consent',
86
+ value: 'systematic',
87
+ },
88
+ ];
89
+
90
+ class ApplicationFormModalComponent {
91
+ constructor(service, applicationsService, injector) {
92
+ this.service = service;
93
+ this.applicationsService = applicationsService;
94
+ this.injector = injector;
95
+ this.saved = new EventEmitter();
96
+ this.types$ = of(defaultApplicationsTypeList);
97
+ this.consentTypes$ = of(DefaultApplicationsConsentType);
98
+ }
99
+ ngOnChanges(changes) {
100
+ this.createForm();
101
+ }
102
+ get isModalVisible$() {
103
+ return this.applicationsService.isModalVisible$;
104
+ }
105
+ visibleChange($event) {
106
+ this.applicationsService.setModalState($event);
107
+ }
108
+ save() {
109
+ var _a;
110
+ if (this.form.invalid) {
111
+ return;
112
+ }
113
+ const id = (_a = this.selected) === null || _a === void 0 ? void 0 : _a.id;
114
+ const isEditMode = !!id;
115
+ let sub;
116
+ const parseTextAreaValue = value => {
117
+ return Array.isArray(value) ? value : hashSetParser(value);
118
+ };
119
+ const formValue = Object.assign(Object.assign({}, this.form.value), { redirectUris: parseTextAreaValue(this.form.value.redirectUris), postLogoutRedirectUris: parseTextAreaValue(this.form.value.postLogoutRedirectUris) });
120
+ if (isEditMode) {
121
+ sub = this.service.update(id, formValue);
122
+ }
123
+ else {
124
+ sub = this.service.create(formValue);
125
+ }
126
+ sub.subscribe(() => {
127
+ this.applicationsService.setModalState(false);
128
+ this.saved.emit();
129
+ });
130
+ }
131
+ getFormValue() {
132
+ var _a;
133
+ return ((_a = this.form) === null || _a === void 0 ? void 0 : _a.value) || {};
134
+ }
135
+ createForm() {
136
+ var _a;
137
+ const selected = ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id)
138
+ ? Object.assign(Object.assign({}, this.selected), { redirectUris: hashSetParser(this.selected.redirectUris), postLogoutRedirectUris: hashSetParser(this.selected.postLogoutRedirectUris) }) : {};
139
+ const data = new FormPropData(this.injector, selected);
140
+ this.form = generateFormFromProps(data);
141
+ }
142
+ }
143
+ ApplicationFormModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: ApplicationFormModalComponent, deps: [{ token: i1.ApplicationService }, { token: ApplicationsService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
144
+ ApplicationFormModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.6", type: ApplicationFormModalComponent, selector: "abp-application-form-modal", inputs: { selected: "selected" }, outputs: { saved: "saved" }, providers: [], usesOnChanges: true, ngImport: i0, template: "\r\n<abp-modal [visible]=\"isModalVisible$ | async\" (visibleChange)=\"visibleChange($event)\" >\r\n\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpOpenIddict::Edit' : 'AbpOpenIddict::NewApplication') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <form [formGroup]=\"form\" id=\"applicationForm\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpOpenIddict::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" buttonType=\"submit\" formName=\"applicationForm\">{{\r\n 'AbpOpenIddict::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n", components: [{ type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { type: i4.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4$1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i3.ModalCloseDirective, selector: "[abpClose]" }], pipes: { "async": i8.AsyncPipe, "abpLocalization": i4$1.LocalizationPipe } });
145
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: ApplicationFormModalComponent, decorators: [{
146
+ type: Component,
147
+ args: [{ selector: 'abp-application-form-modal', styles: [], providers: [], template: "\r\n<abp-modal [visible]=\"isModalVisible$ | async\" (visibleChange)=\"visibleChange($event)\" >\r\n\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpOpenIddict::Edit' : 'AbpOpenIddict::NewApplication') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <form [formGroup]=\"form\" id=\"applicationForm\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpOpenIddict::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" buttonType=\"submit\" formName=\"applicationForm\">{{\r\n 'AbpOpenIddict::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
148
+ }], ctorParameters: function () { return [{ type: i1.ApplicationService }, { type: ApplicationsService }, { type: i0.Injector }]; }, propDecorators: { saved: [{
149
+ type: Output
150
+ }], selected: [{
151
+ type: Input
152
+ }] } });
153
+
154
+ class ApplicationsComponent {
155
+ constructor(service, applicationsService, confirmationService, list) {
156
+ this.service = service;
157
+ this.applicationsService = applicationsService;
158
+ this.confirmationService = confirmationService;
159
+ this.list = list;
160
+ this.data = { items: [], totalCount: 0 };
161
+ this.selected = {};
162
+ this.visiblePermissions = false;
163
+ this.onVisiblePermissionChange = (value) => {
164
+ this.visiblePermissions = value;
165
+ };
166
+ }
167
+ onSaved() {
168
+ this.list.get();
169
+ }
170
+ edit(id) {
171
+ this.service.get(id).subscribe(res => {
172
+ this.selected = res;
173
+ this.applicationsService.openModal();
174
+ });
175
+ }
176
+ delete(id, name) {
177
+ this.confirmationService
178
+ .warn('AbpOpenIddict::ApplicationDeletionWarningMessage', 'AbpOpenIddict::AreYouSure', {
179
+ messageLocalizationParams: [name],
180
+ })
181
+ .subscribe((status) => {
182
+ if (status === Confirmation.Status.confirm) {
183
+ this.service.delete(id).subscribe(() => this.list.get());
184
+ }
185
+ });
186
+ }
187
+ ngOnInit() {
188
+ this.hookToQuery();
189
+ }
190
+ onAdd() {
191
+ this.selected = {};
192
+ this.applicationsService.openModal();
193
+ }
194
+ openPermissionsModal(providerKey) {
195
+ this.providerKey = providerKey;
196
+ setTimeout(() => {
197
+ this.visiblePermissions = true;
198
+ }, 0);
199
+ }
200
+ hookToQuery() {
201
+ this.list.hookToQuery(query => this.service.getList(query)).subscribe(res => (this.data = res));
202
+ }
203
+ }
204
+ ApplicationsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: ApplicationsComponent, deps: [{ token: i1.ApplicationService }, { token: ApplicationsService }, { token: i3.ConfirmationService }, { token: i4$1.ListService }], target: i0.ɵɵFactoryTarget.Component });
205
+ ApplicationsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.6", type: ApplicationsComponent, selector: "abp-applications", providers: [
206
+ ListService,
207
+ {
208
+ provide: EXTENSIONS_IDENTIFIER,
209
+ useValue: "OpenIddictPro.Applications" /* Applications */,
210
+ },
211
+ ], ngImport: i0, template: "\r\n<abp-page [title]=\"'AbpOpenIddict::Applications' | abpLocalization\" [toolbar]=\"data.items\">\r\n <div id=\"wrapper\">\r\n\r\n <abp-advanced-entity-filters\r\n localizationSourceName=\"AbpOpenIddict\"\r\n [list]=\"list\"\r\n ></abp-advanced-entity-filters>\r\n\r\n\r\n <div class=\"card\">\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n</abp-page>\r\n<abp-application-form-modal [selected]=\"selected\" (saved)=\"onSaved()\">\r\n</abp-application-form-modal>\r\n\r\n<abp-permission-management\r\n *abpReplaceableTemplate=\"{\r\n inputs: {\r\n providerName: { value: 'C' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: 'PermissionManagement.PermissionManagementComponent'\r\n }\"\r\n [(visible)]=\"visiblePermissions\"\r\n providerName=\"C\"\r\n [providerKey]=\"providerKey\"\r\n>\r\n</abp-permission-management>\r\n", components: [{ type: i5$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { type: i6.AdvancedEntityFiltersComponent, selector: "abp-advanced-entity-filters", inputs: ["list", "localizationSourceName", "entityFilterPlaceholder"] }, { type: i4.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], exportAs: ["abpExtensibleTable"] }, { type: ApplicationFormModalComponent, selector: "abp-application-form-modal", inputs: ["selected"], outputs: ["saved"] }, { type: i9.PermissionManagementComponent, selector: "abp-permission-management", inputs: ["providerName", "providerKey", "hideBadges", "entityDisplayName", "visible"], outputs: ["visibleChange"], exportAs: ["abpPermissionManagement"] }], directives: [{ type: i4$1.ReplaceableTemplateDirective, selector: "[abpReplaceableTemplate]", inputs: ["abpReplaceableTemplate"] }], pipes: { "abpLocalization": i4$1.LocalizationPipe } });
212
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: ApplicationsComponent, decorators: [{
213
+ type: Component,
214
+ args: [{ selector: 'abp-applications', providers: [
215
+ ListService,
216
+ {
217
+ provide: EXTENSIONS_IDENTIFIER,
218
+ useValue: "OpenIddictPro.Applications" /* Applications */,
219
+ },
220
+ ], template: "\r\n<abp-page [title]=\"'AbpOpenIddict::Applications' | abpLocalization\" [toolbar]=\"data.items\">\r\n <div id=\"wrapper\">\r\n\r\n <abp-advanced-entity-filters\r\n localizationSourceName=\"AbpOpenIddict\"\r\n [list]=\"list\"\r\n ></abp-advanced-entity-filters>\r\n\r\n\r\n <div class=\"card\">\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n</abp-page>\r\n<abp-application-form-modal [selected]=\"selected\" (saved)=\"onSaved()\">\r\n</abp-application-form-modal>\r\n\r\n<abp-permission-management\r\n *abpReplaceableTemplate=\"{\r\n inputs: {\r\n providerName: { value: 'C' },\r\n providerKey: { value: providerKey },\r\n visible: { value: visiblePermissions, twoWay: true }\r\n },\r\n outputs: { visibleChange: onVisiblePermissionChange },\r\n componentKey: 'PermissionManagement.PermissionManagementComponent'\r\n }\"\r\n [(visible)]=\"visiblePermissions\"\r\n providerName=\"C\"\r\n [providerKey]=\"providerKey\"\r\n>\r\n</abp-permission-management>\r\n" }]
221
+ }], ctorParameters: function () { return [{ type: i1.ApplicationService }, { type: ApplicationsService }, { type: i3.ConfirmationService }, { type: i4$1.ListService }]; } });
222
+
223
+ const DEFAULT_APPLICATIONS_ENTITY_ACTIONS = EntityAction.createMany([
224
+ {
225
+ text: 'AbpOpenIddict::Edit',
226
+ action: data => {
227
+ const component = data.getInjected(ApplicationsComponent);
228
+ component.edit(data.record.id);
229
+ },
230
+ permission: 'OpenIddictPro.Application.Update',
231
+ },
232
+ {
233
+ text: 'AbpOpenIddict::ChangeHistory',
234
+ action: data => {
235
+ const showHistory = data.getInjected(SHOW_ENTITY_HISTORY);
236
+ showHistory(data.record.id, 'Volo.Abp.OpenIddict.Applications.OpenIddictApplication');
237
+ },
238
+ permission: 'AuditLogging.ViewChangeHistory:Volo.Abp.OpenIddict.Pro.Applications.Application',
239
+ },
240
+ {
241
+ text: 'AbpOpenIddict::Permissions',
242
+ action: data => {
243
+ const component = data.getInjected(ApplicationsComponent);
244
+ component.openPermissionsModal(data.record.clientId);
245
+ },
246
+ permission: 'OpenIddictPro.Application.ManagePermissions',
247
+ },
248
+ {
249
+ text: 'LanguageManagement::Delete',
250
+ action: data => {
251
+ const component = data.getInjected(ApplicationsComponent);
252
+ component.delete(data.record.id, data.record.clientId);
253
+ },
254
+ permission: 'LanguageManagement.Languages.Delete',
255
+ },
256
+ ]);
257
+
258
+ const DEFAULT_APPLICATIONS_ENTITY_PROPS = EntityProp.createMany([
259
+ {
260
+ type: "string" /* String */,
261
+ name: 'clientId',
262
+ displayName: 'AbpOpenIddict::ClientId',
263
+ columnWidth: 200,
264
+ },
265
+ {
266
+ type: "string" /* String */,
267
+ name: 'displayName',
268
+ displayName: 'AbpOpenIddict::DisplayName',
269
+ columnWidth: 200,
270
+ },
271
+ {
272
+ type: "string" /* String */,
273
+ name: 'type',
274
+ displayName: 'AbpOpenIddict::Type',
275
+ columnWidth: 200,
276
+ },
277
+ ]);
278
+
279
+ const DEFAULT_APPLICATIONS_TOOLBAR_ACTIONS = ToolbarAction.createMany([
280
+ {
281
+ text: 'AbpOpenIddict::NewApplication',
282
+ action: data => {
283
+ const component = data.getInjected(ApplicationsComponent);
284
+ component.onAdd();
285
+ },
286
+ permission: 'OpenIddictPro.Application.Create',
287
+ icon: 'fa fa-plus',
288
+ },
289
+ ]);
290
+
291
+ const allowFlow = ({ allowImplicitFlow, allowAuthorizationCodeFlow, allowHybridFlow, }) => {
292
+ return allowAuthorizationCodeFlow || allowImplicitFlow || allowHybridFlow;
293
+ };
294
+
295
+ const defaultUriPattern = /^([a-z][a-z0-9+.-]*):(?:\/\/((?:(?=((?:[a-z0-9-._~!$&'()*+,;=:]|%[0-9A-F]{2})*))(\3)@)?(?=(\[[0-9A-F:.]{2,}\]|(?:[a-z0-9-._~!$&'()*+,;=]|%[0-9A-F]{2})*))\5(?::(?=(\d*))\6)?)(\/(?=((?:[a-z0-9-._~!$&'()*+,;=:@\/]|%[0-9A-F]{2})*))\8)?|(\/?(?!\/)(?=((?:[a-z0-9-._~!$&'()*+,;=:@\/]|%[0-9A-F]{2})*))\10)?)(?:\?(?=((?:[a-z0-9-._~!$&'()*+,;=:@\/?]|%[0-9A-F]{2})*))\11)?(?:#(?=((?:[a-z0-9-._~!$&'()*+,;=:@\/?]|%[0-9A-F]{2})*))\12)?$/i;
296
+
297
+ const NewLineRegex = /(\r\n|\r|\n)/;
298
+
299
+ function UrisValidator() {
300
+ const pattern = defaultUriPattern;
301
+ return (control) => {
302
+ if (isEmptyInputValue(control.value)) {
303
+ return null;
304
+ }
305
+ const value = control.value;
306
+ const rows = value.split(NewLineRegex).filter(item => !!item.trim());
307
+ if (rows.length === 0) {
308
+ return null;
309
+ }
310
+ const isAllRowsValid = rows.every(item => pattern.test(item));
311
+ if (isAllRowsValid) {
312
+ return null;
313
+ }
314
+ return { url: pattern.toString(), actualValue: value };
315
+ };
316
+ }
317
+ function isEmptyInputValue(value) {
318
+ return (value == null || ((typeof value === 'string' || Array.isArray(value)) && value.length === 0));
319
+ }
320
+
321
+ const DEFAULT_APPLICATIONS_CREATE_FORM_PROPS = FormProp.createMany([
322
+ {
323
+ type: "string" /* String */,
324
+ name: 'clientId',
325
+ displayName: 'AbpOpenIddict::ClientId',
326
+ id: 'clientId',
327
+ validators: () => [Validators.required],
328
+ },
329
+ {
330
+ type: "string" /* String */,
331
+ name: 'displayName',
332
+ displayName: 'AbpOpenIddict::DisplayName',
333
+ id: 'displayName',
334
+ validators: () => [Validators.required],
335
+ },
336
+ {
337
+ type: "string" /* String */,
338
+ name: 'type',
339
+ displayName: 'AbpOpenIddict::Type',
340
+ id: 'type',
341
+ validators: () => [Validators.required],
342
+ options: data => data.getInjected(ApplicationFormModalComponent).types$,
343
+ },
344
+ {
345
+ type: "string" /* String */,
346
+ name: 'clientSecret',
347
+ displayName: 'AbpOpenIddict::ClientSecret',
348
+ id: 'clientSecret',
349
+ visible: data => {
350
+ const formValue = data.getInjected(ApplicationFormModalComponent).getFormValue();
351
+ return formValue.type === defaultApplicationTypes.confidential;
352
+ },
353
+ },
354
+ {
355
+ type: "string" /* String */,
356
+ name: 'clientUri',
357
+ displayName: 'AbpOpenIddict::ClientUri',
358
+ id: 'clientUri',
359
+ validators: () => [UrisValidator()],
360
+ },
361
+ {
362
+ type: "string" /* String */,
363
+ name: 'logoUri',
364
+ displayName: 'AbpOpenIddict::LogoUri',
365
+ id: 'logoUri',
366
+ },
367
+ {
368
+ type: "boolean" /* Boolean */,
369
+ defaultValue: false,
370
+ name: 'allowAuthorizationCodeFlow',
371
+ displayName: 'AbpOpenIddict::AllowAuthorizationCodeFlow',
372
+ id: 'allowAuthorizationCodeFlow',
373
+ },
374
+ {
375
+ type: "boolean" /* Boolean */,
376
+ defaultValue: false,
377
+ name: 'allowImplicitFlow',
378
+ displayName: 'AbpOpenIddict::AllowImplicitFlow',
379
+ id: 'allowImplicitFlow',
380
+ },
381
+ {
382
+ type: "boolean" /* Boolean */,
383
+ defaultValue: false,
384
+ name: 'allowHybridFlow',
385
+ displayName: 'AbpOpenIddict::AllowHybridFlow',
386
+ id: 'allowHybridFlow',
387
+ },
388
+ {
389
+ type: "boolean" /* Boolean */,
390
+ defaultValue: false,
391
+ name: 'allowPasswordFlow',
392
+ displayName: 'AbpOpenIddict::AllowPasswordFlow',
393
+ id: 'allowPasswordFlow',
394
+ },
395
+ {
396
+ type: "boolean" /* Boolean */,
397
+ defaultValue: false,
398
+ name: 'allowClientCredentialsFlow',
399
+ displayName: 'AbpOpenIddict::AllowClientCredentialsFlow',
400
+ id: 'allowClientCredentialsFlow',
401
+ },
402
+ {
403
+ type: "boolean" /* Boolean */,
404
+ defaultValue: false,
405
+ name: 'allowRefreshTokenFlow',
406
+ displayName: 'AbpOpenIddict::AllowRefreshTokenFlow',
407
+ disabled: data => {
408
+ const { allowHybridFlow, allowAuthorizationCodeFlow, allowPasswordFlow } = data
409
+ .getInjected(ApplicationFormModalComponent)
410
+ .getFormValue();
411
+ return !(allowHybridFlow || allowAuthorizationCodeFlow || allowPasswordFlow);
412
+ },
413
+ id: 'allowRefreshTokenFlow',
414
+ },
415
+ {
416
+ type: "boolean" /* Boolean */,
417
+ defaultValue: false,
418
+ name: 'allowDeviceEndpoint',
419
+ displayName: 'AbpOpenIddict::AllowDeviceEndpoint',
420
+ id: 'allowDeviceEndpoint',
421
+ },
422
+ {
423
+ type: "string" /* String */,
424
+ name: 'consentType',
425
+ displayName: 'AbpOpenIddict::ConsentType',
426
+ id: 'consentType',
427
+ options: data => data.getInjected(ApplicationFormModalComponent).consentTypes$,
428
+ visible: data => {
429
+ const formValue = data.getInjected(ApplicationFormModalComponent).getFormValue();
430
+ return allowFlow(formValue);
431
+ },
432
+ },
433
+ {
434
+ type: "multiselect" /* MultiSelect */,
435
+ name: 'scopes',
436
+ displayName: 'AbpOpenIddict::Scopes',
437
+ id: 'scopes',
438
+ options: data => {
439
+ return data
440
+ .getInjected(ScopeService)
441
+ .getAllScopes()
442
+ .pipe(map(result => result.map(scope => ({
443
+ key: scope.displayName,
444
+ value: scope.name,
445
+ }))));
446
+ },
447
+ },
448
+ {
449
+ type: "text" /* Text */,
450
+ name: 'redirectUris',
451
+ displayName: 'AbpOpenIddict::RedirectUris',
452
+ id: 'redirectUris',
453
+ validators: () => [UrisValidator()],
454
+ visible: data => {
455
+ const formValue = data.getInjected(ApplicationFormModalComponent).getFormValue();
456
+ return allowFlow(formValue);
457
+ },
458
+ },
459
+ {
460
+ type: "boolean" /* Boolean */,
461
+ defaultValue: false,
462
+ name: 'allowLogoutEndpoint',
463
+ displayName: 'AbpOpenIddict::AllowLogoutEndpoint',
464
+ id: 'allowLogoutEndpoint',
465
+ visible: data => {
466
+ const formValue = data.getInjected(ApplicationFormModalComponent).getFormValue();
467
+ return allowFlow(formValue);
468
+ },
469
+ },
470
+ {
471
+ type: "text" /* Text */,
472
+ name: 'postLogoutRedirectUris',
473
+ displayName: 'AbpOpenIddict::PostLogoutRedirectUris',
474
+ id: 'postLogoutRedirectUris',
475
+ validators: () => [UrisValidator()],
476
+ visible: data => {
477
+ const { allowLogoutEndpoint } = data
478
+ .getInjected(ApplicationFormModalComponent)
479
+ .getFormValue();
480
+ return allowLogoutEndpoint;
481
+ },
482
+ },
483
+ ]);
484
+ const DEFAULT_APPLICATIONS_FORM_PROPS = DEFAULT_APPLICATIONS_CREATE_FORM_PROPS.concat(FormProp.createMany([
485
+ {
486
+ type: "boolean" /* Boolean */,
487
+ name: 'enabled',
488
+ displayName: 'AbpIdentityServer::Enabled',
489
+ id: 'enabled',
490
+ defaultValue: false,
491
+ },
492
+ ]));
493
+
494
+ const DEFAULT_SCOPES_ENTITY_PROPS = EntityProp.createMany([
495
+ {
496
+ type: "string" /* String */,
497
+ name: 'name',
498
+ displayName: 'AbpOpenIddict::Name',
499
+ columnWidth: 200,
500
+ },
501
+ {
502
+ type: "string" /* String */,
503
+ name: 'displayName',
504
+ displayName: 'AbpOpenIddict::DisplayName',
505
+ columnWidth: 200,
506
+ },
507
+ {
508
+ type: "string" /* String */,
509
+ name: 'description',
510
+ displayName: 'AbpOpenIddict::Description',
511
+ columnWidth: 200,
512
+ },
513
+ ]);
514
+
515
+ class ScopesService {
516
+ constructor() {
517
+ this.state = new InternalStore({ isModalVisible: false });
518
+ this.isModalVisible$ = this.state.sliceState(x => x.isModalVisible);
519
+ }
520
+ openModal() {
521
+ this.setModalState(true);
522
+ }
523
+ setModalState(value) {
524
+ this.state.patch({ isModalVisible: value });
525
+ }
526
+ }
527
+
528
+ class ScopeFormModalComponent {
529
+ constructor(injector, scopesService, service) {
530
+ this.injector = injector;
531
+ this.scopesService = scopesService;
532
+ this.service = service;
533
+ this.saved = new EventEmitter();
534
+ this.isModalVisible$ = this.scopesService.isModalVisible$;
535
+ }
536
+ ngOnChanges(changes) {
537
+ this.createForm();
538
+ }
539
+ save() {
540
+ if (this.form.invalid) {
541
+ return;
542
+ }
543
+ const id = this.selected.id;
544
+ const isEditMode = !!id;
545
+ let sub;
546
+ const value = Object.assign(Object.assign({}, this.form.value), { resources: hashSetParser(this.form.value.resources) });
547
+ if (isEditMode) {
548
+ sub = this.service.update(id, value);
549
+ }
550
+ else {
551
+ sub = this.service.create(value);
552
+ }
553
+ sub.subscribe(() => {
554
+ this.scopesService.setModalState(false);
555
+ this.saved.emit();
556
+ });
557
+ }
558
+ visibleChange($event) {
559
+ this.scopesService.setModalState($event);
560
+ }
561
+ createForm() {
562
+ var _a;
563
+ const selected = ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id)
564
+ ? Object.assign(Object.assign({}, this.selected), { resources: hashSetParser(this.selected.resources) }) : {};
565
+ const data = new FormPropData(this.injector, selected);
566
+ this.form = generateFormFromProps(data);
567
+ }
568
+ }
569
+ ScopeFormModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: ScopeFormModalComponent, deps: [{ token: i0.Injector }, { token: ScopesService }, { token: i1.ScopeService }], target: i0.ɵɵFactoryTarget.Component });
570
+ ScopeFormModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.6", type: ScopeFormModalComponent, selector: "abp-scope-form-modal", inputs: { selected: "selected" }, outputs: { saved: "saved" }, usesOnChanges: true, ngImport: i0, template: "\r\n<abp-modal [visible]=\"isModalVisible$ | async\" (visibleChange)=\"visibleChange($event)\" >\r\n\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpOpenIddict::Edit' : 'AbpOpenIddict::NewScope') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <form [formGroup]=\"form\" id=\"scopeForm\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpOpenIddict::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" buttonType=\"submit\" formName=\"scopeForm\">{{\r\n 'AbpOpenIddict::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n", components: [{ type: i3.ModalComponent, selector: "abp-modal", inputs: ["visible", "busy", "options", "suppressUnsavedChangesWarning"], outputs: ["visibleChange", "init", "appear", "disappear"] }, { type: i4.ExtensibleFormComponent, selector: "abp-extensible-form", inputs: ["selectedRecord"], exportAs: ["abpExtensibleForm"] }, { type: i3.ButtonComponent, selector: "abp-button", inputs: ["buttonId", "buttonClass", "buttonType", "formName", "iconClass", "loading", "disabled", "attributes"], outputs: ["click", "focus", "blur", "abpClick", "abpFocus", "abpBlur"] }], directives: [{ type: i5.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i5.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i4$1.FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: ["debounce", "notValidateOnSubmit", "markAsDirtyWhenSubmit"], outputs: ["ngSubmit"] }, { type: i5.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i7.ValidationGroupDirective, selector: "[formGroup],[formGroupName]", exportAs: ["validationGroup"] }, { type: i3.ModalCloseDirective, selector: "[abpClose]" }], pipes: { "async": i8.AsyncPipe, "abpLocalization": i4$1.LocalizationPipe } });
571
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: ScopeFormModalComponent, decorators: [{
572
+ type: Component,
573
+ args: [{ selector: 'abp-scope-form-modal', template: "\r\n<abp-modal [visible]=\"isModalVisible$ | async\" (visibleChange)=\"visibleChange($event)\" >\r\n\r\n <ng-template #abpHeader>\r\n <h3>{{ (selected?.id ? 'AbpOpenIddict::Edit' : 'AbpOpenIddict::NewScope') | abpLocalization }}</h3>\r\n </ng-template>\r\n\r\n <ng-template #abpBody>\r\n <form [formGroup]=\"form\" id=\"scopeForm\" (ngSubmit)=\"save()\" validateOnSubmit>\r\n <abp-extensible-form [selectedRecord]=\"selected\"></abp-extensible-form>\r\n </form>\r\n </ng-template>\r\n\r\n <ng-template #abpFooter>\r\n <button type=\"button\" class=\"btn btn-secondary\" abpClose>\r\n {{ 'AbpOpenIddict::Cancel' | abpLocalization }}\r\n </button>\r\n <abp-button iconClass=\"fa fa-check\" buttonType=\"submit\" formName=\"scopeForm\">{{\r\n 'AbpOpenIddict::Save' | abpLocalization\r\n }}</abp-button>\r\n </ng-template>\r\n</abp-modal>\r\n" }]
574
+ }], ctorParameters: function () { return [{ type: i0.Injector }, { type: ScopesService }, { type: i1.ScopeService }]; }, propDecorators: { selected: [{
575
+ type: Input
576
+ }], saved: [{
577
+ type: Output
578
+ }] } });
579
+
580
+ class ScopesComponent {
581
+ constructor(list, service, scopesService, confirmationService) {
582
+ this.list = list;
583
+ this.service = service;
584
+ this.scopesService = scopesService;
585
+ this.confirmationService = confirmationService;
586
+ this.data = { items: [], totalCount: 0 };
587
+ this.selected = {};
588
+ }
589
+ hookToQuery() {
590
+ this.list.hookToQuery(query => this.service.getList(query)).subscribe(res => (this.data = res));
591
+ }
592
+ ngOnInit() {
593
+ this.hookToQuery();
594
+ }
595
+ onAdd() {
596
+ this.selected = {};
597
+ this.scopesService.openModal();
598
+ }
599
+ onEdit(id) {
600
+ this.service.get(id).subscribe(res => {
601
+ this.selected = res;
602
+ this.scopesService.openModal();
603
+ });
604
+ }
605
+ onDelete(id, name) {
606
+ const sub = this.confirmationService
607
+ .warn('AbpOpenIddict::ScopeDeletionWarningMessage', 'AbpOpenIddict::AreYouSure', {
608
+ messageLocalizationParams: [name],
609
+ })
610
+ .subscribe((status) => {
611
+ if (status === Confirmation.Status.confirm) {
612
+ this.service.delete(id).subscribe(() => this.list.get());
613
+ }
614
+ });
615
+ }
616
+ onSaved() {
617
+ this.list.get();
618
+ }
619
+ }
620
+ ScopesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: ScopesComponent, deps: [{ token: i4$1.ListService }, { token: i1.ScopeService }, { token: ScopesService }, { token: i3.ConfirmationService }], target: i0.ɵɵFactoryTarget.Component });
621
+ ScopesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.6", type: ScopesComponent, selector: "abp-scopes", providers: [
622
+ ListService,
623
+ {
624
+ provide: EXTENSIONS_IDENTIFIER,
625
+ useValue: "OpenIddictPro.Scopes" /* Scopes */,
626
+ },
627
+ ], ngImport: i0, template: "<abp-page [title]=\"'AbpOpenIddict::Scopes' | abpLocalization\" [toolbar]=\"data.items\">\r\n <div id=\"wrapper\">\r\n\r\n <abp-advanced-entity-filters\r\n localizationSourceName=\"AbpOpenIddict\"\r\n [list]=\"list\"\r\n ></abp-advanced-entity-filters>\r\n\r\n\r\n <div class=\"card\">\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n</abp-page>\r\n\r\n<abp-scope-form-modal [selected]=\"selected\" (saved)=\"onSaved()\">\r\n</abp-scope-form-modal>\r\n", components: [{ type: i5$1.PageComponent, selector: "abp-page", inputs: ["title", "toolbar", "breadcrumb"] }, { type: i6.AdvancedEntityFiltersComponent, selector: "abp-advanced-entity-filters", inputs: ["list", "localizationSourceName", "entityFilterPlaceholder"] }, { type: i4.ExtensibleTableComponent, selector: "abp-extensible-table", inputs: ["actionsText", "data", "list", "recordsTotal", "actionsColumnWidth", "actionsTemplate"], exportAs: ["abpExtensibleTable"] }, { type: ScopeFormModalComponent, selector: "abp-scope-form-modal", inputs: ["selected"], outputs: ["saved"] }], pipes: { "abpLocalization": i4$1.LocalizationPipe } });
628
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: ScopesComponent, decorators: [{
629
+ type: Component,
630
+ args: [{ selector: 'abp-scopes', styles: [], providers: [
631
+ ListService,
632
+ {
633
+ provide: EXTENSIONS_IDENTIFIER,
634
+ useValue: "OpenIddictPro.Scopes" /* Scopes */,
635
+ },
636
+ ], template: "<abp-page [title]=\"'AbpOpenIddict::Scopes' | abpLocalization\" [toolbar]=\"data.items\">\r\n <div id=\"wrapper\">\r\n\r\n <abp-advanced-entity-filters\r\n localizationSourceName=\"AbpOpenIddict\"\r\n [list]=\"list\"\r\n ></abp-advanced-entity-filters>\r\n\r\n\r\n <div class=\"card\">\r\n <abp-extensible-table\r\n [data]=\"data.items\"\r\n [recordsTotal]=\"data.totalCount\"\r\n [list]=\"list\"\r\n ></abp-extensible-table>\r\n </div>\r\n </div>\r\n</abp-page>\r\n\r\n<abp-scope-form-modal [selected]=\"selected\" (saved)=\"onSaved()\">\r\n</abp-scope-form-modal>\r\n" }]
637
+ }], ctorParameters: function () { return [{ type: i4$1.ListService }, { type: i1.ScopeService }, { type: ScopesService }, { type: i3.ConfirmationService }]; } });
638
+
639
+ const DEFAULT_SCOPES_TOOLBAR_ACTIONS = ToolbarAction.createMany([
640
+ {
641
+ text: 'AbpOpenIddict::NewScope',
642
+ action: data => {
643
+ const component = data.getInjected(ScopesComponent);
644
+ component.onAdd();
645
+ },
646
+ permission: 'OpenIddictPro.Scope.Create',
647
+ icon: 'fa fa-plus',
648
+ },
649
+ ]);
650
+
651
+ const DEFAULT_SCOPE_CREATE_FORM_PROPS = FormProp.createMany([
652
+ {
653
+ type: "string" /* String */,
654
+ name: 'name',
655
+ displayName: 'AbpOpenIddict::Name',
656
+ id: 'name',
657
+ validators: () => [Validators.required],
658
+ },
659
+ {
660
+ type: "string" /* String */,
661
+ name: 'displayName',
662
+ displayName: 'AbpOpenIddict::DisplayName',
663
+ id: 'displayName',
664
+ },
665
+ {
666
+ type: "string" /* String */,
667
+ name: 'description',
668
+ displayName: 'AbpOpenIddict::Description',
669
+ id: 'description',
670
+ },
671
+ {
672
+ type: "text" /* Text */,
673
+ name: 'resources',
674
+ displayName: 'AbpOpenIddict::Resources',
675
+ id: 'resources',
676
+ },
677
+ ]);
678
+ const DEFAULT_SCOPES_FORM_PROPS = DEFAULT_SCOPE_CREATE_FORM_PROPS;
679
+
680
+ const DEFAULT_SCOPE_ENTITY_ACTIONS = EntityAction.createMany([
681
+ {
682
+ text: 'AbpOpenIddict::Edit',
683
+ action: data => {
684
+ const component = data.getInjected(ScopesComponent);
685
+ component.onEdit(data.record.id);
686
+ },
687
+ permission: 'OpenIddictPro.Scope.Update',
688
+ },
689
+ {
690
+ text: 'AbpOpenIddict::ChangeHistory',
691
+ action: data => {
692
+ const showHistory = data.getInjected(SHOW_ENTITY_HISTORY);
693
+ showHistory(data.record.id, 'Volo.Abp.OpenIddict.Scopes.OpenIddictScope');
694
+ },
695
+ permission: 'AuditLogging.ViewChangeHistory:Volo.Abp.OpenIddict.Pro.Scopes.Scope',
696
+ visible: data => Boolean(data.getInjected(SHOW_ENTITY_HISTORY, null)),
697
+ },
698
+ {
699
+ text: 'AbpOpenIddict::Delete',
700
+ action: data => {
701
+ const component = data.getInjected(ScopesComponent);
702
+ component.onDelete(data.record.id, data.record.name);
703
+ },
704
+ permission: 'OpenIddictPro.Scope.Delete',
705
+ },
706
+ ]);
707
+
708
+ const DEFAULT_OPENIDDICT_PRO_ENTITY_ACTIONS = {
709
+ ["OpenIddictPro.Applications" /* Applications */]: DEFAULT_APPLICATIONS_ENTITY_ACTIONS,
710
+ ["OpenIddictPro.Scopes" /* Scopes */]: DEFAULT_SCOPE_ENTITY_ACTIONS,
711
+ };
712
+ const DEFAULT_OPENIDDICT_PRO_TOOLBAR_ACTIONS = {
713
+ ["OpenIddictPro.Applications" /* Applications */]: DEFAULT_APPLICATIONS_TOOLBAR_ACTIONS,
714
+ ["OpenIddictPro.Scopes" /* Scopes */]: DEFAULT_SCOPES_TOOLBAR_ACTIONS,
715
+ };
716
+ const DEFAULT_OPENIDDICT_PRO_ENTITY_PROPS = {
717
+ ["OpenIddictPro.Applications" /* Applications */]: DEFAULT_APPLICATIONS_ENTITY_PROPS,
718
+ ["OpenIddictPro.Scopes" /* Scopes */]: DEFAULT_SCOPES_ENTITY_PROPS,
719
+ };
720
+ const DEFAULT_OPENIDDICT_PRO_CREATE_FORM_PROPS = {
721
+ ["OpenIddictPro.Applications" /* Applications */]: DEFAULT_APPLICATIONS_CREATE_FORM_PROPS,
722
+ ["OpenIddictPro.Scopes" /* Scopes */]: DEFAULT_SCOPE_CREATE_FORM_PROPS,
723
+ };
724
+ const DEFAULT_OPENIDDICT_PRO_EDIT_FORM_PROPS = {
725
+ ["OpenIddictPro.Applications" /* Applications */]: DEFAULT_APPLICATIONS_FORM_PROPS,
726
+ ["OpenIddictPro.Scopes" /* Scopes */]: DEFAULT_SCOPES_FORM_PROPS,
727
+ };
728
+ const OPENIDDICT_PRO_ENTITY_ACTION_CONTRIBUTORS = new InjectionToken('OPENIDDICT_PRO_ENTITY_ACTION_CONTRIBUTORS');
729
+ const OPENIDDICT_PRO_TOOLBAR_ACTION_CONTRIBUTORS = new InjectionToken('OPENIDDICT_PRO__TOOLBAR_ACTION_CONTRIBUTORS');
730
+ const OPENIDDICT_PRO_ENTITY_PROP_CONTRIBUTORS = new InjectionToken('OPENIDDICT_PRO_ENTITY_PROP_CONTRIBUTORS');
731
+ const OPENIDDICT_PRO_CREATE_FORM_PROP_CONTRIBUTORS = new InjectionToken('OPENIDDICT_PRO_CREATE_FORM_PROP_CONTRIBUTORS');
732
+ const OPENIDDICT_PRO_EDIT_FORM_PROP_CONTRIBUTORS = new InjectionToken('OPENIDDICT_PRO_EDIT_FORM_PROP_CONTRIBUTORS');
733
+
734
+ class OpenIddictProExtensionsGuard {
735
+ constructor(injector) {
736
+ this.injector = injector;
737
+ }
738
+ canActivate() {
739
+ const extensions = this.injector.get(ExtensionsService);
740
+ const actionContributors = this.injector.get(OPENIDDICT_PRO_ENTITY_ACTION_CONTRIBUTORS, null) || {};
741
+ const toolbarContributors = this.injector.get(OPENIDDICT_PRO_TOOLBAR_ACTION_CONTRIBUTORS, null) || {};
742
+ const propContributors = this.injector.get(OPENIDDICT_PRO_ENTITY_PROP_CONTRIBUTORS, null) || {};
743
+ const createFormContributors = this.injector.get(OPENIDDICT_PRO_CREATE_FORM_PROP_CONTRIBUTORS, null) || {};
744
+ const editFormContributors = this.injector.get(OPENIDDICT_PRO_EDIT_FORM_PROP_CONTRIBUTORS, null) || {};
745
+ const configState = this.injector.get(ConfigStateService);
746
+ return getObjectExtensionEntitiesFromStore(configState, 'OpenIddictPro').pipe(map(entities => {
747
+ return {
748
+ ["OpenIddictPro.Applications" /* Applications */]: entities.ApiResource,
749
+ ["OpenIddictPro.Scopes" /* Scopes */]: entities.Scopes,
750
+ };
751
+ }), mapEntitiesToContributors(configState, 'AbpOpenIddictPro'), tap(objectExtensionContributors => {
752
+ mergeWithDefaultActions(extensions.entityActions, DEFAULT_OPENIDDICT_PRO_ENTITY_ACTIONS, actionContributors);
753
+ mergeWithDefaultActions(extensions.toolbarActions, DEFAULT_OPENIDDICT_PRO_TOOLBAR_ACTIONS, toolbarContributors);
754
+ mergeWithDefaultProps(extensions.entityProps, DEFAULT_OPENIDDICT_PRO_ENTITY_PROPS, objectExtensionContributors.prop, propContributors);
755
+ mergeWithDefaultProps(extensions.createFormProps, DEFAULT_OPENIDDICT_PRO_CREATE_FORM_PROPS, objectExtensionContributors.createForm, createFormContributors);
756
+ mergeWithDefaultProps(extensions.editFormProps, DEFAULT_OPENIDDICT_PRO_EDIT_FORM_PROPS, objectExtensionContributors.editForm, editFormContributors);
757
+ }), mapTo(true));
758
+ }
759
+ }
760
+ OpenIddictProExtensionsGuard.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: OpenIddictProExtensionsGuard, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
761
+ OpenIddictProExtensionsGuard.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: OpenIddictProExtensionsGuard });
762
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: OpenIddictProExtensionsGuard, decorators: [{
763
+ type: Injectable
764
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; } });
765
+
766
+ const routes = [
767
+ { path: '', redirectTo: 'Applications', pathMatch: 'full' },
768
+ {
769
+ path: '',
770
+ component: RouterOutletComponent,
771
+ canActivate: [AuthGuard, PermissionGuard, OpenIddictProExtensionsGuard],
772
+ children: [
773
+ {
774
+ path: 'Applications',
775
+ component: ReplaceableRouteContainerComponent,
776
+ data: {
777
+ requiredPolicy: 'OpenIddictPro.Application',
778
+ replaceableComponent: {
779
+ key: "OpenIddictPro.Applications" /* Applications */,
780
+ defaultComponent: ApplicationsComponent,
781
+ },
782
+ },
783
+ },
784
+ {
785
+ path: 'Scopes',
786
+ component: ReplaceableRouteContainerComponent,
787
+ data: {
788
+ requiredPolicy: 'OpenIddictPro.Scopes',
789
+ replaceableComponent: {
790
+ key: "OpenIddictPro.Scopes" /* Scopes */,
791
+ defaultComponent: ScopesComponent,
792
+ },
793
+ },
794
+ },
795
+ ],
796
+ },
797
+ ];
798
+ class OpeniddictproRoutingModule {
799
+ }
800
+ OpeniddictproRoutingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: OpeniddictproRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
801
+ OpeniddictproRoutingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: OpeniddictproRoutingModule, imports: [i1$1.RouterModule], exports: [RouterModule] });
802
+ OpeniddictproRoutingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: OpeniddictproRoutingModule, imports: [[RouterModule.forChild(routes)], RouterModule] });
803
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: OpeniddictproRoutingModule, decorators: [{
804
+ type: NgModule,
805
+ args: [{
806
+ imports: [RouterModule.forChild(routes)],
807
+ exports: [RouterModule],
808
+ }]
809
+ }] });
810
+
811
+ const components = [
812
+ ApplicationsComponent,
813
+ ApplicationFormModalComponent,
814
+ ScopesComponent,
815
+ ScopeFormModalComponent,
816
+ ];
817
+ class OpeniddictproModule {
818
+ static forChild(options = {}) {
819
+ return {
820
+ ngModule: OpeniddictproModule,
821
+ providers: [
822
+ {
823
+ provide: OPENIDDICT_PRO_ENTITY_ACTION_CONTRIBUTORS,
824
+ useValue: options.entityActionContributors,
825
+ },
826
+ {
827
+ provide: OPENIDDICT_PRO_TOOLBAR_ACTION_CONTRIBUTORS,
828
+ useValue: options.toolbarActionContributors,
829
+ },
830
+ {
831
+ provide: OPENIDDICT_PRO_ENTITY_PROP_CONTRIBUTORS,
832
+ useValue: options.entityPropContributors,
833
+ },
834
+ {
835
+ provide: OPENIDDICT_PRO_CREATE_FORM_PROP_CONTRIBUTORS,
836
+ useValue: options.createFormPropContributors,
837
+ },
838
+ {
839
+ provide: OPENIDDICT_PRO_EDIT_FORM_PROP_CONTRIBUTORS,
840
+ useValue: options.editFormPropContributors,
841
+ },
842
+ OpenIddictProExtensionsGuard,
843
+ ApplicationsService,
844
+ ScopesService,
845
+ ],
846
+ };
847
+ }
848
+ static forLazy(options = {}) {
849
+ return new LazyModuleFactory(OpeniddictproModule.forChild(options));
850
+ }
851
+ }
852
+ OpeniddictproModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: OpeniddictproModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
853
+ OpeniddictproModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: OpeniddictproModule, declarations: [ApplicationsComponent,
854
+ ApplicationFormModalComponent,
855
+ ScopesComponent,
856
+ ScopeFormModalComponent], imports: [OpeniddictproRoutingModule,
857
+ CoreModule,
858
+ CommercialUiModule,
859
+ ThemeSharedModule,
860
+ NgbDropdownModule,
861
+ NgxValidateCoreModule,
862
+ PageModule,
863
+ AdvancedEntityFiltersModule,
864
+ PermissionManagementModule], exports: [ApplicationsComponent,
865
+ ApplicationFormModalComponent,
866
+ ScopesComponent,
867
+ ScopeFormModalComponent] });
868
+ OpeniddictproModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: OpeniddictproModule, imports: [[
869
+ OpeniddictproRoutingModule,
870
+ CoreModule,
871
+ CommercialUiModule,
872
+ ThemeSharedModule,
873
+ NgbDropdownModule,
874
+ NgxValidateCoreModule,
875
+ PageModule,
876
+ AdvancedEntityFiltersModule,
877
+ PermissionManagementModule,
878
+ ]] });
879
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.6", ngImport: i0, type: OpeniddictproModule, decorators: [{
880
+ type: NgModule,
881
+ args: [{
882
+ imports: [
883
+ OpeniddictproRoutingModule,
884
+ CoreModule,
885
+ CommercialUiModule,
886
+ ThemeSharedModule,
887
+ NgbDropdownModule,
888
+ NgxValidateCoreModule,
889
+ PageModule,
890
+ AdvancedEntityFiltersModule,
891
+ PermissionManagementModule,
892
+ ],
893
+ declarations: [...components],
894
+ exports: [...components],
895
+ }]
896
+ }] });
897
+
898
+ /**
899
+ * Generated bundle index. Do not edit.
900
+ */
901
+
902
+ export { ApplicationFormModalComponent, ApplicationsComponent, ApplicationsService, DEFAULT_APPLICATIONS_CREATE_FORM_PROPS, DEFAULT_APPLICATIONS_ENTITY_ACTIONS, DEFAULT_APPLICATIONS_ENTITY_PROPS, DEFAULT_APPLICATIONS_FORM_PROPS, DEFAULT_APPLICATIONS_TOOLBAR_ACTIONS, DEFAULT_SCOPES_ENTITY_PROPS, DEFAULT_SCOPES_FORM_PROPS, DEFAULT_SCOPES_TOOLBAR_ACTIONS, DEFAULT_SCOPE_CREATE_FORM_PROPS, DEFAULT_SCOPE_ENTITY_ACTIONS, DefaultApplicationsConsentType, OpeniddictproModule, ScopeFormModalComponent, ScopesComponent, ScopesService, allowFlow, defaultApplicationTypes, defaultApplicationsTypeList, defaultUriPattern };
903
+ //# sourceMappingURL=volo-abp.ng.openiddictpro.mjs.map