@equinor/fusion-framework-module-services 3.1.5 → 3.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/CHANGELOG.md +1118 -0
  2. package/dist/esm/people/api-models.js +2 -0
  3. package/dist/esm/people/api-models.js.map +1 -0
  4. package/dist/esm/people/api-models.v2.js +2 -0
  5. package/dist/esm/people/api-models.v2.js.map +1 -0
  6. package/dist/esm/people/api-models.v4.js +2 -0
  7. package/dist/esm/people/api-models.v4.js.map +1 -0
  8. package/dist/esm/people/client.js +26 -0
  9. package/dist/esm/people/client.js.map +1 -0
  10. package/dist/esm/people/index.js +4 -0
  11. package/dist/esm/people/index.js.map +1 -0
  12. package/dist/esm/people/person-details/client.js +4 -0
  13. package/dist/esm/people/person-details/client.js.map +1 -0
  14. package/dist/esm/people/person-details/generate-endpoint.js +21 -0
  15. package/dist/esm/people/person-details/generate-endpoint.js.map +1 -0
  16. package/dist/esm/people/person-details/generate-parameters.js +7 -0
  17. package/dist/esm/people/person-details/generate-parameters.js.map +1 -0
  18. package/dist/esm/people/person-details/index.js +5 -0
  19. package/dist/esm/people/person-details/index.js.map +1 -0
  20. package/dist/esm/people/person-details/types.js +2 -0
  21. package/dist/esm/people/person-details/types.js.map +1 -0
  22. package/dist/esm/people/person-photo/client.js +4 -0
  23. package/dist/esm/people/person-photo/client.js.map +1 -0
  24. package/dist/esm/people/person-photo/generate-endpoint.js +18 -0
  25. package/dist/esm/people/person-photo/generate-endpoint.js.map +1 -0
  26. package/dist/esm/people/person-photo/generate-parameters.js +7 -0
  27. package/dist/esm/people/person-photo/generate-parameters.js.map +1 -0
  28. package/dist/esm/people/person-photo/index.js +5 -0
  29. package/dist/esm/people/person-photo/index.js.map +1 -0
  30. package/dist/esm/people/person-photo/types.js +2 -0
  31. package/dist/esm/people/person-photo/types.js.map +1 -0
  32. package/dist/esm/people/query/client.js +4 -0
  33. package/dist/esm/people/query/client.js.map +1 -0
  34. package/dist/esm/people/query/generate-endpoint.js +19 -0
  35. package/dist/esm/people/query/generate-endpoint.js.map +1 -0
  36. package/dist/esm/people/query/generate-parameters.js +7 -0
  37. package/dist/esm/people/query/generate-parameters.js.map +1 -0
  38. package/dist/esm/people/query/index.js +5 -0
  39. package/dist/esm/people/query/index.js.map +1 -0
  40. package/dist/esm/people/query/types.js +2 -0
  41. package/dist/esm/people/query/types.js.map +1 -0
  42. package/dist/esm/people/static.js +6 -0
  43. package/dist/esm/people/static.js.map +1 -0
  44. package/dist/esm/provider.js +8 -0
  45. package/dist/esm/provider.js.map +1 -1
  46. package/dist/esm/version.js +1 -1
  47. package/dist/tsconfig.tsbuildinfo +1 -1
  48. package/dist/types/people/api-models.d.ts +34 -0
  49. package/dist/types/people/api-models.v2.d.ts +25 -0
  50. package/dist/types/people/api-models.v4.d.ts +81 -0
  51. package/dist/types/people/client.d.ts +15 -0
  52. package/dist/types/people/index.d.ts +3 -0
  53. package/dist/types/people/person-details/client.d.ts +5 -0
  54. package/dist/types/people/person-details/generate-endpoint.d.ts +2 -0
  55. package/dist/types/people/person-details/generate-parameters.d.ts +5 -0
  56. package/dist/types/people/person-details/index.d.ts +4 -0
  57. package/dist/types/people/person-details/types.d.ts +30 -0
  58. package/dist/types/people/person-photo/client.d.ts +5 -0
  59. package/dist/types/people/person-photo/generate-endpoint.d.ts +2 -0
  60. package/dist/types/people/person-photo/generate-parameters.d.ts +5 -0
  61. package/dist/types/people/person-photo/index.d.ts +4 -0
  62. package/dist/types/people/person-photo/types.d.ts +16 -0
  63. package/dist/types/people/query/client.d.ts +5 -0
  64. package/dist/types/people/query/generate-endpoint.d.ts +2 -0
  65. package/dist/types/people/query/generate-parameters.d.ts +5 -0
  66. package/dist/types/people/query/index.d.ts +4 -0
  67. package/dist/types/people/query/types.d.ts +17 -0
  68. package/dist/types/people/static.d.ts +4 -0
  69. package/dist/types/provider.d.ts +3 -0
  70. package/dist/types/types.d.ts +4 -0
  71. package/dist/types/version.d.ts +1 -1
  72. package/package.json +21 -5
  73. package/src/people/api-models.ts +52 -0
  74. package/src/people/api-models.v2.ts +31 -0
  75. package/src/people/api-models.v4.ts +100 -0
  76. package/src/people/client.ts +109 -0
  77. package/src/people/index.ts +5 -0
  78. package/src/people/person-details/client.ts +33 -0
  79. package/src/people/person-details/generate-endpoint.ts +28 -0
  80. package/src/people/person-details/generate-parameters.ts +22 -0
  81. package/src/people/person-details/index.ts +6 -0
  82. package/src/people/person-details/types.ts +54 -0
  83. package/src/people/person-photo/client.ts +33 -0
  84. package/src/people/person-photo/generate-endpoint.ts +25 -0
  85. package/src/people/person-photo/generate-parameters.ts +22 -0
  86. package/src/people/person-photo/index.ts +6 -0
  87. package/src/people/person-photo/types.ts +24 -0
  88. package/src/people/query/client.ts +33 -0
  89. package/src/people/query/generate-endpoint.ts +26 -0
  90. package/src/people/query/generate-parameters.ts +22 -0
  91. package/src/people/query/index.ts +6 -0
  92. package/src/people/query/types.ts +28 -0
  93. package/src/people/static.ts +4 -0
  94. package/src/provider.ts +10 -0
  95. package/src/types.ts +5 -0
  96. package/src/version.ts +1 -1
