@cleavelandprice/ngx-lib 3.14.6 → 4.0.0
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/{public_api.d.ts → active-directory.api.d.ts} +2 -4
- package/active-directory/active-directory.module.d.ts +2 -2
- package/active-directory/index.d.ts +1 -1
- package/active-directory/{gui → material}/components/user-chooser/user-chooser.component.d.ts +11 -31
- package/active-directory/{gui → material}/components/user-form-field/user-form-field.component.d.ts +5 -8
- package/active-directory/{gui → material}/index.d.ts +2 -2
- package/active-directory/{gui/public_api.d.ts → material/mat-active-directory.api.d.ts} +1 -1
- package/active-directory/material/mat-active-directory.module.d.ts +25 -0
- package/active-directory/model/active-directory-service-options.d.ts +7 -0
- package/active-directory/services/active-directory.service.d.ts +7 -7
- package/authentication/{public_api.d.ts → authentication.api.d.ts} +1 -1
- package/authentication/authentication.base.module.d.ts +5 -1
- package/authentication/index.d.ts +1 -1
- package/authentication/{token/gui → material}/components/login/login.component.d.ts +6 -4
- package/authentication/{token/gui → material}/components/login-form/login-form.component.d.ts +9 -10
- package/authentication/material/index.d.ts +5 -0
- package/authentication/material/mat-authentication.api.d.ts +6 -0
- package/authentication/material/mat-authentication.module.d.ts +21 -0
- package/authentication/material/model/mat-authentication-service-options.d.ts +6 -0
- package/authentication/material/services/mat-authentication.service.d.ts +11 -0
- package/authentication/model/abstract-authentication-service.d.ts +4 -4
- package/authentication/model/authentication-service-options.d.ts +8 -0
- package/authentication/object/authentication-object.api.d.ts +2 -0
- package/authentication/object/authentication-object.module.d.ts +11 -0
- package/authentication/object/index.d.ts +1 -1
- package/authentication/object/services/authentication-object.service.d.ts +23 -0
- package/authentication/token/authentication-token.api.d.ts +4 -0
- package/authentication/token/authetiction-token.module.d.ts +11 -0
- package/authentication/token/index.d.ts +1 -1
- package/authentication/token/model/authentication-token-service-options.d.ts +6 -0
- package/authentication/token/services/authentication-token.service.d.ts +23 -0
- package/dialog/components/base/base.component.d.ts +3 -3
- package/dialog/components/choice/choice.component.d.ts +5 -3
- package/dialog/components/confirmation/confirmation.component.d.ts +5 -3
- package/dialog/components/input/input.component.d.ts +5 -3
- package/dialog/components/message/message.component.d.ts +5 -3
- package/dialog/dialog.module.d.ts +13 -13
- package/dialog/index.d.ts +1 -1
- package/esm2022/active-directory/active-directory.api.mjs +12 -0
- package/esm2022/active-directory/active-directory.module.mjs +20 -10
- package/esm2022/active-directory/cleavelandprice-ngx-lib-active-directory.mjs +2 -2
- package/esm2022/active-directory/material/cleavelandprice-ngx-lib-active-directory-material.mjs +5 -0
- package/esm2022/active-directory/material/components/user-chooser/user-chooser.component.mjs +406 -0
- package/esm2022/active-directory/material/components/user-form-field/user-form-field.component.mjs +136 -0
- package/esm2022/active-directory/material/mat-active-directory.api.mjs +9 -0
- package/esm2022/active-directory/material/mat-active-directory.module.mjs +109 -0
- package/esm2022/active-directory/material/model/selectable-group.mjs +2 -0
- package/esm2022/active-directory/material/model/selectable-user.mjs +2 -0
- package/esm2022/active-directory/material/model/user-chooser-data.mjs +33 -0
- package/esm2022/active-directory/material/model/user-chooser-filter-options.mjs +10 -0
- package/esm2022/active-directory/{gui → material}/model/user-chooser-mode.mjs +1 -1
- package/esm2022/active-directory/material/model/user-chooser-pre-processing-group.mjs +9 -0
- package/esm2022/active-directory/model/active-directory-service-options.mjs +3 -0
- package/esm2022/active-directory/services/active-directory.service.mjs +61 -41
- package/esm2022/authentication/authentication.api.mjs +6 -0
- package/esm2022/authentication/authentication.base.module.mjs +28 -7
- package/esm2022/authentication/cleavelandprice-ngx-lib-authentication.mjs +2 -2
- package/esm2022/authentication/material/cleavelandprice-ngx-lib-authentication-material.mjs +5 -0
- package/esm2022/authentication/material/components/login/login.component.mjs +49 -0
- package/esm2022/authentication/material/components/login-form/login-form.component.mjs +82 -0
- package/esm2022/authentication/material/mat-authentication.api.mjs +7 -0
- package/esm2022/authentication/material/mat-authentication.module.mjs +84 -0
- package/esm2022/authentication/material/model/login-form-data.mjs +2 -0
- package/esm2022/authentication/material/model/mat-authentication-service-options.mjs +3 -0
- package/esm2022/authentication/material/services/mat-authentication.service.mjs +67 -0
- package/esm2022/authentication/model/abstract-authentication-service.mjs +1 -1
- package/esm2022/authentication/model/authentication-service-options.mjs +3 -0
- package/esm2022/authentication/object/authentication-object.api.mjs +4 -0
- package/esm2022/authentication/object/authentication-object.module.mjs +40 -0
- package/esm2022/authentication/object/cleavelandprice-ngx-lib-authentication-object.mjs +2 -2
- package/esm2022/authentication/object/services/authentication-object.service.mjs +119 -0
- package/esm2022/authentication/token/authentication-token.api.mjs +5 -0
- package/esm2022/authentication/token/authetiction-token.module.mjs +40 -0
- package/esm2022/authentication/token/cleavelandprice-ngx-lib-authentication-token.mjs +2 -2
- package/esm2022/authentication/token/model/authentication-token-service-options.mjs +3 -0
- package/esm2022/authentication/token/services/authentication-token.service.mjs +128 -0
- package/esm2022/dialog/cleavelandprice-ngx-lib-dialog.mjs +2 -2
- package/esm2022/dialog/components/base/base.component.mjs +27 -16
- package/esm2022/dialog/components/choice/choice.component.mjs +11 -11
- package/esm2022/dialog/components/confirmation/confirmation.component.mjs +11 -11
- package/esm2022/dialog/components/input/input.component.mjs +11 -11
- package/esm2022/dialog/components/message/message.component.mjs +11 -11
- package/esm2022/dialog/dialog.api.mjs +20 -0
- package/esm2022/dialog/dialog.module.mjs +25 -20
- package/esm2022/lib/model/caching-config.mjs +2 -0
- package/esm2022/lib/model/credentials.mjs +2 -0
- package/esm2022/lib/model/logging-config.mjs +2 -0
- package/esm2022/lib/model/service-options.mjs +3 -0
- package/esm2022/lib/ngx-lib.module.mjs +20 -10
- package/esm2022/lib/services/app-path-config.service.mjs +31 -24
- package/esm2022/lib/services/service-base.mjs +26 -0
- package/esm2022/msgraph/cleavelandprice-ngx-lib-msgraph.mjs +2 -2
- package/esm2022/msgraph/msgraph.api.mjs +19 -0
- package/esm2022/msgraph/msgraph.module.mjs +6 -11
- package/esm2022/public_api.mjs +6 -2
- package/esm2022/quill/cleavelandprice-ngx-lib-quill.mjs +2 -2
- package/esm2022/quill/components/editor/editor.component.mjs +29 -39
- package/esm2022/quill/components/raw/raw.component.mjs +18 -11
- package/esm2022/quill/mention/cleavelandprice-ngx-lib-quill-mention.mjs +2 -2
- package/esm2022/quill/mention/components/editor/editor.component.mjs +20 -14
- package/esm2022/quill/mention/quill-mention.api.mjs +8 -0
- package/esm2022/quill/mention/quill-mention.module.mjs +12 -12
- package/esm2022/quill/quill.api.mjs +9 -0
- package/esm2022/quill/quill.module.mjs +20 -18
- package/esm2022/sharepoint/cleavelandprice-ngx-lib-sharepoint.mjs +2 -2
- package/esm2022/sharepoint/components/user-photo/user-photo.component.mjs +13 -9
- package/esm2022/sharepoint/model/sharepoint-service-options.mjs +3 -0
- package/esm2022/sharepoint/pipes/user-photo-url.pipe.mjs +8 -9
- package/esm2022/sharepoint/services/sharepoint.service.mjs +74 -65
- package/esm2022/sharepoint/sharepoint.api.mjs +17 -0
- package/esm2022/sharepoint/sharepoint.module.mjs +25 -15
- package/esm2022/table/cleavelandprice-ngx-lib-table.mjs +2 -2
- package/esm2022/table/components/table/table.component.mjs +76 -74
- package/esm2022/table/table.api.mjs +4 -0
- package/esm2022/table/table.module.mjs +16 -15
- package/esm2022/upload/cleavelandprice-ngx-lib-upload.mjs +2 -2
- package/esm2022/upload/components/upload/upload.component.mjs +16 -20
- package/esm2022/upload/components/upload-dialog/upload-dialog.component.mjs +49 -39
- package/esm2022/upload/model/upload-service-options.mjs +4 -0
- package/esm2022/upload/model/upload-status.mjs +2 -0
- package/esm2022/upload/services/upload.service.mjs +44 -29
- package/esm2022/upload/upload.api.mjs +9 -0
- package/esm2022/upload/upload.module.mjs +33 -20
- package/esm2022/url-utilities/cleavelandprice-ngx-lib-url-utilities.mjs +2 -2
- package/esm2022/url-utilities/pipes/safe-resource-url.pipe.mjs +8 -9
- package/esm2022/url-utilities/pipes/safe-url.pipe.mjs +8 -9
- package/esm2022/url-utilities/pipes/uri-scheme.pipe.mjs +9 -8
- package/esm2022/url-utilities/url-utilities.api.mjs +13 -0
- package/esm2022/url-utilities/url-utilities.module.mjs +11 -11
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-material.mjs +683 -0
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-material.mjs.map +1 -0
- package/fesm2022/cleavelandprice-ngx-lib-active-directory.mjs +79 -72
- package/fesm2022/cleavelandprice-ngx-lib-active-directory.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-material.mjs +268 -0
- package/fesm2022/cleavelandprice-ngx-lib-authentication-material.mjs.map +1 -0
- package/fesm2022/cleavelandprice-ngx-lib-authentication-object.mjs +54 -49
- package/fesm2022/cleavelandprice-ngx-lib-authentication-object.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-token.mjs +50 -51
- package/fesm2022/cleavelandprice-ngx-lib-authentication-token.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication.mjs +28 -18
- package/fesm2022/cleavelandprice-ngx-lib-authentication.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-dialog.mjs +87 -66
- package/fesm2022/cleavelandprice-ngx-lib-dialog.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-msgraph.mjs +5 -10
- package/fesm2022/cleavelandprice-ngx-lib-msgraph.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-quill-mention.mjs +29 -26
- package/fesm2022/cleavelandprice-ngx-lib-quill-mention.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-quill.mjs +61 -67
- package/fesm2022/cleavelandprice-ngx-lib-quill.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-sharepoint.mjs +115 -118
- package/fesm2022/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-table.mjs +85 -90
- package/fesm2022/cleavelandprice-ngx-lib-table.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-upload.mjs +134 -117
- package/fesm2022/cleavelandprice-ngx-lib-upload.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib-url-utilities.mjs +38 -33
- package/fesm2022/cleavelandprice-ngx-lib-url-utilities.mjs.map +1 -1
- package/fesm2022/cleavelandprice-ngx-lib.mjs +66 -45
- package/fesm2022/cleavelandprice-ngx-lib.mjs.map +1 -1
- package/lib/model/caching-config.d.ts +4 -0
- package/lib/model/credentials.d.ts +4 -0
- package/lib/model/logging-config.d.ts +6 -0
- package/lib/model/service-options.d.ts +6 -0
- package/lib/ngx-lib.module.d.ts +2 -2
- package/lib/services/app-path-config.service.d.ts +5 -4
- package/lib/services/service-base.d.ts +7 -0
- package/msgraph/index.d.ts +1 -1
- package/msgraph/msgraph.module.d.ts +0 -2
- package/package.json +27 -27
- package/public_api.d.ts +5 -1
- package/quill/components/editor/editor.component.d.ts +10 -10
- package/quill/components/raw/raw.component.d.ts +1 -1
- package/quill/index.d.ts +1 -1
- package/quill/mention/components/editor/editor.component.d.ts +3 -3
- package/quill/mention/index.d.ts +1 -1
- package/quill/mention/quill-mention.module.d.ts +9 -9
- package/quill/quill.module.d.ts +12 -14
- package/sharepoint/components/user-photo/user-photo.component.d.ts +2 -2
- package/sharepoint/index.d.ts +1 -1
- package/sharepoint/model/sharepoint-service-options.d.ts +19 -0
- package/sharepoint/pipes/user-photo-url.pipe.d.ts +2 -2
- package/sharepoint/services/sharepoint.service.d.ts +7 -10
- package/sharepoint/{public_api.d.ts → sharepoint.api.d.ts} +1 -1
- package/sharepoint/sharepoint.module.d.ts +6 -6
- package/table/components/table/table.component.d.ts +21 -22
- package/table/index.d.ts +1 -1
- package/table/table.module.d.ts +13 -13
- package/upload/components/upload/upload.component.d.ts +4 -8
- package/upload/components/upload-dialog/upload-dialog.component.d.ts +11 -9
- package/upload/index.d.ts +1 -1
- package/upload/model/upload-service-options.d.ts +16 -0
- package/upload/model/upload-status.d.ts +6 -0
- package/upload/services/upload.service.d.ts +9 -6
- package/upload/{public_api.d.ts → upload.api.d.ts} +2 -2
- package/upload/upload.module.d.ts +10 -10
- package/url-utilities/index.d.ts +1 -1
- package/url-utilities/pipes/safe-resource-url.pipe.d.ts +2 -2
- package/url-utilities/pipes/safe-url.pipe.d.ts +2 -2
- package/url-utilities/pipes/uri-scheme.pipe.d.ts +2 -3
- package/url-utilities/url-utilities.api.d.ts +8 -0
- package/url-utilities/url-utilities.module.d.ts +5 -5
- package/active-directory/gui/gui.module.d.ts +0 -25
- package/active-directory/model/caching-config.d.ts +0 -4
- package/active-directory/model/logging-config.d.ts +0 -6
- package/active-directory/model/service-config.d.ts +0 -8
- package/authentication/model/service-config.d.ts +0 -8
- package/authentication/object/model/service-config.d.ts +0 -4
- package/authentication/object/object.module.d.ts +0 -11
- package/authentication/object/public_api.d.ts +0 -3
- package/authentication/object/services/authentication.service.d.ts +0 -23
- package/authentication/token/gui/index.d.ts +0 -5
- package/authentication/token/gui/model/service-config.d.ts +0 -5
- package/authentication/token/gui/public_api.d.ts +0 -6
- package/authentication/token/gui/services/authentication.service.d.ts +0 -12
- package/authentication/token/gui/token-gui.module.d.ts +0 -21
- package/authentication/token/model/service-config.d.ts +0 -5
- package/authentication/token/public_api.d.ts +0 -4
- package/authentication/token/services/authentication.service.d.ts +0 -23
- package/authentication/token/token.module.d.ts +0 -11
- package/esm2022/active-directory/gui/cleavelandprice-ngx-lib-active-directory-gui.mjs +0 -5
- package/esm2022/active-directory/gui/components/user-chooser/user-chooser.component.mjs +0 -393
- package/esm2022/active-directory/gui/components/user-form-field/user-form-field.component.mjs +0 -132
- package/esm2022/active-directory/gui/gui.module.mjs +0 -96
- package/esm2022/active-directory/gui/model/selectable-group.mjs +0 -2
- package/esm2022/active-directory/gui/model/selectable-user.mjs +0 -2
- package/esm2022/active-directory/gui/model/user-chooser-data.mjs +0 -33
- package/esm2022/active-directory/gui/model/user-chooser-filter-options.mjs +0 -10
- package/esm2022/active-directory/gui/model/user-chooser-pre-processing-group.mjs +0 -9
- package/esm2022/active-directory/gui/public_api.mjs +0 -9
- package/esm2022/active-directory/model/caching-config.mjs +0 -7
- package/esm2022/active-directory/model/logging-config.mjs +0 -9
- package/esm2022/active-directory/model/service-config.mjs +0 -12
- package/esm2022/active-directory/public_api.mjs +0 -12
- package/esm2022/authentication/model/service-config.mjs +0 -12
- package/esm2022/authentication/object/model/service-config.mjs +0 -9
- package/esm2022/authentication/object/object.module.mjs +0 -39
- package/esm2022/authentication/object/public_api.mjs +0 -4
- package/esm2022/authentication/object/services/authentication.service.mjs +0 -110
- package/esm2022/authentication/public_api.mjs +0 -6
- package/esm2022/authentication/token/gui/cleavelandprice-ngx-lib-authentication-token-gui.mjs +0 -5
- package/esm2022/authentication/token/gui/components/login/login.component.mjs +0 -43
- package/esm2022/authentication/token/gui/components/login-form/login-form.component.mjs +0 -72
- package/esm2022/authentication/token/gui/model/login-form-data.mjs +0 -2
- package/esm2022/authentication/token/gui/model/service-config.mjs +0 -10
- package/esm2022/authentication/token/gui/public_api.mjs +0 -7
- package/esm2022/authentication/token/gui/services/authentication.service.mjs +0 -78
- package/esm2022/authentication/token/gui/token-gui.module.mjs +0 -81
- package/esm2022/authentication/token/model/service-config.mjs +0 -10
- package/esm2022/authentication/token/public_api.mjs +0 -5
- package/esm2022/authentication/token/services/authentication.service.mjs +0 -124
- package/esm2022/authentication/token/token.module.mjs +0 -39
- package/esm2022/dialog/public_api.mjs +0 -10
- package/esm2022/lib/model/service-config.mjs +0 -21
- package/esm2022/msgraph/public_api.mjs +0 -19
- package/esm2022/quill/mention/public_api.mjs +0 -8
- package/esm2022/quill/public_api.mjs +0 -9
- package/esm2022/sharepoint/model/service-config.mjs +0 -27
- package/esm2022/sharepoint/public_api.mjs +0 -17
- package/esm2022/table/public_api.mjs +0 -4
- package/esm2022/upload/model/service-config.mjs +0 -16
- package/esm2022/upload/public_api.mjs +0 -9
- package/esm2022/url-utilities/public_api.mjs +0 -5
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-gui.mjs +0 -660
- package/fesm2022/cleavelandprice-ngx-lib-active-directory-gui.mjs.map +0 -1
- package/fesm2022/cleavelandprice-ngx-lib-authentication-token-gui.mjs +0 -271
- package/fesm2022/cleavelandprice-ngx-lib-authentication-token-gui.mjs.map +0 -1
- package/lib/model/service-config.d.ts +0 -6
- package/sharepoint/model/service-config.d.ts +0 -23
- package/upload/model/service-config.d.ts +0 -15
- package/url-utilities/public_api.d.ts +0 -4
- /package/active-directory/{gui → material}/model/selectable-group.d.ts +0 -0
- /package/active-directory/{gui → material}/model/selectable-user.d.ts +0 -0
- /package/active-directory/{gui → material}/model/user-chooser-data.d.ts +0 -0
- /package/active-directory/{gui → material}/model/user-chooser-filter-options.d.ts +0 -0
- /package/active-directory/{gui → material}/model/user-chooser-mode.d.ts +0 -0
- /package/active-directory/{gui → material}/model/user-chooser-pre-processing-group.d.ts +0 -0
- /package/authentication/{token/gui → material}/model/login-form-data.d.ts +0 -0
- /package/dialog/{public_api.d.ts → dialog.api.d.ts} +0 -0
- /package/msgraph/{public_api.d.ts → msgraph.api.d.ts} +0 -0
- /package/quill/mention/{public_api.d.ts → quill-mention.api.d.ts} +0 -0
- /package/quill/{public_api.d.ts → quill.api.d.ts} +0 -0
- /package/table/{public_api.d.ts → table.api.d.ts} +0 -0
|
@@ -1,187 +1,168 @@
|
|
|
1
|
-
import { ServiceConfig as ServiceConfig$1 } from '@cleavelandprice/ngx-lib';
|
|
2
1
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { inject, Injectable, Pipe, input, Component, NgModule,
|
|
2
|
+
import { InjectionToken, inject, Injectable, Optional, Inject, Pipe, input, Component, NgModule, SkipSelf } from '@angular/core';
|
|
4
3
|
import { of, map } from 'rxjs';
|
|
5
4
|
import { HttpClient } from '@angular/common/http';
|
|
6
5
|
import { DateTime } from 'luxon';
|
|
6
|
+
import { NgxLibServiceBase } from '@cleavelandprice/ngx-lib';
|
|
7
|
+
import { AsyncPipe, CommonModule } from '@angular/common';
|
|
7
8
|
import { ActiveDirectoryService } from '@cleavelandprice/ngx-lib/active-directory';
|
|
8
|
-
import * as i1 from '@angular/common';
|
|
9
|
-
import { CommonModule } from '@angular/common';
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
// See the comment in the library's main service-config.ts file for an explanation
|
|
13
|
-
constructor(useSsl_or_customApiUrl = false) {
|
|
14
|
-
super(useSsl_or_customApiUrl);
|
|
15
|
-
this.usersEndpoint = '/sharepoint/users';
|
|
16
|
-
this.listItemsEndpoint = '/sharepoint/listitems';
|
|
17
|
-
this.photos = {
|
|
18
|
-
site: 'https://sharepoint.cleavelandprice.com/digitaldisplay',
|
|
19
|
-
list: 'Employee Thumbnail Photos',
|
|
20
|
-
additionalPropertiesToRetrieve: [
|
|
21
|
-
'EncodedAbsUrl'
|
|
22
|
-
]
|
|
23
|
-
};
|
|
24
|
-
this.caching = {
|
|
25
|
-
enabled: true,
|
|
26
|
-
lifeMinutes: 720
|
|
27
|
-
};
|
|
28
|
-
this.logging = {
|
|
29
|
-
dataCached: true,
|
|
30
|
-
cachedDataReturned: true,
|
|
31
|
-
freshDataReturned: true,
|
|
32
|
-
cacheCleared: true
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
}
|
|
10
|
+
const SharePointServiceOptionsToken = new InjectionToken('');
|
|
36
11
|
|
|
37
|
-
class SharePointService {
|
|
12
|
+
class SharePointService extends NgxLibServiceBase {
|
|
13
|
+
#services = {
|
|
14
|
+
http: inject(HttpClient)
|
|
15
|
+
};
|
|
16
|
+
#cache = { users: undefined, photos: undefined };
|
|
17
|
+
#defaultCacheLifeMinutes = 720;
|
|
38
18
|
//#region Utilities
|
|
39
|
-
cacheExpired(cache) {
|
|
19
|
+
#cacheExpired(cache) {
|
|
40
20
|
if (!cache) {
|
|
41
21
|
return true;
|
|
42
22
|
}
|
|
43
|
-
const lifeMinutes = this.
|
|
23
|
+
const lifeMinutes = this.options?.caching?.lifeMinutes ?? this.#defaultCacheLifeMinutes;
|
|
44
24
|
const expiration = cache.lastUpdate.plus({ minutes: lifeMinutes });
|
|
45
25
|
return DateTime.now() > expiration;
|
|
46
26
|
}
|
|
47
27
|
//#endregion
|
|
48
28
|
//#region Initialization
|
|
49
|
-
constructor() {
|
|
50
|
-
|
|
51
|
-
this.
|
|
52
|
-
this.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (this.config) {
|
|
60
|
-
this.config.caching = this.config?.caching ?? {
|
|
29
|
+
constructor(options) {
|
|
30
|
+
super(options);
|
|
31
|
+
this.options = options;
|
|
32
|
+
this.options = {
|
|
33
|
+
...options,
|
|
34
|
+
credentials: options?.credentials ?? {
|
|
35
|
+
username: 'viewer',
|
|
36
|
+
password: 'viewer'
|
|
37
|
+
},
|
|
38
|
+
caching: options?.caching ?? {
|
|
61
39
|
enabled: false,
|
|
62
|
-
lifeMinutes: this
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
40
|
+
lifeMinutes: this.#defaultCacheLifeMinutes
|
|
41
|
+
},
|
|
42
|
+
endpoints: options?.endpoints ?? {
|
|
43
|
+
users: `/sharepoint/users`,
|
|
44
|
+
listItems: `/sharepoint/listitems`
|
|
45
|
+
},
|
|
46
|
+
photos: options?.photos ?? {
|
|
47
|
+
site: 'https://sharepoint.cleavelandprice.com/digitaldisplay',
|
|
48
|
+
list: 'Employee Thumbnail Photos',
|
|
49
|
+
additionalPropertiesToRetrieve: ['EncodedAbsUrl']
|
|
50
|
+
},
|
|
51
|
+
logging: options?.logging ?? {
|
|
74
52
|
dataCached: false,
|
|
75
53
|
cachedDataReturned: false,
|
|
76
54
|
freshDataReturned: false,
|
|
77
55
|
cacheCleared: false
|
|
78
|
-
}
|
|
79
|
-
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
80
58
|
}
|
|
81
59
|
//#endregion
|
|
82
60
|
getListItems(request) {
|
|
83
|
-
const apiUrl = this.
|
|
84
|
-
const endpoint = this.
|
|
85
|
-
return this.http.post(`${apiUrl}${endpoint}`, request);
|
|
61
|
+
//const apiUrl = this.options?.apiUrl;
|
|
62
|
+
const endpoint = this.options?.endpoints?.listItems;
|
|
63
|
+
return this.#services.http.post(`${this.apiUrl}${endpoint}`, request);
|
|
64
|
+
//return this.#services.http.post<ListItem[]>(this.config!.endpoints!.listItems!, request);
|
|
86
65
|
}
|
|
87
66
|
getPhotos() {
|
|
88
67
|
const request = {
|
|
89
|
-
username: this.
|
|
90
|
-
password: this.
|
|
91
|
-
site: this.
|
|
92
|
-
list: this.
|
|
93
|
-
additionalPropertiesToRetrieve: this.
|
|
68
|
+
username: this.options?.credentials?.username,
|
|
69
|
+
password: this.options?.credentials?.password,
|
|
70
|
+
site: this.options?.photos?.site,
|
|
71
|
+
list: this.options?.photos?.list,
|
|
72
|
+
additionalPropertiesToRetrieve: this.options?.photos?.additionalPropertiesToRetrieve
|
|
94
73
|
};
|
|
95
74
|
const observable$ = this.getListItems(request);
|
|
96
|
-
if (this.
|
|
97
|
-
if (this
|
|
75
|
+
if (this.options?.caching?.enabled) {
|
|
76
|
+
if (this.#cacheExpired(this.#cache?.photos)) {
|
|
98
77
|
// Get the data and cache it
|
|
99
78
|
observable$.subscribe(data => {
|
|
100
|
-
this
|
|
79
|
+
this.#cache.photos = {
|
|
101
80
|
data,
|
|
102
81
|
lastUpdate: DateTime.now()
|
|
103
82
|
};
|
|
104
|
-
if (this.
|
|
105
|
-
const lifeMinutes = this.
|
|
83
|
+
if (this.options?.logging?.dataCached) {
|
|
84
|
+
const lifeMinutes = this.options.caching?.lifeMinutes ?? this.#defaultCacheLifeMinutes;
|
|
106
85
|
console.log(`Photos cached for ${lifeMinutes} minutes`);
|
|
107
86
|
}
|
|
108
87
|
});
|
|
109
88
|
}
|
|
110
89
|
else {
|
|
111
90
|
// Cache exists and hasn't expired yet
|
|
112
|
-
if (this.
|
|
91
|
+
if (this.options.logging?.cachedDataReturned) {
|
|
113
92
|
console.log('Returning cached photos');
|
|
114
93
|
}
|
|
115
|
-
return of(this
|
|
94
|
+
return of(this.#cache.photos.data);
|
|
116
95
|
}
|
|
117
96
|
}
|
|
118
97
|
// Cache is either disabled or expired, return data from API
|
|
119
|
-
if (this.
|
|
98
|
+
if (this.options?.logging?.freshDataReturned) {
|
|
120
99
|
console.log('Returning fresh photos');
|
|
121
100
|
}
|
|
122
101
|
return observable$;
|
|
123
102
|
}
|
|
124
103
|
getUsers(request, id) {
|
|
125
|
-
const
|
|
126
|
-
const
|
|
127
|
-
const observable$ = this.http.post(`${apiUrl}${endpoint}/${id ?? ''}`, request);
|
|
104
|
+
const endpoint = this.options?.endpoints?.users;
|
|
105
|
+
const observable$ = this.#services.http.post(`${this.apiUrl}${endpoint}/${id ?? ''}`, request);
|
|
128
106
|
//#region Single user
|
|
129
107
|
if (id) {
|
|
130
108
|
return observable$;
|
|
131
109
|
}
|
|
132
110
|
//#endregion
|
|
133
111
|
//#region Multiple users
|
|
134
|
-
if (this.
|
|
135
|
-
if (this
|
|
112
|
+
if (this.options?.caching?.enabled) {
|
|
113
|
+
if (this.#cacheExpired(this.#cache.users)) {
|
|
136
114
|
// Get the data and cache it
|
|
137
115
|
observable$.subscribe(data => {
|
|
138
|
-
this
|
|
116
|
+
this.#cache.users = {
|
|
139
117
|
data: data,
|
|
140
118
|
lastUpdate: DateTime.now()
|
|
141
119
|
};
|
|
142
|
-
if (this.
|
|
143
|
-
const lifeMinutes = this.
|
|
120
|
+
if (this.options?.logging?.dataCached) {
|
|
121
|
+
const lifeMinutes = this.options.caching?.lifeMinutes ?? this.#defaultCacheLifeMinutes;
|
|
144
122
|
console.log(`Users cached for ${lifeMinutes} minutes`);
|
|
145
123
|
}
|
|
146
124
|
});
|
|
147
125
|
}
|
|
148
126
|
else {
|
|
149
127
|
// Cache exists and hasn't expired yet
|
|
150
|
-
if (this.
|
|
128
|
+
if (this.options.logging?.cachedDataReturned) {
|
|
151
129
|
console.log('Returning cached users');
|
|
152
130
|
}
|
|
153
|
-
return of(this
|
|
131
|
+
return of(this.#cache.users.data);
|
|
154
132
|
}
|
|
155
133
|
}
|
|
156
134
|
// Cache is either disabled or expired, return data from API
|
|
157
|
-
if (this.
|
|
135
|
+
if (this.options?.logging?.freshDataReturned) {
|
|
158
136
|
console.log('Returning fresh users');
|
|
159
137
|
}
|
|
160
138
|
return observable$;
|
|
161
139
|
//#endregion
|
|
162
140
|
}
|
|
163
141
|
clearCache() {
|
|
164
|
-
this
|
|
165
|
-
if (this.
|
|
142
|
+
this.#cache = { users: undefined, photos: undefined };
|
|
143
|
+
if (this.options?.logging?.cacheCleared) {
|
|
166
144
|
console.log('Cache cleared');
|
|
167
145
|
}
|
|
168
146
|
}
|
|
169
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
170
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.
|
|
147
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SharePointService, deps: [{ token: SharePointServiceOptionsToken, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
148
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SharePointService, providedIn: 'root' }); }
|
|
171
149
|
}
|
|
172
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
150
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SharePointService, decorators: [{
|
|
173
151
|
type: Injectable,
|
|
174
152
|
args: [{
|
|
175
153
|
providedIn: 'root'
|
|
176
154
|
}]
|
|
177
|
-
}], ctorParameters: () => [
|
|
155
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
156
|
+
type: Optional
|
|
157
|
+
}, {
|
|
158
|
+
type: Inject,
|
|
159
|
+
args: [SharePointServiceOptionsToken]
|
|
160
|
+
}] }] });
|
|
178
161
|
|
|
179
162
|
class UserPhotoUrlPipe {
|
|
180
|
-
|
|
181
|
-
this.sharePointService = inject(SharePointService);
|
|
182
|
-
}
|
|
163
|
+
#sharePointService = inject(SharePointService);
|
|
183
164
|
transform(user, userPhotos) {
|
|
184
|
-
const observable$ = userPhotos ? of(userPhotos) : this
|
|
165
|
+
const observable$ = userPhotos ? of(userPhotos) : this.#sharePointService.getPhotos();
|
|
185
166
|
return observable$
|
|
186
167
|
.pipe(map(photos => photos.find(pic =>
|
|
187
168
|
// Try to match by employeeNumber, accountName, or title
|
|
@@ -200,19 +181,20 @@ class UserPhotoUrlPipe {
|
|
|
200
181
|
|
|
201
182
|
return photo ? photo.encodedAbsUrl : null;*/
|
|
202
183
|
}
|
|
203
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
204
|
-
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.
|
|
184
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: UserPhotoUrlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
185
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.3", ngImport: i0, type: UserPhotoUrlPipe, isStandalone: true, name: "userPhotoUrl" }); }
|
|
205
186
|
}
|
|
206
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
187
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: UserPhotoUrlPipe, decorators: [{
|
|
207
188
|
type: Pipe,
|
|
208
189
|
args: [{
|
|
209
|
-
name: 'userPhotoUrl'
|
|
190
|
+
name: 'userPhotoUrl',
|
|
191
|
+
standalone: true
|
|
210
192
|
}]
|
|
211
193
|
}] });
|
|
212
194
|
|
|
213
195
|
class UserPhotoComponent {
|
|
214
196
|
constructor() {
|
|
215
|
-
this
|
|
197
|
+
this.#activeDirectoryService = inject(ActiveDirectoryService);
|
|
216
198
|
this.user = input.required();
|
|
217
199
|
//employee = input<CleavelandPriceUser | undefined>();
|
|
218
200
|
// Or...
|
|
@@ -221,33 +203,48 @@ class UserPhotoComponent {
|
|
|
221
203
|
this.size = input("2em");
|
|
222
204
|
this.notRound = input(false);
|
|
223
205
|
}
|
|
206
|
+
#activeDirectoryService;
|
|
224
207
|
ngOnInit() {
|
|
225
208
|
;
|
|
226
209
|
if (typeof this.user() === 'string') {
|
|
227
210
|
// Developer passed in an account name instead of a user object
|
|
228
211
|
// We need to do the work of getting the user object ourselves
|
|
229
|
-
this
|
|
212
|
+
this.#activeDirectoryService.getUser(this.user())
|
|
230
213
|
.subscribe(user => this._user = user);
|
|
231
214
|
}
|
|
232
215
|
else {
|
|
233
216
|
this._user = this.user();
|
|
234
217
|
}
|
|
235
218
|
}
|
|
236
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
237
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.
|
|
219
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: UserPhotoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
220
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.3", type: UserPhotoComponent, isStandalone: true, selector: "user-photo", inputs: { user: { classPropertyName: "user", publicName: "user", isSignal: true, isRequired: true, transformFunction: null }, userPhotos: { classPropertyName: "userPhotos", publicName: "userPhotos", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, notRound: { classPropertyName: "notRound", publicName: "notRound", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (_user) {\r\n @if ((_user | userPhotoUrl:userPhotos() | async)) {\r\n <img\r\n [src]=\"_user | userPhotoUrl:userPhotos() | async\"\r\n [style.width]=\"size()\"\r\n [style.height]=\"size()\"\r\n [style.border-radius]=\"notRound() ? 'initial' : '100%'\">\r\n }\r\n}\r\n", styles: [""], dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: UserPhotoUrlPipe, name: "userPhotoUrl" }] }); }
|
|
238
221
|
}
|
|
239
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
222
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: UserPhotoComponent, decorators: [{
|
|
240
223
|
type: Component,
|
|
241
|
-
args: [{ selector: 'user-photo',
|
|
224
|
+
args: [{ selector: 'user-photo', imports: [
|
|
225
|
+
AsyncPipe,
|
|
226
|
+
UserPhotoUrlPipe
|
|
227
|
+
], standalone: true, template: "@if (_user) {\r\n @if ((_user | userPhotoUrl:userPhotos() | async)) {\r\n <img\r\n [src]=\"_user | userPhotoUrl:userPhotos() | async\"\r\n [style.width]=\"size()\"\r\n [style.height]=\"size()\"\r\n [style.border-radius]=\"notRound() ? 'initial' : '100%'\">\r\n }\r\n}\r\n" }]
|
|
242
228
|
}] });
|
|
243
229
|
|
|
244
230
|
class SharePointModule {
|
|
245
|
-
static forRoot(config) {
|
|
231
|
+
/*static forRoot(config: SharePointServiceConfig): ModuleWithProviders<SharePointModule> {
|
|
232
|
+
return {
|
|
233
|
+
ngModule: SharePointModule,
|
|
234
|
+
providers: [
|
|
235
|
+
SharePointService,
|
|
236
|
+
{ provide: SharePointServiceConfigToken, useValue: config }
|
|
237
|
+
]
|
|
238
|
+
};
|
|
239
|
+
}*/
|
|
240
|
+
static forRoot(options) {
|
|
246
241
|
return {
|
|
247
242
|
ngModule: SharePointModule,
|
|
248
243
|
providers: [
|
|
249
|
-
|
|
250
|
-
|
|
244
|
+
{
|
|
245
|
+
provide: SharePointServiceOptionsToken,
|
|
246
|
+
useValue: options
|
|
247
|
+
}
|
|
251
248
|
]
|
|
252
249
|
};
|
|
253
250
|
}
|
|
@@ -256,22 +253,22 @@ class SharePointModule {
|
|
|
256
253
|
throw new Error('SharePointModule is already loaded. Import it in the AppModule only');
|
|
257
254
|
}
|
|
258
255
|
}
|
|
259
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
260
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.
|
|
261
|
-
|
|
256
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SharePointModule, deps: [{ token: SharePointModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
257
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.3", ngImport: i0, type: SharePointModule, imports: [CommonModule,
|
|
258
|
+
UserPhotoUrlPipe,
|
|
259
|
+
UserPhotoComponent], exports: [UserPhotoUrlPipe,
|
|
262
260
|
UserPhotoComponent] }); }
|
|
263
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.
|
|
261
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SharePointModule, imports: [CommonModule] }); }
|
|
264
262
|
}
|
|
265
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
263
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: SharePointModule, decorators: [{
|
|
266
264
|
type: NgModule,
|
|
267
265
|
args: [{
|
|
268
|
-
declarations: [
|
|
266
|
+
declarations: [],
|
|
267
|
+
imports: [
|
|
268
|
+
CommonModule,
|
|
269
269
|
UserPhotoUrlPipe,
|
|
270
270
|
UserPhotoComponent
|
|
271
271
|
],
|
|
272
|
-
imports: [
|
|
273
|
-
CommonModule
|
|
274
|
-
],
|
|
275
272
|
exports: [
|
|
276
273
|
UserPhotoUrlPipe,
|
|
277
274
|
UserPhotoComponent
|
|
@@ -287,5 +284,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImpor
|
|
|
287
284
|
* Generated bundle index. Do not edit.
|
|
288
285
|
*/
|
|
289
286
|
|
|
290
|
-
export {
|
|
287
|
+
export { SharePointModule, SharePointService, SharePointServiceOptionsToken, UserPhotoComponent, UserPhotoUrlPipe };
|
|
291
288
|
//# sourceMappingURL=cleavelandprice-ngx-lib-sharepoint.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleavelandprice-ngx-lib-sharepoint.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/services/sharepoint.service.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/pipes/user-photo-url.pipe.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/user-photo/user-photo.component.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/user-photo/user-photo.component.html","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/sharepoint.module.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/cleavelandprice-ngx-lib-sharepoint.ts"],"sourcesContent":["import { ServiceConfig as NgxLibServiceConfig } from '@cleavelandprice/ngx-lib';\r\n\r\nexport class ServiceConfig extends NgxLibServiceConfig {\r\n usersEndpoint = '/sharepoint/users';\r\n listItemsEndpoint = '/sharepoint/listitems';\r\n username?: string;\r\n password?: string;\r\n photos = {\r\n site: 'https://sharepoint.cleavelandprice.com/digitaldisplay',\r\n list: 'Employee Thumbnail Photos',\r\n additionalPropertiesToRetrieve: [\r\n 'EncodedAbsUrl'\r\n ]\r\n };\r\n caching = {\r\n enabled: true,\r\n lifeMinutes: 720\r\n };\r\n logging = {\r\n dataCached: true,\r\n cachedDataReturned: true,\r\n freshDataReturned: true,\r\n cacheCleared: true\r\n };\r\n\r\n // See the comment in the library's main service-config.ts file for an explanation\r\n constructor(useSsl_or_customApiUrl: boolean | string = false) {\r\n super(useSsl_or_customApiUrl);\r\n }\r\n}","import { HttpClient } from '@angular/common/http';\r\nimport { inject, Injectable } from '@angular/core';\r\nimport { DateTime } from 'luxon';\r\nimport { Observable, of } from 'rxjs';\r\n\r\nimport { CacheObject } from '../model/cache-object';\r\nimport { ListItem } from '../model/list-item';\r\nimport { ListItemsRequest } from '../model/list-items-request';\r\nimport { PhotoItem } from '../model/photo-item';\r\nimport { ServiceConfig } from '../model/service-config';\r\nimport { User } from '../model/user';\r\nimport { UserRequest } from '../model/user-request';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SharePointService {\r\n //#region Services\r\n private config = inject(ServiceConfig, { optional: true }) ?? new ServiceConfig();\r\n private http = inject(HttpClient);\r\n //#endregion\r\n\r\n private cache: {\r\n users?: CacheObject<User>,\r\n photos?: CacheObject<PhotoItem>\r\n } | undefined;\r\n\r\n private defaultCacheLifeMinutes = 720;\r\n\r\n //#region Utilities\r\n private cacheExpired<T>(cache: CacheObject<T>): boolean {\r\n if (!cache) {\r\n return true;\r\n }\r\n\r\n const lifeMinutes = this.config?.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n const expiration = cache.lastUpdate.plus({ minutes: lifeMinutes});\r\n\r\n return DateTime.now() > expiration;\r\n }\r\n //#endregion\r\n\r\n //#region Initialization\r\n constructor() {\r\n this.configureCaching();\r\n this.configureLogging();\r\n }\r\n\r\n private configureCaching(): void {\r\n // If caching config is missing entirely, give it a default\r\n if (this.config) {\r\n this.config.caching = this.config?.caching ?? {\r\n enabled: false,\r\n lifeMinutes: this.defaultCacheLifeMinutes\r\n };\r\n }\r\n\r\n this.cache = {\r\n photos: undefined,\r\n users: undefined\r\n };\r\n }\r\n\r\n private configureLogging(): void {\r\n // If logging config is missing entirely, give it a default\r\n if (this.config) {\r\n this.config.logging = this.config.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 //#endregion\r\n\r\n getListItems(request: ListItemsRequest): Observable<ListItem[]> {\r\n const apiUrl = this.config?.apiUrl;\r\n const endpoint = this.config?.listItemsEndpoint;\r\n\r\n return this.http.post<ListItem[]>(`${apiUrl}${endpoint}`, request);\r\n }\r\n\r\n getPhotos(): Observable<PhotoItem[]> {\r\n const request: ListItemsRequest = {\r\n username: this.config?.username,\r\n password: this.config?.password,\r\n site: this.config?.photos.site,\r\n list: this.config?.photos.list,\r\n additionalPropertiesToRetrieve: this.config?.photos.additionalPropertiesToRetrieve\r\n };\r\n\r\n const observable$ = this.getListItems(request) as Observable<PhotoItem[]>;\r\n\r\n if (this.config?.caching?.enabled) {\r\n if (this.cacheExpired<PhotoItem>(this.cache?.photos!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.cache!.photos = {\r\n data,\r\n lastUpdate: DateTime.now()\r\n };\r\n\r\n if (this.config?.logging?.dataCached) {\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n console.log(`Photos cached for ${lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.config.logging?.cachedDataReturned) {\r\n console.log('Returning cached photos');\r\n }\r\n\r\n return of(this.cache!.photos!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.config?.logging?.freshDataReturned) {\r\n console.log('Returning fresh photos');\r\n }\r\n\r\n return observable$;\r\n }\r\n\r\n getUsers(request: UserRequest, id?: number): Observable<User | User[]> {\r\n const apiUrl = this.config?.apiUrl;\r\n const endpoint = this.config?.usersEndpoint;\r\n \r\n const observable$ = this.http.post<User | User[]>(`${apiUrl}${endpoint}/${id ?? ''}`, request);\r\n\r\n //#region Single user\r\n if (id) {\r\n return observable$;\r\n }\r\n //#endregion\r\n\r\n //#region Multiple users\r\n if (this.config?.caching?.enabled) {\r\n if (this.cacheExpired<User>(this.cache!.users!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.cache!.users = {\r\n data: data as User[],\r\n lastUpdate: DateTime.now()\r\n };\r\n\r\n if (this.config?.logging?.dataCached) {\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n console.log(`Users cached for ${lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.config.logging?.cachedDataReturned) {\r\n console.log('Returning cached users');\r\n }\r\n\r\n return of(this.cache!.users!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.config?.logging?.freshDataReturned) {\r\n console.log('Returning fresh users');\r\n }\r\n\r\n return observable$;\r\n //#endregion\r\n }\r\n\r\n clearCache(): void {\r\n this.cache = undefined;\r\n\r\n if (this.config?.logging?.cacheCleared) {\r\n console.log('Cache cleared');\r\n }\r\n }\r\n}","import { inject, Pipe, PipeTransform } from '@angular/core';\r\nimport { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\r\nimport { map, of } from 'rxjs';\r\nimport { PhotoItem } from '../model/photo-item';\r\nimport { SharePointService } from '../services/sharepoint.service';\r\n\r\n@Pipe({\r\n name: 'userPhotoUrl'\r\n})\r\nexport class UserPhotoUrlPipe implements PipeTransform {\r\n private sharePointService = inject(SharePointService);\r\n\r\n transform(user: CleavelandPriceUser, userPhotos?: PhotoItem[]): any {\r\n const observable$ = userPhotos ? of(userPhotos) : this.sharePointService.getPhotos();\r\n\r\n return observable$\r\n .pipe(\r\n map(photos =>\r\n photos.find(pic =>\r\n // Try to match by employeeNumber, accountName, or title\r\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\r\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\r\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase())\r\n )?.encodedAbsUrl\r\n )\r\n );\r\n\r\n /*const photo = photos\r\n .find(pic =>\r\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\r\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\r\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase()));\r\n\r\n if (!photo) {\r\n console.log(`No photo match for ${user.displayName}`);\r\n }\r\n\r\n return photo ? photo.encodedAbsUrl : null;*/\r\n }\r\n}","import { Component, inject, input, OnInit } from '@angular/core';\r\nimport { ActiveDirectoryService, CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\r\nimport { PhotoItem } from '../../model/photo-item';\r\n\r\n@Component({\r\n selector: 'user-photo',\r\n templateUrl: './user-photo.component.html',\r\n styleUrls: ['./user-photo.component.css']\r\n})\r\nexport class UserPhotoComponent implements OnInit {\r\n private activeDirectoryService = inject(ActiveDirectoryService);\r\n\r\n user = input.required<CleavelandPriceUser | string>();\r\n protected _user!: CleavelandPriceUser;\r\n\r\n //employee = input<CleavelandPriceUser | undefined>();\r\n // Or...\r\n //accountName = input<string | undefined>();\r\n\r\n userPhotos = input<PhotoItem[] | undefined>();\r\n size = input(\"2em\");\r\n notRound = input(false);\r\n\r\n ngOnInit(): void {;\r\n if (typeof this.user() === 'string') {\r\n // Developer passed in an account name instead of a user object\r\n // We need to do the work of getting the user object ourselves\r\n this.activeDirectoryService.getUser(this.user() as string)\r\n .subscribe(user => this._user = user);\r\n } else {\r\n this._user = this.user() as CleavelandPriceUser;\r\n }\r\n }\r\n}\r\n","@if (_user) {\r\n @if ((_user | userPhotoUrl:userPhotos() | async)) {\r\n <img\r\n [src]=\"_user | userPhotoUrl:userPhotos() | async\"\r\n [style.width]=\"size()\"\r\n [style.height]=\"size()\"\r\n [style.border-radius]=\"notRound() ? 'initial' : '100%'\">\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\n\r\nimport { UserPhotoComponent } from './components/user-photo/user-photo.component';\r\nimport { ServiceConfig } from './model/service-config';\r\nimport { UserPhotoUrlPipe } from './pipes/user-photo-url.pipe';\r\nimport { SharePointService } from './services/sharepoint.service';\r\n\r\n@NgModule({\r\n declarations: [\r\n UserPhotoUrlPipe,\r\n UserPhotoComponent\r\n ],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: [\r\n UserPhotoUrlPipe,\r\n UserPhotoComponent\r\n ]\r\n})\r\nexport class SharePointModule {\r\n static forRoot(config: ServiceConfig): ModuleWithProviders<SharePointModule> {\r\n return {\r\n ngModule: SharePointModule,\r\n providers: [\r\n SharePointService,\r\n { provide: ServiceConfig, useValue: config }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: SharePointModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'SharePointModule 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 './public_api';\n"],"names":["NgxLibServiceConfig","i2.UserPhotoUrlPipe"],"mappings":";;;;;;;;;;AAEM,MAAO,aAAc,SAAQA,eAAmB,CAAA;;AAwBlD,IAAA,WAAA,CAAY,yBAA2C,KAAK,EAAA;QACxD,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAxBlC,IAAa,CAAA,aAAA,GAAG,mBAAmB,CAAC;QACpC,IAAiB,CAAA,iBAAA,GAAG,uBAAuB,CAAC;AAG5C,QAAA,IAAA,CAAA,MAAM,GAAG;AACL,YAAA,IAAI,EAAE,uDA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AA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA,EAAA;AAAhB,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,gBAAgB,iBAXzB,gBAAgB;YAChB,kBAAkB,CAAA,EAAA,OAAA,EAAA,CAGlB,YAAY,CAAA,EAAA,OAAA,EAAA,CAGZ,gBAAgB;YAChB,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,gBAAgB,YAPzB,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAOH,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAb5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,gBAAgB;wBAChB,kBAAkB;AACnB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,gBAAgB;wBAChB,kBAAkB;AACnB,qBAAA;AACF,iBAAA,CAAA;;0BAYc,QAAQ;;0BAAI,QAAQ;;;AChCnC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"cleavelandprice-ngx-lib-sharepoint.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/sharepoint-service-options.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/services/sharepoint.service.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/pipes/user-photo-url.pipe.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/user-photo/user-photo.component.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/user-photo/user-photo.component.html","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/sharepoint.module.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/cleavelandprice-ngx-lib-sharepoint.ts"],"sourcesContent":["import { InjectionToken } from \"@angular/core\";\r\nimport { CachingConfig, Credentials, LoggingConfig, NgxLibServiceOptions } from \"@cleavelandprice/ngx-lib\";\r\n\r\nexport interface SharePointEndpoints {\r\n users?: string;\r\n listItems?: string;\r\n}\r\n\r\nexport interface SharePointPhotos {\r\n site?: string;\r\n list?: string;\r\n additionalPropertiesToRetrieve?: string[]\r\n}\r\n\r\nexport interface SharePointServiceOptions extends NgxLibServiceOptions {\r\n credentials?: Credentials;\r\n caching?: CachingConfig;\r\n endpoints?: SharePointEndpoints;\r\n photos?: SharePointPhotos;\r\n logging?: LoggingConfig;\r\n}\r\nexport const SharePointServiceOptionsToken = new InjectionToken<SharePointServiceOptions>('');","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 { CacheObject } from '../model/cache-object';\r\nimport { ListItem } from '../model/list-item';\r\nimport { ListItemsRequest } from '../model/list-items-request';\r\nimport { PhotoItem } from '../model/photo-item';\r\nimport { SharePointServiceOptions, SharePointServiceOptionsToken } from '../model/sharepoint-service-options';\r\nimport { User } from '../model/user';\r\nimport { UserRequest } from '../model/user-request';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SharePointService extends NgxLibServiceBase {\r\n #services = {\r\n http: inject(HttpClient)\r\n };\r\n\r\n #cache: {\r\n users?: CacheObject<User>,\r\n photos?: CacheObject<PhotoItem>\r\n } = { users: undefined, photos: undefined };\r\n\r\n #defaultCacheLifeMinutes = 720;\r\n\r\n //#region Utilities\r\n #cacheExpired<T>(cache: CacheObject<T>): boolean {\r\n if (!cache) {\r\n return true;\r\n }\r\n\r\n const lifeMinutes = this.options?.caching?.lifeMinutes ?? this.#defaultCacheLifeMinutes;\r\n const expiration = cache.lastUpdate.plus({ minutes: lifeMinutes});\r\n\r\n return DateTime.now() > expiration;\r\n }\r\n //#endregion\r\n\r\n //#region Initialization\r\n constructor(@Optional() @Inject(SharePointServiceOptionsToken) private options: SharePointServiceOptions) {\r\n\r\n super(options);\r\n\r\n this.options = {\r\n ...options,\r\n \r\n credentials: options?.credentials ?? {\r\n username: 'viewer',\r\n password: 'viewer'\r\n },\r\n\r\n caching: options?.caching ?? {\r\n enabled: false,\r\n lifeMinutes: this.#defaultCacheLifeMinutes\r\n },\r\n\r\n endpoints: options?.endpoints ?? {\r\n users: `/sharepoint/users`,\r\n listItems: `/sharepoint/listitems`\r\n },\r\n \r\n photos: options?.photos ?? {\r\n site: 'https://sharepoint.cleavelandprice.com/digitaldisplay',\r\n list: 'Employee Thumbnail Photos',\r\n additionalPropertiesToRetrieve: [ 'EncodedAbsUrl' ]\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 //#endregion\r\n\r\n getListItems(request: ListItemsRequest): Observable<ListItem[]> {\r\n //const apiUrl = this.options?.apiUrl;\r\n const endpoint = this.options?.endpoints?.listItems;\r\n\r\n return this.#services.http.post<ListItem[]>(`${this.apiUrl}${endpoint}`, request);\r\n //return this.#services.http.post<ListItem[]>(this.config!.endpoints!.listItems!, request);\r\n }\r\n\r\n getPhotos(): Observable<PhotoItem[]> {\r\n const request: ListItemsRequest = {\r\n username: this.options?.credentials?.username,\r\n password: this.options?.credentials?.password,\r\n site: this.options?.photos?.site,\r\n list: this.options?.photos?.list,\r\n additionalPropertiesToRetrieve: this.options?.photos?.additionalPropertiesToRetrieve\r\n };\r\n\r\n const observable$ = this.getListItems(request) as Observable<PhotoItem[]>;\r\n\r\n if (this.options?.caching?.enabled) {\r\n if (this.#cacheExpired<PhotoItem>(this.#cache?.photos!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.#cache!.photos = {\r\n data,\r\n lastUpdate: DateTime.now()\r\n };\r\n\r\n if (this.options?.logging?.dataCached) {\r\n const lifeMinutes = this.options.caching?.lifeMinutes ?? this.#defaultCacheLifeMinutes;\r\n console.log(`Photos cached for ${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 photos');\r\n }\r\n\r\n return of(this.#cache!.photos!.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 photos');\r\n }\r\n\r\n return observable$;\r\n }\r\n\r\n getUsers(request: UserRequest, id?: number): Observable<User | User[]> {\r\n const endpoint = this.options?.endpoints?.users;\r\n \r\n const observable$ = this.#services.http.post<User | User[]>(`${this.apiUrl}${endpoint}/${id ?? ''}`, request);\r\n\r\n //#region Single user\r\n if (id) {\r\n return observable$;\r\n }\r\n //#endregion\r\n\r\n //#region Multiple users\r\n if (this.options?.caching?.enabled) {\r\n if (this.#cacheExpired<User>(this.#cache!.users!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.#cache!.users = {\r\n data: data as User[],\r\n lastUpdate: DateTime.now()\r\n };\r\n\r\n if (this.options?.logging?.dataCached) {\r\n const lifeMinutes = this.options.caching?.lifeMinutes ?? this.#defaultCacheLifeMinutes;\r\n console.log(`Users cached for ${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!.users!.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 //#endregion\r\n }\r\n\r\n clearCache(): void {\r\n this.#cache = { users: undefined, photos: undefined };\r\n\r\n if (this.options?.logging?.cacheCleared) {\r\n console.log('Cache cleared');\r\n }\r\n }\r\n}","import { inject, Pipe, PipeTransform } from '@angular/core';\nimport { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\nimport { map, of } from 'rxjs';\nimport { PhotoItem } from '../model/photo-item';\nimport { SharePointService } from '../services/sharepoint.service';\n\n@Pipe({\n name: 'userPhotoUrl',\n standalone: true\n})\nexport class UserPhotoUrlPipe implements PipeTransform {\n #sharePointService = inject(SharePointService);\n\n transform(user: CleavelandPriceUser, userPhotos?: PhotoItem[]): any {\n const observable$ = userPhotos ? of(userPhotos) : this.#sharePointService.getPhotos();\n\n return observable$\n .pipe(\n map(photos =>\n photos.find(pic =>\n // Try to match by employeeNumber, accountName, or title\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase())\n )?.encodedAbsUrl\n )\n );\n\n /*const photo = photos\n .find(pic =>\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase()));\n\n if (!photo) {\n console.log(`No photo match for ${user.displayName}`);\n }\n\n return photo ? photo.encodedAbsUrl : null;*/\n }\n}","import { AsyncPipe } from '@angular/common';\r\nimport { Component, inject, input, OnInit } from '@angular/core';\r\nimport { ActiveDirectoryService, CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\r\nimport { PhotoItem } from '../../model/photo-item';\r\nimport { UserPhotoUrlPipe } from '../../pipes/user-photo-url.pipe';\r\n\r\n@Component({\r\n selector: 'user-photo',\r\n templateUrl: './user-photo.component.html',\r\n imports: [\r\n AsyncPipe,\r\n UserPhotoUrlPipe\r\n ],\r\n standalone: true,\r\n styleUrl: './user-photo.component.scss'\r\n})\r\nexport class UserPhotoComponent implements OnInit {\r\n #activeDirectoryService = inject(ActiveDirectoryService);\r\n\r\n user = input.required<CleavelandPriceUser | string>();\r\n protected _user!: CleavelandPriceUser;\r\n\r\n //employee = input<CleavelandPriceUser | undefined>();\r\n // Or...\r\n //accountName = input<string | undefined>();\r\n\r\n userPhotos = input<PhotoItem[] | undefined>();\r\n size = input(\"2em\");\r\n notRound = input(false);\r\n\r\n ngOnInit(): void {;\r\n if (typeof this.user() === 'string') {\r\n // Developer passed in an account name instead of a user object\r\n // We need to do the work of getting the user object ourselves\r\n this.#activeDirectoryService.getUser(this.user() as string)\r\n .subscribe(user => this._user = user);\r\n } else {\r\n this._user = this.user() as CleavelandPriceUser;\r\n }\r\n }\r\n}\r\n","@if (_user) {\r\n @if ((_user | userPhotoUrl:userPhotos() | async)) {\r\n <img\r\n [src]=\"_user | userPhotoUrl:userPhotos() | async\"\r\n [style.width]=\"size()\"\r\n [style.height]=\"size()\"\r\n [style.border-radius]=\"notRound() ? 'initial' : '100%'\">\r\n }\r\n}\r\n","import { CommonModule } from '@angular/common';\r\nimport { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\n\r\nimport { UserPhotoComponent } from './components/user-photo/user-photo.component';\r\nimport { SharePointServiceOptions, SharePointServiceOptionsToken } from './model/sharepoint-service-options';\r\nimport { UserPhotoUrlPipe } from './pipes/user-photo-url.pipe';\r\n\r\n@NgModule({\r\n declarations: [],\r\n imports: [\r\n CommonModule,\r\n UserPhotoUrlPipe,\r\n UserPhotoComponent\r\n ],\r\n exports: [\r\n UserPhotoUrlPipe,\r\n UserPhotoComponent\r\n ]\r\n})\r\nexport class SharePointModule {\r\n /*static forRoot(config: SharePointServiceConfig): ModuleWithProviders<SharePointModule> {\r\n return {\r\n ngModule: SharePointModule,\r\n providers: [\r\n SharePointService,\r\n { provide: SharePointServiceConfigToken, useValue: config }\r\n ]\r\n };\r\n }*/\r\n static forRoot(options: SharePointServiceOptions): ModuleWithProviders<SharePointModule> {\r\n return {\r\n ngModule: SharePointModule,\r\n providers: [\r\n {\r\n provide: SharePointServiceOptionsToken,\r\n useValue: options\r\n }\r\n ]\r\n }\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: SharePointModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'SharePointModule 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 './sharepoint.api';\n"],"names":[],"mappings":";;;;;;;;;MAqBa,6BAA6B,GAAG,IAAI,cAAc,CAA2B,EAAE;;ACJtF,MAAO,iBAAkB,SAAQ,iBAAiB,CAAA;AACtD,IAAA,SAAS,GAAG;AACV,QAAA,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC;KACzB,CAAC;IAEF,MAAM,GAGF,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAE5C,wBAAwB,GAAG,GAAG,CAAC;;AAG/B,IAAA,aAAa,CAAI,KAAqB,EAAA;QACpC,IAAI,CAAC,KAAK,EAAE;AACV,YAAA,OAAO,IAAI,CAAC;SACb;AAED,QAAA,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,IAAI,IAAI,CAAC,wBAAwB,CAAC;AACxF,QAAA,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,WAAW,EAAC,CAAC,CAAC;AAElE,QAAA,OAAO,QAAQ,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC;KACpC;;;AAID,IAAA,WAAA,CAAuE,OAAiC,EAAA;QAEtG,KAAK,CAAC,OAAO,CAAC,CAAC;QAFsD,IAAO,CAAA,OAAA,GAAP,OAAO,CAA0B;QAItG,IAAI,CAAC,OAAO,GAAG;AACb,YAAA,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