@equinor/fusion-framework-module-bookmark 2.1.15 → 2.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.
- package/CHANGELOG.md +87 -0
- package/dist/esm/BookmarkClient.js +1 -1
- package/dist/esm/BookmarkProvider.js +3 -3
- package/dist/esm/BookmarkProvider.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/BookmarkClient.d.ts +1 -1
- package/dist/types/BookmarkProvider.actions.d.ts +4 -178
- package/dist/types/BookmarkProvider.d.ts +19 -113
- package/dist/types/BookmarkProvider.reducer.d.ts +3 -90
- package/dist/types/bookmark.schemas.d.ts +2 -126
- package/dist/types/index.d.ts +1 -0
- package/dist/types/types.d.ts +4 -2
- package/dist/types/version.d.ts +1 -1
- package/package.json +14 -14
- package/src/BookmarkClient.ts +1 -1
- package/src/BookmarkProvider.ts +7 -3
- package/src/index.ts +2 -0
- package/src/types.ts +4 -5
- package/src/version.ts +1 -1
- package/tsconfig.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-module-bookmark",
|
|
3
|
-
"version": "2.1
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/esm/index.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -38,23 +38,23 @@
|
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"fast-deep-equal": "^3.1.3",
|
|
41
|
-
"immer": "^
|
|
41
|
+
"immer": "^10.1.3",
|
|
42
42
|
"rxjs": "^7.8.1",
|
|
43
|
-
"uuid": "^
|
|
44
|
-
"@equinor/fusion-framework-module": "^
|
|
45
|
-
"@equinor/fusion-
|
|
46
|
-
"@equinor/fusion-
|
|
47
|
-
"@equinor/fusion-
|
|
43
|
+
"uuid": "^13.0.0",
|
|
44
|
+
"@equinor/fusion-framework-module": "^5.0.1",
|
|
45
|
+
"@equinor/fusion-log": "^1.1.7",
|
|
46
|
+
"@equinor/fusion-query": "^5.2.13",
|
|
47
|
+
"@equinor/fusion-observable": "^8.5.3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@types/uuid": "^
|
|
50
|
+
"@types/uuid": "^11.0.0",
|
|
51
51
|
"typescript": "^5.8.2",
|
|
52
|
-
"zod": "^3.
|
|
53
|
-
"@equinor/fusion-framework-module-app": "^6.1.
|
|
54
|
-
"@equinor/fusion-framework-module-
|
|
55
|
-
"@equinor/fusion-framework-module-
|
|
56
|
-
"@equinor/fusion-framework-module-
|
|
57
|
-
"@equinor/fusion-framework-module-
|
|
52
|
+
"zod": "^3.25.76",
|
|
53
|
+
"@equinor/fusion-framework-module-app": "^6.1.19",
|
|
54
|
+
"@equinor/fusion-framework-module-context": "^7.0.0",
|
|
55
|
+
"@equinor/fusion-framework-module-services": "^7.0.2",
|
|
56
|
+
"@equinor/fusion-framework-module-event": "^4.3.7",
|
|
57
|
+
"@equinor/fusion-framework-module-http": "^6.3.5"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
60
|
"build": "tsc -b"
|
package/src/BookmarkClient.ts
CHANGED
|
@@ -69,7 +69,7 @@ const parseBookmarkWithoutPayload = (value: unknown): BookmarkWithoutData => {
|
|
|
69
69
|
*
|
|
70
70
|
* Fetching single and all bookmarks will use Query from '@equinor/fusion-query' to cache the results.
|
|
71
71
|
*
|
|
72
|
-
* @
|
|
72
|
+
* @remarks if you wish to implement your own bookmarks API client, you can do so by implementing the {@link IBookmarkClient} interface.
|
|
73
73
|
*/
|
|
74
74
|
export class BookmarkClient implements IBookmarkClient {
|
|
75
75
|
#api: BookmarksApiClient<'json$'>;
|
package/src/BookmarkProvider.ts
CHANGED
|
@@ -407,7 +407,11 @@ export class BookmarkProvider implements IBookmarkProvider {
|
|
|
407
407
|
* Observable that emits the generated payload.
|
|
408
408
|
*/
|
|
409
409
|
const result$ = from(this.#payloadGenerators).pipe(
|
|
410
|
-
mergeScan(
|
|
410
|
+
mergeScan(
|
|
411
|
+
(acc, generator) => of(this._producePayload(acc, generator)),
|
|
412
|
+
initial ?? ({} as Partial<T>),
|
|
413
|
+
1,
|
|
414
|
+
),
|
|
411
415
|
tap((payload) => this._log?.debug(`generated payload`, { initial, payload })),
|
|
412
416
|
) as Observable<T | null | undefined>;
|
|
413
417
|
|
|
@@ -434,9 +438,9 @@ export class BookmarkProvider implements IBookmarkProvider {
|
|
|
434
438
|
initial?: Partial<T> | null,
|
|
435
439
|
) {
|
|
436
440
|
// produce payload from generator
|
|
437
|
-
return produce(value,
|
|
441
|
+
return produce(value, (draft) => {
|
|
438
442
|
try {
|
|
439
|
-
const result =
|
|
443
|
+
const result = generator(draft as Partial<T>, initial);
|
|
440
444
|
// cast the result to a draft object
|
|
441
445
|
if (result) {
|
|
442
446
|
this._log?.warn(
|
package/src/index.ts
CHANGED
|
@@ -23,6 +23,8 @@ export type {
|
|
|
23
23
|
BookmarkPayloadGenerator,
|
|
24
24
|
} from './BookmarkProvider.interface';
|
|
25
25
|
|
|
26
|
+
export type { BookmarkProviderEventMap as BookmarkProviderEvents } from './BookmarkProvider.events.js';
|
|
27
|
+
|
|
26
28
|
export { enableBookmark } from './enable-bookmark';
|
|
27
29
|
|
|
28
30
|
export * from './types';
|
package/src/types.ts
CHANGED
|
@@ -6,7 +6,6 @@ import type {
|
|
|
6
6
|
bookmarkSourceSystemSchema,
|
|
7
7
|
bookmarksSchema,
|
|
8
8
|
bookmarkUserSchema,
|
|
9
|
-
bookmarkWithDataSchema,
|
|
10
9
|
} from './bookmark.schemas';
|
|
11
10
|
|
|
12
11
|
import type { bookmarkConfigSchema } from './bookmark-config.schema';
|
|
@@ -37,10 +36,10 @@ export type BookmarkWithoutData = z.infer<typeof bookmarkSchema>;
|
|
|
37
36
|
* Represents a bookmark with associated data.
|
|
38
37
|
* @template T - The type of the bookmark data.
|
|
39
38
|
*/
|
|
40
|
-
//
|
|
41
|
-
export type Bookmark<T extends BookmarkData = any> =
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
// biome-ignore lint/suspicious/noExplicitAny: must be any to support all bookmark data types
|
|
40
|
+
export type Bookmark<T extends BookmarkData = any> = BookmarkWithoutData & {
|
|
41
|
+
payload?: T;
|
|
42
|
+
};
|
|
44
43
|
|
|
45
44
|
/**
|
|
46
45
|
* Represents the configuration options for a bookmark module.
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '2.1
|
|
2
|
+
export const version = '2.2.1';
|