@equinor/fusion-framework-module-services 3.1.3 → 3.1.4
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 +13 -0
- package/LICENSE +21 -0
- package/dist/esm/bookmarks/client.js.map +1 -1
- package/dist/esm/context/client.js +1 -1
- package/dist/esm/context/client.js.map +1 -1
- package/dist/esm/context/get/generate-endpoint.js +2 -2
- package/dist/esm/context/get/generate-endpoint.js.map +1 -1
- package/dist/esm/context/get/index.js +1 -1
- package/dist/esm/context/get/index.js.map +1 -1
- package/dist/esm/context/get/types.js +1 -1
- package/dist/esm/context/get/types.js.map +1 -1
- package/dist/esm/context/query/generate-endpoint.js +2 -2
- package/dist/esm/context/query/generate-endpoint.js.map +1 -1
- package/dist/esm/context/query/index.js +1 -1
- package/dist/esm/context/query/index.js.map +1 -1
- package/dist/esm/context/query/types.js +1 -1
- package/dist/esm/context/query/types.js.map +1 -1
- package/dist/esm/context/related/generate-endpoint.js +2 -2
- package/dist/esm/context/related/generate-endpoint.js.map +1 -1
- package/dist/esm/context/related/index.js +1 -1
- package/dist/esm/context/related/index.js.map +1 -1
- package/dist/esm/context/related/types.js +1 -1
- package/dist/esm/context/related/types.js.map +1 -1
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/notification/client.js.map +1 -1
- package/dist/esm/notification/notification/delete/generate-endpoint.js +2 -2
- package/dist/esm/notification/notification/delete/generate-endpoint.js.map +1 -1
- package/dist/esm/notification/notification/delete/index.js +1 -1
- package/dist/esm/notification/notification/delete/index.js.map +1 -1
- package/dist/esm/notification/notification/get/generate-endpoint.js +2 -2
- package/dist/esm/notification/notification/get/generate-endpoint.js.map +1 -1
- package/dist/esm/notification/notification/get/index.js +1 -1
- package/dist/esm/notification/notification/get/index.js.map +1 -1
- package/dist/esm/notification/notification/getAll/generate-endpoint.js +2 -2
- package/dist/esm/notification/notification/getAll/generate-endpoint.js.map +1 -1
- package/dist/esm/notification/notification/getAll/index.js +1 -1
- package/dist/esm/notification/notification/getAll/index.js.map +1 -1
- package/dist/esm/notification/notification/patch/generate-endpoint.js +2 -2
- package/dist/esm/notification/notification/patch/generate-endpoint.js.map +1 -1
- package/dist/esm/notification/notification/patch/index.js +1 -1
- package/dist/esm/notification/notification/patch/index.js.map +1 -1
- package/dist/esm/notification/notification/post/generate-endpoint.js +2 -2
- package/dist/esm/notification/notification/post/generate-endpoint.js.map +1 -1
- package/dist/esm/notification/notification/post/index.js +1 -1
- package/dist/esm/notification/notification/post/index.js.map +1 -1
- package/dist/esm/notification/settings/get/generate-endpoint.js +2 -2
- package/dist/esm/notification/settings/get/generate-endpoint.js.map +1 -1
- package/dist/esm/notification/settings/get/index.js +1 -1
- package/dist/esm/notification/settings/get/index.js.map +1 -1
- package/dist/esm/notification/settings/put/generate-endpoint.js +2 -2
- package/dist/esm/notification/settings/put/generate-endpoint.js.map +1 -1
- package/dist/esm/notification/settings/put/index.js +1 -1
- package/dist/esm/notification/settings/put/index.js.map +1 -1
- package/dist/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/bookmarks/client.d.ts +1 -1
- package/dist/types/bookmarks/types.d.ts +1 -1
- package/dist/types/context/client.d.ts +2 -1
- package/dist/types/context/get/index.d.ts +1 -1
- package/dist/types/context/get/types.d.ts +2 -2
- package/dist/types/context/query/index.d.ts +1 -1
- package/dist/types/context/query/types.d.ts +2 -2
- package/dist/types/context/related/index.d.ts +1 -1
- package/dist/types/context/related/types.d.ts +2 -2
- package/dist/types/context/types.d.ts +1 -1
- package/dist/types/notification/notification/delete/index.d.ts +1 -1
- package/dist/types/notification/notification/get/index.d.ts +1 -1
- package/dist/types/notification/notification/getAll/index.d.ts +1 -1
- package/dist/types/notification/notification/patch/index.d.ts +1 -1
- package/dist/types/notification/notification/post/index.d.ts +1 -1
- package/dist/types/notification/settings/get/index.d.ts +1 -1
- package/dist/types/notification/settings/put/index.d.ts +1 -1
- package/dist/types/notification/types.d.ts +1 -1
- package/dist/types/version.d.ts +1 -0
- package/package.json +67 -68
- package/src/bookmarks/client.ts +7 -4
- package/src/bookmarks/delete/client.ts +4 -4
- package/src/bookmarks/delete/generate-endpoint.ts +1 -1
- package/src/bookmarks/delete/generate-parameters.ts +3 -3
- package/src/bookmarks/delete/types.ts +3 -3
- package/src/bookmarks/favorites/delete/client.ts +4 -4
- package/src/bookmarks/favorites/delete/generate-endpoint.ts +1 -1
- package/src/bookmarks/favorites/delete/generate-parameters.ts +3 -3
- package/src/bookmarks/favorites/delete/types.ts +3 -3
- package/src/bookmarks/favorites/head/client.ts +4 -4
- package/src/bookmarks/favorites/head/generate-endpoint.ts +1 -1
- package/src/bookmarks/favorites/head/generate-parameters.ts +3 -3
- package/src/bookmarks/favorites/head/types.ts +3 -3
- package/src/bookmarks/favorites/post/client.ts +4 -4
- package/src/bookmarks/favorites/post/generate-endpoint.ts +1 -1
- package/src/bookmarks/favorites/post/generate-parameters.ts +3 -3
- package/src/bookmarks/favorites/post/types.ts +3 -3
- package/src/bookmarks/get/client.ts +4 -4
- package/src/bookmarks/get/generate-endpoint.ts +1 -1
- package/src/bookmarks/get/generate-parameters.ts +2 -2
- package/src/bookmarks/get/types.ts +4 -4
- package/src/bookmarks/getAll/client.ts +4 -4
- package/src/bookmarks/getAll/generate-parameters.ts +2 -2
- package/src/bookmarks/getAll/types.ts +2 -2
- package/src/bookmarks/patch/client.ts +4 -4
- package/src/bookmarks/patch/generate-endpoint.ts +1 -1
- package/src/bookmarks/patch/generate-parameters.ts +3 -3
- package/src/bookmarks/patch/types.ts +5 -5
- package/src/bookmarks/post/client.ts +4 -4
- package/src/bookmarks/post/generate-endpoint.ts +1 -1
- package/src/bookmarks/post/generate-parameters.ts +3 -3
- package/src/bookmarks/post/types.ts +5 -5
- package/src/bookmarks/types.ts +1 -5
- package/src/context/client.ts +10 -6
- package/src/context/get/client.ts +5 -5
- package/src/context/get/generate-endpoint.ts +3 -3
- package/src/context/get/generate-parameters.ts +3 -3
- package/src/context/get/index.ts +1 -1
- package/src/context/get/types.ts +5 -12
- package/src/context/query/client.ts +5 -5
- package/src/context/query/generate-endpoint.ts +3 -3
- package/src/context/query/generate-parameters.ts +3 -3
- package/src/context/query/index.ts +1 -1
- package/src/context/query/types.ts +5 -12
- package/src/context/related/client.ts +5 -5
- package/src/context/related/generate-endpoint.ts +3 -3
- package/src/context/related/generate-parameters.ts +3 -3
- package/src/context/related/index.ts +1 -1
- package/src/context/related/types.ts +5 -12
- package/src/context/types.ts +1 -5
- package/src/errors.ts +4 -1
- package/src/module.ts +3 -3
- package/src/notification/client.ts +19 -16
- package/src/notification/notification/delete/client.ts +4 -4
- package/src/notification/notification/delete/generate-endpoint.ts +3 -3
- package/src/notification/notification/delete/generate-parameters.ts +3 -3
- package/src/notification/notification/delete/index.ts +1 -1
- package/src/notification/notification/delete/types.ts +3 -3
- package/src/notification/notification/get/client.ts +4 -4
- package/src/notification/notification/get/generate-endpoint.ts +3 -3
- package/src/notification/notification/get/generate-parameters.ts +2 -2
- package/src/notification/notification/get/index.ts +1 -1
- package/src/notification/notification/get/types.ts +3 -3
- package/src/notification/notification/getAll/client.ts +4 -4
- package/src/notification/notification/getAll/generate-endpoint.ts +3 -3
- package/src/notification/notification/getAll/generate-parameters.ts +2 -2
- package/src/notification/notification/getAll/index.ts +1 -1
- package/src/notification/notification/getAll/types.ts +3 -3
- package/src/notification/notification/patch/client.ts +4 -4
- package/src/notification/notification/patch/generate-endpoint.ts +3 -3
- package/src/notification/notification/patch/generate-parameters.ts +3 -3
- package/src/notification/notification/patch/index.ts +1 -1
- package/src/notification/notification/patch/types.ts +3 -3
- package/src/notification/notification/post/client.ts +4 -4
- package/src/notification/notification/post/generate-endpoint.ts +3 -3
- package/src/notification/notification/post/generate-parameters.ts +3 -3
- package/src/notification/notification/post/index.ts +1 -1
- package/src/notification/notification/post/types.ts +3 -3
- package/src/notification/settings/get/client.ts +4 -4
- package/src/notification/settings/get/generate-endpoint.ts +3 -3
- package/src/notification/settings/get/generate-parameters.ts +2 -2
- package/src/notification/settings/get/index.ts +1 -1
- package/src/notification/settings/get/types.ts +3 -3
- package/src/notification/settings/put/client.ts +4 -4
- package/src/notification/settings/put/generate-endpoint.ts +3 -3
- package/src/notification/settings/put/generate-parameters.ts +3 -3
- package/src/notification/settings/put/index.ts +1 -1
- package/src/notification/settings/put/types.ts +3 -3
- package/src/notification/types.ts +1 -5
- package/src/provider.ts +6 -6
- package/src/types.ts +2 -2
- package/src/version.ts +2 -0
- package/tsconfig.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UnsupportedApiVersion } from '
|
|
2
|
-
import { ApiVersion } from '
|
|
1
|
+
import { UnsupportedApiVersion } from '../../../errors';
|
|
2
|
+
import { ApiVersion } from '../..';
|
|
3
3
|
|
|
4
4
|
import type { PostNotificationArgs } from './types';
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ import type { PostNotificationArgs } from './types';
|
|
|
8
8
|
*/
|
|
9
9
|
export const generateEndpoint = <TVersion extends string = keyof typeof ApiVersion>(
|
|
10
10
|
version: TVersion,
|
|
11
|
-
args: PostNotificationArgs<TVersion
|
|
11
|
+
args: PostNotificationArgs<TVersion>,
|
|
12
12
|
) => {
|
|
13
13
|
const apiVersion = ApiVersion[version as keyof typeof ApiVersion] ?? version;
|
|
14
14
|
switch (apiVersion) {
|
|
@@ -9,11 +9,11 @@ import { PostNotificationArgs } from './types';
|
|
|
9
9
|
export const generateParameters = <
|
|
10
10
|
TResult,
|
|
11
11
|
TVersion extends string = keyof typeof ApiVersion,
|
|
12
|
-
TClient extends IHttpClient = IHttpClient
|
|
12
|
+
TClient extends IHttpClient = IHttpClient,
|
|
13
13
|
>(
|
|
14
14
|
version: TVersion,
|
|
15
15
|
args: PostNotificationArgs<TVersion>,
|
|
16
|
-
init?: ClientRequestInit<TClient, TResult
|
|
16
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
17
17
|
): ApiClientArguments<TClient, TResult> => {
|
|
18
18
|
const path = generateEndpoint(version, args);
|
|
19
19
|
|
|
@@ -23,7 +23,7 @@ export const generateParameters = <
|
|
|
23
23
|
const requestParams: ClientRequestInit<TClient, TResult> = Object.assign(
|
|
24
24
|
{},
|
|
25
25
|
{ method: 'post', body: JSON.stringify(args), headers: headers },
|
|
26
|
-
init
|
|
26
|
+
init,
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
return [path, requestParams];
|
|
@@ -44,14 +44,14 @@ export type PostNotificationFn<
|
|
|
44
44
|
TVersion extends string = keyof typeof ApiVersion,
|
|
45
45
|
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
46
46
|
TClient extends IHttpClient = IHttpClient,
|
|
47
|
-
TResult = PostNotificationResponse<TVersion
|
|
47
|
+
TResult = PostNotificationResponse<TVersion>,
|
|
48
48
|
> = (
|
|
49
49
|
args: PostNotificationArgs<TVersion>,
|
|
50
|
-
init?: ClientRequestInit<TClient, TResult
|
|
50
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
51
51
|
) => PostNotificationResult<TVersion, TMethod, TResult>;
|
|
52
52
|
|
|
53
53
|
export type PostNotificationResult<
|
|
54
54
|
TVersion extends string = keyof typeof ApiVersion,
|
|
55
55
|
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
56
|
-
TResult = PostNotificationResponse<TVersion
|
|
56
|
+
TResult = PostNotificationResponse<TVersion>,
|
|
57
57
|
> = ClientMethod<TResult>[TMethod];
|
|
@@ -20,18 +20,18 @@ export const getUserNotificationSettings =
|
|
|
20
20
|
<
|
|
21
21
|
TVersion extends string = keyof typeof ApiVersion,
|
|
22
22
|
TMethod extends keyof ClientMethod = keyof ClientMethod,
|
|
23
|
-
TClient extends IHttpClient = IHttpClient
|
|
23
|
+
TClient extends IHttpClient = IHttpClient,
|
|
24
24
|
>(
|
|
25
25
|
client: TClient,
|
|
26
26
|
version: TVersion,
|
|
27
|
-
method: TMethod = 'json' as TMethod
|
|
27
|
+
method: TMethod = 'json' as TMethod,
|
|
28
28
|
) =>
|
|
29
29
|
<T = GetUserNotificationSettingsResponse<TVersion>>(
|
|
30
30
|
args: GetUserNotificationSettingsArgs<TVersion>,
|
|
31
|
-
init?: ClientRequestInit<TClient, T
|
|
31
|
+
init?: ClientRequestInit<TClient, T>,
|
|
32
32
|
): GetUserNotificationsSettingsResult<TVersion, TMethod, T> =>
|
|
33
33
|
client[method](
|
|
34
|
-
...generateParameters<T, TVersion, TClient>(version, args, init)
|
|
34
|
+
...generateParameters<T, TVersion, TClient>(version, args, init),
|
|
35
35
|
) as GetUserNotificationsSettingsResult<TVersion, TMethod, T>;
|
|
36
36
|
|
|
37
37
|
export default getUserNotificationSettings;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UnsupportedApiVersion } from '
|
|
2
|
-
import { ApiVersion } from '
|
|
1
|
+
import { UnsupportedApiVersion } from '../../../errors';
|
|
2
|
+
import { ApiVersion } from '../..';
|
|
3
3
|
|
|
4
4
|
import type { GetUserNotificationSettingsArgs } from './types';
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ import type { GetUserNotificationSettingsArgs } from './types';
|
|
|
8
8
|
*/
|
|
9
9
|
export const generateEndpoint = <TVersion extends string = keyof typeof ApiVersion>(
|
|
10
10
|
version: TVersion,
|
|
11
|
-
args: GetUserNotificationSettingsArgs<TVersion
|
|
11
|
+
args: GetUserNotificationSettingsArgs<TVersion>,
|
|
12
12
|
) => {
|
|
13
13
|
const apiVersion = ApiVersion[version as keyof typeof ApiVersion] ?? version;
|
|
14
14
|
switch (apiVersion) {
|
|
@@ -9,11 +9,11 @@ import { GetUserNotificationSettingsArgs } from './types';
|
|
|
9
9
|
export const generateParameters = <
|
|
10
10
|
TResult,
|
|
11
11
|
TVersion extends string = keyof typeof ApiVersion,
|
|
12
|
-
TClient extends IHttpClient = IHttpClient
|
|
12
|
+
TClient extends IHttpClient = IHttpClient,
|
|
13
13
|
>(
|
|
14
14
|
version: TVersion,
|
|
15
15
|
args: GetUserNotificationSettingsArgs<TVersion>,
|
|
16
|
-
init?: ClientRequestInit<TClient, TResult
|
|
16
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
17
17
|
): ApiClientArguments<TClient, TResult> => {
|
|
18
18
|
const path = generateEndpoint(version, args);
|
|
19
19
|
return [path, init];
|
|
@@ -31,14 +31,14 @@ export type GetUserNotificationSettingsFn<
|
|
|
31
31
|
TVersion extends string = keyof typeof ApiVersion,
|
|
32
32
|
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
33
33
|
TClient extends IHttpClient = IHttpClient,
|
|
34
|
-
TResult = GetUserNotificationSettingsResponse<TVersion
|
|
34
|
+
TResult = GetUserNotificationSettingsResponse<TVersion>,
|
|
35
35
|
> = (
|
|
36
36
|
args: GetUserNotificationSettingsArgs<TVersion>,
|
|
37
|
-
init?: ClientRequestInit<TClient, TResult
|
|
37
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
38
38
|
) => GetUserNotificationsSettingsResult<TVersion, TMethod, TResult>;
|
|
39
39
|
|
|
40
40
|
export type GetUserNotificationsSettingsResult<
|
|
41
41
|
TVersion extends string = keyof typeof ApiVersion,
|
|
42
42
|
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
43
|
-
TResult = GetUserNotificationSettingsResponse<TVersion
|
|
43
|
+
TResult = GetUserNotificationSettingsResponse<TVersion>,
|
|
44
44
|
> = ClientMethod<TResult>[TMethod];
|
|
@@ -20,18 +20,18 @@ export const updateUserNotificationSettings =
|
|
|
20
20
|
<
|
|
21
21
|
TVersion extends string = keyof typeof ApiVersion,
|
|
22
22
|
TMethod extends keyof ClientMethod = keyof ClientMethod,
|
|
23
|
-
TClient extends IHttpClient = IHttpClient
|
|
23
|
+
TClient extends IHttpClient = IHttpClient,
|
|
24
24
|
>(
|
|
25
25
|
client: TClient,
|
|
26
26
|
version: TVersion,
|
|
27
|
-
method: TMethod = 'json' as TMethod
|
|
27
|
+
method: TMethod = 'json' as TMethod,
|
|
28
28
|
) =>
|
|
29
29
|
<T = PutUserNotificationSettingsResponse<TVersion>>(
|
|
30
30
|
args: PutUserNotificationSettingsArgs<TVersion>,
|
|
31
|
-
init?: ClientRequestInit<TClient, T
|
|
31
|
+
init?: ClientRequestInit<TClient, T>,
|
|
32
32
|
): PutUserNotificationSettingsResult<TVersion, TMethod, T> =>
|
|
33
33
|
client[method](
|
|
34
|
-
...generateParameters<T, TVersion, TClient>(version, args, init)
|
|
34
|
+
...generateParameters<T, TVersion, TClient>(version, args, init),
|
|
35
35
|
) as PutUserNotificationSettingsResult<TVersion, TMethod, T>;
|
|
36
36
|
|
|
37
37
|
export default updateUserNotificationSettings;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { UnsupportedApiVersion } from '
|
|
2
|
-
import { ApiVersion } from '
|
|
1
|
+
import { UnsupportedApiVersion } from '../../../errors';
|
|
2
|
+
import { ApiVersion } from '../..';
|
|
3
3
|
|
|
4
4
|
import type { PutUserNotificationSettingsArgs } from './types';
|
|
5
5
|
|
|
@@ -8,7 +8,7 @@ import type { PutUserNotificationSettingsArgs } from './types';
|
|
|
8
8
|
*/
|
|
9
9
|
export const generateEndpoint = <TVersion extends string = keyof typeof ApiVersion>(
|
|
10
10
|
version: TVersion,
|
|
11
|
-
args: PutUserNotificationSettingsArgs<TVersion
|
|
11
|
+
args: PutUserNotificationSettingsArgs<TVersion>,
|
|
12
12
|
) => {
|
|
13
13
|
const apiVersion = ApiVersion[version as keyof typeof ApiVersion] ?? version;
|
|
14
14
|
switch (apiVersion) {
|
|
@@ -9,11 +9,11 @@ import { PutUserNotificationSettingsArgs } from './types';
|
|
|
9
9
|
export const generateParameters = <
|
|
10
10
|
TResult,
|
|
11
11
|
TVersion extends string = keyof typeof ApiVersion,
|
|
12
|
-
TClient extends IHttpClient = IHttpClient
|
|
12
|
+
TClient extends IHttpClient = IHttpClient,
|
|
13
13
|
>(
|
|
14
14
|
version: TVersion,
|
|
15
15
|
args: PutUserNotificationSettingsArgs<TVersion>,
|
|
16
|
-
init?: ClientRequestInit<TClient, TResult
|
|
16
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
17
17
|
): ApiClientArguments<TClient, TResult> => {
|
|
18
18
|
const path = generateEndpoint(version, args);
|
|
19
19
|
//add versions switch case later
|
|
@@ -25,7 +25,7 @@ export const generateParameters = <
|
|
|
25
25
|
const requestParams: ClientRequestInit<TClient, TResult> = Object.assign(
|
|
26
26
|
{},
|
|
27
27
|
{ method: 'put', body: JSON.stringify(args), headers: headers },
|
|
28
|
-
init
|
|
28
|
+
init,
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
return [path, requestParams];
|
|
@@ -25,14 +25,14 @@ export type PutUserNotificationSettingsFn<
|
|
|
25
25
|
TVersion extends string = keyof typeof ApiVersion,
|
|
26
26
|
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
27
27
|
TClient extends IHttpClient = IHttpClient,
|
|
28
|
-
TResult = PutUserNotificationSettingsResponse<TVersion
|
|
28
|
+
TResult = PutUserNotificationSettingsResponse<TVersion>,
|
|
29
29
|
> = (
|
|
30
30
|
args: PutUserNotificationSettingsArgs<TVersion>,
|
|
31
|
-
init?: ClientRequestInit<TClient, TResult
|
|
31
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
32
32
|
) => PutUserNotificationSettingsResult<TVersion, TMethod, TResult>;
|
|
33
33
|
|
|
34
34
|
export type PutUserNotificationSettingsResult<
|
|
35
35
|
TVersion extends string = keyof typeof ApiVersion,
|
|
36
36
|
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
37
|
-
TResult = PutUserNotificationSettingsResponse<TVersion
|
|
37
|
+
TResult = PutUserNotificationSettingsResponse<TVersion>,
|
|
38
38
|
> = ClientMethod<TResult>[TMethod];
|
package/src/provider.ts
CHANGED
|
@@ -11,20 +11,20 @@ export interface IApiProvider<TClient extends IHttpClient = IHttpClient> {
|
|
|
11
11
|
* @param method - Version of the service to use
|
|
12
12
|
*/
|
|
13
13
|
createBookmarksClient<TMethod extends keyof ClientMethod, TPayload = unknown>(
|
|
14
|
-
method: TMethod
|
|
14
|
+
method: TMethod,
|
|
15
15
|
): Promise<BookmarksApiClient<TMethod, TClient, TPayload>>;
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @param method - Version of the service to use
|
|
19
19
|
*/
|
|
20
20
|
createContextClient<TMethod extends keyof ClientMethod>(
|
|
21
|
-
method: TMethod
|
|
21
|
+
method: TMethod,
|
|
22
22
|
): Promise<ContextApiClient<TMethod, TClient>>;
|
|
23
23
|
/**
|
|
24
24
|
* @param method - Version of the service to use
|
|
25
25
|
*/
|
|
26
26
|
createNotificationClient<TMethod extends keyof ClientMethod>(
|
|
27
|
-
method: TMethod
|
|
27
|
+
method: TMethod,
|
|
28
28
|
): Promise<NotificationApiClient<TMethod, TClient>>;
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -80,7 +80,7 @@ export class ApiProvider<TClient extends IHttpClient = IHttpClient>
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
public async createNotificationClient<TMethod extends keyof ClientMethod>(
|
|
83
|
-
method: TMethod
|
|
83
|
+
method: TMethod,
|
|
84
84
|
): Promise<NotificationApiClient<TMethod, TClient>> {
|
|
85
85
|
const httpClient = await this._createClientFn('notification');
|
|
86
86
|
httpClient.responseHandler.add('validate_api_request', validateResponse);
|
|
@@ -88,7 +88,7 @@ export class ApiProvider<TClient extends IHttpClient = IHttpClient>
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
public async createBookmarksClient<TMethod extends keyof ClientMethod, TPayload = unknown>(
|
|
91
|
-
method: TMethod
|
|
91
|
+
method: TMethod,
|
|
92
92
|
): Promise<BookmarksApiClient<TMethod, TClient, TPayload>> {
|
|
93
93
|
const httpClient = await this._createClientFn('bookmarks');
|
|
94
94
|
httpClient.responseHandler.add('validate_api_request', validateResponse);
|
|
@@ -96,7 +96,7 @@ export class ApiProvider<TClient extends IHttpClient = IHttpClient>
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
public async createContextClient<TMethod extends keyof ClientMethod>(
|
|
99
|
-
method: TMethod
|
|
99
|
+
method: TMethod,
|
|
100
100
|
): Promise<ContextApiClient<TMethod, TClient>> {
|
|
101
101
|
const httpClient = await this._createClientFn('context');
|
|
102
102
|
httpClient.responseHandler.add('validate_api_request', validateResponse);
|
package/src/types.ts
CHANGED
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
} from '@equinor/fusion-framework-module-http/client';
|
|
7
7
|
|
|
8
8
|
export type ApiClientFactory<TClient extends IHttpClient = IHttpClient> = (
|
|
9
|
-
name: string
|
|
9
|
+
name: string,
|
|
10
10
|
) => Promise<TClient>;
|
|
11
11
|
|
|
12
12
|
export type ApiClientArguments<TClient extends IHttpClient, TResult = unknown> = [
|
|
13
13
|
path: string,
|
|
14
|
-
init?: ClientRequestInit<TClient, TResult
|
|
14
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
15
15
|
];
|
|
16
16
|
|
|
17
17
|
/**
|
package/src/version.ts
ADDED