@cleavelandprice/ngx-lib 4.4.0 → 4.4.2
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/README.md +5 -5
- package/active-directory/material/components/user-chooser/user-chooser.component.d.ts +18 -18
- package/authentication/model/abstract-authentication-service.d.ts +4 -4
- package/authentication/object/services/authentication-object.service.d.ts +4 -3
- package/authentication/token/services/authentication-token.service.d.ts +4 -3
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-material.mjs +13 -13
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-material.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-active-directory.mjs +7 -7
- package/fesm2022/cleavelandprice-ngx-lib-active-directory.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-material.mjs +17 -17
- package/fesm2022/cleavelandprice-ngx-lib-authentication-material.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-object.mjs +22 -12
- package/fesm2022/cleavelandprice-ngx-lib-authentication-object.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-token.mjs +22 -12
- package/fesm2022/cleavelandprice-ngx-lib-authentication-token.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication.mjs +4 -4
- package/fesm2022/cleavelandprice-ngx-lib-authentication.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-dialog.mjs +25 -25
- package/fesm2022/cleavelandprice-ngx-lib-dialog.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-msgraph.mjs +4 -4
- package/fesm2022/cleavelandprice-ngx-lib-msgraph.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-quill-mention.mjs +10 -10
- package/fesm2022/cleavelandprice-ngx-lib-quill-mention.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-quill.mjs +15 -15
- package/fesm2022/cleavelandprice-ngx-lib-quill.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-sharepoint.mjs +14 -14
- package/fesm2022/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-table.mjs +14 -14
- package/fesm2022/cleavelandprice-ngx-lib-table.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-upload.mjs +15 -16
- package/fesm2022/cleavelandprice-ngx-lib-upload.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-url-utilities.mjs +13 -13
- package/fesm2022/cleavelandprice-ngx-lib-url-utilities.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib.mjs +7 -7
- package/fesm2022/cleavelandprice-ngx-lib.mjs.map +1 -1
- package/package.json +3 -33
- package/esm2022/active-directory/active-directory.api.mjs +0 -11
- package/esm2022/active-directory/active-directory.module.mjs +0 -40
- package/esm2022/active-directory/cleavelandprice-ngx-lib-active-directory.mjs +0 -5
- package/esm2022/active-directory/material/cleavelandprice-ngx-lib-active-directory-material.mjs +0 -5
- package/esm2022/active-directory/material/components/user-chooser/user-chooser.component.mjs +0 -437
- package/esm2022/active-directory/material/components/user-form-field/user-form-field.component.mjs +0 -159
- package/esm2022/active-directory/material/mat-active-directory.api.mjs +0 -11
- package/esm2022/active-directory/material/mat-active-directory.module.mjs +0 -100
- package/esm2022/active-directory/material/model/default-user-chooser-data.mjs +0 -15
- package/esm2022/active-directory/material/model/default-user-chooser-filter-options.mjs +0 -8
- package/esm2022/active-directory/material/model/selectable-group.mjs +0 -2
- package/esm2022/active-directory/material/model/selectable-user.mjs +0 -2
- package/esm2022/active-directory/material/model/user-chooser-data.mjs +0 -2
- package/esm2022/active-directory/material/model/user-chooser-filter-options.mjs +0 -3
- package/esm2022/active-directory/material/model/user-chooser-mode.mjs +0 -6
- package/esm2022/active-directory/material/model/user-chooser-pre-processing-group.mjs +0 -3
- package/esm2022/active-directory/model/active-directory-service-options-token.mjs +0 -3
- package/esm2022/active-directory/model/active-directory-service-options.mjs +0 -2
- package/esm2022/active-directory/model/ad-object-with-children.mjs +0 -2
- package/esm2022/active-directory/model/ad-object.mjs +0 -2
- package/esm2022/active-directory/model/cache-object.mjs +0 -3
- package/esm2022/active-directory/model/cleaveland-price-user.mjs +0 -2
- package/esm2022/active-directory/model/group.mjs +0 -2
- package/esm2022/active-directory/model/user-or-group.mjs +0 -2
- package/esm2022/active-directory/model/user.mjs +0 -2
- package/esm2022/active-directory/services/active-directory.service.mjs +0 -125
- package/esm2022/authentication/authentication.api.mjs +0 -7
- package/esm2022/authentication/authentication.base.module.mjs +0 -40
- package/esm2022/authentication/cleavelandprice-ngx-lib-authentication.mjs +0 -5
- package/esm2022/authentication/material/cleavelandprice-ngx-lib-authentication-material.mjs +0 -5
- package/esm2022/authentication/material/components/login/login.component.mjs +0 -49
- package/esm2022/authentication/material/components/login-form/login-form.component.mjs +0 -82
- package/esm2022/authentication/material/mat-authentication.api.mjs +0 -8
- package/esm2022/authentication/material/mat-authentication.module.mjs +0 -84
- package/esm2022/authentication/material/model/login-form-data.mjs +0 -2
- package/esm2022/authentication/material/model/mat-authentication-service-options-token.mjs +0 -3
- package/esm2022/authentication/material/model/mat-authentication-service-options.mjs +0 -2
- package/esm2022/authentication/material/services/mat-authentication.service.mjs +0 -67
- package/esm2022/authentication/model/abstract-authentication-service.mjs +0 -2
- package/esm2022/authentication/model/authenticated-user.mjs +0 -2
- package/esm2022/authentication/model/authentication-request.mjs +0 -2
- package/esm2022/authentication/model/authentication-service-options-token.mjs +0 -3
- package/esm2022/authentication/model/authentication-service-options.mjs +0 -2
- package/esm2022/authentication/object/authentication-object.api.mjs +0 -6
- package/esm2022/authentication/object/authentication-object.module.mjs +0 -40
- package/esm2022/authentication/object/cleavelandprice-ngx-lib-authentication-object.mjs +0 -5
- package/esm2022/authentication/object/services/authentication-object.service.mjs +0 -119
- package/esm2022/authentication/token/authentication-token.api.mjs +0 -6
- package/esm2022/authentication/token/authetiction-token.module.mjs +0 -40
- package/esm2022/authentication/token/cleavelandprice-ngx-lib-authentication-token.mjs +0 -5
- package/esm2022/authentication/token/model/authentication-token-service-options-token.mjs +0 -3
- package/esm2022/authentication/token/model/authentication-token-service-options.mjs +0 -2
- package/esm2022/authentication/token/model/authentication-token.mjs +0 -2
- package/esm2022/authentication/token/services/authentication-token.service.mjs +0 -128
- package/esm2022/cleavelandprice-ngx-lib.mjs +0 -5
- package/esm2022/dialog/cleavelandprice-ngx-lib-dialog.mjs +0 -5
- package/esm2022/dialog/components/base/base.component.mjs +0 -102
- package/esm2022/dialog/components/choice/choice.component.mjs +0 -21
- package/esm2022/dialog/components/confirmation/confirmation.component.mjs +0 -21
- package/esm2022/dialog/components/input/input.component.mjs +0 -21
- package/esm2022/dialog/components/message/message.component.mjs +0 -21
- package/esm2022/dialog/dialog.api.mjs +0 -20
- package/esm2022/dialog/dialog.module.mjs +0 -73
- package/esm2022/dialog/model/confirmation-dialog-mode.mjs +0 -8
- package/esm2022/dialog/model/dialog-base-data.mjs +0 -2
- package/esm2022/dialog/model/dialog-choice-data.mjs +0 -2
- package/esm2022/dialog/model/dialog-type.mjs +0 -8
- package/esm2022/lib/model/app-path-config.mjs +0 -2
- package/esm2022/lib/model/app-type.mjs +0 -2
- package/esm2022/lib/model/app.mjs +0 -2
- package/esm2022/lib/model/caching-config.mjs +0 -2
- package/esm2022/lib/model/credentials.mjs +0 -2
- package/esm2022/lib/model/logging-config.mjs +0 -2
- package/esm2022/lib/model/service-options-token.mjs +0 -3
- package/esm2022/lib/model/service-options.mjs +0 -2
- package/esm2022/lib/ngx-lib.module.mjs +0 -37
- package/esm2022/lib/services/app-path-config.service.mjs +0 -50
- package/esm2022/lib/services/service-base.mjs +0 -26
- package/esm2022/msgraph/cleavelandprice-ngx-lib-msgraph.mjs +0 -5
- package/esm2022/msgraph/model/address.mjs +0 -2
- package/esm2022/msgraph/model/attendee.mjs +0 -2
- package/esm2022/msgraph/model/bulk-calendar-events.mjs +0 -2
- package/esm2022/msgraph/model/bulk-calendar-request.mjs +0 -2
- package/esm2022/msgraph/model/calendar-event.mjs +0 -2
- package/esm2022/msgraph/model/coordinates.mjs +0 -2
- package/esm2022/msgraph/model/email-address.mjs +0 -2
- package/esm2022/msgraph/model/location.mjs +0 -2
- package/esm2022/msgraph/model/online-meeting-info.mjs +0 -2
- package/esm2022/msgraph/model/patterned-recurrence.mjs +0 -2
- package/esm2022/msgraph/model/phone.mjs +0 -2
- package/esm2022/msgraph/model/recipient.mjs +0 -2
- package/esm2022/msgraph/model/recurrence-pattern.mjs +0 -2
- package/esm2022/msgraph/model/recurrence-range.mjs +0 -2
- package/esm2022/msgraph/model/response-status.mjs +0 -2
- package/esm2022/msgraph/model/room.mjs +0 -6
- package/esm2022/msgraph/model/user.mjs +0 -132
- package/esm2022/msgraph/msgraph.api.mjs +0 -19
- package/esm2022/msgraph/msgraph.module.mjs +0 -27
- package/esm2022/public_api.mjs +0 -15
- package/esm2022/quill/cleavelandprice-ngx-lib-quill.mjs +0 -5
- package/esm2022/quill/components/editor/editor.component.mjs +0 -282
- package/esm2022/quill/components/raw/raw.component.mjs +0 -30
- package/esm2022/quill/mention/cleavelandprice-ngx-lib-quill-mention.mjs +0 -5
- package/esm2022/quill/mention/components/editor/editor.component.mjs +0 -151
- package/esm2022/quill/mention/model/dialog-data.mjs +0 -2
- package/esm2022/quill/mention/quill-mention.api.mjs +0 -9
- package/esm2022/quill/mention/quill-mention.module.mjs +0 -65
- package/esm2022/quill/model/buttons.mjs +0 -3
- package/esm2022/quill/model/config.mjs +0 -3
- package/esm2022/quill/model/default-buttons.mjs +0 -50
- package/esm2022/quill/model/default-config.mjs +0 -28
- package/esm2022/quill/model/default-icons.mjs +0 -7
- package/esm2022/quill/model/default-tooltips.mjs +0 -53
- package/esm2022/quill/model/dialog-data.mjs +0 -2
- package/esm2022/quill/model/icons.mjs +0 -3
- package/esm2022/quill/model/tooltips.mjs +0 -3
- package/esm2022/quill/quill.api.mjs +0 -13
- package/esm2022/quill/quill.module.mjs +0 -75
- package/esm2022/sharepoint/cleavelandprice-ngx-lib-sharepoint.mjs +0 -5
- package/esm2022/sharepoint/components/user-photo/user-photo.component.mjs +0 -40
- package/esm2022/sharepoint/default-credentials.mjs +0 -6
- package/esm2022/sharepoint/model/base-item.mjs +0 -2
- package/esm2022/sharepoint/model/base-request-credential.mjs +0 -2
- package/esm2022/sharepoint/model/base-request.mjs +0 -2
- package/esm2022/sharepoint/model/cache-object.mjs +0 -3
- package/esm2022/sharepoint/model/file-request.mjs +0 -2
- package/esm2022/sharepoint/model/folder-request.mjs +0 -2
- package/esm2022/sharepoint/model/list-item.mjs +0 -2
- package/esm2022/sharepoint/model/list-items-request.mjs +0 -2
- package/esm2022/sharepoint/model/photo-item.mjs +0 -2
- package/esm2022/sharepoint/model/sharepoint-service-options.mjs +0 -3
- package/esm2022/sharepoint/model/uri-request.mjs +0 -2
- package/esm2022/sharepoint/model/user-request.mjs +0 -2
- package/esm2022/sharepoint/model/user.mjs +0 -2
- package/esm2022/sharepoint/pipes/user-photo-url.pipe.mjs +0 -37
- package/esm2022/sharepoint/services/sharepoint.service.mjs +0 -155
- package/esm2022/sharepoint/sharepoint.api.mjs +0 -17
- package/esm2022/sharepoint/sharepoint.module.mjs +0 -50
- package/esm2022/table/cleavelandprice-ngx-lib-table.mjs +0 -5
- package/esm2022/table/components/table/table.component.mjs +0 -120
- package/esm2022/table/model/table-column.mjs +0 -2
- package/esm2022/table/pipes/decimalPoints.mjs +0 -14
- package/esm2022/table/pipes/roundNumber.mjs +0 -14
- package/esm2022/table/table.api.mjs +0 -6
- package/esm2022/table/table.module.mjs +0 -78
- package/esm2022/upload/cleavelandprice-ngx-lib-upload.mjs +0 -5
- package/esm2022/upload/components/upload/upload.component.mjs +0 -32
- package/esm2022/upload/components/upload-dialog/upload-dialog.component.mjs +0 -98
- package/esm2022/upload/model/database-file-info.mjs +0 -2
- package/esm2022/upload/model/file-upload-request.mjs +0 -2
- package/esm2022/upload/model/filesystem-file-info.mjs +0 -2
- package/esm2022/upload/model/msg-file-content.mjs +0 -5
- package/esm2022/upload/model/upload-service-options-token.mjs +0 -3
- package/esm2022/upload/model/upload-service-options.mjs +0 -3
- package/esm2022/upload/model/upload-status.mjs +0 -2
- package/esm2022/upload/services/upload.service.mjs +0 -106
- package/esm2022/upload/upload.api.mjs +0 -11
- package/esm2022/upload/upload.module.mjs +0 -68
- package/esm2022/url-utilities/cleavelandprice-ngx-lib-url-utilities.mjs +0 -5
- package/esm2022/url-utilities/pipes/safe-resource-url.pipe.mjs +0 -19
- package/esm2022/url-utilities/pipes/safe-url.pipe.mjs +0 -19
- package/esm2022/url-utilities/pipes/uri-scheme.pipe.mjs +0 -106
- package/esm2022/url-utilities/url-utilities.api.mjs +0 -13
- package/esm2022/url-utilities/url-utilities.module.mjs +0 -34
|
@@ -111,10 +111,10 @@ class ActiveDirectoryService extends NgxLibServiceBase {
|
|
|
111
111
|
getWorkstations(includeDisabled = false, parentOU = '') {
|
|
112
112
|
return this.#services.http.get(`${this.apiUrl}/activedirectory/workstations/${includeDisabled}/${parentOU}`);
|
|
113
113
|
}
|
|
114
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
115
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
114
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ActiveDirectoryService, deps: [{ token: ActiveDirectoryServiceOptionsToken, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
115
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ActiveDirectoryService, providedIn: 'root' }); }
|
|
116
116
|
}
|
|
117
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
117
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ActiveDirectoryService, decorators: [{
|
|
118
118
|
type: Injectable,
|
|
119
119
|
args: [{
|
|
120
120
|
providedIn: 'root'
|
|
@@ -143,11 +143,11 @@ class ActiveDirectoryModule {
|
|
|
143
143
|
throw new Error('ActiveDirectoryModule is already loaded. Import it in the AppModule only');
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
147
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
148
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
146
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ActiveDirectoryModule, deps: [{ token: ActiveDirectoryModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
147
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: ActiveDirectoryModule, imports: [CommonModule] }); }
|
|
148
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ActiveDirectoryModule, imports: [CommonModule] }); }
|
|
149
149
|
}
|
|
150
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: ActiveDirectoryModule, decorators: [{
|
|
151
151
|
type: NgModule,
|
|
152
152
|
args: [{
|
|
153
153
|
declarations: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleavelandprice-ngx-lib-active-directory.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/active-directory/src/model/active-directory-service-options-token.ts","../../../../projects/cleavelandprice/ngx-lib/active-directory/src/services/active-directory.service.ts","../../../../projects/cleavelandprice/ngx-lib/active-directory/src/active-directory.module.ts","../../../../projects/cleavelandprice/ngx-lib/active-directory/src/cleavelandprice-ngx-lib-active-directory.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { ActiveDirectoryServiceOptions } from \"./active-directory-service-options\";\r\n\r\nexport const ActiveDirectoryServiceOptionsToken = new InjectionToken<ActiveDirectoryServiceOptions>('');","import { HttpClient } from '@angular/common/http';\r\nimport { Inject, inject, Injectable, Optional } from '@angular/core';\r\nimport { DateTime } from 'luxon';\r\nimport { Observable, of } from 'rxjs';\r\n\r\nimport { NgxLibServiceBase } from '@cleavelandprice/ngx-lib';\r\nimport { ActiveDirectoryServiceOptions } from '../model/active-directory-service-options';\r\nimport { ActiveDirectoryServiceOptionsToken } from '../model/active-directory-service-options-token';\r\nimport { ADObject } from '../model/ad-object';\r\nimport { ADObjectWithChildren } from '../model/ad-object-with-children';\r\nimport { CacheObject } from '../model/cache-object';\r\nimport { CleavelandPriceUser } from '../model/cleaveland-price-user';\r\nimport { Group } from '../model/group';\r\nimport { User } from '../model/user';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ActiveDirectoryService extends NgxLibServiceBase {\r\n #services = {\r\n http: inject(HttpClient)\r\n };\r\n #cache?: CacheObject<CleavelandPriceUser>;\r\n #defaultCacheLifeMinutes = 720;\r\n\r\n //#region Properties\r\n get #cacheExpired(): boolean {\r\n if (!this.#cache) {\r\n return true;\r\n }\r\n\r\n const expiration = this.#cache.lastUpdate.plus({ minutes: this.options.caching!.lifeMinutes});\r\n\r\n return DateTime.now() > expiration;\r\n }\r\n //#endregion\r\n\r\n constructor(@Optional() @Inject(ActiveDirectoryServiceOptionsToken) private options: ActiveDirectoryServiceOptions) {\r\n super(options);\r\n\r\n this.options = {\r\n ...options,\r\n\r\n caching: options?.caching ?? {\r\n enabled: false,\r\n lifeMinutes: this.#defaultCacheLifeMinutes\r\n },\r\n\r\n logging: options?.logging ?? {\r\n dataCached: false,\r\n cachedDataReturned: false,\r\n freshDataReturned: false,\r\n cacheCleared: false\r\n }\r\n };\r\n }\r\n \r\n getUsers(includePhoto = false, includeDisabled = false, parentOU = ''): Observable<CleavelandPriceUser[]> {\r\n // If caching is enabled, there will be two calls to the API if the cache is null/expired\r\n // One call is to update the cache and the other is to return the data that the user requested\r\n // Subsequent calls will bypass the API and returned cached data until it expires\r\n\r\n const observable$ = this.#services.http.get<CleavelandPriceUser[]>(`${this.apiUrl}/users/${includePhoto}/${includeDisabled}/${parentOU}`);\r\n\r\n if (this.options.caching!.enabled) {\r\n if (this.#cacheExpired) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.#cache = {\r\n data,\r\n lastUpdate: DateTime.now()\r\n };\r\n\r\n if (this.options.logging!.dataCached) {\r\n console.log(`Data cached for ${this.options.caching!.lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.options.logging!.cachedDataReturned) {\r\n console.log('Returning cached users');\r\n }\r\n\r\n return of(this.#cache!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.options.logging!.freshDataReturned) {\r\n console.log('Returning fresh users');\r\n }\r\n\r\n return observable$;\r\n }\r\n\r\n getUser(accountName: string, includePhoto = false): Observable<CleavelandPriceUser> {\r\n return this.#services.http.get<CleavelandPriceUser>(`${this.apiUrl}/users/name/${accountName}/${includePhoto}`);\r\n }\r\n\r\n clearCache(): void {\r\n this.#cache = undefined;\r\n\r\n if (this.options.logging!.cacheCleared) {\r\n console.log('Cache cleared');\r\n }\r\n }\r\n\r\n getDomains(): Observable<ADObject[]> {\r\n return this.#services.http.get<ADObject[]>(`${this.apiUrl}/activedirectory/domains`);\r\n }\r\n\r\n getOUs(parentOU = ''): Observable<ADObjectWithChildren[]> {\r\n return this.#services.http.get<ADObjectWithChildren[]>(`${this.apiUrl}/activedirectory/ous/${parentOU}`);\r\n }\r\n\r\n getContainers(parentOU = ''): Observable<ADObjectWithChildren[]> {\r\n return this.#services.http.get<ADObjectWithChildren[]>(`${this.apiUrl}/activedirectory/containers/${parentOU}`);\r\n }\r\n\r\n getGroups(parentOU = ''): Observable<Group[]> {\r\n return this.#services.http.get<Group[]>(`${this.apiUrl}/activedirectory/groups/${parentOU}`);\r\n }\r\n\r\n getDistinctUserAttributeValues(attributeName: string) : Observable<any[]> {\r\n return this.#services.http.get<any[]>(`${this.apiUrl}/activedirectory/distinct/${attributeName}`);\r\n }\r\n\r\n getDepartments() : Observable<string[]> {\r\n return this.#services.http.get<string[]>(`${this.apiUrl}/activedirectory/departments`);\r\n }\r\n\r\n getTitles() : Observable<string[]> {\r\n return this.#services.http.get<string[]>(`${this.apiUrl}/activedirectory/titles`);\r\n }\r\n\r\n getComputers(includeDisabled = false, parentOU = ''): Observable<User[]> {\r\n return this.#services.http.get<User[]>(`${this.apiUrl}/activedirectory/computers/${includeDisabled}/${parentOU}`);\r\n }\r\n\r\n getServers(includeDisabled = false, parentOU = ''): Observable<User[]> {\r\n return this.#services.http.get<User[]>(`${this.apiUrl}/activedirectory/servers/${includeDisabled}/${parentOU}`);\r\n }\r\n\r\n getWorkstations(includeDisabled = false, parentOU = ''): Observable<User[]> {\r\n return this.#services.http.get<User[]>(`${this.apiUrl}/activedirectory/workstations/${includeDisabled}/${parentOU}`);\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\n\r\nimport { ActiveDirectoryServiceOptions } from './model/active-directory-service-options';\r\nimport { ActiveDirectoryServiceOptionsToken } from './model/active-directory-service-options-token';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: []\r\n})\r\nexport class ActiveDirectoryModule {\r\n static forRoot(config: ActiveDirectoryServiceOptions): ModuleWithProviders<ActiveDirectoryModule> {\r\n return {\r\n ngModule: ActiveDirectoryModule,\r\n providers: [\r\n {\r\n provide: ActiveDirectoryServiceOptionsToken,\r\n useValue: config\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: ActiveDirectoryModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'ActiveDirectoryModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './active-directory.api';\n"],"names":[],"mappings":";;;;;;;;MAGa,kCAAkC,GAAG,IAAI,cAAc,CAAgC,EAAE;;ACehG,MAAO,sBAAuB,SAAQ,iBAAiB,CAAA;AAC3D,IAAA,SAAS,GAAG;AACV,QAAA,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC;KACzB,CAAC;AACF,IAAA,MAAM,CAAoC;IAC1C,wBAAwB,GAAG,GAAG,CAAC;;AAG/B,IAAA,IAAI,aAAa,GAAA;AACf,QAAA,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;AAChB,YAAA,OAAO,IAAI,CAAC;SACb;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,OAAQ,CAAC,WAAW,EAAC,CAAC,CAAC;AAE9F,QAAA,OAAO,QAAQ,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC;KACpC;;AAGD,IAAA,WAAA,CAA4E,OAAsC,EAAA;QAChH,KAAK,CAAC,OAAO,CAAC,CAAC;QAD2D,IAAO,CAAA,OAAA,GAAP,OAAO,CAA+B;QAGhH,IAAI,CAAC,OAAO,GAAG;AACb,YAAA,GAAG,OAAO;AAEV,YAAA,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI;AAC3B,gBAAA,OAAO,EAAE,KAAK;gBACd,WAAW,EAAE,IAAI,CAAC,wBAAwB;AAC3C,aAAA;AAED,YAAA,OAAO,EAAE,OAAO,EAAE,OAAO,IAAI;AAC3B,gBAAA,UAAU,EAAE,KAAK;AACjB,gBAAA,kBAAkB,EAAE,KAA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A,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAJ9B,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;AAIH,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAJ9B,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAIH,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE,EAAE;AACZ,iBAAA,CAAA;;0BAcc,QAAQ;;0BAAI,QAAQ;;;AC1BnC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cleavelandprice-ngx-lib-active-directory.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/active-directory/src/model/active-directory-service-options-token.ts","../../../../projects/cleavelandprice/ngx-lib/active-directory/src/services/active-directory.service.ts","../../../../projects/cleavelandprice/ngx-lib/active-directory/src/active-directory.module.ts","../../../../projects/cleavelandprice/ngx-lib/active-directory/src/cleavelandprice-ngx-lib-active-directory.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { ActiveDirectoryServiceOptions } from \"./active-directory-service-options\";\r\n\r\nexport const ActiveDirectoryServiceOptionsToken = new InjectionToken<ActiveDirectoryServiceOptions>('');","import { HttpClient } from '@angular/common/http';\r\nimport { Inject, inject, Injectable, Optional } from '@angular/core';\r\nimport { DateTime } from 'luxon';\r\nimport { Observable, of } from 'rxjs';\r\n\r\nimport { NgxLibServiceBase } from '@cleavelandprice/ngx-lib';\r\nimport { ActiveDirectoryServiceOptions } from '../model/active-directory-service-options';\r\nimport { ActiveDirectoryServiceOptionsToken } from '../model/active-directory-service-options-token';\r\nimport { ADObject } from '../model/ad-object';\r\nimport { ADObjectWithChildren } from '../model/ad-object-with-children';\r\nimport { CacheObject } from '../model/cache-object';\r\nimport { CleavelandPriceUser } from '../model/cleaveland-price-user';\r\nimport { Group } from '../model/group';\r\nimport { User } from '../model/user';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class ActiveDirectoryService extends NgxLibServiceBase {\r\n #services = {\r\n http: inject(HttpClient)\r\n };\r\n #cache?: CacheObject<CleavelandPriceUser>;\r\n #defaultCacheLifeMinutes = 720;\r\n\r\n //#region Properties\r\n get #cacheExpired(): boolean {\r\n if (!this.#cache) {\r\n return true;\r\n }\r\n\r\n const expiration = this.#cache.lastUpdate.plus({ minutes: this.options.caching!.lifeMinutes});\r\n\r\n return DateTime.now() > expiration;\r\n }\r\n //#endregion\r\n\r\n constructor(@Optional() @Inject(ActiveDirectoryServiceOptionsToken) private options: ActiveDirectoryServiceOptions) {\r\n super(options);\r\n\r\n this.options = {\r\n ...options,\r\n\r\n caching: options?.caching ?? {\r\n enabled: false,\r\n lifeMinutes: this.#defaultCacheLifeMinutes\r\n },\r\n\r\n logging: options?.logging ?? {\r\n dataCached: false,\r\n cachedDataReturned: false,\r\n freshDataReturned: false,\r\n cacheCleared: false\r\n }\r\n };\r\n }\r\n \r\n getUsers(includePhoto = false, includeDisabled = false, parentOU = ''): Observable<CleavelandPriceUser[]> {\r\n // If caching is enabled, there will be two calls to the API if the cache is null/expired\r\n // One call is to update the cache and the other is to return the data that the user requested\r\n // Subsequent calls will bypass the API and returned cached data until it expires\r\n\r\n const observable$ = this.#services.http.get<CleavelandPriceUser[]>(`${this.apiUrl}/users/${includePhoto}/${includeDisabled}/${parentOU}`);\r\n\r\n if (this.options.caching!.enabled) {\r\n if (this.#cacheExpired) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.#cache = {\r\n data,\r\n lastUpdate: DateTime.now()\r\n };\r\n\r\n if (this.options.logging!.dataCached) {\r\n console.log(`Data cached for ${this.options.caching!.lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.options.logging!.cachedDataReturned) {\r\n console.log('Returning cached users');\r\n }\r\n\r\n return of(this.#cache!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.options.logging!.freshDataReturned) {\r\n console.log('Returning fresh users');\r\n }\r\n\r\n return observable$;\r\n }\r\n\r\n getUser(accountName: string, includePhoto = false): Observable<CleavelandPriceUser> {\r\n return this.#services.http.get<CleavelandPriceUser>(`${this.apiUrl}/users/name/${accountName}/${includePhoto}`);\r\n }\r\n\r\n clearCache(): void {\r\n this.#cache = undefined;\r\n\r\n if (this.options.logging!.cacheCleared) {\r\n console.log('Cache cleared');\r\n }\r\n }\r\n\r\n getDomains(): Observable<ADObject[]> {\r\n return this.#services.http.get<ADObject[]>(`${this.apiUrl}/activedirectory/domains`);\r\n }\r\n\r\n getOUs(parentOU = ''): Observable<ADObjectWithChildren[]> {\r\n return this.#services.http.get<ADObjectWithChildren[]>(`${this.apiUrl}/activedirectory/ous/${parentOU}`);\r\n }\r\n\r\n getContainers(parentOU = ''): Observable<ADObjectWithChildren[]> {\r\n return this.#services.http.get<ADObjectWithChildren[]>(`${this.apiUrl}/activedirectory/containers/${parentOU}`);\r\n }\r\n\r\n getGroups(parentOU = ''): Observable<Group[]> {\r\n return this.#services.http.get<Group[]>(`${this.apiUrl}/activedirectory/groups/${parentOU}`);\r\n }\r\n\r\n getDistinctUserAttributeValues(attributeName: string) : Observable<any[]> {\r\n return this.#services.http.get<any[]>(`${this.apiUrl}/activedirectory/distinct/${attributeName}`);\r\n }\r\n\r\n getDepartments() : Observable<string[]> {\r\n return this.#services.http.get<string[]>(`${this.apiUrl}/activedirectory/departments`);\r\n }\r\n\r\n getTitles() : Observable<string[]> {\r\n return this.#services.http.get<string[]>(`${this.apiUrl}/activedirectory/titles`);\r\n }\r\n\r\n getComputers(includeDisabled = false, parentOU = ''): Observable<User[]> {\r\n return this.#services.http.get<User[]>(`${this.apiUrl}/activedirectory/computers/${includeDisabled}/${parentOU}`);\r\n }\r\n\r\n getServers(includeDisabled = false, parentOU = ''): Observable<User[]> {\r\n return this.#services.http.get<User[]>(`${this.apiUrl}/activedirectory/servers/${includeDisabled}/${parentOU}`);\r\n }\r\n\r\n getWorkstations(includeDisabled = false, parentOU = ''): Observable<User[]> {\r\n return this.#services.http.get<User[]>(`${this.apiUrl}/activedirectory/workstations/${includeDisabled}/${parentOU}`);\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\n\r\nimport { ActiveDirectoryServiceOptions } from './model/active-directory-service-options';\r\nimport { ActiveDirectoryServiceOptionsToken } from './model/active-directory-service-options-token';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: []\r\n})\r\nexport class ActiveDirectoryModule {\r\n static forRoot(config: ActiveDirectoryServiceOptions): ModuleWithProviders<ActiveDirectoryModule> {\r\n return {\r\n ngModule: ActiveDirectoryModule,\r\n providers: [\r\n {\r\n provide: ActiveDirectoryServiceOptionsToken,\r\n useValue: config\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: ActiveDirectoryModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'ActiveDirectoryModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './active-directory.api';\n"],"names":[],"mappings":";;;;;;;;MAGa,kCAAkC,GAAG,IAAI,cAAc,CAAgC,EAAE;;ACehG,MAAO,sBAAuB,SAAQ,iBAAiB,CAAA;AAC3D,IAAA,SAAS,GAAG;AACV,QAAA,IAAI,EAAE,MAAM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B;AAC/B,YAAA,SAAS,EAAE;AACT,gBAAA;AACE,oBAAA,OAAO,EAAE,kCAAkC;AAC3C,oBAAA,QAAQ,EAAE;AACX;AACF;SACF;;AAGH,IAAA,WAAA,CAAoC,YAAmC,EAAA;QACrE,IAAI,YAAY,EAAE;AAChB,YAAA,MAAM,IAAI,KAAK,CACb,0EAA0E,CAAC;;;8GAhBtE,qBAAqB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,qBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAJ9B,YAAY,CAAA,EAAA,CAAA,CAAA;AAIH,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAJ9B,YAAY,CAAA,EAAA,CAAA,CAAA;;2FAIH,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAPjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;AACV,iBAAA;;0BAcc;;0BAAY;;;AC1B3B;;AAEG;;;;"}
|
|
@@ -63,10 +63,10 @@ class MatAuthenticationService extends AuthenticationTokenService {
|
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
67
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
66
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: MatAuthenticationService, deps: [{ token: MatAuthenticationServiceOptionsToken, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
67
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: MatAuthenticationService, providedIn: 'root' }); }
|
|
68
68
|
}
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: MatAuthenticationService, decorators: [{
|
|
70
70
|
type: Injectable,
|
|
71
71
|
args: [{
|
|
72
72
|
providedIn: 'root'
|
|
@@ -130,12 +130,12 @@ class LoginFormComponent {
|
|
|
130
130
|
localStorage.setItem(keyName, 'true');
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
134
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
133
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LoginFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
134
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: LoginFormComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<h2 mat-dialog-title>\n @if (services.authentication.authenticating) {\n <span>Authenticating...</span>\n } @else {\n <span>Login</span>\n }\n</h2>\n\n<mat-dialog-content>\n @if (services.authentication.authenticating) {\n <div id=\"spinner\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\n </div>\n } @else if (errorMessage) {\n <div id=\"error\">\n {{ errorMessage }}\n </div>\n } @else {\n <form [formGroup]=\"form\">\n <mat-form-field>\n <input matInput formControlName=\"username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n <mat-form-field>\n <input matInput formControlName=\"password\" type=\"password\" placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n @if (services.authentication.options.showRememberMeOption) {\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\n Remember me next time\n </mat-slide-toggle>\n }\n </form>\n }\n</mat-dialog-content>\n\n@if (!services.authentication.authenticating) {\n <mat-dialog-actions>\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\n [disabled]=\"form.invalid\">\n <mat-icon fontIcon=\"done\"/>\n <span>OK</span>\n </button>\n <button mat-raised-button (click)=\"services.dialogRef.close()\">\n <mat-icon fontIcon=\"close\"/>\n <span>Cancel</span>\n </button>\n </mat-dialog-actions>\n}", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}form{display:grid;gap:1rem}mat-dialog-actions{display:grid;justify-content:center;grid-template-columns:auto auto;gap:1rem}#error{color:red}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "component", type: MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon", "disabledInteractive"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] }); }
|
|
135
135
|
}
|
|
136
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
136
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LoginFormComponent, decorators: [{
|
|
137
137
|
type: Component,
|
|
138
|
-
args: [{
|
|
138
|
+
args: [{ imports: [
|
|
139
139
|
MatButton,
|
|
140
140
|
MatDialogActions,
|
|
141
141
|
MatDialogContent,
|
|
@@ -145,7 +145,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImpor
|
|
|
145
145
|
MatProgressSpinner,
|
|
146
146
|
MatSlideToggle,
|
|
147
147
|
ReactiveFormsModule
|
|
148
|
-
], template: "<h2 mat-dialog-title>\
|
|
148
|
+
], template: "<h2 mat-dialog-title>\n @if (services.authentication.authenticating) {\n <span>Authenticating...</span>\n } @else {\n <span>Login</span>\n }\n</h2>\n\n<mat-dialog-content>\n @if (services.authentication.authenticating) {\n <div id=\"spinner\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\n </div>\n } @else if (errorMessage) {\n <div id=\"error\">\n {{ errorMessage }}\n </div>\n } @else {\n <form [formGroup]=\"form\">\n <mat-form-field>\n <input matInput formControlName=\"username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n <mat-form-field>\n <input matInput formControlName=\"password\" type=\"password\" placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n @if (services.authentication.options.showRememberMeOption) {\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\n Remember me next time\n </mat-slide-toggle>\n }\n </form>\n }\n</mat-dialog-content>\n\n@if (!services.authentication.authenticating) {\n <mat-dialog-actions>\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\n [disabled]=\"form.invalid\">\n <mat-icon fontIcon=\"done\"/>\n <span>OK</span>\n </button>\n <button mat-raised-button (click)=\"services.dialogRef.close()\">\n <mat-icon fontIcon=\"close\"/>\n <span>Cancel</span>\n </button>\n </mat-dialog-actions>\n}", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}form{display:grid;gap:1rem}mat-dialog-actions{display:grid;justify-content:center;grid-template-columns:auto auto;gap:1rem}#error{color:red}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"] }]
|
|
149
149
|
}] });
|
|
150
150
|
|
|
151
151
|
class LoginComponent {
|
|
@@ -180,14 +180,14 @@ class LoginComponent {
|
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
184
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
183
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LoginComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
184
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.0", type: LoginComponent, isStandalone: true, selector: "cp-login", inputs: { adminGroup: { classPropertyName: "adminGroup", publicName: "adminGroup", isSignal: true, isRequired: false, transformFunction: null }, additionalInfo: { classPropertyName: "additionalInfo", publicName: "additionalInfo", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div id=\"user-id\">\n <!-- Logged out -->\n <!-- Logged in -->\n @if (services.authentication.authenticated) {\n <!-- With photo -->\n @if (services.authentication.authenticatedUser?.photoUrl) {\n <img\n id=\"authenticated-user-image\"\n [src]=\"services.authentication.authenticatedUser?.photoUrl\"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\" />\n } @else {\n <!-- Without photo -->\n <mat-icon\n fontIcon=\"account_circle\"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\">\n </mat-icon>\n }\n <!-- Name -->\n <div id=\"user-name\">\n {{ services.authentication.authenticatedUser?.displayName }}\n </div>\n } @else {\n <mat-icon\n fontIcon=\"account_circle\"\n matTooltip=\"Login\"\n (click)=\"login()\">\n </mat-icon>\n }\n</div>", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}mat-icon{font-size:2em!important;height:2em!important;width:2em!important}img{border-radius:100%;width:2em;height:2em}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"], dependencies: [{ kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }] }); }
|
|
185
185
|
}
|
|
186
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
186
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: LoginComponent, decorators: [{
|
|
187
187
|
type: Component,
|
|
188
|
-
args: [{ selector: 'cp-login',
|
|
188
|
+
args: [{ selector: 'cp-login', imports: [
|
|
189
189
|
MatIcon,
|
|
190
|
-
], template: "<div id=\"user-id\">\
|
|
190
|
+
], template: "<div id=\"user-id\">\n <!-- Logged out -->\n <!-- Logged in -->\n @if (services.authentication.authenticated) {\n <!-- With photo -->\n @if (services.authentication.authenticatedUser?.photoUrl) {\n <img\n id=\"authenticated-user-image\"\n [src]=\"services.authentication.authenticatedUser?.photoUrl\"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\" />\n } @else {\n <!-- Without photo -->\n <mat-icon\n fontIcon=\"account_circle\"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\">\n </mat-icon>\n }\n <!-- Name -->\n <div id=\"user-name\">\n {{ services.authentication.authenticatedUser?.displayName }}\n </div>\n } @else {\n <mat-icon\n fontIcon=\"account_circle\"\n matTooltip=\"Login\"\n (click)=\"login()\">\n </mat-icon>\n }\n</div>", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}mat-icon{font-size:2em!important;height:2em!important;width:2em!important}img{border-radius:100%;width:2em;height:2em}\n", ".material-icons{font-family:Material Icons;font-weight:400;font-style:normal;font-size:24px;display:inline-block;line-height:1;text-transform:none;letter-spacing:normal;word-wrap:normal;white-space:nowrap;direction:ltr;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:\"liga\"}\n"] }]
|
|
191
191
|
}] });
|
|
192
192
|
|
|
193
193
|
class MatAuthenticationModule {
|
|
@@ -207,8 +207,8 @@ class MatAuthenticationModule {
|
|
|
207
207
|
throw new Error('MatAuthenticationModule is already loaded. Import it in the AppModule only');
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
211
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
210
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: MatAuthenticationModule, deps: [{ token: MatAuthenticationModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
211
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: MatAuthenticationModule, imports: [CommonModule,
|
|
212
212
|
ReactiveFormsModule,
|
|
213
213
|
MatButtonModule,
|
|
214
214
|
MatDialogModule,
|
|
@@ -220,7 +220,7 @@ class MatAuthenticationModule {
|
|
|
220
220
|
LoginComponent,
|
|
221
221
|
LoginFormComponent], exports: [LoginComponent,
|
|
222
222
|
LoginFormComponent] }); }
|
|
223
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
223
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: MatAuthenticationModule, imports: [CommonModule,
|
|
224
224
|
ReactiveFormsModule,
|
|
225
225
|
MatButtonModule,
|
|
226
226
|
MatDialogModule,
|
|
@@ -232,7 +232,7 @@ class MatAuthenticationModule {
|
|
|
232
232
|
LoginComponent,
|
|
233
233
|
LoginFormComponent] }); }
|
|
234
234
|
}
|
|
235
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
235
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: MatAuthenticationModule, decorators: [{
|
|
236
236
|
type: NgModule,
|
|
237
237
|
args: [{
|
|
238
238
|
declarations: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleavelandprice-ngx-lib-authentication-material.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/model/mat-authentication-service-options-token.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/services/mat-authentication.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login-form/login-form.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login-form/login-form.component.html","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login/login.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login/login.component.html","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/mat-authentication.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/cleavelandprice-ngx-lib-authentication-material.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { MatAuthenticationServiceOptions } from \"./mat-authentication-service-options\";\r\n\r\nexport const MatAuthenticationServiceOptionsToken = new InjectionToken<MatAuthenticationServiceOptions>('');","import { Inject, inject, Injectable, Optional } from '@angular/core';\r\nimport { JwtHelperService } from '@auth0/angular-jwt';\r\n\r\nimport { SharePointService } from '@cleavelandprice/ngx-lib/sharepoint';\r\n\r\nimport {\r\n AuthenticationToken,\r\n AuthenticationTokenService\r\n} from '@cleavelandprice/ngx-lib/authentication/token';\r\nimport { MatAuthenticationServiceOptions } from '../model/mat-authentication-service-options';\r\nimport { MatAuthenticationServiceOptionsToken } from '../model/mat-authentication-service-options-token';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class MatAuthenticationService extends AuthenticationTokenService {\r\n #sharePointService = inject(SharePointService);\r\n\r\n override options!: MatAuthenticationServiceOptions;\r\n\r\n //#region Lifecycle\r\n constructor(@Optional() @Inject(MatAuthenticationServiceOptionsToken) constructorOptions: MatAuthenticationServiceOptions) {\r\n super({...constructorOptions, deferTokenValidation: true});\r\n\r\n // When super() was called, the parent class defined the 'options' object with all of the other properties\r\n this.options = { ...this.options, ...constructorOptions };\r\n this.checkForExistingToken();\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n override validateUser(token: string): void {\r\n const jwtHelper = new JwtHelperService();\r\n const decoded = jwtHelper.decodeToken(token) as AuthenticationToken;\r\n\r\n if (jwtHelper.isTokenExpired(token)) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n this.authenticatedUser = {\r\n admin: decoded.role === 'Admin',\r\n displayName: decoded.displayName,\r\n accountName: decoded.winaccountname,\r\n distinguishedName: decoded.distinguishedName,\r\n employeeNumber: decoded.employeeNumber,\r\n memberOf: decoded.memberOf\r\n };\r\n\r\n this.storage.setItem(this.options.tokenName!, token);\r\n\r\n this.#getPhoto();\r\n \r\n this.authenticated = true;\r\n this.authenticatedChanged.emit(this.authenticated);\r\n\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n }\r\n\r\n #getPhoto(): void {\r\n this.#sharePointService.getPhotos()\r\n .subscribe(photos => {\r\n // The user may have been logged out by the time the photos came back\r\n if (!this.authenticatedUser?.employeeNumber) {\r\n return;\r\n }\r\n\r\n const photo = photos.find(pic => pic.employeeNumber === +this.authenticatedUser!.employeeNumber);\r\n\r\n if (photo) {\r\n this.authenticatedUser.photoUrl = photo.encodedAbsUrl;\r\n }\r\n });\r\n }\r\n //#endregion\r\n}","import { Component, inject, OnDestroy, OnInit, OutputRefSubscription } from '@angular/core';\r\nimport { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';\r\nimport { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog';\r\n\r\nimport { MatButton } from '@angular/material/button';\r\nimport { MatFormField } from '@angular/material/form-field';\r\nimport { MatIcon } from '@angular/material/icon';\r\nimport { MatInput } from '@angular/material/input';\r\nimport { MatProgressSpinner } from '@angular/material/progress-spinner';\r\nimport { MatSlideToggle } from '@angular/material/slide-toggle';\r\nimport { LoginFormData } from '../../model/login-form-data';\r\nimport { MatAuthenticationService } from '../../services/mat-authentication.service';\r\n\r\n@Component({\r\n templateUrl: './login-form.component.html',\r\n standalone: true,\r\n imports: [\r\n MatButton,\r\n MatDialogActions,\r\n MatDialogContent,\r\n MatFormField,\r\n MatIcon,\r\n MatInput,\r\n MatProgressSpinner,\r\n MatSlideToggle,\r\n ReactiveFormsModule\r\n ],\r\n styleUrls: [\r\n './login-form.component.scss',\r\n '../../../../../styles/mat-icon.scss'\r\n ]\r\n})\r\nexport class LoginFormComponent implements OnInit, OnDestroy {\r\n #data = inject<LoginFormData>(MAT_DIALOG_DATA);\r\n\r\n services = {\r\n dialogRef: inject(MatDialogRef<LoginFormComponent>),\r\n authentication: inject(MatAuthenticationService)\r\n };\r\n \r\n errorMessage?: string;\r\n authenticatedChangedSubscription!: OutputRefSubscription;\r\n authenticationErrorSubscription!: OutputRefSubscription;\r\n\r\n form = new FormGroup({\r\n username: new FormControl(null, [ Validators.required ]),\r\n password: new FormControl(null, [ Validators.required ]),\r\n adminGroup: new FormControl(),\r\n additionalInfo: new FormControl()\r\n });\r\n \r\n ngOnInit(): void {\r\n this.form.get('adminGroup')?.setValue(this.#data.adminGroup);\r\n this.form.get('additionalInfo')?.setValue(this.#data.additionalInfo);\r\n\r\n this.authenticatedChangedSubscription = this.services.authentication.authenticatedChanged\r\n .subscribe(this.#authChangedHandler.bind(this));\r\n\r\n this.authenticationErrorSubscription = this.services.authentication.authenticationError\r\n .subscribe(this.#errorHandler.bind(this));\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.authenticationErrorSubscription.unsubscribe();\r\n this.authenticatedChangedSubscription.unsubscribe();\r\n }\r\n\r\n authenticate() {\r\n this.errorMessage = undefined;\r\n const { username, password, adminGroup, additionalInfo } = this.form.value;\r\n this.services.authentication.login(username!, password!, adminGroup, additionalInfo);\r\n }\r\n\r\n #authChangedHandler(authenticated: boolean): void {\r\n if (authenticated) {\r\n this.services.dialogRef.close();\r\n }\r\n }\r\n\r\n #errorHandler(err: any): void {\r\n console.log('Authentication error', err);\r\n this.errorMessage = `${err.name}: ${err.statusText}`;\r\n }\r\n\r\n changeTokenStorageMode(checked: boolean): void {\r\n const keyName = 'storeTokenInSession';\r\n\r\n if (checked) {\r\n if (localStorage.getItem(keyName)) {\r\n localStorage.removeItem(keyName);\r\n }\r\n } else {\r\n localStorage.setItem(keyName, 'true');\r\n }\r\n }\r\n}\r\n","<h2 mat-dialog-title>\r\n @if (services.authentication.authenticating) {\r\n <span>Authenticating...</span>\r\n } @else {\r\n <span>Login</span>\r\n }\r\n</h2>\r\n\r\n<mat-dialog-content>\r\n @if (services.authentication.authenticating) {\r\n <div id=\"spinner\">\r\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\r\n </div>\r\n } @else if (errorMessage) {\r\n <div id=\"error\">\r\n {{ errorMessage }}\r\n </div>\r\n } @else {\r\n <form [formGroup]=\"form\">\r\n <mat-form-field>\r\n <input matInput formControlName=\"username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput formControlName=\"password\" type=\"password\" placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n @if (services.authentication.options.showRememberMeOption) {\r\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\r\n Remember me next time\r\n </mat-slide-toggle>\r\n }\r\n </form>\r\n }\r\n</mat-dialog-content>\r\n\r\n@if (!services.authentication.authenticating) {\r\n <mat-dialog-actions>\r\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\r\n [disabled]=\"form.invalid\">\r\n <mat-icon fontIcon=\"done\"/>\r\n <span>OK</span>\r\n </button>\r\n <button mat-raised-button (click)=\"services.dialogRef.close()\">\r\n <mat-icon fontIcon=\"close\"/>\r\n <span>Cancel</span>\r\n </button>\r\n </mat-dialog-actions>\r\n}","import { Component, inject, input } from '@angular/core';\r\nimport { MatDialog } from '@angular/material/dialog';\r\nimport { ConfirmationComponent } from '@cleavelandprice/ngx-lib/dialog';\r\n\r\nimport { MatIcon } from '@angular/material/icon';\r\nimport { MatAuthenticationService } from '../../services/mat-authentication.service';\r\nimport { LoginFormComponent } from '../login-form/login-form.component';\r\n\r\n@Component({\r\n selector: 'cp-login',\r\n standalone: true,\r\n imports: [\r\n MatIcon,\r\n ],\r\n templateUrl: './login.component.html',\r\n styleUrls: [\r\n './login.component.scss',\r\n '../../../../../styles/mat-icon.scss'\r\n ]\r\n})\r\nexport class LoginComponent {\r\n #services = {\r\n dialog: inject(MatDialog)\r\n };\r\n services = {\r\n authentication: inject(MatAuthenticationService)\r\n };\r\n //#endregion\r\n\r\n adminGroup = input<string>();\r\n additionalInfo = input<string>();\r\n\r\n login(): void {\r\n this.#services.dialog.open(LoginFormComponent, {\r\n data: {\r\n adminGroup: this.adminGroup(),\r\n additionalInfo: this.additionalInfo()\r\n }\r\n });\r\n }\r\n\r\n confirmLogout(): void {\r\n this.#services.dialog.open(ConfirmationComponent, {\r\n data: { message: `Are you sure you want to logout?` }\r\n })\r\n .afterClosed()\r\n .subscribe(result => {\r\n if (result) {\r\n this.services.authentication.logout();\r\n }\r\n });\r\n }\r\n}\r\n","<div id=\"user-id\">\r\n <!-- Logged out -->\r\n <!-- Logged in -->\r\n @if (services.authentication.authenticated) {\r\n <!-- With photo -->\r\n @if (services.authentication.authenticatedUser?.photoUrl) {\r\n <img\r\n id=\"authenticated-user-image\"\r\n [src]=\"services.authentication.authenticatedUser?.photoUrl\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\" />\r\n } @else {\r\n <!-- Without photo -->\r\n <mat-icon\r\n fontIcon=\"account_circle\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\">\r\n </mat-icon>\r\n }\r\n <!-- Name -->\r\n <div id=\"user-name\">\r\n {{ services.authentication.authenticatedUser?.displayName }}\r\n </div>\r\n } @else {\r\n <mat-icon\r\n fontIcon=\"account_circle\"\r\n matTooltip=\"Login\"\r\n (click)=\"login()\">\r\n </mat-icon>\r\n }\r\n</div>","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { ReactiveFormsModule } from '@angular/forms';\r\n\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\r\n\r\nimport { MatAuthenticationServiceOptions } from './model/mat-authentication-service-options';\r\n\r\n\r\nimport { LoginFormComponent } from './components/login-form/login-form.component';\r\nimport { LoginComponent } from './components/login/login.component';\r\nimport { MatAuthenticationServiceOptionsToken } from './model/mat-authentication-service-options-token';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n \r\n MatButtonModule,\r\n MatDialogModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatProgressSpinnerModule,\r\n MatSlideToggleModule,\r\n\r\n LoginComponent,\r\n LoginFormComponent\r\n ],\r\n exports: [\r\n LoginComponent,\r\n LoginFormComponent\r\n ]\r\n})\r\nexport class MatAuthenticationModule {\r\n static forRoot(options: MatAuthenticationServiceOptions): ModuleWithProviders<MatAuthenticationModule> {\r\n return {\r\n ngModule: MatAuthenticationModule,\r\n providers: [\r\n {\r\n provide: MatAuthenticationServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: MatAuthenticationModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'MatAuthenticationModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './mat-authentication.api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAGa,oCAAoC,GAAG,IAAI,cAAc,CAAkC,EAAE;;ACYpG,MAAO,wBAAyB,SAAQ,0BAA0B,CAAA;AACtE,IAAA,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;;AAK/C,IAAA,WAAA,CAAsE,kBAAmD,EAAA;QACvH,KAAK,CAAC,EAAC,GAAG,kBAAkB,EAAE,oBAAoB,EAAE,IAAI,EAAC,CAAC,CAAC;;AAG3D,QAAA,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,kBAAkB,EAAE,CAAC;QAC1D,IAAI,CAAC,qBAAqB,EAAE,CAAC;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AACd,YAAA,kBAAkB,aAGlB,cAAc;YACd,kBAAkB,CAAA,EAAA,CAAA,CAAA,EAAA;AAGT,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAuB,YAnBhC,YAAY;YACZ,mBAAmB;YAEnB,eAAe;YACf,eAAe;YACf,kBAAkB;YAClB,aAAa;YACb,cAAc;YACd,wBAAwB;YACxB,oBAAoB;YAEpB,cAAc;YACd,kBAAkB,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAOT,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAtBnC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBAEnB,eAAe;wBACf,eAAe;wBACf,kBAAkB;wBAClB,aAAa;wBACb,cAAc;wBACd,wBAAwB;wBACxB,oBAAoB;wBAEpB,cAAc;wBACd,kBAAkB;AACnB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,cAAc;wBACd,kBAAkB;AACnB,qBAAA;AACF,iBAAA,CAAA;;0BAcc,QAAQ;;0BAAI,QAAQ;;;ACtDnC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cleavelandprice-ngx-lib-authentication-material.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/model/mat-authentication-service-options-token.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/services/mat-authentication.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login-form/login-form.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login-form/login-form.component.html","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login/login.component.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/components/login/login.component.html","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/mat-authentication.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/material/src/cleavelandprice-ngx-lib-authentication-material.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { MatAuthenticationServiceOptions } from \"./mat-authentication-service-options\";\r\n\r\nexport const MatAuthenticationServiceOptionsToken = new InjectionToken<MatAuthenticationServiceOptions>('');","import { Inject, inject, Injectable, Optional } from '@angular/core';\r\nimport { JwtHelperService } from '@auth0/angular-jwt';\r\n\r\nimport { SharePointService } from '@cleavelandprice/ngx-lib/sharepoint';\r\n\r\nimport {\r\n AuthenticationToken,\r\n AuthenticationTokenService\r\n} from '@cleavelandprice/ngx-lib/authentication/token';\r\nimport { MatAuthenticationServiceOptions } from '../model/mat-authentication-service-options';\r\nimport { MatAuthenticationServiceOptionsToken } from '../model/mat-authentication-service-options-token';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class MatAuthenticationService extends AuthenticationTokenService {\r\n #sharePointService = inject(SharePointService);\r\n\r\n override options!: MatAuthenticationServiceOptions;\r\n\r\n //#region Lifecycle\r\n constructor(@Optional() @Inject(MatAuthenticationServiceOptionsToken) constructorOptions: MatAuthenticationServiceOptions) {\r\n super({...constructorOptions, deferTokenValidation: true});\r\n\r\n // When super() was called, the parent class defined the 'options' object with all of the other properties\r\n this.options = { ...this.options, ...constructorOptions };\r\n this.checkForExistingToken();\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n override validateUser(token: string): void {\r\n const jwtHelper = new JwtHelperService();\r\n const decoded = jwtHelper.decodeToken(token) as AuthenticationToken;\r\n\r\n if (jwtHelper.isTokenExpired(token)) {\r\n this.logout();\r\n return;\r\n }\r\n\r\n this.authenticatedUser = {\r\n admin: decoded.role === 'Admin',\r\n displayName: decoded.displayName,\r\n accountName: decoded.winaccountname,\r\n distinguishedName: decoded.distinguishedName,\r\n employeeNumber: decoded.employeeNumber,\r\n memberOf: decoded.memberOf\r\n };\r\n\r\n this.storage.setItem(this.options.tokenName!, token);\r\n\r\n this.#getPhoto();\r\n \r\n this.authenticated = true;\r\n this.authenticatedChanged.emit(this.authenticated);\r\n\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n }\r\n\r\n #getPhoto(): void {\r\n this.#sharePointService.getPhotos()\r\n .subscribe(photos => {\r\n // The user may have been logged out by the time the photos came back\r\n if (!this.authenticatedUser?.employeeNumber) {\r\n return;\r\n }\r\n\r\n const photo = photos.find(pic => pic.employeeNumber === +this.authenticatedUser!.employeeNumber);\r\n\r\n if (photo) {\r\n this.authenticatedUser.photoUrl = photo.encodedAbsUrl;\r\n }\r\n });\r\n }\r\n //#endregion\r\n}","import { Component, inject, OnDestroy, OnInit, OutputRefSubscription } from '@angular/core';\r\nimport { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';\r\nimport { MAT_DIALOG_DATA, MatDialogActions, MatDialogContent, MatDialogRef } from '@angular/material/dialog';\r\n\r\nimport { MatButton } from '@angular/material/button';\r\nimport { MatFormField } from '@angular/material/form-field';\r\nimport { MatIcon } from '@angular/material/icon';\r\nimport { MatInput } from '@angular/material/input';\r\nimport { MatProgressSpinner } from '@angular/material/progress-spinner';\r\nimport { MatSlideToggle } from '@angular/material/slide-toggle';\r\nimport { LoginFormData } from '../../model/login-form-data';\r\nimport { MatAuthenticationService } from '../../services/mat-authentication.service';\r\n\r\n@Component({\n templateUrl: './login-form.component.html',\n imports: [\n MatButton,\n MatDialogActions,\n MatDialogContent,\n MatFormField,\n MatIcon,\n MatInput,\n MatProgressSpinner,\n MatSlideToggle,\n ReactiveFormsModule\n ],\n styleUrls: [\n './login-form.component.scss',\n '../../../../../styles/mat-icon.scss'\n ]\n})\r\nexport class LoginFormComponent implements OnInit, OnDestroy {\r\n #data = inject<LoginFormData>(MAT_DIALOG_DATA);\r\n\r\n services = {\r\n dialogRef: inject(MatDialogRef<LoginFormComponent>),\r\n authentication: inject(MatAuthenticationService)\r\n };\r\n \r\n errorMessage?: string;\r\n authenticatedChangedSubscription!: OutputRefSubscription;\r\n authenticationErrorSubscription!: OutputRefSubscription;\r\n\r\n form = new FormGroup({\r\n username: new FormControl(null, [ Validators.required ]),\r\n password: new FormControl(null, [ Validators.required ]),\r\n adminGroup: new FormControl(),\r\n additionalInfo: new FormControl()\r\n });\r\n \r\n ngOnInit(): void {\r\n this.form.get('adminGroup')?.setValue(this.#data.adminGroup);\r\n this.form.get('additionalInfo')?.setValue(this.#data.additionalInfo);\r\n\r\n this.authenticatedChangedSubscription = this.services.authentication.authenticatedChanged\r\n .subscribe(this.#authChangedHandler.bind(this));\r\n\r\n this.authenticationErrorSubscription = this.services.authentication.authenticationError\r\n .subscribe(this.#errorHandler.bind(this));\r\n }\r\n\r\n ngOnDestroy(): void {\r\n this.authenticationErrorSubscription.unsubscribe();\r\n this.authenticatedChangedSubscription.unsubscribe();\r\n }\r\n\r\n authenticate() {\r\n this.errorMessage = undefined;\r\n const { username, password, adminGroup, additionalInfo } = this.form.value;\r\n this.services.authentication.login(username!, password!, adminGroup, additionalInfo);\r\n }\r\n\r\n #authChangedHandler(authenticated: boolean): void {\r\n if (authenticated) {\r\n this.services.dialogRef.close();\r\n }\r\n }\r\n\r\n #errorHandler(err: any): void {\r\n console.log('Authentication error', err);\r\n this.errorMessage = `${err.name}: ${err.statusText}`;\r\n }\r\n\r\n changeTokenStorageMode(checked: boolean): void {\r\n const keyName = 'storeTokenInSession';\r\n\r\n if (checked) {\r\n if (localStorage.getItem(keyName)) {\r\n localStorage.removeItem(keyName);\r\n }\r\n } else {\r\n localStorage.setItem(keyName, 'true');\r\n }\r\n }\r\n}\r\n","<h2 mat-dialog-title>\n @if (services.authentication.authenticating) {\n <span>Authenticating...</span>\n } @else {\n <span>Login</span>\n }\n</h2>\n\n<mat-dialog-content>\n @if (services.authentication.authenticating) {\n <div id=\"spinner\">\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"/>\n </div>\n } @else if (errorMessage) {\n <div id=\"error\">\n {{ errorMessage }}\n </div>\n } @else {\n <form [formGroup]=\"form\">\n <mat-form-field>\n <input matInput formControlName=\"username\" placeholder=\"Username\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n <mat-form-field>\n <input matInput formControlName=\"password\" type=\"password\" placeholder=\"Password\" (keyup.enter)=\"authenticate()\">\n </mat-form-field>\n @if (services.authentication.options.showRememberMeOption) {\n <mat-slide-toggle [checked]=\"!services.authentication.useSessionStorage\" (change)=\"changeTokenStorageMode($event.checked)\">\n Remember me next time\n </mat-slide-toggle>\n }\n </form>\n }\n</mat-dialog-content>\n\n@if (!services.authentication.authenticating) {\n <mat-dialog-actions>\n <button mat-raised-button color=\"primary\" (click)=\"authenticate()\"\n [disabled]=\"form.invalid\">\n <mat-icon fontIcon=\"done\"/>\n <span>OK</span>\n </button>\n <button mat-raised-button (click)=\"services.dialogRef.close()\">\n <mat-icon fontIcon=\"close\"/>\n <span>Cancel</span>\n </button>\n </mat-dialog-actions>\n}","import { Component, inject, input } from '@angular/core';\r\nimport { MatDialog } from '@angular/material/dialog';\r\nimport { ConfirmationComponent } from '@cleavelandprice/ngx-lib/dialog';\r\n\r\nimport { MatIcon } from '@angular/material/icon';\r\nimport { MatAuthenticationService } from '../../services/mat-authentication.service';\r\nimport { LoginFormComponent } from '../login-form/login-form.component';\r\n\r\n@Component({\n selector: 'cp-login',\n imports: [\n MatIcon,\n ],\n templateUrl: './login.component.html',\n styleUrls: [\n './login.component.scss',\n '../../../../../styles/mat-icon.scss'\n ]\n})\r\nexport class LoginComponent {\r\n #services = {\r\n dialog: inject(MatDialog)\r\n };\r\n services = {\r\n authentication: inject(MatAuthenticationService)\r\n };\r\n //#endregion\r\n\r\n adminGroup = input<string>();\r\n additionalInfo = input<string>();\r\n\r\n login(): void {\r\n this.#services.dialog.open(LoginFormComponent, {\r\n data: {\r\n adminGroup: this.adminGroup(),\r\n additionalInfo: this.additionalInfo()\r\n }\r\n });\r\n }\r\n\r\n confirmLogout(): void {\r\n this.#services.dialog.open(ConfirmationComponent, {\r\n data: { message: `Are you sure you want to logout?` }\r\n })\r\n .afterClosed()\r\n .subscribe(result => {\r\n if (result) {\r\n this.services.authentication.logout();\r\n }\r\n });\r\n }\r\n}\r\n","<div id=\"user-id\">\n <!-- Logged out -->\n <!-- Logged in -->\n @if (services.authentication.authenticated) {\n <!-- With photo -->\n @if (services.authentication.authenticatedUser?.photoUrl) {\n <img\n id=\"authenticated-user-image\"\n [src]=\"services.authentication.authenticatedUser?.photoUrl\"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\" />\n } @else {\n <!-- Without photo -->\n <mat-icon\n fontIcon=\"account_circle\"\n matTooltip=\"Logout\"\n (click)=\"confirmLogout()\">\n </mat-icon>\n }\n <!-- Name -->\n <div id=\"user-name\">\n {{ services.authentication.authenticatedUser?.displayName }}\n </div>\n } @else {\n <mat-icon\n fontIcon=\"account_circle\"\n matTooltip=\"Login\"\n (click)=\"login()\">\n </mat-icon>\n }\n</div>","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { ReactiveFormsModule } from '@angular/forms';\r\n\r\nimport { MatButtonModule } from '@angular/material/button';\r\nimport { MatDialogModule } from '@angular/material/dialog';\r\nimport { MatFormFieldModule } from '@angular/material/form-field';\r\nimport { MatIconModule } from '@angular/material/icon';\r\nimport { MatInputModule } from '@angular/material/input';\r\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\r\nimport { MatSlideToggleModule } from '@angular/material/slide-toggle';\r\n\r\nimport { MatAuthenticationServiceOptions } from './model/mat-authentication-service-options';\r\n\r\n\r\nimport { LoginFormComponent } from './components/login-form/login-form.component';\r\nimport { LoginComponent } from './components/login/login.component';\r\nimport { MatAuthenticationServiceOptionsToken } from './model/mat-authentication-service-options-token';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule,\r\n ReactiveFormsModule,\r\n \r\n MatButtonModule,\r\n MatDialogModule,\r\n MatFormFieldModule,\r\n MatIconModule,\r\n MatInputModule,\r\n MatProgressSpinnerModule,\r\n MatSlideToggleModule,\r\n\r\n LoginComponent,\r\n LoginFormComponent\r\n ],\r\n exports: [\r\n LoginComponent,\r\n LoginFormComponent\r\n ]\r\n})\r\nexport class MatAuthenticationModule {\r\n static forRoot(options: MatAuthenticationServiceOptions): ModuleWithProviders<MatAuthenticationModule> {\r\n return {\r\n ngModule: MatAuthenticationModule,\r\n providers: [\r\n {\r\n provide: MatAuthenticationServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: MatAuthenticationModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'MatAuthenticationModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './mat-authentication.api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;MAGa,oCAAoC,GAAG,IAAI,cAAc,CAAkC,EAAE;;ACYpG,MAAO,wBAAyB,SAAQ,0BAA0B,CAAA;AACtE,IAAA,kBAAkB,GAAG,MAAM,CAAC,iBAAiB,CAAC;;AAK9C,IAAA,WAAA,CAAsE,kBAAmD,EAAA;QACvH,KAAK,CAAC,EAAC,GAAG,kBAAkB,EAAE,oBAAoB,EAAE,IAAI,EAAC,CAAC;;AAG1D,QAAA,IAAI,CAAC,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,EAAE,GAAG,kBAAkB,EAAE;QACzD,IAAI,CAAC,qBAAqB,EAAE;;;;AAKrB,IAAA,YAAY,CAAC,KAAa,EAAA;AACjC,QAAA,MAAM,SAAS,GAAG,IAAI,gBAAgB,EAAE;QACxC,MAAM,OAAO,GAAG,SAAS,CAAC,WAAW,CAAC,KAAK,CAAwB;AAEnE,QAAA,IAAI,SAAS,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE;YACnC,IAAI,CAA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c;;0BAAY;;;ACtD3B;;AAEG;;;;"}
|
|
@@ -2,7 +2,7 @@ import { AuthenticationServiceOptionsToken } from '@cleavelandprice/ngx-lib/auth
|
|
|
2
2
|
export * from '@cleavelandprice/ngx-lib/authentication';
|
|
3
3
|
import { HttpClient } from '@angular/common/http';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
|
-
import { inject,
|
|
5
|
+
import { inject, EventEmitter, Injectable, Optional, Inject, Output, NgModule, SkipSelf } from '@angular/core';
|
|
6
6
|
import { NgxLibServiceBase } from '@cleavelandprice/ngx-lib';
|
|
7
7
|
import { CommonModule } from '@angular/common';
|
|
8
8
|
|
|
@@ -29,11 +29,15 @@ class AuthenticationObjectService extends NgxLibServiceBase {
|
|
|
29
29
|
//config: inject(ServiceConfig, { optional: true }) ?? new ServiceConfig(),
|
|
30
30
|
http: inject(HttpClient)
|
|
31
31
|
};
|
|
32
|
-
this.authenticatedChanged = output();
|
|
33
|
-
this.authenticatingChanged = output();
|
|
34
|
-
this.authenticationError = output();
|
|
35
32
|
this.authenticating = false; // Flag set to true while the service is attempting to authenticate the user
|
|
36
33
|
this.authenticated = false; // Flag set to true when the user is successfully authenticated
|
|
34
|
+
// error NG8110: Unsupported call to the output function. This function can only be used as the initializer of a property on a @Component or @Directive class.
|
|
35
|
+
/*authenticatedChanged = output<boolean>();
|
|
36
|
+
authenticatingChanged = output<boolean>();
|
|
37
|
+
authenticationError = output();*/
|
|
38
|
+
this.authenticatedChanged = new EventEmitter();
|
|
39
|
+
this.authenticatingChanged = new EventEmitter();
|
|
40
|
+
this.authenticationError = new EventEmitter();
|
|
37
41
|
this.options = {
|
|
38
42
|
...options,
|
|
39
43
|
tokenName: 'userObject',
|
|
@@ -105,10 +109,10 @@ class AuthenticationObjectService extends NgxLibServiceBase {
|
|
|
105
109
|
}
|
|
106
110
|
}
|
|
107
111
|
}
|
|
108
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
109
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
112
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AuthenticationObjectService, deps: [{ token: AuthenticationServiceOptionsToken, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
113
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AuthenticationObjectService, providedIn: 'root' }); }
|
|
110
114
|
}
|
|
111
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AuthenticationObjectService, decorators: [{
|
|
112
116
|
type: Injectable,
|
|
113
117
|
args: [{
|
|
114
118
|
providedIn: 'root'
|
|
@@ -118,7 +122,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImpor
|
|
|
118
122
|
}, {
|
|
119
123
|
type: Inject,
|
|
120
124
|
args: [AuthenticationServiceOptionsToken]
|
|
121
|
-
}] }]
|
|
125
|
+
}] }], propDecorators: { authenticatedChanged: [{
|
|
126
|
+
type: Output
|
|
127
|
+
}], authenticatingChanged: [{
|
|
128
|
+
type: Output
|
|
129
|
+
}], authenticationError: [{
|
|
130
|
+
type: Output
|
|
131
|
+
}] } });
|
|
122
132
|
|
|
123
133
|
class AuthenticationObjectModule {
|
|
124
134
|
static forRoot(options) {
|
|
@@ -137,11 +147,11 @@ class AuthenticationObjectModule {
|
|
|
137
147
|
throw new Error('AuthenticationObjectModule is already loaded. Import it in the AppModule only');
|
|
138
148
|
}
|
|
139
149
|
}
|
|
140
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
141
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
142
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
150
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AuthenticationObjectModule, deps: [{ token: AuthenticationObjectModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
151
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: AuthenticationObjectModule, imports: [CommonModule] }); }
|
|
152
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AuthenticationObjectModule, imports: [CommonModule] }); }
|
|
143
153
|
}
|
|
144
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
154
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AuthenticationObjectModule, decorators: [{
|
|
145
155
|
type: NgModule,
|
|
146
156
|
args: [{
|
|
147
157
|
declarations: [],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleavelandprice-ngx-lib-authentication-object.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/object/src/services/authentication-object.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/object/src/authentication-object.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/object/src/cleavelandprice-ngx-lib-authentication-object.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\r\nimport { Inject, inject, Injectable, Optional, output } from '@angular/core';\r\n\r\nimport { User } from '@cleavelandprice/ngx-lib/active-directory';\r\n\r\nimport { AbstractAuthenticationService, AuthenticatedUser, AuthenticationRequest, AuthenticationServiceOptions, AuthenticationServiceOptionsToken } from '@cleavelandprice/ngx-lib/authentication';\r\n\r\nimport { NgxLibServiceBase } from '@cleavelandprice/ngx-lib';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthenticationObjectService extends NgxLibServiceBase implements AbstractAuthenticationService {\r\n //#region Fields\r\n #services = {\r\n //config: inject(ServiceConfig, { optional: true }) ?? new ServiceConfig(),\r\n http: inject(HttpClient)\r\n };\r\n authenticatedChanged = output<boolean>();\r\n authenticatingChanged = output<boolean>();\r\n authenticationError = output();\r\n authenticating = false; // Flag set to true while the service is attempting to authenticate the user\r\n authenticated = false; // Flag set to true when the user is successfully authenticated\r\n authenticatedUser?: AuthenticatedUser; // Object representing the authenticated user\r\n //#endregion\r\n\r\n //#region Properties\r\n get useSessionStorage(): boolean {\r\n return !!localStorage.getItem('storeTokenInSession');\r\n }\r\n\r\n get storage(): Storage {\r\n return this.useSessionStorage ?\r\n sessionStorage:\r\n localStorage;\r\n }\r\n //#endregion\r\n\r\n //#region Lifecycle\r\n constructor(@Optional() @Inject(AuthenticationServiceOptionsToken) private options: AuthenticationServiceOptions) {\r\n super(options);\r\n\r\n this.options = {\r\n ...options,\r\n\r\n tokenName: 'userObject',\r\n authenticationEndpoint: '/authenticate'\r\n };\r\n\r\n this.checkForExistingToken();\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n //Authenticate the user and store the token in Local Storage\r\n login(username: string, password: string, adminGroup?: string, additionalInfo?: string): void {\r\n const request: AuthenticationRequest = {\r\n username,\r\n password,\r\n adminGroup,\r\n additionalInfo,\r\n appName: this.options.appName\r\n };\r\n\r\n this.authenticating = true;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n\r\n this.#services.http.post(`${this.apiUrl}${this.options.authenticationEndpoint}`, request)\r\n .subscribe({\r\n next: (user) => {\r\n if (user) {\r\n this.validateUser(user as User);\r\n } else {\r\n this.logout();\r\n }\r\n },\r\n error: (err) => {\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n this.authenticationError.emit(err);\r\n }\r\n });\r\n }\r\n \r\n //Logout the user and delete the token from Local Storage\r\n logout(): void {\r\n if (this.storage.getItem(this.options.tokenName!)) {\r\n this.storage.removeItem(this.options.tokenName!);\r\n }\r\n\r\n this.authenticatedUser = undefined;\r\n this.authenticated = false;\r\n this.authenticatedChanged.emit(false);\r\n }\r\n \r\n validateUser(token: User): void {\r\n this.authenticatedUser = {\r\n admin: false, // This type of authentication has no concept of Admin\r\n displayName: token.displayName ?? token.name,\r\n accountName: token.sAMAccountName,\r\n distinguishedName: token.distinguishedName,\r\n employeeNumber: token.employeeNumber,\r\n memberOf: token.memberOf.join(',')\r\n };\r\n\r\n if (this.options.tokenName) {\r\n this.storage.setItem(this.options.tokenName, JSON.stringify(token));\r\n }\r\n \r\n this.authenticated = true;\r\n this.authenticatedChanged.emit(this.authenticated);\r\n\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n }\r\n\r\n checkForExistingToken(): void {\r\n if (this.options.tokenName) {\r\n const token = this.storage.getItem(this.options.tokenName);\r\n\r\n if (token) {\r\n this.validateUser(JSON.parse(token) as User);\r\n }\r\n }\r\n }\r\n //#endregion\r\n}\r\n ","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { AuthenticationServiceOptions, AuthenticationServiceOptionsToken } from '@cleavelandprice/ngx-lib/authentication';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: []\r\n})\r\nexport class AuthenticationObjectModule {\r\n static forRoot(options: AuthenticationServiceOptions): ModuleWithProviders<AuthenticationObjectModule> {\r\n return {\r\n ngModule: AuthenticationObjectModule,\r\n providers: [\r\n {\r\n provide: AuthenticationServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: AuthenticationObjectModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'AuthenticationObjectModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './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AAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,YAJnC,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAIH,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAPtC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE,EAAE;AACZ,iBAAA,CAAA;;0BAcc,QAAQ;;0BAAI,QAAQ;;;ACxBnC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cleavelandprice-ngx-lib-authentication-object.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/authentication/object/src/services/authentication-object.service.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/object/src/authentication-object.module.ts","../../../../projects/cleavelandprice/ngx-lib/authentication/object/src/cleavelandprice-ngx-lib-authentication-object.ts"],"sourcesContent":["import { HttpClient } from '@angular/common/http';\r\nimport { EventEmitter, Inject, inject, Injectable, Optional, Output } from '@angular/core';\r\n\r\nimport { User } from '@cleavelandprice/ngx-lib/active-directory';\r\n\r\nimport { AbstractAuthenticationService, AuthenticatedUser, AuthenticationRequest, AuthenticationServiceOptions, AuthenticationServiceOptionsToken } from '@cleavelandprice/ngx-lib/authentication';\r\n\r\nimport { NgxLibServiceBase } from '@cleavelandprice/ngx-lib';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class AuthenticationObjectService extends NgxLibServiceBase implements AbstractAuthenticationService {\r\n //#region Fields\r\n #services = {\r\n //config: inject(ServiceConfig, { optional: true }) ?? new ServiceConfig(),\r\n http: inject(HttpClient)\r\n };\r\n \r\n authenticating = false; // Flag set to true while the service is attempting to authenticate the user\r\n authenticated = false; // Flag set to true when the user is successfully authenticated\r\n authenticatedUser?: AuthenticatedUser; // Object representing the authenticated user\r\n \r\n // error NG8110: Unsupported call to the output function. This function can only be used as the initializer of a property on a @Component or @Directive class.\r\n /*authenticatedChanged = output<boolean>();\r\n authenticatingChanged = output<boolean>();\r\n authenticationError = output();*/\r\n @Output() authenticatedChanged = new EventEmitter<boolean>();\r\n @Output() authenticatingChanged = new EventEmitter<boolean>();\r\n @Output() authenticationError = new EventEmitter();\r\n //#endregion\r\n\r\n //#region Properties\r\n get useSessionStorage(): boolean {\r\n return !!localStorage.getItem('storeTokenInSession');\r\n }\r\n\r\n get storage(): Storage {\r\n return this.useSessionStorage ?\r\n sessionStorage:\r\n localStorage;\r\n }\r\n //#endregion\r\n\r\n //#region Lifecycle\r\n constructor(@Optional() @Inject(AuthenticationServiceOptionsToken) private options: AuthenticationServiceOptions) {\r\n super(options);\r\n\r\n this.options = {\r\n ...options,\r\n\r\n tokenName: 'userObject',\r\n authenticationEndpoint: '/authenticate'\r\n };\r\n\r\n this.checkForExistingToken();\r\n }\r\n //#endregion\r\n\r\n //#region Utilities\r\n //Authenticate the user and store the token in Local Storage\r\n login(username: string, password: string, adminGroup?: string, additionalInfo?: string): void {\r\n const request: AuthenticationRequest = {\r\n username,\r\n password,\r\n adminGroup,\r\n additionalInfo,\r\n appName: this.options.appName\r\n };\r\n\r\n this.authenticating = true;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n\r\n this.#services.http.post(`${this.apiUrl}${this.options.authenticationEndpoint}`, request)\r\n .subscribe({\r\n next: (user) => {\r\n if (user) {\r\n this.validateUser(user as User);\r\n } else {\r\n this.logout();\r\n }\r\n },\r\n error: (err) => {\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n this.authenticationError.emit(err);\r\n }\r\n });\r\n }\r\n \r\n //Logout the user and delete the token from Local Storage\r\n logout(): void {\r\n if (this.storage.getItem(this.options.tokenName!)) {\r\n this.storage.removeItem(this.options.tokenName!);\r\n }\r\n\r\n this.authenticatedUser = undefined;\r\n this.authenticated = false;\r\n this.authenticatedChanged.emit(false);\r\n }\r\n \r\n validateUser(token: User): void {\r\n this.authenticatedUser = {\r\n admin: false, // This type of authentication has no concept of Admin\r\n displayName: token.displayName ?? token.name,\r\n accountName: token.sAMAccountName,\r\n distinguishedName: token.distinguishedName,\r\n employeeNumber: token.employeeNumber,\r\n memberOf: token.memberOf.join(',')\r\n };\r\n\r\n if (this.options.tokenName) {\r\n this.storage.setItem(this.options.tokenName, JSON.stringify(token));\r\n }\r\n \r\n this.authenticated = true;\r\n this.authenticatedChanged.emit(this.authenticated);\r\n\r\n this.authenticating = false;\r\n this.authenticatingChanged.emit(this.authenticating);\r\n }\r\n\r\n checkForExistingToken(): void {\r\n if (this.options.tokenName) {\r\n const token = this.storage.getItem(this.options.tokenName);\r\n\r\n if (token) {\r\n this.validateUser(JSON.parse(token) as User);\r\n }\r\n }\r\n }\r\n //#endregion\r\n}\r\n ","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { AuthenticationServiceOptions, AuthenticationServiceOptionsToken } from '@cleavelandprice/ngx-lib/authentication';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: []\r\n})\r\nexport class AuthenticationObjectModule {\r\n static forRoot(options: AuthenticationServiceOptions): ModuleWithProviders<AuthenticationObjectModule> {\r\n return {\r\n ngModule: AuthenticationObjectModule,\r\n providers: [\r\n {\r\n provide: AuthenticationServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: AuthenticationObjectModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'AuthenticationObjectModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './authentication-object.api';\n"],"names":[],"mappings":";;;;;;;;AAYM,MAAO,2BAA4B,SAAQ,iBAA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,YAAY,EAAE,EAAE;AAChB,oBAAA,OAAO,EAAE;wBACP;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;AACV,iBAAA;;0BAcc;;0BAAY;;;ACxB3B;;AAEG;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject,
|
|
2
|
+
import { InjectionToken, inject, EventEmitter, Injectable, Optional, Inject, Output, NgModule, SkipSelf } from '@angular/core';
|
|
3
3
|
import { HttpClient } from '@angular/common/http';
|
|
4
4
|
import { JwtHelperService } from '@auth0/angular-jwt';
|
|
5
5
|
import { NgxLibServiceBase } from '@cleavelandprice/ngx-lib';
|
|
@@ -27,11 +27,15 @@ class AuthenticationTokenService extends NgxLibServiceBase {
|
|
|
27
27
|
this.options = options;
|
|
28
28
|
//#region Fields
|
|
29
29
|
this.#http = inject(HttpClient);
|
|
30
|
-
this.authenticatedChanged = output();
|
|
31
|
-
this.authenticatingChanged = output();
|
|
32
|
-
this.authenticationError = output();
|
|
33
30
|
this.authenticating = false; // Flag set to true while the service is attempting to authenticate the user
|
|
34
31
|
this.authenticated = false; // Flag set to true when the user is successfully authenticated
|
|
32
|
+
// error NG8110: Unsupported call to the output function. This function can only be used as the initializer of a property on a @Component or @Directive class.
|
|
33
|
+
/*authenticatedChanged = output<boolean>();
|
|
34
|
+
authenticatingChanged = output<boolean>();
|
|
35
|
+
authenticationError = output();*/
|
|
36
|
+
this.authenticatedChanged = new EventEmitter();
|
|
37
|
+
this.authenticatingChanged = new EventEmitter();
|
|
38
|
+
this.authenticationError = new EventEmitter();
|
|
35
39
|
this.options = {
|
|
36
40
|
...options,
|
|
37
41
|
tokenName: 'token',
|
|
@@ -114,10 +118,10 @@ class AuthenticationTokenService extends NgxLibServiceBase {
|
|
|
114
118
|
}
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
118
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
121
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AuthenticationTokenService, deps: [{ token: AuthenticationTokenServiceOptionsToken, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
122
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AuthenticationTokenService, providedIn: 'root' }); }
|
|
119
123
|
}
|
|
120
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AuthenticationTokenService, decorators: [{
|
|
121
125
|
type: Injectable,
|
|
122
126
|
args: [{
|
|
123
127
|
providedIn: 'root'
|
|
@@ -127,7 +131,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImpor
|
|
|
127
131
|
}, {
|
|
128
132
|
type: Inject,
|
|
129
133
|
args: [AuthenticationTokenServiceOptionsToken]
|
|
130
|
-
}] }]
|
|
134
|
+
}] }], propDecorators: { authenticatedChanged: [{
|
|
135
|
+
type: Output
|
|
136
|
+
}], authenticatingChanged: [{
|
|
137
|
+
type: Output
|
|
138
|
+
}], authenticationError: [{
|
|
139
|
+
type: Output
|
|
140
|
+
}] } });
|
|
131
141
|
|
|
132
142
|
class AuthenticationTokenModule {
|
|
133
143
|
static forRoot(options) {
|
|
@@ -146,11 +156,11 @@ class AuthenticationTokenModule {
|
|
|
146
156
|
throw new Error('AuthenticationTokenModule is already loaded. Import it in the AppModule only');
|
|
147
157
|
}
|
|
148
158
|
}
|
|
149
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
150
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
151
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
159
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AuthenticationTokenModule, deps: [{ token: AuthenticationTokenModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
160
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0", ngImport: i0, type: AuthenticationTokenModule, imports: [CommonModule] }); }
|
|
161
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AuthenticationTokenModule, imports: [CommonModule] }); }
|
|
152
162
|
}
|
|
153
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
163
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0", ngImport: i0, type: AuthenticationTokenModule, decorators: [{
|
|
154
164
|
type: NgModule,
|
|
155
165
|
args: [{
|
|
156
166
|
declarations: [],
|