@equinor/fusion-framework-module-context 7.0.0 → 7.0.2

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,6 @@
1
1
  import { Observable, Subscription } from 'rxjs';
2
2
  import type { ContextModuleConfig } from './configurator';
3
+ import { BaseModuleProvider } from '@equinor/fusion-framework-module/provider';
3
4
  import { ContextClient } from './client/ContextClient';
4
5
  import type { ContextItem, QueryContextParameters, RelatedContextParameters } from './types';
5
6
  import type { ModuleType } from '@equinor/fusion-framework-module';
@@ -287,7 +288,7 @@ export interface IContextProvider {
287
288
  * provider.setCurrentContextById('context-id').subscribe(...);
288
289
  * ```
289
290
  */
290
- export declare class ContextProvider implements IContextProvider {
291
+ export declare class ContextProvider extends BaseModuleProvider<ContextModuleConfig> implements IContextProvider {
291
292
  #private;
292
293
  get contextClient(): ContextClient;
293
294
  get queryClient(): Query<ContextItem[], QueryContextParameters>;
@@ -1 +1 @@
1
- export declare const version = "7.0.0";
1
+ export declare const version = "7.0.2";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-module-context",
3
- "version": "7.0.0",
3
+ "version": "7.0.2",
4
4
  "description": "",
5
5
  "main": "./dist/esm/index.js",
6
6
  "exports": {
@@ -45,19 +45,19 @@
45
45
  },
46
46
  "dependencies": {
47
47
  "fast-deep-equal": "^3.1.3",
48
- "@equinor/fusion-query": "^5.2.11"
48
+ "@equinor/fusion-query": "^6.0.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "rxjs": "^7.8.1",
52
52
  "typescript": "^5.8.2",
53
- "@equinor/fusion-framework-module-event": "^4.3.7",
53
+ "@equinor/fusion-framework-module-event": "^4.4.0",
54
+ "@equinor/fusion-framework-module": "^5.0.4",
54
55
  "@equinor/fusion-framework-module-navigation": "^6.0.0",
55
- "@equinor/fusion-framework-module": "^5.0.0",
56
- "@equinor/fusion-framework-module-services": "^7.0.0"
56
+ "@equinor/fusion-framework-module-services": "^7.1.3"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "rxjs": "^7.8.1",
60
- "@equinor/fusion-framework-module": "^5.0.0"
60
+ "@equinor/fusion-framework-module": "^5.0.4"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "tsc -b"
@@ -12,6 +12,9 @@ import {
12
12
 
13
13
  import type { ContextModuleConfig } from './configurator';
14
14
 
15
+ import { BaseModuleProvider } from '@equinor/fusion-framework-module/provider';
16
+ import { version } from './version.js';
17
+
15
18
  import { ContextClient } from './client/ContextClient';
16
19
  import type { ContextItem, QueryContextParameters, RelatedContextParameters } from './types';
17
20
  import type { ModuleType } from '@equinor/fusion-framework-module';
@@ -325,7 +328,10 @@ export interface IContextProvider {
325
328
  * provider.setCurrentContextById('context-id').subscribe(...);
326
329
  * ```
327
330
  */
328
- export class ContextProvider implements IContextProvider {
331
+ export class ContextProvider
332
+ extends BaseModuleProvider<ContextModuleConfig>
333
+ implements IContextProvider
334
+ {
329
335
  #contextClient: ContextClient;
330
336
  #contextQuery: Query<Array<ContextItem>, QueryContextParameters>;
331
337
  #contextRelated?: Query<Array<ContextItem>, RelatedContextParameters>;
@@ -377,6 +383,8 @@ export class ContextProvider implements IContextProvider {
377
383
  }) {
378
384
  const { config, event } = args;
379
385
 
386
+ super({ version, config });
387
+
380
388
  if (args.parentContext) {
381
389
  console.warn(
382
390
  '@deprecated',
@@ -387,8 +395,12 @@ export class ContextProvider implements IContextProvider {
387
395
  this.#event = event;
388
396
 
389
397
  // set the resolve and validate context functions
390
- config.resolveContext && (this.resolveContext = config.resolveContext?.bind(this));
391
- config.validateContext && (this.validateContext = config.validateContext?.bind(this));
398
+ if (config.resolveContext) {
399
+ this.resolveContext = config.resolveContext?.bind(this);
400
+ }
401
+ if (config.validateContext) {
402
+ this.validateContext = config.validateContext?.bind(this);
403
+ }
392
404
 
393
405
  if (config.extractContextIdFromPath) {
394
406
  // @ts-ignore
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '7.0.0';
2
+ export const version = '7.0.2';