@equinor/fusion-framework-module-bookmark 2.2.0 → 3.0.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.
@@ -1,5 +1,5 @@
1
1
  import { type Action, type ActionTypes } from '@equinor/fusion-observable';
2
- import type { Bookmark, BookmarkData } from './types';
2
+ import type { Bookmark, BookmarkData, BookmarkWithoutData, Bookmarks } from './types';
3
3
  import type { BookmarkNew, BookmarkUpdate, BookmarksFilter } from './BookmarkClient.interface';
4
4
  import type { BookmarkFlowError } from './BookmarkProvider.error';
5
5
  /**
@@ -15,122 +15,10 @@ type BookmarkActionMeta = {
15
15
  */
16
16
  export declare const bookmarkActions: {
17
17
  aborted: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[action: Action], Action, "action_aborted", never, never>;
18
- setBookmark: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[bookmark: {
19
- id: string;
20
- name: string;
21
- appKey: string;
22
- created: Date;
23
- createdBy: {
24
- id: string;
25
- name: string;
26
- mail?: string | undefined;
27
- };
28
- description?: string | undefined;
29
- isShared?: boolean | undefined;
30
- updated?: Date | undefined;
31
- updatedBy?: {
32
- id: string;
33
- name: string;
34
- mail?: string | undefined;
35
- } | undefined;
36
- context?: {
37
- id: string;
38
- name?: string | undefined;
39
- type?: string | undefined;
40
- } | undefined;
41
- sourceSystem?: {
42
- identifier: string;
43
- name?: string | null | undefined;
44
- subSystem?: string | null | undefined;
45
- } | null | undefined;
46
- }], {
47
- id: string;
48
- name: string;
49
- appKey: string;
50
- created: Date;
51
- createdBy: {
52
- id: string;
53
- name: string;
54
- mail?: string | undefined;
55
- };
56
- description?: string | undefined;
57
- isShared?: boolean | undefined;
58
- updated?: Date | undefined;
59
- updatedBy?: {
60
- id: string;
61
- name: string;
62
- mail?: string | undefined;
63
- } | undefined;
64
- context?: {
65
- id: string;
66
- name?: string | undefined;
67
- type?: string | undefined;
68
- } | undefined;
69
- sourceSystem?: {
70
- identifier: string;
71
- name?: string | null | undefined;
72
- subSystem?: string | null | undefined;
73
- } | null | undefined;
74
- }, "set_bookmark", never, never>;
75
- setCurrentBookmark: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[bookmark: Bookmark | null], Bookmark | null, "set_current_bookmark", never, never>;
18
+ setBookmark: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[bookmark: BookmarkWithoutData], BookmarkWithoutData, "set_bookmark", never, never>;
19
+ setCurrentBookmark: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[bookmark: Bookmark<any> | null], Bookmark<any> | null, "set_current_bookmark", never, never>;
76
20
  fetchBookmark: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[bookmarkId: string, meta?: BookmarkActionMeta | undefined], string, "fetch_bookmark::request", never, BookmarkActionMeta | undefined> & {
77
- success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[bookmark: {
78
- id: string;
79
- name: string;
80
- appKey: string;
81
- created: Date;
82
- createdBy: {
83
- id: string;
84
- name: string;
85
- mail?: string | undefined;
86
- };
87
- description?: string | undefined;
88
- isShared?: boolean | undefined;
89
- updated?: Date | undefined;
90
- updatedBy?: {
91
- id: string;
92
- name: string;
93
- mail?: string | undefined;
94
- } | undefined;
95
- context?: {
96
- id: string;
97
- name?: string | undefined;
98
- type?: string | undefined;
99
- } | undefined;
100
- sourceSystem?: {
101
- identifier: string;
102
- name?: string | null | undefined;
103
- subSystem?: string | null | undefined;
104
- } | null | undefined;
105
- }, meta?: BookmarkActionMeta | undefined], {
106
- id: string;
107
- name: string;
108
- appKey: string;
109
- created: Date;
110
- createdBy: {
111
- id: string;
112
- name: string;
113
- mail?: string | undefined;
114
- };
115
- description?: string | undefined;
116
- isShared?: boolean | undefined;
117
- updated?: Date | undefined;
118
- updatedBy?: {
119
- id: string;
120
- name: string;
121
- mail?: string | undefined;
122
- } | undefined;
123
- context?: {
124
- id: string;
125
- name?: string | undefined;
126
- type?: string | undefined;
127
- } | undefined;
128
- sourceSystem?: {
129
- identifier: string;
130
- name?: string | null | undefined;
131
- subSystem?: string | null | undefined;
132
- } | null | undefined;
133
- }, "fetch_bookmark::success", never, BookmarkActionMeta | undefined>;
21
+ success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[bookmark: BookmarkWithoutData, meta?: BookmarkActionMeta | undefined], BookmarkWithoutData, "fetch_bookmark::success", never, BookmarkActionMeta | undefined>;
134
22
  failure: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[error: BookmarkFlowError, meta?: BookmarkActionMeta | undefined], BookmarkFlowError, "fetch_bookmark::failure", never, BookmarkActionMeta | undefined>;
135
23
  };
136
24
  fetchBookmarkData: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[bookmarkId: string, meta?: BookmarkActionMeta | undefined], string, "fetch_bookmark_payload::request", never, BookmarkActionMeta | undefined> & {
@@ -141,63 +29,7 @@ export declare const bookmarkActions: {
141
29
  failure: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[error: BookmarkFlowError, meta?: BookmarkActionMeta | undefined], BookmarkFlowError, "fetch_bookmark_payload::failure", never, BookmarkActionMeta | undefined>;
142
30
  };
143
31
  fetchBookmarks: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[filter?: BookmarksFilter | undefined, meta?: BookmarkActionMeta | undefined], BookmarksFilter | undefined, "fetch_bookmarks::request", never, BookmarkActionMeta | undefined> & {
144
- success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[bookmarks: {
145
- id: string;
146
- name: string;
147
- appKey: string;
148
- created: Date;
149
- createdBy: {
150
- id: string;
151
- name: string;
152
- mail?: string | undefined;
153
- };
154
- description?: string | undefined;
155
- isShared?: boolean | undefined;
156
- updated?: Date | undefined;
157
- updatedBy?: {
158
- id: string;
159
- name: string;
160
- mail?: string | undefined;
161
- } | undefined;
162
- context?: {
163
- id: string;
164
- name?: string | undefined;
165
- type?: string | undefined;
166
- } | undefined;
167
- sourceSystem?: {
168
- identifier: string;
169
- name?: string | null | undefined;
170
- subSystem?: string | null | undefined;
171
- } | null | undefined;
172
- }[], meta?: BookmarkActionMeta | undefined], {
173
- id: string;
174
- name: string;
175
- appKey: string;
176
- created: Date;
177
- createdBy: {
178
- id: string;
179
- name: string;
180
- mail?: string | undefined;
181
- };
182
- description?: string | undefined;
183
- isShared?: boolean | undefined;
184
- updated?: Date | undefined;
185
- updatedBy?: {
186
- id: string;
187
- name: string;
188
- mail?: string | undefined;
189
- } | undefined;
190
- context?: {
191
- id: string;
192
- name?: string | undefined;
193
- type?: string | undefined;
194
- } | undefined;
195
- sourceSystem?: {
196
- identifier: string;
197
- name?: string | null | undefined;
198
- subSystem?: string | null | undefined;
199
- } | null | undefined;
200
- }[], "fetch_bookmarks::success", never, BookmarkActionMeta | undefined>;
32
+ success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[bookmarks: Bookmarks, meta?: BookmarkActionMeta | undefined], Bookmarks, "fetch_bookmarks::success", never, BookmarkActionMeta | undefined>;
201
33
  failure: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[error: BookmarkFlowError, meta?: BookmarkActionMeta | undefined], BookmarkFlowError, "fetch_bookmarks::failure", never, BookmarkActionMeta | undefined>;
202
34
  };
203
35
  updateBookmark: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[payload: {
@@ -207,11 +39,11 @@ export declare const bookmarkActions: {
207
39
  bookmarkId: string;
208
40
  updates: BookmarkUpdate;
209
41
  }, "set_bookmark::request", never, BookmarkActionMeta> & {
210
- success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[payload: Bookmark, meta: BookmarkActionMeta], Bookmark, "set_bookmark::success", never, BookmarkActionMeta>;
42
+ success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[payload: Bookmark<any>, meta: BookmarkActionMeta], Bookmark<any>, "set_bookmark::success", never, BookmarkActionMeta>;
211
43
  failure: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[payload: BookmarkFlowError, meta: BookmarkActionMeta], BookmarkFlowError, "set_bookmark::failure", never, BookmarkActionMeta>;
212
44
  };
213
45
  createBookmark: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[payload: BookmarkNew, meta: BookmarkActionMeta], BookmarkNew, "create_bookmark::request", never, BookmarkActionMeta> & {
214
- success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[payload: Bookmark, meta: BookmarkActionMeta], Bookmark, "create_bookmark::success", never, BookmarkActionMeta>;
46
+ success: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[payload: Bookmark<any>, meta: BookmarkActionMeta], Bookmark<any>, "create_bookmark::success", never, BookmarkActionMeta>;
215
47
  failure: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[payload: BookmarkFlowError, meta: BookmarkActionMeta], BookmarkFlowError, "create_bookmark::failure", never, BookmarkActionMeta>;
216
48
  };
217
49
  deleteBookmark: import("@equinor/fusion-observable").ActionCreatorWithPreparedPayload<[bookmarkId: string, meta?: BookmarkActionMeta | undefined], string, "delete_bookmark::request", never, {
@@ -147,7 +147,7 @@ export declare class BookmarkProvider implements IBookmarkProvider {
147
147
  * @returns An observable that emits the generated payload.
148
148
  * @template T - The type of the generated payload.
149
149
  */
150
- generatePayload<T extends BookmarkData>(initial?: Partial<T> | null): Observable<T | null | undefined>;
150
+ generatePayload<T extends BookmarkData = BookmarkData>(initial?: Partial<T> | null): Observable<T | null | undefined>;
151
151
  /**
152
152
  * Produces a payload using the provided generator function.
153
153
  *
@@ -162,7 +162,7 @@ export declare class BookmarkProvider implements IBookmarkProvider {
162
162
  * If the generator returns a value, a warning will be logged.
163
163
  * If the generator returns null, an info message will be logged indicating that the bookmark data should be cleared.
164
164
  */
165
- protected _producePayload<T extends BookmarkData>(value: Partial<T>, generator: BookmarkPayloadGenerator<T>, initial?: Partial<T> | null): Promise<Partial<T>>;
165
+ protected _producePayload<T extends BookmarkData = BookmarkData>(value: Partial<T>, generator: BookmarkPayloadGenerator<T>, initial?: Partial<T> | null): Promise<T | null | undefined>;
166
166
  /**
167
167
  * Retrieves a bookmark with the specified bookmarkId and returns an observable that emits the combined result of fetching the bookmark and bookmark data.
168
168
  * @template T The type of the bookmark payload.
@@ -170,39 +170,9 @@ export declare class BookmarkProvider implements IBookmarkProvider {
170
170
  * @param options An optional object that allows excluding the bookmark payload from the result.
171
171
  * @returns An observable that emits the combined result of fetching the bookmark and bookmark data.
172
172
  */
173
- getBookmark<T extends BookmarkData>(bookmarkId: string, options?: {
173
+ getBookmark<T extends BookmarkData = BookmarkData>(bookmarkId: string, options?: {
174
174
  excludePayload?: boolean;
175
- }): Observable<{
176
- id: string;
177
- name: string;
178
- appKey: string;
179
- created: Date;
180
- createdBy: {
181
- id: string;
182
- name: string;
183
- mail?: string | undefined;
184
- };
185
- description?: string | undefined;
186
- isShared?: boolean | undefined;
187
- updated?: Date | undefined;
188
- updatedBy?: {
189
- id: string;
190
- name: string;
191
- mail?: string | undefined;
192
- } | undefined;
193
- context?: {
194
- id: string;
195
- name?: string | undefined;
196
- type?: string | undefined;
197
- } | undefined;
198
- sourceSystem?: {
199
- identifier: string;
200
- name?: string | null | undefined;
201
- subSystem?: string | null | undefined;
202
- } | null | undefined;
203
- } & {
204
- payload?: T | undefined;
205
- }>;
175
+ }): Observable<Bookmark<T>>;
206
176
  /**
207
177
  * Retrieves a bookmark asynchronously.
208
178
  *
@@ -211,13 +181,41 @@ export declare class BookmarkProvider implements IBookmarkProvider {
211
181
  * @param options.excludePayload - Specifies whether to exclude the payload from the bookmark.
212
182
  * @returns A promise that resolves to the retrieved bookmark, or null if the bookmark is not found.
213
183
  */
214
- getBookmarkAsync<T extends BookmarkData>(id: string, options?: {
184
+ getBookmarkAsync<T extends BookmarkData = BookmarkData>(id: string, options?: {
215
185
  excludePayload?: boolean;
216
186
  }): Promise<Bookmark<T> | null>;
217
187
  /**
218
- * Asynchronously retrieves all bookmarks from the store.
188
+ * Retrieves all bookmarks from the store as an Observable stream.
219
189
  *
220
- * @returns A Promise that resolves to the Bookmarks object containing all bookmarks.
190
+ * This method implements a complex flow that:
191
+ * 1. Resolves filter parameters (sourceSystem, appKey, contextId) based on configuration
192
+ * 2. Dispatches a fetch action to the store with resolved filters
193
+ * 3. Monitors store actions for success/failure responses
194
+ * 4. Returns the bookmarks data or throws appropriate errors
195
+ *
196
+ * @remarks
197
+ * The method uses a reactive pattern where filter resolution and store actions are
198
+ * handled asynchronously. If filtering is enabled, it will resolve the current
199
+ * application and context to filter bookmarks accordingly.
200
+ *
201
+ * @example
202
+ * ```ts
203
+ * // Basic usage
204
+ * bookmarkProvider.getAllBookmarks().subscribe({
205
+ * next: (bookmarks) => console.log('Retrieved bookmarks:', bookmarks),
206
+ * error: (err) => console.error('Failed to fetch bookmarks:', err)
207
+ * });
208
+ *
209
+ * // With filtering enabled in config
210
+ * const config = {
211
+ * filters: { context: true, application: true }
212
+ * };
213
+ * // Will automatically filter by current context and application
214
+ * ```
215
+ *
216
+ * @returns An Observable that emits the array of bookmarks when successfully retrieved
217
+ * @throws {BookmarkProviderError} When filter resolution fails or store operations fail
218
+ * @throws {BookmarkProviderError} When a timeout occurs during the fetch operation
221
219
  */
222
220
  getAllBookmarks(): Observable<Bookmarks>;
223
221
  /**
@@ -237,7 +235,7 @@ export declare class BookmarkProvider implements IBookmarkProvider {
237
235
  * @returns An observable that emits the next bookmark or null.
238
236
  * @template T - The type of the bookmark data.
239
237
  */
240
- setCurrentBookmark<T extends BookmarkData>(bookmark_or_id: Bookmark<T> | string | null): Observable<Bookmark<T> | null>;
238
+ setCurrentBookmark<T extends BookmarkData = BookmarkData>(bookmark_or_id: Bookmark<T> | string | null): Observable<Bookmark<T> | null>;
241
239
  /**
242
240
  * Sets the current bookmark.
243
241
  * This method dispatches an event to notify listeners of a change in the current bookmark,
@@ -248,31 +246,33 @@ export declare class BookmarkProvider implements IBookmarkProvider {
248
246
  * @param bookmarkId - The ID of the bookmark to set as the current bookmark.
249
247
  * @returns A subscription to the operation that sets the current bookmark.
250
248
  */
251
- setCurrentBookmarkAsync<T extends BookmarkData>(bookmark_or_id: Bookmark<T> | string | null): Promise<Bookmark<T> | null>;
249
+ setCurrentBookmarkAsync<T extends BookmarkData = BookmarkData>(bookmark_or_id: Bookmark<T> | string | null): Promise<Bookmark<T> | null>;
252
250
  /**
253
251
  * Creates a new bookmark with the provided bookmark data.
252
+ * The creation executes immediately when this method is called.
254
253
  * @template T - The type of bookmark data.
255
254
  * @param {BookmarkCreateArgs<T>} newBookmarkData - The data for creating the bookmark.
256
255
  * @returns {Observable<Bookmark<T>>} - An observable that emits the created bookmark.
257
256
  */
258
- createBookmark<T extends BookmarkData>(newBookmarkData: BookmarkCreateArgs<T>): Observable<Bookmark<T>>;
257
+ createBookmark<T extends BookmarkData = BookmarkData>(newBookmarkData: BookmarkCreateArgs<T>): Observable<Bookmark<T>>;
259
258
  /**
260
259
  * Asynchronously creates a new bookmark.
261
260
  *
262
261
  * @param bookmark - The new bookmark to create.
263
262
  * @returns A promise that resolves to the created bookmark with its associated data.
264
263
  */
265
- createBookmarkAsync<T extends BookmarkData>(args: BookmarkCreateArgs<T>): Promise<Bookmark<T>>;
264
+ createBookmarkAsync<T extends BookmarkData = BookmarkData>(args: BookmarkCreateArgs<T>): Promise<Bookmark<T>>;
266
265
  /**
267
266
  * Updates a bookmark with the specified bookmarkId and bookmarkUpdates.
267
+ * The update executes immediately when this method is called.
268
268
  *
269
269
  * @template T - The type of the bookmark data.
270
270
  * @param {string} bookmarkId - The identifier of the bookmark to update.
271
271
  * @param {BookmarkUpdate<T>} [bookmarkUpdates] - The updates to apply to the bookmark.
272
272
  * @param {BookmarkUpdateOptions} [options] - The options for updating the bookmark.
273
- * @returns {Promise<Bookmark<T>>} - A promise that resolves to the updated bookmark.
273
+ * @returns {Observable<Bookmark<T>>} - An observable that emits the updated bookmark.
274
274
  */
275
- updateBookmark<T extends BookmarkData>(bookmarkId: string, bookmarkUpdates?: BookmarkUpdate<T>, options?: BookmarkUpdateOptions): Observable<Bookmark<T>>;
275
+ updateBookmark<T extends BookmarkData = BookmarkData>(bookmarkId: string, bookmarkUpdates?: BookmarkUpdate<T>, options?: BookmarkUpdateOptions): Observable<Bookmark<T>>;
276
276
  /**
277
277
  * Updates a bookmark asynchronously.
278
278
  *
@@ -281,12 +281,13 @@ export declare class BookmarkProvider implements IBookmarkProvider {
281
281
  * @param bookmark - The bookmark to update.
282
282
  * @returns A promise that resolves to the updated bookmark with its associated data.
283
283
  */
284
- updateBookmarkAsync<T extends BookmarkData>(id_or_bookmark: string | Bookmark<T>, updates_or_options?: BookmarkUpdate<T> | BookmarkUpdateOptions, options?: BookmarkUpdateOptions): Promise<Bookmark<T>>;
284
+ updateBookmarkAsync<T extends BookmarkData = BookmarkData>(id_or_bookmark: string | Bookmark<T>, updates_or_options?: BookmarkUpdate<T> | BookmarkUpdateOptions, options?: BookmarkUpdateOptions): Promise<Bookmark<T>>;
285
285
  /**
286
286
  * Deletes a bookmark with the specified bookmarkId.
287
+ * The deletion executes immediately when this method is called.
287
288
  *
288
289
  * @param bookmarkId - The unique identifier of the bookmark to be deleted.
289
- * @returns A Promise that resolves when the bookmark is successfully deleted.
290
+ * @returns An Observable that emits when the bookmark is successfully deleted.
290
291
  * @throws {BookmarkProviderError} If there is an error deleting the bookmark.
291
292
  */
292
293
  deleteBookmark(bookmarkId: string): Observable<void>;
@@ -342,7 +343,7 @@ export declare class BookmarkProvider implements IBookmarkProvider {
342
343
  protected _getBookmarkInfo(bookmarkId: string, options?: {
343
344
  timeout?: number;
344
345
  }): Observable<BookmarkWithoutData>;
345
- protected _getBookmarkData<T extends BookmarkData>(bookmarkId: string, options?: {
346
+ protected _getBookmarkData<T extends BookmarkData = BookmarkData>(bookmarkId: string, options?: {
346
347
  timeout?: number;
347
348
  }): Observable<T | null>;
348
349
  /**
@@ -1,5 +1,6 @@
1
1
  import type { BookmarkState } from './BookmarkProvider.store';
2
2
  import type { BookmarkFlowError } from './BookmarkProvider.error';
3
+ import type { BookmarkWithoutData } from './types';
3
4
  /**
4
5
  * Creates a reducer for managing the state of bookmarks.
5
6
  *
@@ -12,38 +13,10 @@ export declare const createBookmarkReducer: (initialState?: Partial<BookmarkStat
12
13
  payload: import("@equinor/fusion-observable").Action;
13
14
  type: "action_aborted";
14
15
  } | {
15
- payload: {
16
- id: string;
17
- name: string;
18
- appKey: string;
19
- created: Date;
20
- createdBy: {
21
- id: string;
22
- name: string;
23
- mail?: string | undefined;
24
- };
25
- description?: string | undefined;
26
- isShared?: boolean | undefined;
27
- updated?: Date | undefined;
28
- updatedBy?: {
29
- id: string;
30
- name: string;
31
- mail?: string | undefined;
32
- } | undefined;
33
- context?: {
34
- id: string;
35
- name?: string | undefined;
36
- type?: string | undefined;
37
- } | undefined;
38
- sourceSystem?: {
39
- identifier: string;
40
- name?: string | null | undefined;
41
- subSystem?: string | null | undefined;
42
- } | null | undefined;
43
- };
16
+ payload: BookmarkWithoutData;
44
17
  type: "set_bookmark";
45
18
  } | {
46
- payload: import("./types").Bookmark | null;
19
+ payload: import("./types").Bookmark<any> | null;
47
20
  type: "set_current_bookmark";
48
21
  } | import("@equinor/fusion-observable").PayloadAction<string, "fetch_bookmark::request", {
49
22
  ref: string;
@@ -66,35 +39,7 @@ export declare const createBookmarkReducer: (initialState?: Partial<BookmarkStat
66
39
  ref: string;
67
40
  }, never> | import("@equinor/fusion-observable").PayloadAction<string, "remove_favourite_bookmark::request", {
68
41
  ref: string;
69
- }, never> | import("@equinor/fusion-observable").PayloadAction<{
70
- id: string;
71
- name: string;
72
- appKey: string;
73
- created: Date;
74
- createdBy: {
75
- id: string;
76
- name: string;
77
- mail?: string | undefined;
78
- };
79
- description?: string | undefined;
80
- isShared?: boolean | undefined;
81
- updated?: Date | undefined;
82
- updatedBy?: {
83
- id: string;
84
- name: string;
85
- mail?: string | undefined;
86
- } | undefined;
87
- context?: {
88
- id: string;
89
- name?: string | undefined;
90
- type?: string | undefined;
91
- } | undefined;
92
- sourceSystem?: {
93
- identifier: string;
94
- name?: string | null | undefined;
95
- subSystem?: string | null | undefined;
96
- } | null | undefined;
97
- }, "fetch_bookmark::success", {
42
+ }, never> | import("@equinor/fusion-observable").PayloadAction<BookmarkWithoutData, "fetch_bookmark::success", {
98
43
  ref: string;
99
44
  } | undefined, never> | import("@equinor/fusion-observable").PayloadAction<BookmarkFlowError, "fetch_bookmark::failure", {
100
45
  ref: string;
@@ -105,43 +50,15 @@ export declare const createBookmarkReducer: (initialState?: Partial<BookmarkStat
105
50
  ref: string;
106
51
  } | undefined, never> | import("@equinor/fusion-observable").PayloadAction<BookmarkFlowError, "fetch_bookmark_payload::failure", {
107
52
  ref: string;
108
- } | undefined, never> | import("@equinor/fusion-observable").PayloadAction<{
109
- id: string;
110
- name: string;
111
- appKey: string;
112
- created: Date;
113
- createdBy: {
114
- id: string;
115
- name: string;
116
- mail?: string | undefined;
117
- };
118
- description?: string | undefined;
119
- isShared?: boolean | undefined;
120
- updated?: Date | undefined;
121
- updatedBy?: {
122
- id: string;
123
- name: string;
124
- mail?: string | undefined;
125
- } | undefined;
126
- context?: {
127
- id: string;
128
- name?: string | undefined;
129
- type?: string | undefined;
130
- } | undefined;
131
- sourceSystem?: {
132
- identifier: string;
133
- name?: string | null | undefined;
134
- subSystem?: string | null | undefined;
135
- } | null | undefined;
136
- }[], "fetch_bookmarks::success", {
53
+ } | undefined, never> | import("@equinor/fusion-observable").PayloadAction<import("./types").Bookmarks, "fetch_bookmarks::success", {
137
54
  ref: string;
138
55
  } | undefined, never> | import("@equinor/fusion-observable").PayloadAction<BookmarkFlowError, "fetch_bookmarks::failure", {
139
56
  ref: string;
140
- } | undefined, never> | import("@equinor/fusion-observable").PayloadAction<import("./types").Bookmark, "set_bookmark::success", {
57
+ } | undefined, never> | import("@equinor/fusion-observable").PayloadAction<import("./types").Bookmark<any>, "set_bookmark::success", {
141
58
  ref: string;
142
59
  }, never> | import("@equinor/fusion-observable").PayloadAction<BookmarkFlowError, "set_bookmark::failure", {
143
60
  ref: string;
144
- }, never> | import("@equinor/fusion-observable").PayloadAction<import("./types").Bookmark, "create_bookmark::success", {
61
+ }, never> | import("@equinor/fusion-observable").PayloadAction<import("./types").Bookmark<any>, "create_bookmark::success", {
145
62
  ref: string;
146
63
  }, never> | import("@equinor/fusion-observable").PayloadAction<BookmarkFlowError, "create_bookmark::failure", {
147
64
  ref: string;
@@ -3,116 +3,25 @@ import { LogLevel, type ILogger } from '@equinor/fusion-log';
3
3
  import type { IEventModuleProvider } from '@equinor/fusion-framework-module-event';
4
4
  import type { IBookmarkProvider } from './BookmarkProvider.interface';
5
5
  import type { IBookmarkClient } from './BookmarkClient.interface';
6
+ import type { BookmarkModuleConfig } from './types';
6
7
  export declare const bookmarkConfigSchema: z.ZodObject<{
7
- log: z.ZodOptional<z.ZodType<ILogger, z.ZodTypeDef, ILogger>>;
8
- logLevel: z.ZodOptional<z.ZodNativeEnum<typeof LogLevel>>;
9
- eventProvider: z.ZodOptional<z.ZodType<IEventModuleProvider, z.ZodTypeDef, IEventModuleProvider>>;
8
+ log: z.ZodOptional<z.ZodCustom<ILogger, ILogger>>;
9
+ logLevel: z.ZodOptional<z.ZodEnum<typeof LogLevel>>;
10
+ eventProvider: z.ZodOptional<z.ZodCustom<IEventModuleProvider, IEventModuleProvider>>;
10
11
  sourceSystem: z.ZodOptional<z.ZodObject<{
11
12
  identifier: z.ZodString;
12
13
  name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
13
14
  subSystem: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
- }, "strip", z.ZodTypeAny, {
15
- identifier: string;
16
- name?: string | null | undefined;
17
- subSystem?: string | null | undefined;
18
- }, {
19
- identifier: string;
20
- name?: string | null | undefined;
21
- subSystem?: string | null | undefined;
22
- }>>;
23
- parent: z.ZodNullable<z.ZodOptional<z.ZodType<IBookmarkProvider, z.ZodTypeDef, IBookmarkProvider>>>;
24
- client: z.ZodType<IBookmarkClient, z.ZodTypeDef, IBookmarkClient>;
15
+ }, z.core.$strip>>;
16
+ parent: z.ZodNullable<z.ZodOptional<z.ZodCustom<IBookmarkProvider, IBookmarkProvider>>>;
17
+ client: z.ZodCustom<IBookmarkClient, IBookmarkClient>;
25
18
  resolve: z.ZodObject<{
26
- context: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodPromise<z.ZodOptional<z.ZodObject<{
27
- id: z.ZodString;
28
- }, "strip", z.ZodTypeAny, {
29
- id: string;
30
- }, {
31
- id: string;
32
- }>>>>;
33
- application: z.ZodFunction<z.ZodTuple<[], z.ZodUnknown>, z.ZodPromise<z.ZodOptional<z.ZodObject<{
34
- appKey: z.ZodString;
35
- name: z.ZodOptional<z.ZodString>;
36
- }, "strip", z.ZodTypeAny, {
37
- appKey: string;
38
- name?: string | undefined;
39
- }, {
40
- appKey: string;
41
- name?: string | undefined;
42
- }>>>>;
43
- }, "strip", z.ZodTypeAny, {
44
- context: (...args: unknown[]) => Promise<{
45
- id: string;
46
- } | undefined>;
47
- application: (...args: unknown[]) => Promise<{
48
- appKey: string;
49
- name?: string | undefined;
50
- } | undefined>;
51
- }, {
52
- context: (...args: unknown[]) => Promise<{
53
- id: string;
54
- } | undefined>;
55
- application: (...args: unknown[]) => Promise<{
56
- appKey: string;
57
- name?: string | undefined;
58
- } | undefined>;
59
- }>;
19
+ context: z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
20
+ application: z.ZodFunction<z.core.$ZodFunctionArgs, z.core.$ZodFunctionOut>;
21
+ }, z.core.$strip>;
60
22
  filters: z.ZodDefault<z.ZodOptional<z.ZodObject<{
61
23
  context: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
62
24
  application: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
63
- }, "strip", z.ZodTypeAny, {
64
- context: boolean;
65
- application: boolean;
66
- }, {
67
- context?: boolean | undefined;
68
- application?: boolean | undefined;
69
- }>>>;
70
- }, "strip", z.ZodTypeAny, {
71
- client: IBookmarkClient;
72
- resolve: {
73
- context: (...args: unknown[]) => Promise<{
74
- id: string;
75
- } | undefined>;
76
- application: (...args: unknown[]) => Promise<{
77
- appKey: string;
78
- name?: string | undefined;
79
- } | undefined>;
80
- };
81
- filters: {
82
- context: boolean;
83
- application: boolean;
84
- };
85
- sourceSystem?: {
86
- identifier: string;
87
- name?: string | null | undefined;
88
- subSystem?: string | null | undefined;
89
- } | undefined;
90
- log?: ILogger | undefined;
91
- logLevel?: LogLevel | undefined;
92
- eventProvider?: IEventModuleProvider | undefined;
93
- parent?: IBookmarkProvider | null | undefined;
94
- }, {
95
- client: IBookmarkClient;
96
- resolve: {
97
- context: (...args: unknown[]) => Promise<{
98
- id: string;
99
- } | undefined>;
100
- application: (...args: unknown[]) => Promise<{
101
- appKey: string;
102
- name?: string | undefined;
103
- } | undefined>;
104
- };
105
- sourceSystem?: {
106
- identifier: string;
107
- name?: string | null | undefined;
108
- subSystem?: string | null | undefined;
109
- } | undefined;
110
- log?: ILogger | undefined;
111
- logLevel?: LogLevel | undefined;
112
- eventProvider?: IEventModuleProvider | undefined;
113
- parent?: IBookmarkProvider | null | undefined;
114
- filters?: {
115
- context?: boolean | undefined;
116
- application?: boolean | undefined;
117
- } | undefined;
118
- }>;
25
+ }, z.core.$strip>>>;
26
+ }, z.core.$strip>;
27
+ export declare const parseBookmarkConfig: (config: unknown) => BookmarkModuleConfig;