@equinor/fusion-framework-module-services 0.3.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/esm/bookmarks/client.js +10 -0
- package/dist/esm/bookmarks/client.js.map +1 -1
- package/dist/esm/bookmarks/delete/client.js +4 -0
- package/dist/esm/bookmarks/delete/client.js.map +1 -0
- package/dist/esm/bookmarks/delete/generate-endpoint.js +17 -0
- package/dist/esm/bookmarks/delete/generate-endpoint.js.map +1 -0
- package/dist/esm/bookmarks/delete/generate-parameters.js +7 -0
- package/dist/esm/bookmarks/delete/generate-parameters.js.map +1 -0
- package/dist/esm/bookmarks/delete/index.js +5 -0
- package/dist/esm/bookmarks/delete/index.js.map +1 -0
- package/dist/esm/bookmarks/delete/types-v1.js +2 -0
- package/dist/esm/bookmarks/delete/types-v1.js.map +1 -0
- package/dist/esm/bookmarks/delete/types.js +2 -0
- package/dist/esm/bookmarks/delete/types.js.map +1 -0
- package/dist/esm/bookmarks/post/client.js +4 -0
- package/dist/esm/bookmarks/post/client.js.map +1 -0
- package/dist/esm/bookmarks/post/generate-endpoint.js +15 -0
- package/dist/esm/bookmarks/post/generate-endpoint.js.map +1 -0
- package/dist/esm/bookmarks/post/generate-parameters.js +9 -0
- package/dist/esm/bookmarks/post/generate-parameters.js.map +1 -0
- package/dist/esm/bookmarks/post/index.js +5 -0
- package/dist/esm/bookmarks/post/index.js.map +1 -0
- package/dist/esm/bookmarks/post/types.js +2 -0
- package/dist/esm/bookmarks/post/types.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/bookmarks/client.d.ts +4 -0
- package/dist/types/bookmarks/delete/client.d.ts +5 -0
- package/dist/types/bookmarks/delete/generate-endpoint.d.ts +2 -0
- package/dist/types/bookmarks/delete/generate-parameters.d.ts +4 -0
- package/dist/types/bookmarks/delete/index.d.ts +4 -0
- package/dist/types/bookmarks/delete/types-v1.d.ts +3 -0
- package/dist/types/bookmarks/delete/types.d.ts +15 -0
- package/dist/types/bookmarks/get/client.d.ts +1 -1
- package/dist/types/bookmarks/post/client.d.ts +5 -0
- package/dist/types/bookmarks/post/generate-endpoint.d.ts +2 -0
- package/dist/types/bookmarks/post/generate-parameters.d.ts +4 -0
- package/dist/types/bookmarks/post/index.d.ts +4 -0
- package/dist/types/bookmarks/post/types.d.ts +29 -0
- package/package.json +4 -4
- package/src/bookmarks/client.ts +24 -0
- package/src/bookmarks/delete/client.ts +35 -0
- package/src/bookmarks/delete/generate-endpoint.ts +24 -0
- package/src/bookmarks/delete/generate-parameters.ts +28 -0
- package/src/bookmarks/delete/index.ts +6 -0
- package/src/bookmarks/delete/types-v1.ts +2 -0
- package/src/bookmarks/delete/types.ts +35 -0
- package/src/bookmarks/post/client.ts +30 -0
- package/src/bookmarks/post/generate-endpoint.ts +22 -0
- package/src/bookmarks/post/generate-parameters.ts +33 -0
- package/src/bookmarks/post/index.ts +6 -0
- package/src/bookmarks/post/types.ts +58 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IHttpClient } from '@equinor/fusion-framework-module-http';
|
|
2
|
+
import { ClientRequestInit } from '@equinor/fusion-framework-module-services/../../module-http/src/lib/client';
|
|
3
|
+
import { ClientMethod } from '../..';
|
|
4
|
+
import { ApiBookmarkEntityV1 } from '../api-models';
|
|
5
|
+
export declare type PostBookmarkResult<TVersion extends ApiVersions, TPayload> = PostBookmarksVersions<TPayload>[TVersion]['result'];
|
|
6
|
+
export declare type PostBookmarkArgs<TVersion extends ApiVersions, TPayload = unknown> = PostBookmarksVersions<TPayload>[TVersion]['args'];
|
|
7
|
+
export declare type PostBookmarksResult<TVersion extends ApiVersions, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TPayload = unknown, TResult = PostBookmarkResult<TVersion, TPayload>> = ClientMethod<TResult>[TMethod];
|
|
8
|
+
export declare type PostBookmarkFn<TVersion extends ApiVersions, TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>, TClient extends IHttpClient = IHttpClient, TPayload = unknown, TResult = PostBookmarkResult<TVersion, TPayload>> = (args: PostBookmarkArgs<TVersion>, init?: ClientRequestInit<TClient, TResult>) => PostBookmarksResult<TVersion, TMethod, TPayload, TResult>;
|
|
9
|
+
declare type PostBookmarksArgsV1<T = unknown> = {
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
isShared: boolean;
|
|
13
|
+
appKey: string;
|
|
14
|
+
contextId?: string;
|
|
15
|
+
payload: T;
|
|
16
|
+
sourceSystem?: {
|
|
17
|
+
identifier?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
subSystem?: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export declare type PostBookmarksVersions<TPayload = unknown> = {
|
|
23
|
+
['v1']: {
|
|
24
|
+
args: PostBookmarksArgsV1<TPayload>;
|
|
25
|
+
result: ApiBookmarkEntityV1<TPayload>;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare type ApiVersions = keyof PostBookmarksVersions<unknown>;
|
|
29
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-module-services",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@equinor/fusion-framework-module": "^1.2.6",
|
|
52
|
-
"@equinor/fusion-framework-module-http": "^2.0
|
|
53
|
-
"@equinor/fusion-framework-module-service-discovery": "^3.0.
|
|
52
|
+
"@equinor/fusion-framework-module-http": "^2.1.0",
|
|
53
|
+
"@equinor/fusion-framework-module-service-discovery": "^3.0.7"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"@equinor/fusion-framework-module": "^1.2.2",
|
|
57
57
|
"odata-query": "^7.0.3"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "b0bada58a93067d4f6adfa7f3e47c864c22c5bc9"
|
|
60
60
|
}
|
package/src/bookmarks/client.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { IHttpClient } from '@equinor/fusion-framework-module-http';
|
|
2
2
|
|
|
3
3
|
import { ClientMethod } from '@equinor/fusion-framework-module-services/context';
|
|
4
|
+
import deleteBookmark from './delete/client';
|
|
5
|
+
import { DeleteBookmarkResult, DeleteBookmarksFn, DeleteBookmarksResult } from './delete/types';
|
|
4
6
|
import getBookmark from './get/client';
|
|
5
7
|
import { ApiVersions, GetBookmarkResult, GetBookmarksFn, GetBookmarksResult } from './get/types';
|
|
8
|
+
import { PostBookmarkResult, PostBookmarkFn, PostBookmarksResult } from './post/types';
|
|
9
|
+
import postBookmark from './post/client';
|
|
6
10
|
|
|
7
11
|
export class BookmarksApiClient<
|
|
8
12
|
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
@@ -22,6 +26,26 @@ export class BookmarksApiClient<
|
|
|
22
26
|
const fn = getBookmark<TVersion, TMethod, TClient>(this._client, version, this._method);
|
|
23
27
|
return fn<TResult>(...args);
|
|
24
28
|
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Create a new bookmark
|
|
32
|
+
* @see {@link get/client}
|
|
33
|
+
*/
|
|
34
|
+
public post<TVersion extends ApiVersions, TResult = PostBookmarkResult<TVersion, TPayload>>(
|
|
35
|
+
version: TVersion,
|
|
36
|
+
...args: Parameters<PostBookmarkFn<TVersion, TMethod, TClient, TPayload, TResult>>
|
|
37
|
+
): PostBookmarksResult<TVersion, TMethod, TPayload, TResult> {
|
|
38
|
+
const fn = postBookmark<TVersion, TMethod, TClient>(this._client, version, this._method);
|
|
39
|
+
return fn<TResult>(...args);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
public delete<TVersion extends ApiVersions, TResult = DeleteBookmarkResult<TVersion>>(
|
|
43
|
+
version: TVersion,
|
|
44
|
+
...args: Parameters<DeleteBookmarksFn<TVersion, TMethod, TClient, TResult>>
|
|
45
|
+
): DeleteBookmarksResult<TVersion, TMethod, TResult> {
|
|
46
|
+
const fn = deleteBookmark(this._client, version, this._method);
|
|
47
|
+
return fn<TResult>(...args);
|
|
48
|
+
}
|
|
25
49
|
}
|
|
26
50
|
|
|
27
51
|
export default BookmarksApiClient;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
|
|
2
|
+
import { ClientMethod } from '../..';
|
|
3
|
+
import { generateParameters } from './generate-parameters';
|
|
4
|
+
import {
|
|
5
|
+
ApiVersions,
|
|
6
|
+
DeleteBookmarkArgs,
|
|
7
|
+
DeleteBookmarkResult,
|
|
8
|
+
DeleteBookmarksResult,
|
|
9
|
+
} from './types';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Method for fetching bookmark by it`s id from bookmark service
|
|
13
|
+
* @param client - client for execution of request
|
|
14
|
+
* @param version - version of API to call
|
|
15
|
+
* @param method - client method to call
|
|
16
|
+
*/
|
|
17
|
+
export const deleteBookmark =
|
|
18
|
+
<
|
|
19
|
+
TVersion extends ApiVersions = ApiVersions,
|
|
20
|
+
TMethod extends keyof ClientMethod = keyof ClientMethod,
|
|
21
|
+
TClient extends IHttpClient = IHttpClient
|
|
22
|
+
>(
|
|
23
|
+
client: TClient,
|
|
24
|
+
version: TVersion,
|
|
25
|
+
method: TMethod = 'json' as TMethod
|
|
26
|
+
) =>
|
|
27
|
+
<TResult = DeleteBookmarkResult<TVersion>>(
|
|
28
|
+
args: DeleteBookmarkArgs<TVersion>,
|
|
29
|
+
init?: ClientRequestInit<TClient, TResult>
|
|
30
|
+
): DeleteBookmarksResult<TVersion, TMethod, TResult> =>
|
|
31
|
+
client[method](
|
|
32
|
+
...generateParameters<TResult, TVersion, TClient>(version, args, init)
|
|
33
|
+
) as DeleteBookmarksResult<TVersion, TMethod, TResult>;
|
|
34
|
+
|
|
35
|
+
export default deleteBookmark;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ApiVersions, DeleteBookmarkArgs } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Method for generating endpoint for deleting a bookmark.
|
|
5
|
+
*/
|
|
6
|
+
export const generateEndpoint = <TVersion extends ApiVersions>(
|
|
7
|
+
version: TVersion,
|
|
8
|
+
args: DeleteBookmarkArgs<TVersion>
|
|
9
|
+
) => {
|
|
10
|
+
switch (version) {
|
|
11
|
+
case 'v1': {
|
|
12
|
+
const { id } = args as { id: string };
|
|
13
|
+
const params = new URLSearchParams();
|
|
14
|
+
params.append('api-version', '1.0');
|
|
15
|
+
return `/bookmarks/${id}/?${String(params)}`;
|
|
16
|
+
}
|
|
17
|
+
default: {
|
|
18
|
+
const { id } = args as { id: string };
|
|
19
|
+
const params = new URLSearchParams();
|
|
20
|
+
params.append('api-version', version);
|
|
21
|
+
return `/bookmarks/${id}/?${String(params)}`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ClientRequestInit,
|
|
3
|
+
IHttpClient,
|
|
4
|
+
} from '@equinor/fusion-framework-module-services/../../module-http/src/lib/client';
|
|
5
|
+
import { ApiClientArguments } from '../..';
|
|
6
|
+
import { generateEndpoint } from './generate-endpoint';
|
|
7
|
+
import { ApiVersions, DeleteBookmarkArgs } from './types';
|
|
8
|
+
|
|
9
|
+
/** function for creating http client arguments */
|
|
10
|
+
export const generateParameters = <
|
|
11
|
+
TResult,
|
|
12
|
+
TVersion extends ApiVersions,
|
|
13
|
+
TClient extends IHttpClient = IHttpClient
|
|
14
|
+
>(
|
|
15
|
+
version: TVersion,
|
|
16
|
+
args: DeleteBookmarkArgs<TVersion>,
|
|
17
|
+
init?: ClientRequestInit<TClient, TResult>
|
|
18
|
+
): ApiClientArguments<TClient, TResult> => {
|
|
19
|
+
const path = generateEndpoint(version, args);
|
|
20
|
+
|
|
21
|
+
const requestParams: ClientRequestInit<TClient, TResult> = Object.assign(
|
|
22
|
+
{},
|
|
23
|
+
{ method: 'Delete' },
|
|
24
|
+
init
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
return [path, requestParams];
|
|
28
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IHttpClient } from '@equinor/fusion-framework-module-http';
|
|
2
|
+
import { ClientRequestInit } from '@equinor/fusion-framework-module-services/../../module-http/src/lib/client';
|
|
3
|
+
import { ClientMethod } from '../..';
|
|
4
|
+
import { DeleteBookmarksArgsV1 } from './types-v1';
|
|
5
|
+
|
|
6
|
+
export type DeleteBookmarkResult<TVersion extends ApiVersions> =
|
|
7
|
+
DeleteBookmarksVersions[TVersion]['result'];
|
|
8
|
+
|
|
9
|
+
/** Returns args for GetBookmark based on version*/
|
|
10
|
+
export type DeleteBookmarkArgs<TVersion extends ApiVersions> =
|
|
11
|
+
DeleteBookmarksVersions[TVersion]['args'];
|
|
12
|
+
|
|
13
|
+
/**Gets result type for GetBookmark call based on version and method */
|
|
14
|
+
export type DeleteBookmarksResult<
|
|
15
|
+
TVersion extends ApiVersions,
|
|
16
|
+
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
17
|
+
TResult = DeleteBookmarkResult<TVersion>
|
|
18
|
+
> = ClientMethod<TResult>[TMethod];
|
|
19
|
+
|
|
20
|
+
export type DeleteBookmarksFn<
|
|
21
|
+
TVersion extends ApiVersions,
|
|
22
|
+
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
23
|
+
TClient extends IHttpClient = IHttpClient,
|
|
24
|
+
TResult = DeleteBookmarkResult<TVersion>
|
|
25
|
+
> = (
|
|
26
|
+
args: DeleteBookmarkArgs<TVersion>,
|
|
27
|
+
init?: ClientRequestInit<TClient, TResult>
|
|
28
|
+
) => DeleteBookmarksResult<TVersion, TMethod, TResult>;
|
|
29
|
+
|
|
30
|
+
export type DeleteBookmarksVersions = {
|
|
31
|
+
['v1']: { args: DeleteBookmarksArgsV1; result: undefined };
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**Api versions for bookmarks service */
|
|
35
|
+
export type ApiVersions = keyof DeleteBookmarksVersions;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
|
|
2
|
+
import { ClientMethod } from '../..';
|
|
3
|
+
import { generateParameters } from './generate-parameters';
|
|
4
|
+
import { ApiVersions, PostBookmarkArgs, PostBookmarkResult, PostBookmarksResult } from './types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Method for fetching bookmark by it`s id from bookmark service
|
|
8
|
+
* @param client - client for execution of request
|
|
9
|
+
* @param version - version of API to call
|
|
10
|
+
* @param method - client method to call
|
|
11
|
+
*/
|
|
12
|
+
export const postBookmark =
|
|
13
|
+
<
|
|
14
|
+
TVersion extends ApiVersions = ApiVersions,
|
|
15
|
+
TMethod extends keyof ClientMethod = keyof ClientMethod,
|
|
16
|
+
TClient extends IHttpClient = IHttpClient
|
|
17
|
+
>(
|
|
18
|
+
client: TClient,
|
|
19
|
+
version: TVersion,
|
|
20
|
+
method: TMethod = 'json' as TMethod
|
|
21
|
+
) =>
|
|
22
|
+
<TResult = PostBookmarkResult<TVersion, unknown>>(
|
|
23
|
+
args: PostBookmarkArgs<TVersion>,
|
|
24
|
+
init?: ClientRequestInit<TClient, TResult>
|
|
25
|
+
): PostBookmarksResult<TVersion, TMethod, unknown, TResult> =>
|
|
26
|
+
client[method](
|
|
27
|
+
...generateParameters<TResult, TVersion, TClient>(version, args, init)
|
|
28
|
+
) as PostBookmarksResult<TVersion, TMethod, unknown, TResult>;
|
|
29
|
+
|
|
30
|
+
export default postBookmark;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ApiVersions, PostBookmarkArgs } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Method for generating endpoint for getting bookmark by id
|
|
5
|
+
*/
|
|
6
|
+
export const generateEndpoint = <TVersion extends ApiVersions>(
|
|
7
|
+
version: TVersion,
|
|
8
|
+
_args: PostBookmarkArgs<TVersion>
|
|
9
|
+
) => {
|
|
10
|
+
switch (version) {
|
|
11
|
+
case 'v1': {
|
|
12
|
+
const params = new URLSearchParams();
|
|
13
|
+
params.append('api-version', '1.0');
|
|
14
|
+
return `/bookmarks?${String(params)}`;
|
|
15
|
+
}
|
|
16
|
+
default: {
|
|
17
|
+
const params = new URLSearchParams();
|
|
18
|
+
params.append('api-version', version);
|
|
19
|
+
return `/bookmarks?${String(params)}`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ClientRequestInit,
|
|
3
|
+
IHttpClient,
|
|
4
|
+
} from '@equinor/fusion-framework-module-services/../../module-http/src/lib/client';
|
|
5
|
+
import { ApiClientArguments } from '../..';
|
|
6
|
+
import { generateEndpoint } from './generate-endpoint';
|
|
7
|
+
import { ApiVersions, PostBookmarkArgs } from './types';
|
|
8
|
+
|
|
9
|
+
/** function for creating http client arguments */
|
|
10
|
+
export const generateParameters = <
|
|
11
|
+
TResult,
|
|
12
|
+
TVersion extends ApiVersions,
|
|
13
|
+
TClient extends IHttpClient = IHttpClient
|
|
14
|
+
>(
|
|
15
|
+
version: TVersion,
|
|
16
|
+
args: PostBookmarkArgs<TVersion>,
|
|
17
|
+
init?: ClientRequestInit<TClient, TResult>
|
|
18
|
+
): ApiClientArguments<TClient, TResult> => {
|
|
19
|
+
const path = generateEndpoint(version, args);
|
|
20
|
+
//add versions switch case later
|
|
21
|
+
|
|
22
|
+
//Not sure why this is needed, defaults to application/problem+json failing the request
|
|
23
|
+
const headers = new Headers();
|
|
24
|
+
headers.append('content-type', 'application/json');
|
|
25
|
+
|
|
26
|
+
const requestParams: ClientRequestInit<TClient, TResult> = Object.assign(
|
|
27
|
+
{},
|
|
28
|
+
{ method: 'post', body: JSON.stringify(args), headers: headers },
|
|
29
|
+
init
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
return [path, requestParams];
|
|
33
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { IHttpClient } from '@equinor/fusion-framework-module-http';
|
|
2
|
+
import { ClientRequestInit } from '@equinor/fusion-framework-module-services/../../module-http/src/lib/client';
|
|
3
|
+
import { ClientMethod } from '../..';
|
|
4
|
+
import { ApiBookmarkEntityV1 } from '../api-models';
|
|
5
|
+
|
|
6
|
+
export type PostBookmarkResult<
|
|
7
|
+
TVersion extends ApiVersions,
|
|
8
|
+
TPayload
|
|
9
|
+
> = PostBookmarksVersions<TPayload>[TVersion]['result'];
|
|
10
|
+
|
|
11
|
+
/** Returns args for GetBookmark based on version*/
|
|
12
|
+
export type PostBookmarkArgs<
|
|
13
|
+
TVersion extends ApiVersions,
|
|
14
|
+
TPayload = unknown
|
|
15
|
+
> = PostBookmarksVersions<TPayload>[TVersion]['args'];
|
|
16
|
+
|
|
17
|
+
/**Gets result type for GetBookmark call based on version and method */
|
|
18
|
+
export type PostBookmarksResult<
|
|
19
|
+
TVersion extends ApiVersions,
|
|
20
|
+
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
21
|
+
TPayload = unknown,
|
|
22
|
+
TResult = PostBookmarkResult<TVersion, TPayload>
|
|
23
|
+
> = ClientMethod<TResult>[TMethod];
|
|
24
|
+
|
|
25
|
+
export type PostBookmarkFn<
|
|
26
|
+
TVersion extends ApiVersions,
|
|
27
|
+
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
28
|
+
TClient extends IHttpClient = IHttpClient,
|
|
29
|
+
TPayload = unknown,
|
|
30
|
+
TResult = PostBookmarkResult<TVersion, TPayload>
|
|
31
|
+
> = (
|
|
32
|
+
args: PostBookmarkArgs<TVersion>,
|
|
33
|
+
init?: ClientRequestInit<TClient, TResult>
|
|
34
|
+
) => PostBookmarksResult<TVersion, TMethod, TPayload, TResult>;
|
|
35
|
+
|
|
36
|
+
type PostBookmarksArgsV1<T = unknown> = {
|
|
37
|
+
/** Display name of the bookmark */
|
|
38
|
+
name: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
/** Is the bookmark shared with others */
|
|
41
|
+
isShared: boolean;
|
|
42
|
+
/** Name of the app it belongs too, should correspond to a fusion appkey */
|
|
43
|
+
appKey: string;
|
|
44
|
+
contextId?: string;
|
|
45
|
+
/** Any JSON object to store as the bookmark payload */
|
|
46
|
+
payload: T;
|
|
47
|
+
sourceSystem?: {
|
|
48
|
+
identifier?: string;
|
|
49
|
+
name?: string;
|
|
50
|
+
subSystem?: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export type PostBookmarksVersions<TPayload = unknown> = {
|
|
55
|
+
['v1']: { args: PostBookmarksArgsV1<TPayload>; result: ApiBookmarkEntityV1<TPayload> };
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export type ApiVersions = keyof PostBookmarksVersions<unknown>;
|