@equinor/fusion-framework-vite-plugin-spa 3.0.1-cli-search-index.0 → 3.0.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 CHANGED
@@ -1,17 +1,11 @@
1
1
  # @equinor/fusion-framework-vite-plugin-spa
2
2
 
3
- ## 3.0.1-cli-search-index.0
3
+ ## 3.0.1
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - [#3757](https://github.com/equinor/fusion-framework/pull/3757) [`db880d1`](https://github.com/equinor/fusion-framework/commit/db880d1fbdb62ba4667f11229d1e6c3a4cea06fc) Thanks [@odinr](https://github.com/odinr)! - preview release
8
-
9
- - Updated dependencies [[`db880d1`](https://github.com/equinor/fusion-framework/commit/db880d1fbdb62ba4667f11229d1e6c3a4cea06fc)]:
10
- - @equinor/fusion-framework-module-http@7.0.6-cli-search-index.0
11
- - @equinor/fusion-framework-module@5.0.6-cli-search-index.0
12
- - @equinor/fusion-framework-module-msal@6.0.1-cli-search-index.0
13
- - @equinor/fusion-framework-module-service-discovery@9.0.5-cli-search-index.0
14
- - @equinor/fusion-framework-module-telemetry@4.4.1-cli-search-index.0
7
+ - Updated dependencies [[`1827381`](https://github.com/equinor/fusion-framework/commit/182738177dbbf5baaf9732ef3b540b4df80932f6)]:
8
+ - @equinor/fusion-framework-module-telemetry@4.5.0
15
9
 
16
10
  ## 3.0.0
17
11
 
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '3.0.1-cli-search-index.0';
2
+ export const version = '3.0.1';
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,0BAA0B,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
@@ -5296,7 +5296,7 @@ class BaseModuleProvider {
5296
5296
  }
5297
5297
 
5298
5298
  // Generated by genversion.
5299
- const version$8 = '5.0.6-cli-search-index.0';
5299
+ const version$8 = '5.0.5';
5300
5300
 
5301
5301
  /* eslint-disable @typescript-eslint/no-explicit-any */
5302
5302
  /**
@@ -19275,7 +19275,7 @@ class HttpClientConfigurator {
19275
19275
  }
19276
19276
 
19277
19277
  // Generated by genversion.
19278
- const version$6 = '7.0.6-cli-search-index.0';
19278
+ const version$6 = '7.0.5';
19279
19279
 
19280
19280
  /**
19281
19281
  * Exception thrown when a client cannot be found.
@@ -21603,10 +21603,32 @@ class TelemetryConfigurator extends BaseConfigBuilder {
21603
21603
  this._set('items$', item$);
21604
21604
  return this;
21605
21605
  }
21606
+ /**
21607
+ * Sets a filter function to determine which telemetry items should be passed to adapters.
21608
+ * Only items for which the filter returns `true` will be sent to adapters.
21609
+ *
21610
+ * @param filter - Function that receives a telemetry item and returns true if it should be sent to adapters
21611
+ * @returns The configurator instance for method chaining
21612
+ */
21613
+ setAdapterFilter(filter) {
21614
+ this._set('adapterFilter', filter);
21615
+ return this;
21616
+ }
21617
+ /**
21618
+ * Sets a filter function to determine which telemetry items should be relayed to the parent provider.
21619
+ * Only items for which the filter returns `true` will be relayed to the parent.
21620
+ *
21621
+ * @param filter - Function that receives a telemetry item and returns true if it should be relayed
21622
+ * @returns The configurator instance for method chaining
21623
+ */
21624
+ setRelayFilter(filter) {
21625
+ this._set('relayFilter', filter);
21626
+ return this;
21627
+ }
21606
21628
  }
21607
21629
 
21608
21630
  // Generated by genversion.
21609
- const version$5 = '4.4.1-cli-search-index.0';
21631
+ const version$5 = '4.5.0';
21610
21632
 
21611
21633
  /**
21612
21634
  * Enum representing the severity levels of telemetry items.
@@ -23883,6 +23905,8 @@ class TelemetryProvider extends BaseModuleProvider {
23883
23905
  #items = new Subject();
23884
23906
  #initialized = false;
23885
23907
  #adapters = {};
23908
+ #adapterFilter;
23909
+ #relayFilter;
23886
23910
  #defaultScope;
23887
23911
  #eventProvider;
23888
23912
  get items() {
@@ -23905,6 +23929,8 @@ class TelemetryProvider extends BaseModuleProvider {
23905
23929
  this.#metadata = config?.metadata;
23906
23930
  this.#defaultScope = config?.defaultScope ?? [];
23907
23931
  this.#eventProvider = deps?.event;
23932
+ this.#adapterFilter = config?.adapterFilter;
23933
+ this.#relayFilter = config?.relayFilter;
23908
23934
  }
23909
23935
  /**
23910
23936
  * Initializes the telemetry provider with adapters, parent provider, and optional initial items.
@@ -23957,7 +23983,7 @@ class TelemetryProvider extends BaseModuleProvider {
23957
23983
  async _initializeAdapters() {
23958
23984
  // Initialize all adapters, do it in parallel
23959
23985
  const adapterEntries = Object.entries(this.#adapters);
23960
- const initializationPromises = adapterEntries.map(([identifier, adapter]) => adapter.initialize());
23986
+ const initializationPromises = adapterEntries.map(([_identifier, adapter]) => adapter.initialize());
23961
23987
  // Wait for all adapters to settle (either resolve or reject)
23962
23988
  const results = await Promise.allSettled(initializationPromises);
23963
23989
  // Check each result and dispatch errors for failed initializations
@@ -23973,6 +23999,7 @@ class TelemetryProvider extends BaseModuleProvider {
23973
23999
  /**
23974
24000
  * Subscribes all adapters to the telemetry item stream.
23975
24001
  * Each adapter processes every telemetry item as it is emitted.
24002
+ * If an adapter filter is configured, only items that pass the filter will be sent to adapters.
23976
24003
  * If an adapter throws, the error is dispatched as a telemetry error event.
23977
24004
  *
23978
24005
  * @returns Subscription to the telemetry item stream
@@ -23983,6 +24010,10 @@ class TelemetryProvider extends BaseModuleProvider {
23983
24010
  throw new Error('TelemetryProvider is not initialized');
23984
24011
  }
23985
24012
  return this.#items.subscribe((item) => {
24013
+ // Apply adapter filter if configured - skip item if filter returns false
24014
+ if (this.#adapterFilter && !this.#adapterFilter(item)) {
24015
+ return;
24016
+ }
23986
24017
  // Iterate through all registered adapters
23987
24018
  for (const [identifier, adapter] of Object.entries(this.#adapters)) {
23988
24019
  try {
@@ -24003,13 +24034,20 @@ class TelemetryProvider extends BaseModuleProvider {
24003
24034
  *
24004
24035
  * Subscribes to the internal telemetry item stream and forwards each processed item
24005
24036
  * to the specified target provider by invoking its `track` method.
24037
+ * If a relay filter is configured, only items that pass the filter will be relayed.
24006
24038
  *
24007
24039
  * @param target - The telemetry provider to which telemetry data should be relayed.
24008
24040
  * @returns A Subscription object that can be used to unsubscribe from the relay.
24009
24041
  */
24010
24042
  _relayTelemetryData(target) {
24011
24043
  // Subscribe to the processed stream and forward each item to the parent provider
24012
- return this.#items.subscribe((item) => target.track(item));
24044
+ return this.#items.subscribe((item) => {
24045
+ // Apply relay filter if configured - skip item if filter returns false
24046
+ if (this.#relayFilter && !this.#relayFilter(item)) {
24047
+ return;
24048
+ }
24049
+ target.track(item);
24050
+ });
24013
24051
  }
24014
24052
  /**
24015
24053
  * Dispatches a telemetry event to the event provider, if available.
@@ -42548,7 +42586,7 @@ const createClientLogCallback = (provider, metadata, scope) => {
42548
42586
  };
42549
42587
 
42550
42588
  // Generated by genversion.
42551
- const version$2 = '6.0.1-cli-search-index.0';
42589
+ const version$2 = '6.0.0';
42552
42590
 
42553
42591
  /**
42554
42592
  * Zod schema for telemetry configuration validation.
@@ -46252,7 +46290,7 @@ class ServiceDiscoveryConfigurator extends BaseConfigBuilder {
46252
46290
  }
46253
46291
 
46254
46292
  // Generated by genversion.
46255
- const version$1 = '9.0.5-cli-search-index.0';
46293
+ const version$1 = '9.0.4';
46256
46294
 
46257
46295
  class ServiceDiscoveryProvider extends BaseModuleProvider {
46258
46296
  config;
@@ -46771,7 +46809,7 @@ async function registerServiceWorker(framework) {
46771
46809
  }
46772
46810
 
46773
46811
  // Generated by genversion.
46774
- const version = '3.0.1-cli-search-index.0';
46812
+ const version = '3.0.1';
46775
46813
 
46776
46814
  // Allow dynamic import without vite
46777
46815
  const importWithoutVite = (path) => import(/* @vite-ignore */ path);