@equinor/fusion-framework-module-services 5.1.1-msal-6cf764b628c2afdd64dfd06e42abc953d78556d2 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +103 -98
- package/dist/esm/bookmarks/api-version.js.map +1 -1
- package/dist/esm/bookmarks/client.js.map +1 -1
- package/dist/esm/bookmarks/endpoints/bookmark-apply.get.js.map +1 -1
- package/dist/esm/bookmarks/endpoints/bookmark.delete.js.map +1 -1
- package/dist/esm/bookmarks/endpoints/bookmark.get.js.map +1 -1
- package/dist/esm/bookmarks/endpoints/bookmark.patch.js.map +1 -1
- package/dist/esm/bookmarks/endpoints/bookmark.post.js.map +1 -1
- package/dist/esm/bookmarks/endpoints/user-bookmark-favourite.delete.js.map +1 -1
- package/dist/esm/bookmarks/endpoints/user-bookmark-favourite.head.js.map +1 -1
- package/dist/esm/bookmarks/endpoints/user-bookmark-favourite.post.js.map +1 -1
- package/dist/esm/bookmarks/endpoints/user-bookmarks.get.js.map +1 -1
- package/dist/esm/bookmarks/schemas.js +1 -3
- package/dist/esm/bookmarks/schemas.js.map +1 -1
- package/dist/esm/bookmarks/selectors.js.map +1 -1
- package/dist/esm/context/client.js +2 -2
- package/dist/esm/context/client.js.map +1 -1
- package/dist/esm/context/get/client.js.map +1 -1
- package/dist/esm/context/get/generate-endpoint.js +0 -1
- package/dist/esm/context/get/generate-endpoint.js.map +1 -1
- package/dist/esm/context/get/generate-parameters.js.map +1 -1
- package/dist/esm/context/get/types.js.map +1 -1
- package/dist/esm/context/query/client.js.map +1 -1
- package/dist/esm/context/query/generate-endpoint.js +0 -1
- package/dist/esm/context/query/generate-endpoint.js.map +1 -1
- package/dist/esm/context/query/generate-parameters.js.map +1 -1
- package/dist/esm/context/query/types.js.map +1 -1
- package/dist/esm/context/related/client.js.map +1 -1
- package/dist/esm/context/related/generate-endpoint.js +0 -1
- package/dist/esm/context/related/generate-endpoint.js.map +1 -1
- package/dist/esm/context/related/generate-parameters.js.map +1 -1
- package/dist/esm/context/related/types.js.map +1 -1
- package/dist/esm/context/static.js.map +1 -1
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/module.js.map +1 -1
- package/dist/esm/notification/client.js.map +1 -1
- package/dist/esm/notification/notification/delete/client.js.map +1 -1
- package/dist/esm/notification/notification/delete/generate-endpoint.js +0 -1
- package/dist/esm/notification/notification/delete/generate-endpoint.js.map +1 -1
- package/dist/esm/notification/notification/delete/generate-parameters.js.map +1 -1
- package/dist/esm/notification/notification/get/client.js.map +1 -1
- package/dist/esm/notification/notification/get/generate-endpoint.js +0 -1
- package/dist/esm/notification/notification/get/generate-endpoint.js.map +1 -1
- package/dist/esm/notification/notification/get/generate-parameters.js.map +1 -1
- package/dist/esm/notification/notification/getAll/client.js.map +1 -1
- package/dist/esm/notification/notification/getAll/generate-endpoint.js +0 -1
- package/dist/esm/notification/notification/getAll/generate-endpoint.js.map +1 -1
- package/dist/esm/notification/notification/getAll/generate-parameters.js.map +1 -1
- package/dist/esm/notification/notification/patch/client.js.map +1 -1
- package/dist/esm/notification/notification/patch/generate-endpoint.js +0 -1
- package/dist/esm/notification/notification/patch/generate-endpoint.js.map +1 -1
- package/dist/esm/notification/notification/patch/generate-parameters.js.map +1 -1
- package/dist/esm/notification/notification/post/client.js.map +1 -1
- package/dist/esm/notification/notification/post/generate-endpoint.js +0 -1
- package/dist/esm/notification/notification/post/generate-endpoint.js.map +1 -1
- package/dist/esm/notification/notification/post/generate-parameters.js.map +1 -1
- package/dist/esm/notification/settings/get/client.js.map +1 -1
- package/dist/esm/notification/settings/get/generate-endpoint.js +0 -1
- package/dist/esm/notification/settings/get/generate-endpoint.js.map +1 -1
- package/dist/esm/notification/settings/get/generate-parameters.js.map +1 -1
- package/dist/esm/notification/settings/put/client.js.map +1 -1
- package/dist/esm/notification/settings/put/generate-endpoint.js +0 -1
- package/dist/esm/notification/settings/put/generate-endpoint.js.map +1 -1
- package/dist/esm/notification/settings/put/generate-parameters.js.map +1 -1
- package/dist/esm/notification/static.js.map +1 -1
- package/dist/esm/people/client.js.map +1 -1
- package/dist/esm/people/person-details/client.js.map +1 -1
- package/dist/esm/people/person-details/generate-endpoint.js.map +1 -1
- package/dist/esm/people/person-details/generate-parameters.js.map +1 -1
- package/dist/esm/people/person-photo/client.js.map +1 -1
- package/dist/esm/people/person-photo/generate-endpoint.js.map +1 -1
- package/dist/esm/people/person-photo/generate-parameters.js.map +1 -1
- package/dist/esm/people/query/client.js.map +1 -1
- package/dist/esm/people/query/generate-endpoint.js.map +1 -1
- package/dist/esm/people/query/generate-parameters.js.map +1 -1
- package/dist/esm/people/static.js.map +1 -1
- package/dist/esm/people/utils.js.map +1 -1
- package/dist/esm/provider.js.map +1 -1
- package/dist/esm/utils.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/bookmarks/api-version.d.ts +2 -2
- package/dist/types/bookmarks/client.d.ts +8 -8
- package/dist/types/bookmarks/endpoints/bookmark-apply.get.d.ts +1 -1
- package/dist/types/bookmarks/endpoints/bookmark.delete.d.ts +1 -1
- package/dist/types/bookmarks/endpoints/bookmark.get.d.ts +1 -1
- package/dist/types/bookmarks/endpoints/bookmark.patch.d.ts +1 -1
- package/dist/types/bookmarks/endpoints/bookmark.post.d.ts +1 -1
- package/dist/types/bookmarks/endpoints/user-bookmark-favourite.delete.d.ts +1 -1
- package/dist/types/bookmarks/endpoints/user-bookmark-favourite.head.d.ts +1 -1
- package/dist/types/bookmarks/endpoints/user-bookmark-favourite.post.d.ts +1 -1
- package/dist/types/bookmarks/endpoints/user-bookmarks.get.d.ts +1 -1
- package/dist/types/bookmarks/selectors.d.ts +1 -1
- package/dist/types/bookmarks/types.d.ts +1 -1
- package/dist/types/configurator.d.ts +1 -1
- package/dist/types/context/client.d.ts +4 -4
- package/dist/types/context/get/client.d.ts +1 -1
- package/dist/types/context/get/types.d.ts +2 -2
- package/dist/types/context/query/client.d.ts +1 -1
- package/dist/types/context/query/generate-parameters.d.ts +1 -1
- package/dist/types/context/query/types.d.ts +2 -2
- package/dist/types/context/related/client.d.ts +1 -1
- package/dist/types/context/related/generate-parameters.d.ts +1 -1
- package/dist/types/context/related/types.d.ts +2 -2
- package/dist/types/context/static.d.ts +2 -2
- package/dist/types/module.d.ts +2 -2
- package/dist/types/notification/client.d.ts +9 -9
- package/dist/types/notification/notification/delete/client.d.ts +2 -2
- package/dist/types/notification/notification/delete/generate-parameters.d.ts +2 -2
- package/dist/types/notification/notification/delete/types.d.ts +3 -3
- package/dist/types/notification/notification/get/client.d.ts +2 -2
- package/dist/types/notification/notification/get/generate-parameters.d.ts +2 -2
- package/dist/types/notification/notification/get/types.d.ts +3 -3
- package/dist/types/notification/notification/getAll/client.d.ts +2 -2
- package/dist/types/notification/notification/getAll/generate-parameters.d.ts +2 -2
- package/dist/types/notification/notification/getAll/types.d.ts +3 -3
- package/dist/types/notification/notification/patch/client.d.ts +2 -2
- package/dist/types/notification/notification/patch/generate-parameters.d.ts +2 -2
- package/dist/types/notification/notification/patch/types.d.ts +3 -3
- package/dist/types/notification/notification/post/client.d.ts +2 -2
- package/dist/types/notification/notification/post/generate-parameters.d.ts +2 -2
- package/dist/types/notification/notification/post/types.d.ts +3 -3
- package/dist/types/notification/settings/get/client.d.ts +2 -2
- package/dist/types/notification/settings/get/generate-parameters.d.ts +2 -2
- package/dist/types/notification/settings/get/types.d.ts +3 -3
- package/dist/types/notification/settings/put/client.d.ts +2 -2
- package/dist/types/notification/settings/put/generate-parameters.d.ts +2 -2
- package/dist/types/notification/settings/put/types.d.ts +3 -3
- package/dist/types/notification/static.d.ts +2 -2
- package/dist/types/people/api-models.d.ts +2 -2
- package/dist/types/people/api-models.v2.d.ts +1 -1
- package/dist/types/people/api-models.v4.d.ts +1 -1
- package/dist/types/people/client.d.ts +4 -4
- package/dist/types/people/person-details/client.d.ts +1 -1
- package/dist/types/people/person-details/types.d.ts +1 -1
- package/dist/types/people/person-photo/client.d.ts +1 -1
- package/dist/types/people/person-photo/types.d.ts +2 -2
- package/dist/types/people/query/client.d.ts +1 -1
- package/dist/types/people/query/types.d.ts +2 -2
- package/dist/types/people/static.d.ts +2 -2
- package/dist/types/people/utils.d.ts +1 -1
- package/dist/types/provider.d.ts +3 -3
- package/dist/types/types.d.ts +1 -1
- package/dist/types/utils.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +5 -5
- package/src/bookmarks/api-version.ts +2 -2
- package/src/bookmarks/client.ts +228 -231
- package/src/bookmarks/endpoints/bookmark-apply.get.ts +58 -58
- package/src/bookmarks/endpoints/bookmark.delete.ts +57 -57
- package/src/bookmarks/endpoints/bookmark.get.ts +62 -62
- package/src/bookmarks/endpoints/bookmark.patch.ts +78 -78
- package/src/bookmarks/endpoints/bookmark.post.ts +68 -68
- package/src/bookmarks/endpoints/user-bookmark-favourite.delete.ts +57 -57
- package/src/bookmarks/endpoints/user-bookmark-favourite.head.ts +57 -57
- package/src/bookmarks/endpoints/user-bookmark-favourite.post.ts +58 -58
- package/src/bookmarks/endpoints/user-bookmarks.get.ts +98 -98
- package/src/bookmarks/schemas.ts +54 -56
- package/src/bookmarks/selectors.ts +24 -24
- package/src/bookmarks/types.ts +6 -6
- package/src/configurator.ts +3 -3
- package/src/context/api-models.ts +19 -19
- package/src/context/client.ts +68 -58
- package/src/context/get/client.ts +18 -18
- package/src/context/get/generate-endpoint.ts +13 -14
- package/src/context/get/generate-parameters.ts +9 -9
- package/src/context/get/types.ts +20 -20
- package/src/context/query/client.ts +22 -22
- package/src/context/query/generate-endpoint.ts +43 -44
- package/src/context/query/generate-parameters.ts +10 -10
- package/src/context/query/types.ts +25 -25
- package/src/context/related/client.ts +22 -22
- package/src/context/related/generate-endpoint.ts +40 -41
- package/src/context/related/generate-parameters.ts +10 -10
- package/src/context/related/types.ts +27 -27
- package/src/context/static.ts +3 -3
- package/src/errors.ts +6 -6
- package/src/module.ts +50 -52
- package/src/notification/api-models.ts +36 -36
- package/src/notification/client.ts +131 -151
- package/src/notification/notification/delete/client.ts +22 -22
- package/src/notification/notification/delete/generate-endpoint.ts +13 -14
- package/src/notification/notification/delete/generate-parameters.ts +18 -18
- package/src/notification/notification/delete/types.ts +21 -21
- package/src/notification/notification/get/client.ts +19 -19
- package/src/notification/notification/get/generate-endpoint.ts +13 -14
- package/src/notification/notification/get/generate-parameters.ts +11 -11
- package/src/notification/notification/get/types.ts +21 -21
- package/src/notification/notification/getAll/client.ts +22 -22
- package/src/notification/notification/getAll/generate-endpoint.ts +13 -14
- package/src/notification/notification/getAll/generate-parameters.ts +11 -11
- package/src/notification/notification/getAll/types.ts +21 -21
- package/src/notification/notification/patch/client.ts +22 -22
- package/src/notification/notification/patch/generate-endpoint.ts +13 -14
- package/src/notification/notification/patch/generate-parameters.ts +18 -18
- package/src/notification/notification/patch/types.ts +22 -22
- package/src/notification/notification/post/client.ts +22 -22
- package/src/notification/notification/post/generate-endpoint.ts +13 -14
- package/src/notification/notification/post/generate-parameters.ts +18 -18
- package/src/notification/notification/post/types.ts +31 -31
- package/src/notification/settings/get/client.ts +22 -22
- package/src/notification/settings/get/generate-endpoint.ts +13 -14
- package/src/notification/settings/get/generate-parameters.ts +11 -11
- package/src/notification/settings/get/types.ts +21 -21
- package/src/notification/settings/put/client.ts +22 -22
- package/src/notification/settings/put/generate-endpoint.ts +13 -14
- package/src/notification/settings/put/generate-parameters.ts +20 -20
- package/src/notification/settings/put/types.ts +20 -20
- package/src/notification/static.ts +3 -3
- package/src/people/api-models.ts +30 -30
- package/src/people/api-models.v2.ts +27 -27
- package/src/people/api-models.v4.ts +79 -79
- package/src/people/client.ts +73 -77
- package/src/people/person-details/client.ts +21 -18
- package/src/people/person-details/generate-endpoint.ts +16 -16
- package/src/people/person-details/generate-parameters.ts +8 -8
- package/src/people/person-details/types.ts +13 -13
- package/src/people/person-photo/client.ts +19 -22
- package/src/people/person-photo/generate-endpoint.ts +13 -13
- package/src/people/person-photo/generate-parameters.ts +8 -8
- package/src/people/person-photo/types.ts +8 -8
- package/src/people/query/client.ts +20 -18
- package/src/people/query/generate-endpoint.ts +14 -14
- package/src/people/query/generate-parameters.ts +8 -8
- package/src/people/query/types.ts +10 -10
- package/src/people/static.ts +2 -2
- package/src/people/utils.ts +20 -20
- package/src/provider.ts +85 -85
- package/src/types.ts +34 -34
- package/src/utils.ts +22 -26
- package/src/version.ts +1 -1
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { IHttpClient, ClientRequestInit } from '@equinor/fusion-framework-module-http/client';
|
|
2
|
-
import { ClientMethod } from '../../../types';
|
|
3
|
-
import { ApiNotificationSettingsEntity } from '../../api-models';
|
|
1
|
+
import type { IHttpClient, ClientRequestInit } from '@equinor/fusion-framework-module-http/client';
|
|
2
|
+
import type { ClientMethod } from '../../../types';
|
|
3
|
+
import type { ApiNotificationSettingsEntity } from '../../api-models';
|
|
4
4
|
import { ApiVersion } from '../../static';
|
|
5
5
|
|
|
6
6
|
type PutUserNotificationSettingsArgsTypes = {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
[ApiVersion.v1]: ApiNotificationSettingsEntity<ApiVersion.v1>;
|
|
8
|
+
[ApiVersion.v2]: ApiNotificationSettingsEntity<ApiVersion.v2>;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export type PutUserNotificationSettingsArgs<T extends string> = T extends keyof typeof ApiVersion
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
? PutUserNotificationSettingsArgsTypes[(typeof ApiVersion)[T]]
|
|
13
|
+
: unknown;
|
|
14
14
|
|
|
15
15
|
type GetUserNotificationSettingsResponseTypes = {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
[ApiVersion.v2]: ApiNotificationSettingsEntity<ApiVersion.v2>;
|
|
17
|
+
[ApiVersion.v1]: ApiNotificationSettingsEntity<ApiVersion.v1>;
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export type PutUserNotificationSettingsResponse<T> = T extends keyof typeof ApiVersion
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
? GetUserNotificationSettingsResponseTypes[(typeof ApiVersion)[T]]
|
|
22
|
+
: unknown;
|
|
23
23
|
|
|
24
24
|
export type PutUserNotificationSettingsFn<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
26
|
+
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
27
|
+
TClient extends IHttpClient = IHttpClient,
|
|
28
|
+
TResult = PutUserNotificationSettingsResponse<TVersion>,
|
|
29
29
|
> = (
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
args: PutUserNotificationSettingsArgs<TVersion>,
|
|
31
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
32
32
|
) => PutUserNotificationSettingsResult<TVersion, TMethod, TResult>;
|
|
33
33
|
|
|
34
34
|
export type PutUserNotificationSettingsResult<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
36
|
+
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
37
|
+
TResult = PutUserNotificationSettingsResponse<TVersion>,
|
|
38
38
|
> = ClientMethod<TResult>[TMethod];
|
package/src/people/api-models.ts
CHANGED
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import { ApiPerson_v2 } from './api-models.v2';
|
|
2
|
-
import { ApiPerson_v4 } from './api-models.v4';
|
|
1
|
+
import type { ApiPerson_v2 } from './api-models.v2';
|
|
2
|
+
import type { ApiPerson_v4 } from './api-models.v4';
|
|
3
3
|
import { ApiVersion } from './static';
|
|
4
4
|
|
|
5
5
|
export type ApiProjectMaster = {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
id: string;
|
|
7
|
+
name?: string;
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export type ApiManager = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
azureUniqueId: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
mail?: string;
|
|
14
|
+
department?: string;
|
|
15
|
+
fullDepartment?: string;
|
|
16
|
+
upn?: string;
|
|
17
|
+
jobTitle?: string;
|
|
18
|
+
accountType: ApiProfileAccountType;
|
|
19
|
+
accountClassification: ApiAccountClassification;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
export type ApiInvitationStatus = 'Accepted' | 'Pending' | 'NotSent';
|
|
23
23
|
|
|
24
24
|
export type ApiProfileAccountType =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
| 'Employee'
|
|
26
|
+
| 'Consultant'
|
|
27
|
+
| 'Enterprise'
|
|
28
|
+
| 'External'
|
|
29
|
+
| 'External Hire';
|
|
30
30
|
|
|
31
31
|
// TODO what are these?
|
|
32
32
|
export type ApiAccountClassification = 'Unclassified' | 'Internal' | 'External';
|
|
33
33
|
|
|
34
34
|
export type ApiProfileAccountLink = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
azureUniqueId: string;
|
|
36
|
+
mail?: string;
|
|
37
|
+
isPrimaryAccount?: boolean;
|
|
38
|
+
preferredContactMail?: string;
|
|
39
|
+
isExpired?: boolean;
|
|
40
|
+
upn?: string;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
export type ApiPersonMap = {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
[ApiVersion.v2]: ApiPerson_v2;
|
|
45
|
+
[ApiVersion.v4]: ApiPerson_v4;
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
export type ApiPerson<T extends keyof typeof ApiVersion | ApiVersion> = T extends ApiVersion
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
? ApiPersonMap[T]
|
|
50
|
+
: T extends keyof typeof ApiVersion
|
|
51
|
+
? ApiPersonMap[(typeof ApiVersion)[T]]
|
|
52
|
+
: unknown;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type {
|
|
2
|
+
ApiAccountClassification,
|
|
3
|
+
ApiInvitationStatus,
|
|
4
|
+
ApiProfileAccountLink,
|
|
5
|
+
ApiProfileAccountType,
|
|
6
6
|
} from './api-models';
|
|
7
7
|
|
|
8
8
|
export type ApiPerson_v2 = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
9
|
+
fusionPersonId?: string;
|
|
10
|
+
azureUniqueId: string;
|
|
11
|
+
mail?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
jobTitle?: string;
|
|
14
|
+
department?: string;
|
|
15
|
+
fullDepartment?: string;
|
|
16
|
+
mobilePhone?: string;
|
|
17
|
+
officeLocation?: string;
|
|
18
|
+
sapId?: string;
|
|
19
|
+
employeeId?: string;
|
|
20
|
+
isResourceOwner?: boolean;
|
|
21
|
+
isExpired?: boolean;
|
|
22
|
+
expiredDate?: string;
|
|
23
|
+
upn?: string;
|
|
24
|
+
accountType: ApiProfileAccountType;
|
|
25
|
+
invitationStatus: ApiInvitationStatus;
|
|
26
|
+
accountClassification: ApiAccountClassification;
|
|
27
|
+
managerAzureUniqueId: string;
|
|
28
|
+
linkedAccounts?: Array<ApiProfileAccountLink>;
|
|
29
|
+
isPrimaryAccount?: boolean;
|
|
30
|
+
preferredContactMail?: string;
|
|
31
31
|
};
|
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import type {
|
|
2
|
+
ApiAccountClassification,
|
|
3
|
+
ApiInvitationStatus,
|
|
4
|
+
ApiManager,
|
|
5
|
+
ApiProfileAccountLink,
|
|
6
|
+
ApiProfileAccountType,
|
|
7
|
+
ApiProjectMaster,
|
|
8
8
|
} from './api-models';
|
|
9
9
|
|
|
10
10
|
export type ApiPersonExpandMap_v4 = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
roles: Array<ApiPersonRole_v4>;
|
|
12
|
+
positions: Array<ApiPersonPosition_v4>;
|
|
13
|
+
contracts: Array<ApiPersonContract_v4>;
|
|
14
|
+
manager: ApiManager;
|
|
15
|
+
companies: Array<ApiCompanyInfo_v4>;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export type ApiPersonExpandProps_v4 = keyof ApiPersonExpandMap_v4;
|
|
19
19
|
|
|
20
20
|
export type ApiPerson_v4<TExpand extends Array<ApiPersonExpandProps_v4> = []> = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
21
|
+
azureUniqueId: string;
|
|
22
|
+
mail?: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
jobTitle?: string;
|
|
25
|
+
department?: string;
|
|
26
|
+
fullDepartment?: string;
|
|
27
|
+
mobilePhone?: string;
|
|
28
|
+
officeLocation?: string;
|
|
29
|
+
upn?: string;
|
|
30
|
+
isResourceOwner?: boolean;
|
|
31
|
+
isExpired?: boolean;
|
|
32
|
+
expiredDate?: string;
|
|
33
|
+
isPrimaryAccount?: boolean;
|
|
34
|
+
preferredContactMail?: string;
|
|
35
|
+
accountType?: ApiProfileAccountType;
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
// TODO is this default
|
|
38
|
+
invitationStatus?: ApiInvitationStatus;
|
|
39
|
+
accountClassification?: ApiAccountClassification;
|
|
40
|
+
managerAzureUniqueId?: string;
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
// TODO is this default
|
|
43
|
+
linkedAccounts?: Array<ApiProfileAccountLink>;
|
|
44
44
|
} & /** expanded */ Partial<ApiPersonExpandMap_v4> & {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
/** Provided */
|
|
46
|
+
[K in TExpand[number]]: ApiPersonExpandMap_v4[K];
|
|
47
|
+
};
|
|
48
48
|
|
|
49
49
|
export type ApiCompanyInfo_v4 = {
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
id: string;
|
|
51
|
+
name?: string;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
export type ApiPersonRole_v4 = {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
name?: string;
|
|
56
|
+
displayName?: string;
|
|
57
|
+
sourceSystem?: string;
|
|
58
|
+
type?: string;
|
|
59
|
+
isActive?: boolean;
|
|
60
|
+
activeToUtc?: string;
|
|
61
|
+
onDemandSupport?: boolean;
|
|
62
|
+
scopes?: Array<ApiPersonRoleScope_v4>;
|
|
63
63
|
};
|
|
64
64
|
|
|
65
65
|
export type ApiPersonRoleScope_v4 = {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
type?: string;
|
|
67
|
+
values?: string[];
|
|
68
|
+
valueType?: string;
|
|
69
69
|
};
|
|
70
70
|
|
|
71
71
|
export type ApiPersonPosition_v4 = {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
72
|
+
positionId: string;
|
|
73
|
+
positionExternalId?: string;
|
|
74
|
+
id: string;
|
|
75
|
+
parentPositionId?: string;
|
|
76
|
+
taskOwnerIds?: string[];
|
|
77
|
+
name?: string;
|
|
78
|
+
obs?: string;
|
|
79
|
+
basePosition: ApiPersonBasePosition_v4;
|
|
80
|
+
project: ApiPersonProject_v4;
|
|
81
|
+
appliesFrom: string;
|
|
82
|
+
appliesTo: string;
|
|
83
|
+
workload?: number;
|
|
84
84
|
};
|
|
85
85
|
|
|
86
86
|
export type ApiPersonBasePosition_v4 = {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
id: string;
|
|
88
|
+
name?: string;
|
|
89
|
+
type?: string;
|
|
90
|
+
discipline?: string;
|
|
91
91
|
};
|
|
92
92
|
|
|
93
93
|
export type ApiPersonProject_v4 = {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
94
|
+
id: string;
|
|
95
|
+
name?: string;
|
|
96
|
+
domainId?: string;
|
|
97
|
+
type?: string;
|
|
98
98
|
};
|
|
99
99
|
|
|
100
100
|
export type ApiPersonContract_v4 = {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
101
|
+
id: string;
|
|
102
|
+
name?: string;
|
|
103
|
+
contractNumber?: string;
|
|
104
|
+
companyId?: string;
|
|
105
|
+
companyName?: string;
|
|
106
|
+
project: ApiPersonProject_v4;
|
|
107
|
+
projectMaster: ApiProjectMaster;
|
|
108
|
+
positions: Array<ApiPersonPosition_v4>;
|
|
109
109
|
};
|
|
110
110
|
|
|
111
111
|
export type ApiCompanyInfoV4 = {
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
id: string;
|
|
113
|
+
name?: string;
|
|
114
114
|
};
|
package/src/people/client.ts
CHANGED
|
@@ -1,99 +1,95 @@
|
|
|
1
|
-
import { IHttpClient, ClientRequestInit } from '@equinor/fusion-framework-module-http/client';
|
|
1
|
+
import type { IHttpClient, ClientRequestInit } from '@equinor/fusion-framework-module-http/client';
|
|
2
2
|
|
|
3
3
|
import type { ClientDataMethod, ClientMethod } from '../types';
|
|
4
4
|
import { ApiVersion } from './static';
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
client as personDetailClient,
|
|
8
|
+
type ApiResponse as PersonDetailApiResponse,
|
|
9
|
+
type ApiResult as PersonDetailResult,
|
|
10
|
+
type SupportedApiVersion as PersonDetailSupportedApiVersion,
|
|
11
|
+
type ApiRequestArgs as PersonDetailApiRequestArgs,
|
|
12
12
|
} from './person-details';
|
|
13
13
|
|
|
14
14
|
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
client as personQueryClient,
|
|
16
|
+
type ApiResponse as PersonQueryApiResponse,
|
|
17
|
+
type ApiResult as PersonQueryResult,
|
|
18
|
+
type SupportedApiVersion as PersonQuerySupportedApiVersion,
|
|
19
|
+
type ApiRequestArgs as PersonQueryApiRequestArgs,
|
|
20
20
|
} from './query';
|
|
21
21
|
|
|
22
22
|
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
client as personPhotoClient,
|
|
24
|
+
type ApiResponse as PersonPhotoApiResponse,
|
|
25
|
+
type ApiResult as PersonPhotoResult,
|
|
26
|
+
type SupportedApiVersion as PersonPhotoSupportedApiVersion,
|
|
27
|
+
type ApiRequestArgs as PersonPhotoApiRequestArgs,
|
|
28
28
|
} from './person-photo';
|
|
29
29
|
|
|
30
30
|
export class PeopleApiClient<
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
// TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
32
|
+
TClient extends IHttpClient = IHttpClient,
|
|
33
33
|
> {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
get Version(): typeof ApiVersion {
|
|
35
|
+
return ApiVersion;
|
|
36
|
+
}
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
constructor(protected _client: TClient) {}
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
method,
|
|
58
|
-
);
|
|
59
|
-
return fn(args, init);
|
|
60
|
-
}
|
|
40
|
+
/**
|
|
41
|
+
* Fetch person by id
|
|
42
|
+
*/
|
|
43
|
+
public get<
|
|
44
|
+
TVersion extends PersonDetailSupportedApiVersion,
|
|
45
|
+
TArgs extends PersonDetailApiRequestArgs<TVersion>,
|
|
46
|
+
TResult extends PersonDetailApiResponse<TVersion, TArgs>,
|
|
47
|
+
TMethod extends keyof ClientMethod<TResult>,
|
|
48
|
+
>(
|
|
49
|
+
version: TVersion,
|
|
50
|
+
method: TMethod,
|
|
51
|
+
args: TArgs,
|
|
52
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
53
|
+
): PersonDetailResult<TVersion, TArgs, TMethod, TResult> {
|
|
54
|
+
const fn = personDetailClient<TVersion, TMethod, TClient, TArgs>(this._client, version, method);
|
|
55
|
+
return fn(args, init);
|
|
56
|
+
}
|
|
61
57
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Query person service
|
|
60
|
+
*/
|
|
61
|
+
public query<
|
|
62
|
+
TVersion extends PersonQuerySupportedApiVersion,
|
|
63
|
+
TArgs extends PersonQueryApiRequestArgs<TVersion>,
|
|
64
|
+
TResult = PersonQueryApiResponse<TVersion>,
|
|
65
|
+
TMethod extends keyof ClientMethod<TResult> = keyof ClientMethod<TResult>,
|
|
66
|
+
>(
|
|
67
|
+
version: TVersion,
|
|
68
|
+
method: TMethod,
|
|
69
|
+
args: TArgs,
|
|
70
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
71
|
+
): PersonQueryResult<TVersion, TMethod, TResult> {
|
|
72
|
+
const fn = personQueryClient<TVersion, TMethod, TClient>(this._client, version, method);
|
|
73
|
+
return fn<TResult>(args, init);
|
|
74
|
+
}
|
|
79
75
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Photo person service
|
|
78
|
+
*/
|
|
79
|
+
public photo<
|
|
80
|
+
TVersion extends PersonPhotoSupportedApiVersion,
|
|
81
|
+
TArgs extends PersonPhotoApiRequestArgs<TVersion>,
|
|
82
|
+
TResult extends PersonPhotoApiResponse<TVersion> = PersonPhotoApiResponse<TVersion>,
|
|
83
|
+
TMethod extends keyof ClientDataMethod = keyof ClientDataMethod,
|
|
84
|
+
>(
|
|
85
|
+
version: TVersion,
|
|
86
|
+
method: TMethod,
|
|
87
|
+
args: TArgs,
|
|
88
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
89
|
+
): PersonPhotoResult<TMethod> {
|
|
90
|
+
const fn = personPhotoClient<TVersion, TMethod, TClient>(this._client, version, method);
|
|
91
|
+
return fn<TResult>(args, init);
|
|
92
|
+
}
|
|
97
93
|
}
|
|
98
94
|
|
|
99
95
|
// const oo = new PeopleApiClient(null).get('v4', 'fetch', { azureId: '123' });
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
|
|
1
|
+
import type { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
|
|
2
2
|
|
|
3
3
|
import { generateParameters } from './generate-parameters';
|
|
4
4
|
|
|
@@ -12,22 +12,25 @@ import type { ApiResponse, ApiResult, ApiRequestArgs, SupportedApiVersion } from
|
|
|
12
12
|
* @param method - client method to call
|
|
13
13
|
*/
|
|
14
14
|
export const client =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
15
|
+
<
|
|
16
|
+
TVersion extends SupportedApiVersion,
|
|
17
|
+
TMethod extends keyof ClientMethod = keyof ClientMethod,
|
|
18
|
+
TClient extends IHttpClient = IHttpClient,
|
|
19
|
+
TArgs extends ApiRequestArgs<TVersion> = ApiRequestArgs<TVersion>,
|
|
20
|
+
>(
|
|
21
|
+
client: TClient,
|
|
22
|
+
version: TVersion,
|
|
23
|
+
method: TMethod = 'json' as TMethod,
|
|
24
|
+
) =>
|
|
25
|
+
<T = ApiResponse<TVersion, TArgs>>(
|
|
26
|
+
args: TArgs,
|
|
27
|
+
init?: ClientRequestInit<TClient, T>,
|
|
28
|
+
): ApiResult<TVersion, TArgs, TMethod, T> =>
|
|
29
|
+
client[method](...generateParameters<T, TVersion, TClient>(version, args, init)) as ApiResult<
|
|
30
|
+
TVersion,
|
|
31
|
+
TArgs,
|
|
32
|
+
TMethod,
|
|
33
|
+
T
|
|
34
|
+
>;
|
|
32
35
|
|
|
33
36
|
export default client;
|