@equinor/fusion-framework-react-components-people-provider 0.0.0-context-error-20240131144633

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/CHANGELOG.md ADDED
@@ -0,0 +1,201 @@
1
+ # @equinor/fusion-framework-react-components-people-provider
2
+
3
+ ## 0.0.0-context-error-20240131144633
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies []:
8
+ - @equinor/fusion-framework-react@0.0.0-context-error-20240131144633
9
+ - @equinor/fusion-framework-react-module-bookmark@0.0.0-context-error-20240131144633
10
+
11
+ ## 1.1.12
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [[`8b031c3`](https://github.com/equinor/fusion-framework/commit/8b031c31f314deeffdf395fc847e4279b61aab7e)]:
16
+ - @equinor/fusion-framework-react@6.0.0
17
+ - @equinor/fusion-framework-react-module-bookmark@2.0.30
18
+
19
+ ## 1.1.11
20
+
21
+ ### Patch Changes
22
+
23
+ - Updated dependencies []:
24
+ - @equinor/fusion-framework-react-module-bookmark@2.0.29
25
+
26
+ ## 1.1.10
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies []:
31
+ - @equinor/fusion-framework-react@5.3.9
32
+ - @equinor/fusion-framework-react-module-bookmark@2.0.28
33
+
34
+ ## 1.1.9
35
+
36
+ ### Patch Changes
37
+
38
+ - [#1565](https://github.com/equinor/fusion-framework/pull/1565) [`4e7dbce`](https://github.com/equinor/fusion-framework/commit/4e7dbce1a92b093bec91d48d38afd7b70fe03296) Thanks [@dependabot](https://github.com/apps/dependabot)! - build(deps): bump @equinor/fusion-wc-person from 2.1.8 to 2.3.0
39
+
40
+ - Updated dependencies []:
41
+ - @equinor/fusion-framework-react@5.3.8
42
+ - @equinor/fusion-framework-module-services@3.2.3
43
+ - @equinor/fusion-framework-react-module-bookmark@2.0.27
44
+
45
+ ## 1.1.8
46
+
47
+ ### Patch Changes
48
+
49
+ - Updated dependencies []:
50
+ - @equinor/fusion-framework-module-services@3.2.3
51
+ - @equinor/fusion-framework-react@5.3.7
52
+ - @equinor/fusion-framework-react-module-bookmark@2.0.26
53
+
54
+ ## 1.1.7
55
+
56
+ ### Patch Changes
57
+
58
+ - Updated dependencies []:
59
+ - @equinor/fusion-framework-module-services@3.2.3
60
+ - @equinor/fusion-framework-react@5.3.6
61
+ - @equinor/fusion-framework-react-module-bookmark@2.0.25
62
+
63
+ ## 1.1.6
64
+
65
+ ### Patch Changes
66
+
67
+ - Updated dependencies []:
68
+ - @equinor/fusion-framework-react@5.3.5
69
+ - @equinor/fusion-framework-react-module-bookmark@2.0.24
70
+ - @equinor/fusion-query@4.0.5
71
+ - @equinor/fusion-framework-module-services@3.2.3
72
+
73
+ ## 1.1.5
74
+
75
+ ### Patch Changes
76
+
77
+ - Updated dependencies [[`9c24e84`](https://github.com/equinor/fusion-framework/commit/9c24e847d041dea8384c77439e6b237f5bdb3125)]:
78
+ - @equinor/fusion-framework-react-module-bookmark@2.0.23
79
+ - @equinor/fusion-framework-module-services@3.2.3
80
+ - @equinor/fusion-framework-react@5.3.4
81
+ - @equinor/fusion-query@4.0.4
82
+ - @equinor/fusion-framework-react-module@3.0.7
83
+
84
+ ## 1.1.4
85
+
86
+ ### Patch Changes
87
+
88
+ - [`22909e77`](https://github.com/equinor/fusion-framework/commit/22909e77488b099697dccec93e7ac8416dc4a5bd) Thanks [@odinr](https://github.com/odinr)! - updated @equinor/fusion-wc-person to 2.2.0
89
+
90
+ - Updated dependencies []:
91
+ - @equinor/fusion-framework-react-module-bookmark@2.0.22
92
+
93
+ ## 1.1.3
94
+
95
+ ### Patch Changes
96
+
97
+ - [#1498](https://github.com/equinor/fusion-framework/pull/1498) [`7287fa3d`](https://github.com/equinor/fusion-framework/commit/7287fa3dca655c84b3a4f5f904e3f423ec341e7a) Thanks [@odinr](https://github.com/odinr)! - bump @equinor/fusion-wc-person from 2.1.0 to 2.1.8
98
+
99
+ ## 1.1.2
100
+
101
+ ### Patch Changes
102
+
103
+ - Updated dependencies [[`446b63ce`](https://github.com/equinor/fusion-framework/commit/446b63ce44b59a3aaab4399c0d877d3a1b560a0e)]:
104
+ - @equinor/fusion-query@4.0.3
105
+ - @equinor/fusion-framework-react-module-bookmark@2.0.21
106
+ - @equinor/fusion-framework-react@5.3.3
107
+ - @equinor/fusion-framework-module-services@3.2.2
108
+
109
+ ## 1.1.1
110
+
111
+ ### Patch Changes
112
+
113
+ - [#1375](https://github.com/equinor/fusion-framework/pull/1375) [`f50ea5da`](https://github.com/equinor/fusion-framework/commit/f50ea5dab449ce7a5e3071f65fac4e800a619eec) Thanks [@odinr](https://github.com/odinr)! - update people deps
114
+
115
+ ## 1.1.0
116
+
117
+ ### Minor Changes
118
+
119
+ - [`3e38c9cc`](https://github.com/equinor/fusion-framework/commit/3e38c9cc925fc0456837e42e7ee3ac55e9553bad) Thanks [@odinr](https://github.com/odinr)! - Observer provided abort signal
120
+
121
+ ### Patch Changes
122
+
123
+ - [`cc7bcfb5`](https://github.com/equinor/fusion-framework/commit/cc7bcfb51187fb757b95793356da4a11b233d930) Thanks [@odinr](https://github.com/odinr)! - update @equinor/fusion-wc-person to 1.1.1
124
+
125
+ - [#1306](https://github.com/equinor/fusion-framework/pull/1306) [`f65c4531`](https://github.com/equinor/fusion-framework/commit/f65c453178e2c581acb154d5839971c75f60fa86) Thanks [@odinr](https://github.com/odinr)! - Allow providing fallback image
126
+
127
+ when defining a `PeopleResolverProvider`, one might want to provide a blob for fallback when a person photo is not found.
128
+
129
+ > this will increase the general resolve time, since repeating request for resolving a person photo will not execute a new query until cache expires
130
+
131
+ ```tsx
132
+ import { PeopleResolverProvider } from "@equinor/fusion-framework-react-components-people-provider";
133
+ import fallbackSvg from "./resources/fallback-photo.svg";
134
+
135
+ const fallbackImage = new Blob([fallbackSvg], { type: "image/svg+xml" });
136
+
137
+ const App = () => (
138
+ <PeopleResolverProvider options={{ fallbackImage }}>
139
+ ...children
140
+ </PeopleResolverProvider>
141
+ );
142
+ ```
143
+
144
+ - [`9f121865`](https://github.com/equinor/fusion-framework/commit/9f121865254a0c76c4a812e6e42bfe3c7086c714) Thanks [@odinr](https://github.com/odinr)! - update types
145
+
146
+ - [`518b8476`](https://github.com/equinor/fusion-framework/commit/518b8476bb40255d05e937663d3a513de479a1f8) Thanks [@odinr](https://github.com/odinr)! - fixed query args for abort signal
147
+
148
+ - [#1345](https://github.com/equinor/fusion-framework/pull/1345) [`9d9f629e`](https://github.com/equinor/fusion-framework/commit/9d9f629e007df38db75067781b251b7e5e9673da) Thanks [@asbjornhaland](https://github.com/asbjornhaland)! - update @equinor/fusion-wc-person to 2.0.1
149
+
150
+ - [`63592229`](https://github.com/equinor/fusion-framework/commit/63592229cea4d3606289738fe14b432e9978623f) Thanks [@odinr](https://github.com/odinr)! - fixed prop interface of `PeopleResolverComponent`
151
+
152
+ - Updated dependencies [[`ddc31c35`](https://github.com/equinor/fusion-framework/commit/ddc31c3571e36be057095238cf22e78051f423b0), [`7ad31761`](https://github.com/equinor/fusion-framework/commit/7ad3176102f92da108b67ede6fdf29b76149bed9)]:
153
+ - @equinor/fusion-framework-module-services@3.2.2
154
+ - @equinor/fusion-query@4.0.2
155
+ - @equinor/fusion-framework-react-module-bookmark@2.0.20
156
+ - @equinor/fusion-framework-react@5.3.2
157
+
158
+ ## 1.0.1
159
+
160
+ ### Patch Changes
161
+
162
+ - [`b5dfe5d2`](https://github.com/equinor/fusion-framework/commit/b5dfe5d29a249e0cca6c9589322931dfedd06acc) Thanks [@odinr](https://github.com/odinr)! - force patch bump, realign missing snapshot
163
+
164
+ - Updated dependencies [[`b5dfe5d2`](https://github.com/equinor/fusion-framework/commit/b5dfe5d29a249e0cca6c9589322931dfedd06acc)]:
165
+ - @equinor/fusion-framework-react@5.3.1
166
+ - @equinor/fusion-framework-react-module-bookmark@2.0.19
167
+ - @equinor/fusion-framework-react-module@3.0.6
168
+ - @equinor/fusion-query@4.0.1
169
+
170
+ ## 1.0.0
171
+
172
+ ### Major Changes
173
+
174
+ - [#1255](https://github.com/equinor/fusion-framework/pull/1255) [`de46f0a2`](https://github.com/equinor/fusion-framework/commit/de46f0a2ce93134fc32bf587d29dd32d7ab9a8d9) Thanks [@odinr](https://github.com/odinr)! - Component for providing people api resources to the @equinor/fusion-wc-person and @equinor/fusion-react-person components
175
+
176
+ mapping and caching of `@equinor/fusion-framework-module-services/people`
177
+
178
+ > Strongly collated to the Fusion ecosystems
179
+
180
+ ```tsx
181
+ import { PeopleResolverProvider } from "@equinor/fusion-framework-react-components-people-provider";
182
+
183
+ <PeopleResolverProvider>
184
+ <fwc-person-avatar azureId="cbc6480d-12c1-467e-b0b8-cfbb22612daa"></fwc-person-avatar>
185
+ <fwc-person-card azureId="cbc6480d-12c1-467e-b0b8-cfbb22612daa"></fwc-person-card>
186
+ <fwc-person-list-item azureId="cbc6480d-12c1-467e-b0b8-cfbb22612daa"></fwc-person-list-item>
187
+ </PeopleResolverProvider>;
188
+ ```
189
+
190
+ > we might in the future provide a module which provides same functionality as the resolver
191
+ >
192
+ > atm there are no flexible way to configure this provider since the api models are strongly collated to the models of the components
193
+ >
194
+ > if requested we can create a provider for the functionality
195
+
196
+ ### Patch Changes
197
+
198
+ - Updated dependencies [[`3896fbec`](https://github.com/equinor/fusion-framework/commit/3896fbec3458dbe2ebd66e772465d5f89cd20658), [`ebcabd0e`](https://github.com/equinor/fusion-framework/commit/ebcabd0e6945e1420a0a9a7d82bd9255da1b8578), [`8739a5a6`](https://github.com/equinor/fusion-framework/commit/8739a5a65d8aaa46ce9ef56cce013efeeb006e8a)]:
199
+ - @equinor/fusion-framework-react@5.3.0
200
+ - @equinor/fusion-query@4.0.0
201
+ - @equinor/fusion-framework-react-module-bookmark@2.0.18
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Equinor
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ Component for providing resolver to person elements
2
+
3
+ mapping and caching of `@equinor/fusion-framework-module-services/people`
4
+
5
+ > Strongly collated to the Fusion ecosystems
6
+
7
+ ```tsx
8
+ import { PeopleResolverProvider } from '@equinor/fusion-framework-react-components-people-provider';
9
+
10
+ <PeopleResolverProvider>
11
+ <fwc-person-avatar azureId='cbc6480d-12c1-467e-b0b8-cfbb22612daa'></fwc-person-avatar>
12
+ <fwc-person-card azureId='cbc6480d-12c1-467e-b0b8-cfbb22612daa'></fwc-person-card>
13
+ <fwc-person-list-item azureId='cbc6480d-12c1-467e-b0b8-cfbb22612daa'></fwc-person-list-item>
14
+ </PeopleResolverProvider>
15
+ ```
16
+
17
+ > we might in the future provide a module which provides same functionality as the resolver
18
+ >
19
+ > atm there are no flexible way to configure this provider since the api models are strongly collated to the models of the components
20
+ >
21
+ > if requested we can create a provider for the functionality
22
+
23
+ ### Fallback image
24
+ ```tsx
25
+ import { PeopleResolverProvider } from '@equinor/fusion-framework-react-components-people-provider';
26
+ import fallbackSvg from './resources/fallback-photo.svg';
27
+
28
+ const fallbackImage = new Blob([fallbackSvg], { type: 'image/svg+xml' });
29
+
30
+ const App = () => (
31
+ <PeopleResolverProvider options={{fallbackImage}}>
32
+ ...children
33
+ </PeopleResolverProvider>
34
+ );
35
+ ```
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from 'react';
3
+ import { PersonProviderElement, PersonAvatarElement, PersonCardElement, PersonListItemElement, PersonSelectElement, } from '@equinor/fusion-wc-person';
4
+ PersonProviderElement;
5
+ PersonAvatarElement;
6
+ PersonCardElement;
7
+ PersonListItemElement;
8
+ PersonSelectElement;
9
+ export const PeopleResolverComponent = (props) => {
10
+ const { resolver, children } = props;
11
+ const ref = useRef(null);
12
+ useEffect(() => {
13
+ if (ref.current && resolver) {
14
+ ref.current.resolver = resolver;
15
+ }
16
+ }, [ref, resolver]);
17
+ return _jsx("fwc-person-provider", { ref: ref, children: children });
18
+ };
19
+ //# sourceMappingURL=PeopleResolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PeopleResolver.js","sourceRoot":"","sources":["../../src/PeopleResolver.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EACH,qBAAqB,EACrB,mBAAmB,EACnB,iBAAiB,EAEjB,qBAAqB,EACrB,mBAAmB,GACtB,MAAM,2BAA2B,CAAC;AAEnC,qBAAqB,CAAC;AACtB,mBAAmB,CAAC;AACpB,iBAAiB,CAAC;AAClB,qBAAqB,CAAC;AACtB,mBAAmB,CAAC;AAIpB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACnC,KAA4D,EAC9D,EAAE;IACA,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IACrC,MAAM,GAAG,GAAG,MAAM,CAA+B,IAAI,CAAC,CAAC;IACvD,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,GAAG,CAAC,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC1B,GAAG,CAAC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACpC,CAAC;IACL,CAAC,EAAE,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC,CAAC;IACpB,OAAO,8BAAqB,GAAG,EAAE,GAAG,YAAG,QAAQ,GAAuB,CAAC;AAC3E,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Suspense, useMemo } from 'react';
3
+ import { useModule } from '@equinor/fusion-framework-react-module';
4
+ import { makeResolver } from './makeResolver';
5
+ export const PeopleResolverProvider = (props) => {
6
+ const { children, options } = props;
7
+ const services = useModule('services');
8
+ if (!services) {
9
+ throw Error('missing service module');
10
+ }
11
+ const Component = useMemo(() => makeResolver(services, options), [services, options]);
12
+ return (_jsx(Suspense, { fallback: _jsx("span", { children: "TODO" }), children: _jsx(Component, { children: children }) }));
13
+ };
14
+ export default PeopleResolverProvider;
15
+ //# sourceMappingURL=PeopleResolverProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PeopleResolverProvider.js","sourceRoot":"","sources":["../../src/PeopleResolverProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAO9C,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAkC,EAAE,EAAE;IACzE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACpC,MAAM,QAAQ,GAAG,SAAS,CAAiB,UAAU,CAAC,CAAC;IACvD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC1C,CAAC;IACD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;IACtF,OAAO,CACH,KAAC,QAAQ,IAAC,QAAQ,EAAE,kCAAiB,YACjC,KAAC,SAAS,cAAE,QAAQ,GAAa,GAC1B,CACd,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
@@ -0,0 +1,146 @@
1
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
+ if (kind === "m") throw new TypeError("Private method is not writable");
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _PersonController_personQuery, _PersonController_personSearchQuery, _PersonController_personPhotoQuery;
13
+ import { EMPTY, concat, from, fromEvent, of } from 'rxjs';
14
+ import { catchError, filter, find, map, switchMap, take, takeUntil } from 'rxjs/operators';
15
+ import { isApiPerson } from '@equinor/fusion-framework-module-services/people/utils';
16
+ import { Query } from '@equinor/fusion-query';
17
+ import { queryValue } from '@equinor/fusion-query/operators';
18
+ const personMatcher = (args) => (value) => {
19
+ var _a, _b;
20
+ const { azureId, upn } = args;
21
+ if (azureId && upn) {
22
+ return (((_a = value.upn) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) === upn.toLocaleLowerCase() &&
23
+ value.azureUniqueId === azureId);
24
+ }
25
+ else if (azureId) {
26
+ return value.azureUniqueId === azureId;
27
+ }
28
+ else if (upn) {
29
+ return ((_b = value.upn) === null || _b === void 0 ? void 0 : _b.toLocaleLowerCase()) === upn.toLocaleLowerCase();
30
+ }
31
+ return false;
32
+ };
33
+ export class PersonController {
34
+ constructor(client, options) {
35
+ _PersonController_personQuery.set(this, void 0);
36
+ _PersonController_personSearchQuery.set(this, void 0);
37
+ _PersonController_personPhotoQuery.set(this, void 0);
38
+ const expire = 3 * 60 * 1000;
39
+ __classPrivateFieldSet(this, _PersonController_personQuery, new Query({
40
+ expire,
41
+ queueOperator: 'merge',
42
+ key: ({ azureId }) => azureId,
43
+ client: {
44
+ fn: ({ azureId }, signal) => {
45
+ return client.get('v4', 'json$', { azureId, expand: ['manager', 'positions'] }, { signal });
46
+ },
47
+ },
48
+ }), "f");
49
+ __classPrivateFieldSet(this, _PersonController_personSearchQuery, new Query({
50
+ expire,
51
+ queueOperator: 'merge',
52
+ key: ({ search }) => search,
53
+ client: {
54
+ fn: ({ search }, signal) => {
55
+ return client.query('v2', 'json$', { search }, { signal });
56
+ },
57
+ },
58
+ }), "f");
59
+ __classPrivateFieldSet(this, _PersonController_personPhotoQuery, new Query({
60
+ expire,
61
+ queueOperator: 'merge',
62
+ key: ({ azureId }) => azureId,
63
+ client: {
64
+ fn: ({ azureId }, signal) => {
65
+ return client.photo('v2', 'blob$', { azureId }, { signal }).pipe(catchError((err) => {
66
+ const apiError = err;
67
+ if (apiError.response.status === 404 && (options === null || options === void 0 ? void 0 : options.fallbackImage)) {
68
+ return of(options === null || options === void 0 ? void 0 : options.fallbackImage);
69
+ }
70
+ return of(err);
71
+ }));
72
+ },
73
+ },
74
+ }), "f");
75
+ }
76
+ search(args) {
77
+ const { search, signal } = args;
78
+ return __classPrivateFieldGet(this, _PersonController_personSearchQuery, "f").query({ search }, { signal }).pipe(queryValue);
79
+ }
80
+ getPhoto(args) {
81
+ const { azureId, upn, signal } = args;
82
+ if (azureId) {
83
+ return this._getPersonPhotoByAzureId(azureId, signal);
84
+ }
85
+ else if (upn) {
86
+ return this._getPersonPhotoByUpn(upn, signal);
87
+ }
88
+ throw Error('invalid args provided');
89
+ }
90
+ getPerson(args) {
91
+ const { azureId, upn, signal } = args;
92
+ if (azureId) {
93
+ return this._getPersonByAzureId(azureId, signal);
94
+ }
95
+ else if (upn) {
96
+ return this._getPersonByUpn(upn, signal);
97
+ }
98
+ throw Error('invalid args provided');
99
+ }
100
+ getPersonInfo(args) {
101
+ const { azureId, upn, signal } = args;
102
+ if (azureId) {
103
+ return this._getPersonInfoById(azureId, signal);
104
+ }
105
+ else if (upn) {
106
+ return this._getPersonInfoByUpn(upn, signal);
107
+ }
108
+ throw Error('invalid args provided');
109
+ }
110
+ _getPersonByUpn(upn, signal) {
111
+ const abort$ = signal ? fromEvent(signal, 'abort') : EMPTY;
112
+ return concat(this._personCache$({ upn }), this._getPersonInfoByUpn(upn, signal).pipe(filter(isApiPerson('v2')), switchMap(({ azureUniqueId: azureId }) => {
113
+ return this._getPersonByAzureId(azureId, signal);
114
+ }))).pipe(filter(isApiPerson('v4')), takeUntil(abort$));
115
+ }
116
+ _getPersonByAzureId(azureId, signal) {
117
+ return __classPrivateFieldGet(this, _PersonController_personQuery, "f").query({ azureId }, { signal }).pipe(queryValue);
118
+ }
119
+ _getPersonInfoById(azureId, signal) {
120
+ const abort$ = signal ? fromEvent(signal, 'abort') : EMPTY;
121
+ return concat(this._personCache$({ azureId }), this._queryCache$({ azureId }), this._getPersonByAzureId(azureId, signal)).pipe(filter(isApiPerson('v2')), takeUntil(abort$));
122
+ }
123
+ _getPersonInfoByUpn(upn, signal) {
124
+ const matcher = personMatcher({ upn });
125
+ const abort$ = signal ? fromEvent(signal, 'abort') : EMPTY;
126
+ return concat(this._personCache$({ upn }), this._queryCache$({ upn }), __classPrivateFieldGet(this, _PersonController_personSearchQuery, "f").query({ search: upn }, { signal }).pipe(map((x) => x.value.find(matcher)), find(isApiPerson('v2')))).pipe(find(isApiPerson('v2')), filter(isApiPerson('v2')), filter(isApiPerson('v2')), takeUntil(abort$));
127
+ }
128
+ _getPersonPhotoByAzureId(azureId, signal) {
129
+ return __classPrivateFieldGet(this, _PersonController_personPhotoQuery, "f").query({ azureId }, { signal }).pipe(take(1), map((result) => URL.createObjectURL(result.value)));
130
+ }
131
+ _getPersonPhotoByUpn(upn, signal) {
132
+ return this._getPersonInfoByUpn(upn, signal).pipe(take(1), switchMap((x) => this._getPersonPhotoByAzureId(x.azureUniqueId, signal)));
133
+ }
134
+ _personCache$(args) {
135
+ const mather = personMatcher(args);
136
+ return __classPrivateFieldGet(this, _PersonController_personQuery, "f").cache.state$.pipe(take(1), map((x) => { var _a; return (_a = Object.values(x).find((x) => mather(x.value))) === null || _a === void 0 ? void 0 : _a.value; }), find(isApiPerson('v4')), filter(isApiPerson('v4')));
137
+ }
138
+ _queryCache$(args) {
139
+ const mather = personMatcher(args);
140
+ return __classPrivateFieldGet(this, _PersonController_personSearchQuery, "f").cache.state$.pipe(take(1), switchMap((entry) => {
141
+ return from(Object.values(entry)).pipe(map((x) => x.value.find((x) => mather(x))), find(isApiPerson('v2')));
142
+ }), find(isApiPerson('v2')), filter(isApiPerson('v2')));
143
+ }
144
+ }
145
+ _PersonController_personQuery = new WeakMap(), _PersonController_personSearchQuery = new WeakMap(), _PersonController_personPhotoQuery = new WeakMap();
146
+ //# sourceMappingURL=PersonController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PersonController.js","sourceRoot":"","sources":["../../src/PersonController.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAc,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,gB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AAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAElC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,EAE1C,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAC1B,CAAC;QACN,CAAC,CAAC,EACF,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EACvB,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAC5B,CAAC;IACN,CAAC;CACJ"}
@@ -0,0 +1,17 @@
1
+ import { firstValueFrom, map } from 'rxjs';
2
+ export const createResolver = (controller) => ({
3
+ getDetails(args) {
4
+ return firstValueFrom(controller.getPerson(args).pipe(map((x) => (Object.assign(Object.assign({}, x), { azureId: x.azureUniqueId })))));
5
+ },
6
+ getInfo(args) {
7
+ return firstValueFrom(controller.getPersonInfo(args).pipe(map((x) => (Object.assign(Object.assign({}, x), { azureId: x.azureUniqueId })))));
8
+ },
9
+ getPhoto(args) {
10
+ return firstValueFrom(controller.getPhoto(args));
11
+ },
12
+ search(args) {
13
+ return firstValueFrom(controller.search(args).pipe(map((x) => x.map((x) => (Object.assign(Object.assign({}, x), { azureId: x.azureUniqueId }))))));
14
+ },
15
+ });
16
+ export default createResolver;
17
+ //# sourceMappingURL=create-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-resolver.js","sourceRoot":"","sources":["../../src/create-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAK3C,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAA6B,EAAkB,EAAE,CAAC,CAAC;IAC9E,UAAU,CAAC,IAAI;QACX,OAAO,cAAc,CACjB,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAE3B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iCAAM,CAAC,KAAE,OAAO,EAAE,CAAC,CAAC,aAAa,IAA+B,CAAC,CAC/E,CACJ,CAAC;IACN,CAAC;IACD,OAAO,CAAC,IAAI;QACR,OAAO,cAAc,CACjB,UAAU,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAE/B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,iCAAM,CAAC,KAAE,OAAO,EAAE,CAAC,CAAC,aAAa,IAA4B,CAAC,CAC5E,CACJ,CAAC;IACN,CAAC;IACD,QAAQ,CAAC,IAAI;QACT,OAAO,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACrD,CAAC;IACD,MAAM,CAAC,IAAI;QACP,OAAO,cAAc,CACjB,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CACxB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CACN,CAAC,CAAC,GAAG,CACD,CAAC,CAAC,EAAE,EAAE,CACF,iCACO,CAAC,KACJ,OAAO,EAAE,CAAC,CAAC,aAAa,IAKD,CAClC,CACJ,CACJ,CACJ,CAAC;IACN,CAAC;CACJ,CAAC,CAAC;AAEH,eAAe,cAAc,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { PeopleResolverProvider, default } from './PeopleResolverProvider';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC"}
@@ -0,0 +1,26 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { lazy } from 'react';
12
+ import { PeopleResolverComponent } from './PeopleResolver';
13
+ import { PersonController } from './PersonController';
14
+ import { createResolver } from './create-resolver';
15
+ export const makeResolver = (services, options) => {
16
+ return lazy(() => __awaiter(void 0, void 0, void 0, function* () {
17
+ const client = yield services.createPeopleClient();
18
+ const controller = new PersonController(client, options);
19
+ const resolver = createResolver(controller);
20
+ const Component = ({ children }) => (_jsx(PeopleResolverComponent, { resolver: resolver, children: children }));
21
+ return {
22
+ default: Component,
23
+ };
24
+ }));
25
+ };
26
+ //# sourceMappingURL=makeResolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"makeResolver.js","sourceRoot":"","sources":["../../src/makeResolver.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAA2B,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,QAAsB,EAAE,OAAiC,EAAE,EAAE;IACtF,OAAO,IAAI,CAAC,GAAS,EAAE;QACnB,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,kBAAkB,EAAE,CAAC;QACnD,MAAM,UAAU,GAAG,IAAI,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACzD,MAAM,QAAQ,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;QAC5C,MAAM,SAAS,GAAG,CAAC,EAAE,QAAQ,EAA2C,EAAE,EAAE,CAAC,CACzE,KAAC,uBAAuB,IAAC,QAAQ,EAAE,QAAQ,YAAG,QAAQ,GAA2B,CACpF,CAAC;QACF,OAAO;YACH,OAAO,EAAE,SAAS;SACrB,CAAC;IACN,CAAC,CAAA,CAAC,CAAC;AACP,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export const version = '1.1.12';
2
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC"}