@@ -0,0 +1,34 @@
1
+ import { ApiPerson_v2 } from './api-models.v2';
2
+ import { ApiPerson_v4 } from './api-models.v4';
3
+ import { ApiVersion } from './static';
4
+ export type ApiProjectMaster = {
5
+ id: string;
6
+ name?: string;
7
+ };
8
+ export type ApiManager = {
9
+ azureUniqueId: string;
10
+ name?: string;
11
+ mail?: string;
12
+ department?: string;
13
+ fullDepartment?: string;
14
+ upn?: string;
15
+ jobTitle?: string;
16
+ accountType: ApiProfileAccountType;
17
+ accountClassification: ApiAccountClassification;
18
+ };
19
+ export type ApiInvitationStatus = 'Accepted' | 'Pending' | 'NotSent';
20
+ export type ApiProfileAccountType = 'Employee' | 'Consultant' | 'Enterprise' | 'External' | 'External Hire';
21
+ export type ApiAccountClassification = 'Unclassified' | 'Internal' | 'External';
22
+ export type ApiProfileAccountLink = {
23
+ azureUniqueId: string;
24
+ mail?: string;
25
+ isPrimaryAccount?: boolean;
26
+ preferredContactMail?: string;
27
+ isExpired?: boolean;
28
+ upn?: string;
29
+ };
30
+ export type ApiPersonMap = {
31
+ [ApiVersion.v2]: ApiPerson_v2;
32
+ [ApiVersion.v4]: ApiPerson_v4;
33
+ };
34
+ export type ApiPerson<T extends keyof typeof ApiVersion | ApiVersion> = T extends ApiVersion ? ApiPersonMap[T] : T extends keyof typeof ApiVersion ? ApiPersonMap[(typeof ApiVersion)[T]] : unknown;
@@ -0,0 +1,25 @@
1
+ import { ApiAccountClassification, ApiInvitationStatus, ApiProfileAccountLink, ApiProfileAccountType } from './api-models';
2
+ export type ApiPerson_v2 = {
3
+ fusionPersonId?: string;
4
+ azureUniqueId: string;
5
+ mail?: string;
6
+ name?: string;
7
+ jobTitle?: string;
8
+ department?: string;
9
+ fullDepartment?: string;
10
+ mobilePhone?: string;
11
+ officeLocation?: string;
12
+ sapId?: string;
13
+ employeeId?: string;
14
+ isResourceOwner?: boolean;
15
+ isExpired?: boolean;
16
+ expiredDate?: string;
17
+ upn?: string;
18
+ accountType: ApiProfileAccountType;
19
+ invitationStatus: ApiInvitationStatus;
20
+ accountClassification: ApiAccountClassification;
21
+ managerAzureUniqueId: string;
22
+ linkedAccounts?: Array<ApiProfileAccountLink>;
23
+ isPrimaryAccount?: boolean;
24
+ preferredContactMail?: string;
25
+ };
@@ -0,0 +1,81 @@
1
+ import { ApiAccountClassification, ApiInvitationStatus, ApiProfileAccountLink, ApiProfileAccountType, ApiProjectMaster } from './api-models';
2
+ export type ApiPerson_v4 = {
3
+ azureUniqueId: string;
4
+ mail?: string;
5
+ name?: string;
6
+ jobTitle?: string;
7
+ department?: string;
8
+ fullDepartment?: string;
9
+ mobilePhone?: string;
10
+ officeLocation?: string;
11
+ upn?: string;
12
+ isResourceOwner?: boolean;
13
+ isExpired?: boolean;
14
+ expiredDate?: string;
15
+ isPrimaryAccount?: boolean;
16
+ preferredContactMail?: string;
17
+ accountType?: ApiProfileAccountType;
18
+ invitationStatus?: ApiInvitationStatus;
19
+ accountClassification?: ApiAccountClassification;
20
+ managerAzureUniqueId?: string;
21
+ linkedAccounts?: Array<ApiProfileAccountLink>;
22
+ };
23
+ export type ApiCompanyInfo_v4 = {
24
+ id: string;
25
+ name?: string;
26
+ };
27
+ export type ApiPersonRole_v4 = {
28
+ name?: string;
29
+ displayName?: string;
30
+ sourceSystem?: string;
31
+ type?: string;
32
+ isActive?: boolean;
33
+ activeToUtc?: string;
34
+ onDemandSupport?: boolean;
35
+ scopes?: Array<ApiPersonRoleScope_v4>;
36
+ };
37
+ export type ApiPersonRoleScope_v4 = {
38
+ type?: string;
39
+ values?: string[];
40
+ valueType?: string;
41
+ };
42
+ export type ApiPersonPosition_v4 = {
43
+ positionId: string;
44
+ positionExternalId?: string;
45
+ id: string;
46
+ parentPositionId?: string;
47
+ taskOwnerIds?: string[];
48
+ name?: string;
49
+ obs?: string;
50
+ basePosition: ApiPersonBasePosition_v4;
51
+ project: ApiPersonProject_v4;
52
+ appliesFrom: string;
53
+ appliesTo: string;
54
+ workload?: number;
55
+ };
56
+ export type ApiPersonBasePosition_v4 = {
57
+ id: string;
58
+ name?: string;
59
+ type?: string;
60
+ discipline?: string;
61
+ };
62
+ export type ApiPersonProject_v4 = {
63
+ id: string;
64
+ name?: string;
65
+ domainId?: string;
66
+ type?: string;
67
+ };
68
+ export type ApiPersonContract_v4 = {
69
+ id: string;
70
+ name?: string;
71
+ contractNumber?: string;
72
+ companyId?: string;
73
+ companyName?: string;
74
+ project: ApiPersonProject_v4;
75
+ projectMaster: ApiProjectMaster;
76
+ positions: Array<ApiPersonPosition_v4>;
77
+ };
78
+ export type ApiCompanyInfoV4 = {
79
+ id: string;
80
+ name?: string;
81
+ };
@@ -0,0 +1,15 @@
1
+ import { IHttpClient, ClientRequestInit } from '@equinor/fusion-framework-module-http/client';
2
+ import type { ClientDataMethod, ClientMethod } from '../types';
3
+ import { ApiVersion } from './static';
4
+ import { ApiResponse as PersonDetailApiResponse, ApiResult as PersonDetailResult, SupportedApiVersion as PersonDetailSupportedApiVersion, ApiRequestArgs as PersonDetailApiRequestArgs } from './person-details';
5
+ import { ApiResponse as PersonQueryApiResponse, ApiResult as PersonQueryResult, SupportedApiVersion as PersonQuerySupportedApiVersion, ApiRequestArgs as PersonQueryApiRequestArgs } from './query';
6
+ import { ApiResponse as PersonPhotoApiResponse, ApiResult as PersonPhotoResult, SupportedApiVersion as PersonPhotoSupportedApiVersion, ApiRequestArgs as PersonPhotoApiRequestArgs } from './person-photo';
7
+ export declare class PeopleApiClient<TClient extends IHttpClient = IHttpClient> {
8
+ protected _client: TClient;
9
+ get Version(): typeof ApiVersion;
10
+ constructor(_client: TClient);
11
+ get<TVersion extends PersonDetailSupportedApiVersion, TArgs extends PersonDetailApiRequestArgs<TVersion>, TResult extends PersonDetailApiResponse<TVersion, TArgs>, TMethod extends keyof ClientMethod<TResult>>(version: TVersion, method: TMethod, args: TArgs, init?: ClientRequestInit<TClient, TResult>): PersonDetailResult<TVersion, TArgs, TMethod, TResult>;
12
+ query<TVersion extends PersonQuerySupportedApiVersion, TArgs extends PersonQueryApiRequestArgs<TVersion>, TResult = PersonQueryApiResponse<TVersion>, TMethod extends keyof ClientMethod<TResult> = keyof ClientMethod<TResult>>(version: TVersion, method: TMethod, args: TArgs, init?: ClientRequestInit<TClient, TResult>): PersonQueryResult<TVersion, TMethod, TResult>;
13
+ photo<TVersion extends PersonPhotoSupportedApiVersion, TArgs extends PersonPhotoApiRequestArgs<TVersion>, TResult extends Blob = PersonPhotoApiResponse<TVersion>, TMethod extends keyof ClientDataMethod = keyof ClientDataMethod>(version: TVersion, method: TMethod, args: TArgs, init?: ClientRequestInit<TClient, TResult>): PersonPhotoResult<TMethod>;
14
+ }
15
+ export default PeopleApiClient;
@@ -0,0 +1,3 @@
1
+ export { PeopleApiClient, default } from './client';
2
+ export { ApiVersion } from './static';
3
+ export * from './api-models';
@@ -0,0 +1,5 @@
1
+ import { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
2
+ import type { ClientMethod } from '../../types';
3
+ import type { ApiResponse, ApiResult, ApiRequestArgs } from './types';
4
+ export declare const client: <TVersion extends "v4", TMethod extends keyof ClientMethod = keyof ClientMethod, TClient extends IHttpClient<import("@equinor/fusion-framework-module-http/client").FetchRequest, Response> = IHttpClient<import("@equinor/fusion-framework-module-http/client").FetchRequest, Response>, TArgs extends ApiRequestArgs<TVersion> = ApiRequestArgs<TVersion>>(client: TClient, version: TVersion, method?: TMethod) => <T = ApiResponse<TVersion, TArgs>>(args: TArgs, init?: ClientRequestInit<TClient, T> | undefined) => ApiResult<TVersion, TArgs, TMethod, T>;
5
+ export default client;
@@ -0,0 +1,2 @@
1
+ import type { ApiRequestArgs } from './types';
2
+ export declare const generateEndpoint: <TVersion extends "v4">(version: TVersion, args: ApiRequestArgs<TVersion>) => string;
@@ -0,0 +1,5 @@
1
+ import type { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
2
+ import type { ApiClientArguments } from '../../types';
3
+ import type { ApiRequestArgs } from './types';
4
+ export declare const generateParameters: <TResult, TVersion extends "v4", TClient extends IHttpClient<import("@equinor/fusion-framework-module-http/client").FetchRequest, Response> = IHttpClient<import("@equinor/fusion-framework-module-http/client").FetchRequest, Response>>(version: TVersion, args: ApiRequestArgs<TVersion>, init?: ClientRequestInit<TClient, TResult> | undefined) => ApiClientArguments<TClient, TResult>;
5
+ export default generateParameters;
@@ -0,0 +1,4 @@
1
+ export { client, default } from './client';
2
+ export { generateEndpoint } from './generate-endpoint';
3
+ export { generateParameters } from './generate-parameters';
4
+ export * from './types';
@@ -0,0 +1,30 @@
1
+ import { ApiVersion } from '../static';
2
+ import type { ApiManager } from '../api-models';
3
+ import type { ApiCompanyInfo_v4, ApiPersonContract_v4, ApiPerson_v4, ApiPersonPosition_v4, ApiPersonRole_v4 } from '../api-models.v4';
4
+ import { ClientMethod } from '../../types';
5
+ export type SupportedApiVersion = Extract<keyof typeof ApiVersion, 'v4'>;
6
+ type ApiRequestArgsMap = {
7
+ [ApiVersion.v4]: {
8
+ azureId: string;
9
+ expand?: Array<keyof ExpandMap[ApiVersion.v4]>;
10
+ };
11
+ };
12
+ export type AllowedArgs = ApiRequestArgsMap[keyof ApiRequestArgsMap];
13
+ type ExpandMap = {
14
+ [ApiVersion.v4]: {
15
+ roles: Array<ApiPersonRole_v4>;
16
+ positions: Array<ApiPersonPosition_v4>;
17
+ contracts: Array<ApiPersonContract_v4>;
18
+ manager: ApiManager;
19
+ companies: Array<ApiCompanyInfo_v4>;
20
+ };
21
+ };
22
+ export type ApiRequestArgs<T extends SupportedApiVersion> = ApiRequestArgsMap[(typeof ApiVersion)[T]];
23
+ type ApiResponseTypes<TArgs extends AllowedArgs> = {
24
+ [ApiVersion.v4]: TArgs['expand'] extends Array<keyof ExpandMap[ApiVersion.v4]> ? ApiPerson_v4 & {
25
+ [K in TArgs['expand'][number]]: ExpandMap[ApiVersion.v4][K];
26
+ } : ApiPerson_v4;
27
+ };
28
+ export type ApiResponse<T extends SupportedApiVersion, TArgs extends AllowedArgs> = ApiResponseTypes<TArgs>[(typeof ApiVersion)[T]];
29
+ export type ApiResult<TVersion extends SupportedApiVersion, TArgs extends ApiRequestArgs<TVersion>, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TResult = ApiResponse<TVersion, TArgs>> = ClientMethod<TResult>[TMethod];
30
+ export {};
@@ -0,0 +1,5 @@
1
+ import { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
2
+ import type { ClientDataMethod } from '../../types';
3
+ import type { ApiResponse, ApiRequestArgs } from './types';
4
+ export declare const client: <TVersion extends "v2", TMethod extends keyof ClientDataMethod = keyof ClientDataMethod, TClient extends IHttpClient<import("@equinor/fusion-framework-module-http/client").FetchRequest, Response> = IHttpClient<import("@equinor/fusion-framework-module-http/client").FetchRequest, Response>, TArgs extends ApiRequestArgs<TVersion> = ApiRequestArgs<TVersion>>(client: TClient, version: TVersion, method?: TMethod) => <T extends Blob = ApiResponse<TVersion>>(args: TArgs, init?: ClientRequestInit<TClient, T> | undefined) => ClientDataMethod[TMethod];
5
+ export default client;
@@ -0,0 +1,2 @@
1
+ import type { ApiRequestArgs } from './types';
2
+ export declare const generateEndpoint: <TVersion extends "v2">(version: TVersion, args: ApiRequestArgs<TVersion>) => string;
@@ -0,0 +1,5 @@
1
+ import type { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
2
+ import type { ApiClientArguments } from '../../types';
3
+ import type { ApiRequestArgs } from './types';
4
+ export declare const generateParameters: <TResult, TVersion extends "v2", TClient extends IHttpClient<import("@equinor/fusion-framework-module-http/client").FetchRequest, Response> = IHttpClient<import("@equinor/fusion-framework-module-http/client").FetchRequest, Response>>(version: TVersion, args: ApiRequestArgs<TVersion>, init?: ClientRequestInit<TClient, TResult> | undefined) => ApiClientArguments<TClient, TResult>;
5
+ export default generateParameters;
@@ -0,0 +1,4 @@
1
+ export { client, default } from './client';
2
+ export { generateEndpoint } from './generate-endpoint';
3
+ export { generateParameters } from './generate-parameters';
4
+ export * from './types';
@@ -0,0 +1,16 @@
1
+ import { ApiVersion } from '../static';
2
+ import { ClientDataMethod } from '../../types';
3
+ export type SupportedApiVersion = Extract<keyof typeof ApiVersion, 'v2'>;
4
+ type ApiRequestArgsMap = {
5
+ [ApiVersion.v2]: {
6
+ azureId: string;
7
+ };
8
+ };
9
+ export type AllowedArgs = ApiRequestArgsMap[keyof ApiRequestArgsMap];
10
+ export type ApiRequestArgs<T extends SupportedApiVersion> = ApiRequestArgsMap[(typeof ApiVersion)[T]];
11
+ type ApiResponseTypes = {
12
+ [ApiVersion.v2]: Blob;
13
+ };
14
+ export type ApiResponse<T extends SupportedApiVersion> = ApiResponseTypes[(typeof ApiVersion)[T]];
15
+ export type ApiResult<TMethod extends keyof ClientDataMethod = keyof ClientDataMethod> = ClientDataMethod[TMethod];
16
+ export {};
@@ -0,0 +1,5 @@
1
+ import { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
2
+ import type { ClientMethod } from '../../types';
3
+ import type { ApiResponse, ApiResult, ApiRequestArgs } from './types';
4
+ export declare const client: <TVersion extends "v2", TMethod extends keyof ClientMethod = keyof ClientMethod, TClient extends IHttpClient<import("@equinor/fusion-framework-module-http/client").FetchRequest, Response> = IHttpClient<import("@equinor/fusion-framework-module-http/client").FetchRequest, Response>, TArgs extends ApiRequestArgs<TVersion> = ApiRequestArgs<TVersion>>(client: TClient, version: TVersion, method?: TMethod) => <T = ApiResponse<TVersion>>(args: TArgs, init?: ClientRequestInit<TClient, T> | undefined) => ApiResult<TVersion, TMethod, T>;
5
+ export default client;
@@ -0,0 +1,2 @@
1
+ import type { ApiRequestArgs } from './types';
2
+ export declare const generateEndpoint: <TVersion extends "v2">(version: TVersion, args: ApiRequestArgs<TVersion>) => string;
@@ -0,0 +1,5 @@
1
+ import type { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
2
+ import type { ApiClientArguments } from '../../types';
3
+ import type { ApiRequestArgs } from './types';
4
+ export declare const generateParameters: <TResult, TVersion extends "v2", TClient extends IHttpClient<import("@equinor/fusion-framework-module-http/client").FetchRequest, Response> = IHttpClient<import("@equinor/fusion-framework-module-http/client").FetchRequest, Response>>(version: TVersion, args: ApiRequestArgs<TVersion>, init?: ClientRequestInit<TClient, TResult> | undefined) => ApiClientArguments<TClient, TResult>;
5
+ export default generateParameters;
@@ -0,0 +1,4 @@
1
+ export { client, default } from './client';
2
+ export { generateEndpoint } from './generate-endpoint';
3
+ export { generateParameters } from './generate-parameters';
4
+ export * from './types';
@@ -0,0 +1,17 @@
1
+ import { ApiVersion } from '../static';
2
+ import { ApiPerson_v2 } from '../api-models.v2';
3
+ import { ClientMethod } from '../../types';
4
+ export type SupportedApiVersion = Extract<keyof typeof ApiVersion, 'v2'>;
5
+ type ApiRequestArgsMap = {
6
+ [ApiVersion.v2]: {
7
+ search: string;
8
+ };
9
+ };
10
+ export type AllowedArgs = ApiRequestArgsMap[keyof ApiRequestArgsMap];
11
+ export type ApiRequestArgs<T extends SupportedApiVersion> = ApiRequestArgsMap[(typeof ApiVersion)[T]];
12
+ type ApiResponseTypes = {
13
+ [ApiVersion.v2]: Array<ApiPerson_v2>;
14
+ };
15
+ export type ApiResponse<T extends SupportedApiVersion> = ApiResponseTypes[(typeof ApiVersion)[T]];
16
+ export type ApiResult<TVersion extends SupportedApiVersion, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TResult = ApiResponse<TVersion>> = ClientMethod<TResult>[TMethod];
17
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare enum ApiVersion {
2
+ 'v2' = "2.0",
3
+ 'v4' = "4.0"
4
+ }
@@ -4,10 +4,12 @@ import { ApiClientFactory } from './types';
4
4
  import { ContextApiClient } from './context';
5
5
  import BookmarksApiClient from './bookmarks/client';
6
6
  import { NotificationApiClient } from './notification';
7
+ import { PeopleApiClient } from './people/client';
7
8
  export interface IApiProvider<TClient extends IHttpClient = IHttpClient> {
8
9
  createBookmarksClient<TMethod extends keyof ClientMethod, TPayload = unknown>(method: TMethod): Promise<BookmarksApiClient<TMethod, TClient, TPayload>>;
9
10
  createContextClient<TMethod extends keyof ClientMethod>(method: TMethod): Promise<ContextApiClient<TMethod, TClient>>;
10
11
  createNotificationClient<TMethod extends keyof ClientMethod>(method: TMethod): Promise<NotificationApiClient<TMethod, TClient>>;
12
+ createPeopleClient(): Promise<PeopleApiClient<TClient>>;
11
13
  }
12
14
  type ApiProviderCtorArgs<TClient extends IHttpClient = IHttpClient> = {
13
15
  createClient: ApiClientFactory<TClient>;
@@ -30,5 +32,6 @@ export declare class ApiProvider<TClient extends IHttpClient = IHttpClient> impl
30
32
  createNotificationClient<TMethod extends keyof ClientMethod>(method: TMethod): Promise<NotificationApiClient<TMethod, TClient>>;
31
33
  createBookmarksClient<TMethod extends keyof ClientMethod, TPayload = unknown>(method: TMethod): Promise<BookmarksApiClient<TMethod, TClient, TPayload>>;
32
34
  createContextClient<TMethod extends keyof ClientMethod>(method: TMethod): Promise<ContextApiClient<TMethod, TClient>>;
35
+ createPeopleClient(): Promise<PeopleApiClient<TClient>>;
33
36
  }
34
37
  export {};
@@ -10,4 +10,8 @@ export type ClientMethod<T = unknown> = {
10
10
  fetch$: StreamResponse<FetchResponse<T>>;
11
11
  json$: StreamResponse<T>;
12
12
  };
13
+ export type ClientDataMethod = {
14
+ blob: Blob;
15
+ blob$: StreamResponse<Blob>;
16
+ };
13
17
  export type ClientMethodType = keyof ClientMethod;
@@ -1 +1 @@
1
- export declare const version = "3.1.5";
1
+ export declare const version = "3.2.1";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-module-services",
3
- "version": "3.1.5",
3
+ "version": "3.2.1",
4
4
  "description": "",
5
5
  "sideEffects": false,
6
6
  "main": "dist/esm/index.js",
@@ -25,6 +25,18 @@
25
25
  "context/related": [
26
26
  "dist/types/context/related/index"
27
27
  ],
28
+ "people": [
29
+ "dist/types/people/index"
30
+ ],
31
+ "people/get": [
32
+ "dist/types/people/person-details/index"
33
+ ],
34
+ "people/query": [
35
+ "dist/types/people/query/index"
36
+ ],
37
+ "people/photo": [
38
+ "dist/types/people/person-photo/index"
39
+ ],
28
40
  "bookmarks": [
29
41
  "dist/types/bookmarks/index"
30
42
  ]
@@ -36,6 +48,10 @@
36
48
  "./bookmark": "./dist/esm/bookmarks/index.js",
37
49
  "./notification": "./dist/esm/notification/index.js",
38
50
  "./context/get": "./dist/esm/context/get-context/index.js",
51
+ "./people": "./dist/esm/people/index.js",
52
+ "./people/get": "./dist/esm/people/person-details/index.js",
53
+ "./people/query": "./dist/esm/people/query/index.js",
54
+ "./people/photo": "./dist/esm/people/person-photo/index.js",
39
55
  "./errors": "./dist/esm/errors.js",
40
56
  "./package.json": "./package.json"
41
57
  },
@@ -55,13 +71,13 @@
55
71
  },
56
72
  "devDependencies": {
57
73
  "typescript": "^5.1.3",
58
- "@equinor/fusion-framework-module": "^4.2.4",
59
- "@equinor/fusion-framework-module-http": "^5.0.6",
60
- "@equinor/fusion-framework-module-service-discovery": "^7.0.8"
74
+ "@equinor/fusion-framework-module": "^4.2.5",
75
+ "@equinor/fusion-framework-module-http": "^5.1.1",
76
+ "@equinor/fusion-framework-module-service-discovery": "^7.0.11"
61
77
  },
62
78
  "peerDependencies": {
63
79
  "odata-query": "^7.0.4",
64
- "@equinor/fusion-framework-module": "^4.2.4"
80
+ "@equinor/fusion-framework-module": "^4.2.5"
65
81
  },
66
82
  "scripts": {
67
83
  "build": "tsc -b"
@@ -0,0 +1,52 @@
1
+ import { ApiPerson_v2 } from './api-models.v2';
2
+ import { ApiPerson_v4 } from './api-models.v4';
3
+ import { ApiVersion } from './static';
4
+
5
+ export type ApiProjectMaster = {
6
+ id: string;
7
+ name?: string;
8
+ };
9
+
10
+ export type ApiManager = {
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
+ };
21
+
22
+ export type ApiInvitationStatus = 'Accepted' | 'Pending' | 'NotSent';
23
+
24
+ export type ApiProfileAccountType =
25
+ | 'Employee'
26
+ | 'Consultant'
27
+ | 'Enterprise'
28
+ | 'External'
29
+ | 'External Hire';
30
+
31
+ // TODO what are these?
32
+ export type ApiAccountClassification = 'Unclassified' | 'Internal' | 'External';
33
+
34
+ export type ApiProfileAccountLink = {
35
+ azureUniqueId: string;
36
+ mail?: string;
37
+ isPrimaryAccount?: boolean;
38
+ preferredContactMail?: string;
39
+ isExpired?: boolean;
40
+ upn?: string;
41
+ };
42
+
43
+ export type ApiPersonMap = {
44
+ [ApiVersion.v2]: ApiPerson_v2;
45
+ [ApiVersion.v4]: ApiPerson_v4;
46
+ };
47
+
48
+ export type ApiPerson<T extends keyof typeof ApiVersion | ApiVersion> = T extends ApiVersion
49
+ ? ApiPersonMap[T]
50
+ : T extends keyof typeof ApiVersion
51
+ ? ApiPersonMap[(typeof ApiVersion)[T]]
52
+ : unknown;
@@ -0,0 +1,31 @@
1
+ import {
2
+ ApiAccountClassification,
3
+ ApiInvitationStatus,
4
+ ApiProfileAccountLink,
5
+ ApiProfileAccountType,
6
+ } from './api-models';
7
+
8
+ export type ApiPerson_v2 = {
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
+ };
@@ -0,0 +1,100 @@
1
+ import {
2
+ ApiAccountClassification,
3
+ ApiInvitationStatus,
4
+ ApiProfileAccountLink,
5
+ ApiProfileAccountType,
6
+ ApiProjectMaster,
7
+ } from './api-models';
8
+
9
+ export type ApiPerson_v4 = {
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
+ upn?: string;
19
+ isResourceOwner?: boolean;
20
+ isExpired?: boolean;
21
+ expiredDate?: string;
22
+ isPrimaryAccount?: boolean;
23
+ preferredContactMail?: string;
24
+ accountType?: ApiProfileAccountType;
25
+
26
+ // TODO is this default
27
+ invitationStatus?: ApiInvitationStatus;
28
+ accountClassification?: ApiAccountClassification;
29
+ managerAzureUniqueId?: string;
30
+
31
+ // TODO is this default
32
+ linkedAccounts?: Array<ApiProfileAccountLink>;
33
+ };
34
+
35
+ export type ApiCompanyInfo_v4 = {
36
+ id: string;
37
+ name?: string;
38
+ };
39
+
40
+ export type ApiPersonRole_v4 = {
41
+ name?: string;
42
+ displayName?: string;
43
+ sourceSystem?: string;
44
+ type?: string;
45
+ isActive?: boolean;
46
+ activeToUtc?: string;
47
+ onDemandSupport?: boolean;
48
+ scopes?: Array<ApiPersonRoleScope_v4>;
49
+ };
50
+
51
+ export type ApiPersonRoleScope_v4 = {
52
+ type?: string;
53
+ values?: string[];
54
+ valueType?: string;
55
+ };
56
+
57
+ export type ApiPersonPosition_v4 = {
58
+ positionId: string;
59
+ positionExternalId?: string;
60
+ id: string;
61
+ parentPositionId?: string;
62
+ taskOwnerIds?: string[];
63
+ name?: string;
64
+ obs?: string;
65
+ basePosition: ApiPersonBasePosition_v4;
66
+ project: ApiPersonProject_v4;
67
+ appliesFrom: string;
68
+ appliesTo: string;
69
+ workload?: number;
70
+ };
71
+
72
+ export type ApiPersonBasePosition_v4 = {
73
+ id: string;
74
+ name?: string;
75
+ type?: string;
76
+ discipline?: string;
77
+ };
78
+
79
+ export type ApiPersonProject_v4 = {
80
+ id: string;
81
+ name?: string;
82
+ domainId?: string;
83
+ type?: string;
84
+ };
85
+
86
+ export type ApiPersonContract_v4 = {
87
+ id: string;
88
+ name?: string;
89
+ contractNumber?: string;
90
+ companyId?: string;
91
+ companyName?: string;
92
+ project: ApiPersonProject_v4;
93
+ projectMaster: ApiProjectMaster;
94
+ positions: Array<ApiPersonPosition_v4>;
95
+ };
96
+
97
+ export type ApiCompanyInfoV4 = {
98
+ id: string;
99
+ name?: string;
100
+ };