@openfin/node-adapter 44.101.1 → 44.101.3

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,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var events = require('events');
4
- var isEqual = require('lodash/isEqual');
4
+ var esToolkit = require('es-toolkit');
5
5
  var fs = require('fs');
6
6
  var crypto = require('crypto');
7
7
  var _WS = require('ws');
@@ -4828,6 +4828,13 @@ class _WindowModule extends Base {
4828
4828
  class SystemContentTracing extends Base {
4829
4829
  /**
4830
4830
  * Gets the currently known tracing category groups.
4831
+ *
4832
+ * @example
4833
+ * ```ts
4834
+ * const categories = await fin.System.ContentTracing.getCategories();
4835
+ * const sorted = [...new Set(categories)].sort((a, b) => a.localeCompare(b));
4836
+ * console.log(`Loaded ${sorted.length} tracing categories`);
4837
+ * ```
4831
4838
  */
4832
4839
  async getCategories() {
4833
4840
  const { payload } = await this.wire.sendAction('content-tracing-get-categories');
@@ -4838,6 +4845,29 @@ class SystemContentTracing extends Base {
4838
4845
  *
4839
4846
  * Only one content tracing session may be active across the runtime at a time.
4840
4847
  * This method rejects if another identity already owns the active session.
4848
+ *
4849
+ * @example
4850
+ * ```ts
4851
+ * await fin.System.ContentTracing.startRecording({
4852
+ * recording_mode: 'record-as-much-as-possible',
4853
+ * included_categories: [
4854
+ * '*',
4855
+ * 'disabled-by-default-blink.invalidation',
4856
+ * 'disabled-by-default-cc.debug',
4857
+ * 'disabled-by-default-viz.surface_id_flow'
4858
+ * ]
4859
+ * });
4860
+ *
4861
+ * console.log('Content tracing started. Call stopRecording() when ready to collect the trace.');
4862
+ * ```
4863
+ *
4864
+ * @example
4865
+ * ```ts
4866
+ * await fin.System.ContentTracing.startRecording({
4867
+ * categoryFilter: 'electron,blink,cc',
4868
+ * traceOptions: 'record-until-full,enable-sampling'
4869
+ * });
4870
+ * ```
4841
4871
  */
4842
4872
  async startRecording(options) {
4843
4873
  await this.wire.sendAction('content-tracing-start-recording', { options });
@@ -4847,6 +4877,13 @@ class SystemContentTracing extends Base {
4847
4877
  *
4848
4878
  * The calling identity must match the identity that started the active tracing session.
4849
4879
  * This method rejects if tracing is not active or is owned by another identity.
4880
+ *
4881
+ * @example
4882
+ * ```ts
4883
+ * const tracePath = await fin.System.ContentTracing.stopRecording();
4884
+ * console.log('Trace written to:', tracePath);
4885
+ * // Load the file in chrome://tracing or https://ui.perfetto.dev/
4886
+ * ```
4850
4887
  */
4851
4888
  async stopRecording() {
4852
4889
  const { payload } = await this.wire.sendAction('content-tracing-stop-recording');
@@ -4856,6 +4893,16 @@ class SystemContentTracing extends Base {
4856
4893
  * Returns the current maximum trace buffer usage across processes.
4857
4894
  *
4858
4895
  * This method is not supported on macOS and rejects on that platform.
4896
+ *
4897
+ * @example
4898
+ * ```ts
4899
+ * try {
4900
+ * const usage = await fin.System.ContentTracing.getTraceBufferUsage();
4901
+ * console.log(`Buffer usage: ${usage.percentage}% (${usage.value})`);
4902
+ * } catch (error) {
4903
+ * console.warn('Trace buffer usage is not available on this platform.', error);
4904
+ * }
4905
+ * ```
4859
4906
  */
4860
4907
  async getTraceBufferUsage() {
4861
4908
  const { payload } = await this.wire.sendAction('content-tracing-get-trace-buffer-usage');
@@ -4952,13 +4999,15 @@ class System extends EmitterBase {
4952
4999
  * * cookies: browser [cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies)
4953
5000
  * * localStorage: browser data that can be used across sessions ([local storage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage))
4954
5001
  * * appcache: html5 [application cache](https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache)
5002
+ * * windowState: clears data written for windows using `saveWindowState`; after clearing, previously saved bounds and state will not be restored until new state is written
4955
5003
  * @example
4956
5004
  * ```js
4957
5005
  * const clearCacheOptions = {
4958
5006
  * appcache: true,
4959
5007
  * cache: true,
4960
5008
  * cookies: true,
4961
- * localStorage: true
5009
+ * localStorage: true,
5010
+ * windowState: true
4962
5011
  * };
4963
5012
  * fin.System.clearCache(clearCacheOptions).then(() => console.log('Cache cleared')).catch(err => console.log(err));
4964
5013
  * ```
@@ -4987,12 +5036,16 @@ class System extends EmitterBase {
4987
5036
  *
4988
5037
  * @param options - Optional configuration for what data to clear
4989
5038
  *
5039
+ * @remarks Set `windowState: true` to also clear data written for windows using `saveWindowState`.
5040
+ * After this data is cleared, previously saved bounds and state will not be restored until new state is written again.
5041
+ *
4990
5042
  * @example
4991
5043
  * ```js
4992
5044
  * // Clear only cookies and localStorage for a specific origin
4993
5045
  * await fin.System.clearCacheData({
4994
5046
  * dataTypes: ['cookies', 'localStorage'],
4995
- * origins: ['http://localhost:8081']
5047
+ * origins: ['http://localhost:8081'],
5048
+ * windowState: true
4996
5049
  * });
4997
5050
  *
4998
5051
  * // Clear everything except for a specific origin
@@ -12881,7 +12934,7 @@ class InteropBroker extends Base {
12881
12934
  constructor(...unused) {
12882
12935
  if (unused.length) {
12883
12936
  const [_ignore1, ignore2, opts] = unused;
12884
- if (opts && typeof opts === 'object' && !isEqual(opts, args[2])) {
12937
+ if (opts && typeof opts === 'object' && !esToolkit.isEqual(opts, args[2])) {
12885
12938
  // eslint-disable-next-line no-console
12886
12939
  console.warn('You have modified the parameters of the InteropOverride constructor. This behavior is deprecated and will be removed in a future version. You can modify these options in your manifest. Please consult our Interop docs for guidance on migrating to the new override scheme.');
12887
12940
  super(args[0], args[1], opts);
@@ -14921,7 +14974,7 @@ const createV1Channel = (sessionContextGroup) => {
14921
14974
  const wrappedHandler = (context, contextMetadata) => {
14922
14975
  if (first) {
14923
14976
  first = false;
14924
- if (isEqual(currentContext, context)) {
14977
+ if (esToolkit.isEqual(currentContext, context)) {
14925
14978
  return;
14926
14979
  }
14927
14980
  }
@@ -15329,7 +15382,7 @@ class FDC3ModuleBase {
15329
15382
  const wrappedHandler = (context, contextMetadata) => {
15330
15383
  if (first) {
15331
15384
  first = false;
15332
- if (isEqual(currentContext, context)) {
15385
+ if (esToolkit.isEqual(currentContext, context)) {
15333
15386
  return;
15334
15387
  }
15335
15388
  }
@@ -17105,7 +17158,7 @@ class NodeEnvironment extends BaseEnvironment {
17105
17158
  };
17106
17159
  }
17107
17160
  getAdapterVersionSync() {
17108
- return "44.101.1";
17161
+ return "44.101.3";
17109
17162
  }
17110
17163
  observeBounds(element, onChange) {
17111
17164
  throw new Error('Method not implemented.');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfin/node-adapter",
3
- "version": "44.101.1",
3
+ "version": "44.101.3",
4
4
  "description": "See README.md",
5
5
  "main": "out/node-adapter.js",
6
6
  "types": "out/node-adapter.d.ts",
@@ -17,10 +17,10 @@
17
17
  "author": "OpenFin",
18
18
  "dependencies": {
19
19
  "@types/node": "^20.14.2",
20
- "lodash": "^4.17.21",
20
+ "es-toolkit": "^1.39.3",
21
21
  "ws": "^7.5.10",
22
22
  "tslib": "2.8.1",
23
- "@openfin/core": "44.101.1"
23
+ "@openfin/core": "44.101.3"
24
24
  },
25
25
  "scripts": {
26
26
  "prebuild": "rimraf ./out",