@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-module-bookmark",
3
- "version": "2.1.15",
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": "^9.0.16",
41
+ "immer": "^10.1.3",
42
42
  "rxjs": "^7.8.1",
43
- "uuid": "^11.0.3",
44
- "@equinor/fusion-framework-module": "^4.4.2",
45
- "@equinor/fusion-observable": "^8.5.1",
46
- "@equinor/fusion-log": "^1.1.4",
47
- "@equinor/fusion-query": "^5.2.11"
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": "^9.0.8",
50
+ "@types/uuid": "^11.0.0",
51
51
  "typescript": "^5.8.2",
52
- "zod": "^3.23.8",
53
- "@equinor/fusion-framework-module-app": "^6.1.16",
54
- "@equinor/fusion-framework-module-event": "^4.3.6",
55
- "@equinor/fusion-framework-module-context": "^6.0.6",
56
- "@equinor/fusion-framework-module-http": "^6.3.3",
57
- "@equinor/fusion-framework-module-services": "^6.0.3"
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"
@@ -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
- * @note if you wish to implement your own bookmarks API client, you can do so by implementing the {@link IBookmarkClient} interface.
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$'>;
@@ -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((acc, generator) => this._producePayload(acc, generator), initial ?? {}, 1),
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, async (draft) => {
441
+ return produce(value, (draft) => {
438
442
  try {
439
- const result = await Promise.resolve(generator(draft as Partial<T>, initial));
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
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
- export type Bookmark<T extends BookmarkData = any> = z.infer<
42
- ReturnType<typeof bookmarkWithDataSchema<T>>
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.15';
2
+ export const version = '2.2.1';
package/tsconfig.json CHANGED
@@ -13,10 +13,10 @@
13
13
  "path": "../module"
14
14
  },
15
15
  {
16
- "path": "../services"
16
+ "path": "../event"
17
17
  },
18
18
  {
19
- "path": "../event"
19
+ "path": "../services"
20
20
  },
21
21
  {
22
22
  "path": "../context"