@equinor/fusion-framework-module-bookmark 1.0.17 → 1.1.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.
@@ -14,7 +14,7 @@ export type BookmarkClientConfig = {
14
14
  export declare class BookmarkClient {
15
15
  #private;
16
16
  appRoute?(appKey: string): string;
17
- constructor(config: BookmarkClientConfig, sourceSystem: SourceSystem, event?: IEventModuleProvider);
17
+ constructor(config: BookmarkClientConfig, sourceSystem?: SourceSystem, event?: IEventModuleProvider);
18
18
  get currentBookmark$(): Observable<Bookmark | undefined>;
19
19
  get bookmarks$(): Observable<Bookmark[]>;
20
20
  setCurrentBookmark<T>(idOrItem?: string | Bookmark<T>): Promise<void>;
@@ -4,7 +4,7 @@ import { Observable } from '@equinor/fusion-observable';
4
4
  import { Query } from '@equinor/fusion-query';
5
5
  import { GetAllBookmarksParameters, Bookmark } from '../types';
6
6
  import { Actions } from './bookmarkActions';
7
- export declare const handleBookmarkGetAll: (queryAllBookmarks: Query<Array<Bookmark<unknown>>, GetAllBookmarksParameters>, sourceSystemIdentifier: string) => (action$: Observable<Actions>) => Observable<{
7
+ export declare const handleBookmarkGetAll: (queryAllBookmarks: Query<Array<Bookmark<unknown>>, GetAllBookmarksParameters>, sourceSystemIdentifier?: string) => (action$: Observable<Actions>) => Observable<{
8
8
  payload: Bookmark<unknown>[];
9
9
  type: "getAll::success";
10
10
  }>;
@@ -8,7 +8,7 @@ import type { EventModule, IEventModuleProvider } from '@equinor/fusion-framewor
8
8
  import type { IBookmarkModuleProvider } from './bookmark-provider';
9
9
  import type { BookmarkClientConfig } from './client/bookmarkClient';
10
10
  export interface BookmarkModuleConfig {
11
- sourceSystem: SourceSystem;
11
+ sourceSystem?: SourceSystem;
12
12
  clientConfiguration: BookmarkClientConfig;
13
13
  getContextId: () => string | undefined;
14
14
  getCurrentAppIdentification?(): string | undefined;
@@ -15,7 +15,7 @@ export interface Bookmark<TData = unknown> {
15
15
  updatedBy: CreatedBy;
16
16
  created: string;
17
17
  updated: string;
18
- sourceSystem: SourceSystem;
18
+ sourceSystem?: SourceSystem;
19
19
  }
20
20
  export type CreateBookmark<TData = unknown> = {
21
21
  name: string;
@@ -1 +1 @@
1
- export declare const version = "1.0.17";
1
+ export declare const version = "1.1.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-module-bookmark",
3
- "version": "1.0.17",
3
+ "version": "1.1.0",
4
4
  "description": "",
5
5
  "main": "./dist/esm/index.js",
6
6
  "exports": {
@@ -44,8 +44,8 @@
44
44
  "@equinor/fusion-framework-module-app": "^5.2.12",
45
45
  "@equinor/fusion-framework-module-context": "^4.0.19",
46
46
  "@equinor/fusion-framework-module-event": "^4.0.7",
47
- "@equinor/fusion-framework-module-http": "^5.1.2",
48
- "@equinor/fusion-framework-module-services": "^3.2.3"
47
+ "@equinor/fusion-framework-module-services": "^3.2.3",
48
+ "@equinor/fusion-framework-module-http": "^5.1.5"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "tsc -b"
@@ -43,7 +43,7 @@ export class BookmarkClient {
43
43
 
44
44
  #currentBookmark$: BehaviorSubject<Bookmark<unknown> | undefined>;
45
45
 
46
- #sourceSystem: SourceSystem;
46
+ #sourceSystem?: SourceSystem;
47
47
  #event?: IEventModuleProvider;
48
48
 
49
49
  #state: FlowState<State, ActionBuilder>;
@@ -53,7 +53,7 @@ export class BookmarkClient {
53
53
 
54
54
  constructor(
55
55
  config: BookmarkClientConfig,
56
- sourceSystem: SourceSystem,
56
+ sourceSystem?: SourceSystem,
57
57
  event?: IEventModuleProvider,
58
58
  ) {
59
59
  this.#currentBookmark$ = new BehaviorSubject<Bookmark<unknown> | undefined>(undefined);
@@ -293,7 +293,7 @@ export class BookmarkClient {
293
293
  #addSubjectFlows() {
294
294
  this.#subscriptions.add(
295
295
  this.#state.subject.addFlow(
296
- handleBookmarkGetAll(this.#queryAllBookmarks, this.#sourceSystem.identifier),
296
+ handleBookmarkGetAll(this.#queryAllBookmarks, this.#sourceSystem?.identifier),
297
297
  ),
298
298
  );
299
299
  this.#subscriptions.add(
@@ -10,7 +10,7 @@ import { actions, Actions } from './bookmarkActions';
10
10
  export const handleBookmarkGetAll =
11
11
  (
12
12
  queryAllBookmarks: Query<Array<Bookmark<unknown>>, GetAllBookmarksParameters>,
13
- sourceSystemIdentifier: string,
13
+ sourceSystemIdentifier?: string,
14
14
  ) =>
15
15
  (action$: Observable<Actions>) =>
16
16
  action$.pipe(
@@ -22,7 +22,7 @@ export const handleBookmarkGetAll =
22
22
  actions.getAll.success(
23
23
  bookmarks.value.filter(
24
24
  (bookmark) =>
25
- bookmark.sourceSystem.identifier === sourceSystemIdentifier,
25
+ bookmark.sourceSystem?.identifier === sourceSystemIdentifier,
26
26
  ),
27
27
  ),
28
28
  ),
@@ -16,7 +16,7 @@ export interface BookmarkModuleConfig {
16
16
  * SourceSystem used when creating a new bookmark,
17
17
  * used as the identifier for the current client. Only used in app shell / portal configuration.
18
18
  */
19
- sourceSystem: SourceSystem;
19
+ sourceSystem?: SourceSystem;
20
20
 
21
21
  /**
22
22
  * The clintConfiguration consist of both Api client configuration and query client configuration
@@ -121,10 +121,6 @@ export class BookmarkModuleConfigurator implements IBookmarkModuleConfigurator {
121
121
  config.clientConfiguration,
122
122
  );
123
123
 
124
- if (!config.sourceSystem) {
125
- throw Error('missing sourceSystem configuration');
126
- }
127
-
128
124
  return config as BookmarkModuleConfig;
129
125
  }
130
126
 
package/src/types.ts CHANGED
@@ -16,7 +16,7 @@ export interface Bookmark<TData = unknown> {
16
16
  updatedBy: CreatedBy;
17
17
  created: string;
18
18
  updated: string;
19
- sourceSystem: SourceSystem;
19
+ sourceSystem?: SourceSystem;
20
20
  }
21
21
 
22
22
  export type CreateBookmark<TData = unknown> = {
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '1.0.17';
2
+ export const version = '1.1.0';