@deephaven/jsapi-utils 1.22.2-alpha-pivot-builder.0 → 1.23.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.
@@ -16,12 +16,12 @@ export declare function fetchVariableDefinition(connection: dh.IdeConnection, na
16
16
  * Fetch the definition for a variable given a connection. Waits for the next
17
17
  * field update event and resolves if a variable matching the predicate is found
18
18
  * in the created variables.
19
- * @param fieldSource Connection or session exposing `subscribeToFieldUpdates`
19
+ * @param connection Connection to get the variable from
20
20
  * @param predicate Predicate function to test each variable definition
21
21
  * @param timeout Timeout for the fetch
22
22
  * @param errorMessage Optional error message for timeout and not found errors
23
23
  * @returns Promise that resolves to the variable definition if found in the next field update,
24
24
  * or rejects if no matching variable is found in that update or if the timeout is exceeded
25
25
  */
26
- export declare function fetchVariableDefinitionByPredicate(fieldSource: Pick<dh.IdeConnection, 'subscribeToFieldUpdates'>, predicate: (definition: dh.ide.VariableDefinition) => boolean, timeout?: number, errorMessage?: string): Promise<dh.ide.VariableDefinition>;
26
+ export declare function fetchVariableDefinitionByPredicate(connection: dh.IdeConnection, predicate: (definition: dh.ide.VariableDefinition) => boolean, timeout?: number, errorMessage?: string): Promise<dh.ide.VariableDefinition>;
27
27
  //# sourceMappingURL=ConnectionUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectionUtils.d.ts","sourceRoot":"","sources":["../src/ConnectionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAGjD,yDAAyD;AACzD,eAAO,MAAM,aAAa,QAAS,CAAC;AAEpC;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,EAAE,CAAC,aAAa,EAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,SAAgB,GACtB,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAOpC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kCAAkC,CAChD,WAAW,EAAE,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,yBAAyB,CAAC,EAC9D,SAAS,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,CAAC,kBAAkB,KAAK,OAAO,EAC7D,OAAO,SAAgB,EACvB,YAAY,SAAuB,GAClC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,CA0BpC"}
1
+ {"version":3,"file":"ConnectionUtils.d.ts","sourceRoot":"","sources":["../src/ConnectionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAGjD,yDAAyD;AACzD,eAAO,MAAM,aAAa,QAAS,CAAC;AAEpC;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,EAAE,CAAC,aAAa,EAC5B,IAAI,EAAE,MAAM,EACZ,OAAO,SAAgB,GACtB,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAOpC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kCAAkC,CAChD,UAAU,EAAE,EAAE,CAAC,aAAa,EAC5B,SAAS,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,GAAG,CAAC,kBAAkB,KAAK,OAAO,EAC7D,OAAO,SAAgB,EACvB,YAAY,SAAuB,GAClC,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,CA0BpC"}
@@ -22,14 +22,14 @@ export function fetchVariableDefinition(connection, name) {
22
22
  * Fetch the definition for a variable given a connection. Waits for the next
23
23
  * field update event and resolves if a variable matching the predicate is found
24
24
  * in the created variables.
25
- * @param fieldSource Connection or session exposing `subscribeToFieldUpdates`
25
+ * @param connection Connection to get the variable from
26
26
  * @param predicate Predicate function to test each variable definition
27
27
  * @param timeout Timeout for the fetch
28
28
  * @param errorMessage Optional error message for timeout and not found errors
29
29
  * @returns Promise that resolves to the variable definition if found in the next field update,
30
30
  * or rejects if no matching variable is found in that update or if the timeout is exceeded
31
31
  */
32
- export function fetchVariableDefinitionByPredicate(fieldSource, predicate) {
32
+ export function fetchVariableDefinitionByPredicate(connection, predicate) {
33
33
  var timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : FETCH_TIMEOUT;
34
34
  var errorMessage = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'Variable not found';
35
35
  return new Promise((resolve, reject) => {
@@ -55,7 +55,7 @@ export function fetchVariableDefinitionByPredicate(fieldSource, predicate) {
55
55
  reject(new Error(errorMessage));
56
56
  }
57
57
  }
58
- removeListener = fieldSource.subscribeToFieldUpdates(handleFieldUpdates);
58
+ removeListener = connection.subscribeToFieldUpdates(handleFieldUpdates);
59
59
  });
60
60
  }
61
61
  //# sourceMappingURL=ConnectionUtils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectionUtils.js","names":["TimeoutError","FETCH_TIMEOUT","fetchVariableDefinition","connection","name","timeout","arguments","length","undefined","fetchVariableDefinitionByPredicate","def","title","concat","fieldSource","predicate","errorMessage","Promise","resolve","reject","removeListener","timeoutId","setTimeout","_removeListener","handleFieldUpdates","changes","_removeListener2","definition","created","find","clearTimeout","Error","subscribeToFieldUpdates"],"sources":["../src/ConnectionUtils.ts"],"sourcesContent":["import type { dh } from '@deephaven/jsapi-types';\nimport { TimeoutError } from '@deephaven/utils';\n\n/** Default timeout for fetching a variable definition */\nexport const FETCH_TIMEOUT = 10_000;\n\n/**\n * Fetch the definition for a variable given a connection. Waits for the next\n * field update event and resolves if the variable is found in the created\n * variables.\n * @param connection Connection to get the variable from\n * @param name Name of the definition to fetch\n * @param timeout Timeout for the fetch\n * @returns Promise that resolves to the variable definition if found in the next field update,\n * or rejects if the variable is not found in that update or if the timeout is exceeded\n */\nexport function fetchVariableDefinition(\n connection: dh.IdeConnection,\n name: string,\n timeout = FETCH_TIMEOUT\n): Promise<dh.ide.VariableDefinition> {\n return fetchVariableDefinitionByPredicate(\n connection,\n def => def.title === name,\n timeout,\n `Variable ${name} not found`\n );\n}\n\n/**\n * Fetch the definition for a variable given a connection. Waits for the next\n * field update event and resolves if a variable matching the predicate is found\n * in the created variables.\n * @param fieldSource Connection or session exposing `subscribeToFieldUpdates`\n * @param predicate Predicate function to test each variable definition\n * @param timeout Timeout for the fetch\n * @param errorMessage Optional error message for timeout and not found errors\n * @returns Promise that resolves to the variable definition if found in the next field update,\n * or rejects if no matching variable is found in that update or if the timeout is exceeded\n */\nexport function fetchVariableDefinitionByPredicate(\n fieldSource: Pick<dh.IdeConnection, 'subscribeToFieldUpdates'>,\n predicate: (definition: dh.ide.VariableDefinition) => boolean,\n timeout = FETCH_TIMEOUT,\n errorMessage = 'Variable not found'\n): Promise<dh.ide.VariableDefinition> {\n return new Promise<dh.ide.VariableDefinition>((resolve, reject) => {\n let removeListener: () => void;\n\n const timeoutId = setTimeout(() => {\n removeListener?.();\n reject(new TimeoutError(`Timeout: ${errorMessage}`));\n }, timeout);\n\n /**\n * Checks if a variable matching the predicate is in the changes, and resolves the promise if it does\n * @param changes Variables changes that have occurred\n */\n function handleFieldUpdates(changes: dh.ide.VariableChanges): void {\n const definition = changes.created.find(predicate);\n clearTimeout(timeoutId);\n removeListener?.();\n if (definition != null) {\n resolve(definition);\n } else {\n reject(new Error(errorMessage));\n }\n }\n\n removeListener = fieldSource.subscribeToFieldUpdates(handleFieldUpdates);\n });\n}\n"],"mappings":"AACA,SAASA,YAAY,QAAQ,kBAAkB;;AAE/C;AACA,OAAO,IAAMC,aAAa,GAAG,KAAM;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CACrCC,UAA4B,EAC5BC,IAAY,EAEwB;EAAA,IADpCC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGL,aAAa;EAEvB,OAAOQ,kCAAkC,CACvCN,UAAU,EACVO,GAAG,IA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,CAAC,CAAC;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"ConnectionUtils.js","names":["TimeoutError","FETCH_TIMEOUT","fetchVariableDefinition","connection","name","timeout","arguments","length","undefined","fetchVariableDefinitionByPredicate","def","title","concat","predicate","errorMessage","Promise","resolve","reject","removeListener","timeoutId","setTimeout","_removeListener","handleFieldUpdates","changes","_removeListener2","definition","created","find","clearTimeout","Error","subscribeToFieldUpdates"],"sources":["../src/ConnectionUtils.ts"],"sourcesContent":["import type { dh } from '@deephaven/jsapi-types';\nimport { TimeoutError } from '@deephaven/utils';\n\n/** Default timeout for fetching a variable definition */\nexport const FETCH_TIMEOUT = 10_000;\n\n/**\n * Fetch the definition for a variable given a connection. Waits for the next\n * field update event and resolves if the variable is found in the created\n * variables.\n * @param connection Connection to get the variable from\n * @param name Name of the definition to fetch\n * @param timeout Timeout for the fetch\n * @returns Promise that resolves to the variable definition if found in the next field update,\n * or rejects if the variable is not found in that update or if the timeout is exceeded\n */\nexport function fetchVariableDefinition(\n connection: dh.IdeConnection,\n name: string,\n timeout = FETCH_TIMEOUT\n): Promise<dh.ide.VariableDefinition> {\n return fetchVariableDefinitionByPredicate(\n connection,\n def => def.title === name,\n timeout,\n `Variable ${name} not found`\n );\n}\n\n/**\n * Fetch the definition for a variable given a connection. Waits for the next\n * field update event and resolves if a variable matching the predicate is found\n * in the created variables.\n * @param connection Connection to get the variable from\n * @param predicate Predicate function to test each variable definition\n * @param timeout Timeout for the fetch\n * @param errorMessage Optional error message for timeout and not found errors\n * @returns Promise that resolves to the variable definition if found in the next field update,\n * or rejects if no matching variable is found in that update or if the timeout is exceeded\n */\nexport function fetchVariableDefinitionByPredicate(\n connection: dh.IdeConnection,\n predicate: (definition: dh.ide.VariableDefinition) => boolean,\n timeout = FETCH_TIMEOUT,\n errorMessage = 'Variable not found'\n): Promise<dh.ide.VariableDefinition> {\n return new Promise<dh.ide.VariableDefinition>((resolve, reject) => {\n let removeListener: () => void;\n\n const timeoutId = setTimeout(() => {\n removeListener?.();\n reject(new TimeoutError(`Timeout: ${errorMessage}`));\n }, timeout);\n\n /**\n * Checks if a variable matching the predicate is in the changes, and resolves the promise if it does\n * @param changes Variables changes that have occurred\n */\n function handleFieldUpdates(changes: dh.ide.VariableChanges): void {\n const definition = changes.created.find(predicate);\n clearTimeout(timeoutId);\n removeListener?.();\n if (definition != null) {\n resolve(definition);\n } else {\n reject(new Error(errorMessage));\n }\n }\n\n removeListener = connection.subscribeToFieldUpdates(handleFieldUpdates);\n });\n}\n"],"mappings":"AACA,SAASA,YAAY,QAAQ,kBAAkB;;AAE/C;AACA,OAAO,IAAMC,aAAa,GAAG,KAAM;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CACrCC,UAA4B,EAC5BC,IAAY,EAEwB;EAAA,IADpCC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGL,aAAa;EAEvB,OAAOQ,kCAAkC,CACvCN,UAAU,EACVO,GAAG,IAAIA,GAAG,CAACC,KAAK,KAAKP,IAAI,EACzBC,OAAO,cAAAO,MAAA,CACKR,IAAI,eAClB,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,kCAAkCA,CAChDN,UAA4B,EAC5BU,SAA6D,EAGzB;EAAA,IAFpCR,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGL,aAAa;EAAA,IACvBa,YAAY,GAAAR,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,oBAAoB;EAEnC,OAAO,IAAIS,OAAO,CAA4B,CAACC,OAAO,EAAEC,MAAM,KAAK;IACjE,IAAIC,cAA0B;IAE9B,IAAMC,SAAS,GAAGC,UAAU,CAAC,MAAM;MAAA,IAAAC,eAAA;MACjC,CAAAA,eAAA,GAAAH,cAAc,cAAAG,eAAA,eAAdA,eAAA,CAAiB,CAAC;MAClBJ,MAAM,CAAC,IAAIjB,YAAY,aAAAY,MAAA,CAAaE,YAAY,CAAE,CAAC,CAAC;IACtD,CAAC,EAAET,OAAO,CAAC;;IAEX;AACJ;AACA;AACA;IACI,SAASiB,kBAAkBA,CAACC,OAA+B,EAAQ;MAAA,IAAAC,gBAAA;MACjE,IAAMC,UAAU,GAAGF,OAAO,CAACG,OAAO,CAACC,IAAI,CAACd,SAAS,CAAC;MAClDe,YAAY,CAACT,SAAS,CAAC;MACvB,CAAAK,gBAAA,GAAAN,cAAc,cAAAM,gBAAA,eAAdA,gBAAA,CAAiB,CAAC;MAClB,IAAIC,UAAU,IAAI,IAAI,EAAE;QACtBT,OAAO,CAACS,UAAU,CAAC;MACrB,CAAC,MAAM;QACLR,MAAM,CAAC,IAAIY,KAAK,CAACf,YAAY,CAAC,CAAC;MACjC;IACF;IAEAI,cAAc,GAAGf,UAAU,CAAC2B,uBAAuB,CAACR,kBAAkB,CAAC;EACzE,CAAC,CAAC;AACJ","ignoreList":[]}
@@ -0,0 +1,57 @@
1
+ import type { dh } from '@deephaven/jsapi-types';
2
+ /**
3
+ * The current full list of variable definitions on a worker. Snapshot identity
4
+ * is stable until the next field-update delta is applied, so consumers using
5
+ * `useSyncExternalStore` will only re-render when the list actually changes.
6
+ */
7
+ export type WorkerVariables = readonly dh.ide.VariableDefinition[];
8
+ /** Default key used when a host exposes a single connection (e.g. DHC). */
9
+ export declare const DEFAULT_WORKER_KEY = "default";
10
+ /**
11
+ * Derive a stable string key identifying the worker that owns the variable
12
+ * described by `descriptor`. Used by {@link WorkerVariablesStore} to dedup
13
+ * subscriptions across consumers that target the same worker.
14
+ *
15
+ * The base `dh.ide.VariableDescriptor` type only carries `type`/`id`/`name`,
16
+ * but DHE attaches routing fields (`querySerial`, `queryName`, `sessionId`).
17
+ * Those are read defensively so this helper works in DHC too — where every
18
+ * descriptor maps to {@link DEFAULT_WORKER_KEY}.
19
+ */
20
+ export declare function getWorkerKey(descriptor: Partial<dh.ide.VariableDescriptor> | Record<string, unknown> | null | undefined): string;
21
+ /**
22
+ * Resolves the IDE connection that owns the worker identified by `key`. Return
23
+ * `null` if the worker is not currently reachable (e.g. query is stopped). The
24
+ * store will retry on the next subscribe or {@link WorkerVariablesStore.invalidate}.
25
+ */
26
+ export type ResolveConnection = (key: string) => Promise<dh.IdeConnection | null>;
27
+ /**
28
+ * A ref-counted store of worker variable lists, keyed by worker. Wraps
29
+ * `IdeConnection.subscribeToFieldUpdates` so the underlying push subscription
30
+ * is opened once per worker regardless of the number of React consumers.
31
+ */
32
+ export type WorkerVariablesStore = {
33
+ /** Current list for `key`, or `null` if not yet resolved. */
34
+ snapshot: (key: string) => WorkerVariables | null;
35
+ /**
36
+ * Subscribe to changes for `key`. The listener fires after each delta is
37
+ * applied. Returns an unsubscribe function; the underlying field-updates
38
+ * subscription is closed when the last listener for `key` unsubscribes.
39
+ */
40
+ subscribe: (key: string, listener: () => void) => () => void;
41
+ /**
42
+ * Drop the cached list and subscription for `key`. Active subscribers will
43
+ * be notified (snapshot becomes `null`) and a fresh resolve+subscribe will
44
+ * kick off. Use when an external signal indicates the worker behind `key`
45
+ * has been replaced (e.g. DHE query restart).
46
+ */
47
+ invalidate: (key: string) => void;
48
+ /** Tear down all entries. Call when the owning provider unmounts. */
49
+ destroy: () => void;
50
+ };
51
+ /**
52
+ * Create a {@link WorkerVariablesStore} backed by `resolveConnection`. The
53
+ * store is framework-free; pair it with a React provider/hook (see
54
+ * `@deephaven/jsapi-bootstrap`'s `WorkerVariablesContext`/`useWorkerVariables`).
55
+ */
56
+ export declare function createWorkerVariablesStore(resolveConnection: ResolveConnection): WorkerVariablesStore;
57
+ //# sourceMappingURL=WorkerVariablesStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkerVariablesStore.d.ts","sourceRoot":"","sources":["../src/WorkerVariablesStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,wBAAwB,CAAC;AAKjD;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,EAAE,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;AAEnE,2EAA2E;AAC3E,eAAO,MAAM,kBAAkB,YAAY,CAAC;AAE5C;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAC1B,UAAU,EACN,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,kBAAkB,CAAC,GAClC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvB,IAAI,GACJ,SAAS,GACZ,MAAM,CAaR;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAC9B,GAAG,EAAE,MAAM,KACR,OAAO,CAAC,EAAE,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;AAwBtC;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,6DAA6D;IAC7D,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,eAAe,GAAG,IAAI,CAAC;IAClD;;;;OAIG;IACH,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;IAC7D;;;;;OAKG;IACH,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,qEAAqE;IACrE,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAUF;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,iBAAiB,EAAE,iBAAiB,GACnC,oBAAoB,CA6JtB"}
@@ -0,0 +1,231 @@
1
+ function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
2
+ function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
3
+ import Log from '@deephaven/log';
4
+ var log = Log.module('@deephaven/jsapi-utils.WorkerVariablesStore');
5
+
6
+ /**
7
+ * The current full list of variable definitions on a worker. Snapshot identity
8
+ * is stable until the next field-update delta is applied, so consumers using
9
+ * `useSyncExternalStore` will only re-render when the list actually changes.
10
+ */
11
+
12
+ /** Default key used when a host exposes a single connection (e.g. DHC). */
13
+ export var DEFAULT_WORKER_KEY = 'default';
14
+
15
+ /**
16
+ * Derive a stable string key identifying the worker that owns the variable
17
+ * described by `descriptor`. Used by {@link WorkerVariablesStore} to dedup
18
+ * subscriptions across consumers that target the same worker.
19
+ *
20
+ * The base `dh.ide.VariableDescriptor` type only carries `type`/`id`/`name`,
21
+ * but DHE attaches routing fields (`querySerial`, `queryName`, `sessionId`).
22
+ * Those are read defensively so this helper works in DHC too — where every
23
+ * descriptor maps to {@link DEFAULT_WORKER_KEY}.
24
+ */
25
+ export function getWorkerKey(descriptor) {
26
+ if (descriptor == null) return DEFAULT_WORKER_KEY;
27
+ var d = descriptor;
28
+ if (typeof d.querySerial === 'string' && d.querySerial.length > 0) {
29
+ return "q:".concat(d.querySerial);
30
+ }
31
+ if (typeof d.queryName === 'string' && d.queryName.length > 0) {
32
+ return "qn:".concat(d.queryName);
33
+ }
34
+ if (typeof d.sessionId === 'string' && d.sessionId.length > 0) {
35
+ return "s:".concat(d.sessionId);
36
+ }
37
+ return DEFAULT_WORKER_KEY;
38
+ }
39
+
40
+ /**
41
+ * Resolves the IDE connection that owns the worker identified by `key`. Return
42
+ * `null` if the worker is not currently reachable (e.g. query is stopped). The
43
+ * store will retry on the next subscribe or {@link WorkerVariablesStore.invalidate}.
44
+ */
45
+
46
+ /**
47
+ * Identify a variable for delta matching. `dh.ide.VariableDefinition` declares
48
+ * a non-optional `id`, but at runtime instances are frequently created as just
49
+ * `{ name, type }` (e.g. field-update payloads and test fixtures), so `id` may
50
+ * be absent. Fall back to `name`, then `title`, and return `undefined` when no
51
+ * usable key exists so such items are never matched against a delta. Keys are
52
+ * namespaced by source field so an `id` of `"x"` never collides with a `name`
53
+ * of `"x"`.
54
+ */
55
+ function getVariableKey(v) {
56
+ if (typeof v.id === 'string' && v.id.length > 0) {
57
+ return "id:".concat(v.id);
58
+ }
59
+ if (typeof v.name === 'string' && v.name.length > 0) {
60
+ return "name:".concat(v.name);
61
+ }
62
+ if (typeof v.title === 'string' && v.title.length > 0) {
63
+ return "title:".concat(v.title);
64
+ }
65
+ return undefined;
66
+ }
67
+
68
+ /**
69
+ * A ref-counted store of worker variable lists, keyed by worker. Wraps
70
+ * `IdeConnection.subscribeToFieldUpdates` so the underlying push subscription
71
+ * is opened once per worker regardless of the number of React consumers.
72
+ */
73
+
74
+ /**
75
+ * Create a {@link WorkerVariablesStore} backed by `resolveConnection`. The
76
+ * store is framework-free; pair it with a React provider/hook (see
77
+ * `@deephaven/jsapi-bootstrap`'s `WorkerVariablesContext`/`useWorkerVariables`).
78
+ */
79
+ export function createWorkerVariablesStore(resolveConnection) {
80
+ var entries = new Map();
81
+
82
+ /** Get the entry for `key`, creating an empty one if it doesn't exist. */
83
+ function getOrCreate(key) {
84
+ var entry = entries.get(key);
85
+ if (entry == null) {
86
+ entry = {
87
+ list: null,
88
+ listeners: new Set(),
89
+ unsubscribeFieldUpdates: null,
90
+ resolving: false,
91
+ generation: 0
92
+ };
93
+ entries.set(key, entry);
94
+ }
95
+ return entry;
96
+ }
97
+
98
+ /** Invoke every listener on `entry`, isolating listener errors. */
99
+ function notify(entry) {
100
+ entry.listeners.forEach(listener => {
101
+ try {
102
+ listener();
103
+ } catch (e) {
104
+ log.error('WorkerVariables listener threw', e);
105
+ }
106
+ });
107
+ }
108
+
109
+ /** Close the field-updates subscription for `key`, if any. */
110
+ function teardown(key) {
111
+ var entry = entries.get(key);
112
+ if ((entry === null || entry === void 0 ? void 0 : entry.unsubscribeFieldUpdates) != null) {
113
+ try {
114
+ entry.unsubscribeFieldUpdates();
115
+ } catch (e) {
116
+ log.warn('Error unsubscribing from field updates', e);
117
+ }
118
+ entry.unsubscribeFieldUpdates = null;
119
+ }
120
+ }
121
+
122
+ /** Resolve the connection for `key` and open its field-updates subscription. */
123
+ function start(_x) {
124
+ return _start.apply(this, arguments);
125
+ }
126
+ /** Current list for `key`, or `null` if not yet resolved. */
127
+ function _start() {
128
+ _start = _asyncToGenerator(function* (key) {
129
+ var entry = entries.get(key);
130
+ if (entry == null || entry.resolving || entry.unsubscribeFieldUpdates != null) {
131
+ return;
132
+ }
133
+ entry.resolving = true;
134
+ var gen = entry.generation;
135
+ try {
136
+ var connection = yield resolveConnection(key);
137
+ if (gen !== entry.generation || entry.listeners.size === 0 || entries.get(key) !== entry) {
138
+ return;
139
+ }
140
+ if (connection == null) {
141
+ log.debug('No connection available for worker', key);
142
+ return;
143
+ }
144
+ // entry.list is replaced with a fresh array each delta so snapshot
145
+ // identity is stable for `useSyncExternalStore` consumers.
146
+ var unsubscribe = connection.subscribeToFieldUpdates(changes => {
147
+ var _entry$list;
148
+ if (gen !== entry.generation) return;
149
+ var removedKeys = new Set(changes.removed.map(getVariableKey).filter(k => k != null));
150
+ var updatedKeys = new Set(changes.updated.map(getVariableKey).filter(k => k != null));
151
+ // Keep keyless items (they can't be matched) and items whose key was
152
+ // not removed or updated; updated/created items are re-appended below.
153
+ var next = ((_entry$list = entry.list) !== null && _entry$list !== void 0 ? _entry$list : []).filter(v => {
154
+ var k = getVariableKey(v);
155
+ return k == null || !removedKeys.has(k) && !updatedKeys.has(k);
156
+ });
157
+ next.push(...changes.updated, ...changes.created);
158
+ entry.list = next;
159
+ notify(entry);
160
+ });
161
+ entry.unsubscribeFieldUpdates = unsubscribe;
162
+ } catch (e) {
163
+ log.error('Failed to resolve worker connection', key, e);
164
+ } finally {
165
+ entry.resolving = false;
166
+ // If `invalidate` ran while this resolve was in flight, it bumped
167
+ // `generation` but couldn't start a fresh resolve (this one was still
168
+ // marked `resolving`). The in-flight resolve above then bailed out as
169
+ // stale, so kick off another resolve now that `resolving` is cleared —
170
+ // otherwise the entry would be stuck with `list === null` and no
171
+ // subscription until the next `invalidate`/subscribe. `gen` now equals
172
+ // `entry.generation` when no invalidation occurred, so this never loops.
173
+ if (entries.get(key) === entry && gen !== entry.generation && entry.unsubscribeFieldUpdates == null && entry.listeners.size > 0) {
174
+ start(key).catch(() => undefined);
175
+ }
176
+ }
177
+ });
178
+ return _start.apply(this, arguments);
179
+ }
180
+ function snapshot(key) {
181
+ var _entries$get$list, _entries$get;
182
+ return (_entries$get$list = (_entries$get = entries.get(key)) === null || _entries$get === void 0 ? void 0 : _entries$get.list) !== null && _entries$get$list !== void 0 ? _entries$get$list : null;
183
+ }
184
+
185
+ /** Register `listener` for `key`, starting the subscription on first listener. */
186
+ function subscribe(key, listener) {
187
+ var entry = getOrCreate(key);
188
+ entry.listeners.add(listener);
189
+ if (entry.unsubscribeFieldUpdates == null && !entry.resolving) {
190
+ // start handles its own errors; nothing to do on rejection
191
+ start(key).catch(() => undefined);
192
+ }
193
+ return () => {
194
+ entry.listeners.delete(listener);
195
+ if (entry.listeners.size === 0) {
196
+ teardown(key);
197
+ entry.list = null;
198
+ entries.delete(key);
199
+ }
200
+ };
201
+ }
202
+
203
+ /** Drop the cached list/subscription for `key` and re-resolve if observed. */
204
+ function invalidate(key) {
205
+ var entry = entries.get(key);
206
+ if (entry == null) return;
207
+ entry.generation += 1;
208
+ teardown(key);
209
+ entry.list = null;
210
+ notify(entry);
211
+ if (entry.listeners.size > 0) {
212
+ // start handles its own errors; nothing to do on rejection
213
+ start(key).catch(() => undefined);
214
+ }
215
+ }
216
+
217
+ /** Tear down every entry and clear all state. */
218
+ function destroy() {
219
+ Array.from(entries.keys()).forEach(key => {
220
+ teardown(key);
221
+ });
222
+ entries.clear();
223
+ }
224
+ return {
225
+ snapshot,
226
+ subscribe,
227
+ invalidate,
228
+ destroy
229
+ };
230
+ }
231
+ //# sourceMappingURL=WorkerVariablesStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WorkerVariablesStore.js","names":["Log","log","module","DEFAULT_WORKER_KEY","getWorkerKey","descriptor","d","querySerial","length","concat","queryName","sessionId","getVariableKey","v","id","name","title","undefined","createWorkerVariablesStore","resolveConnection","entries","Map","getOrCreate","key","entry","get","list","listeners","Set","unsubscribeFieldUpdates","resolving","generation","set","notify","forEach","listener","e","error","teardown","warn","start","_x","_start","apply","arguments","_asyncToGenerator","gen","connection","size","debug","unsubscribe","subscribeToFieldUpdates","changes","_entry$list","removedKeys","removed","map","filter","k","updatedKeys","updated","next","has","push","created","catch","snapshot","_entries$get$list","_entries$get","subscribe","add","delete","invalidate","destroy","Array","from","keys","clear"],"sources":["../src/WorkerVariablesStore.ts"],"sourcesContent":["import type { dh } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\n\nconst log = Log.module('@deephaven/jsapi-utils.WorkerVariablesStore');\n\n/**\n * The current full list of variable definitions on a worker. Snapshot identity\n * is stable until the next field-update delta is applied, so consumers using\n * `useSyncExternalStore` will only re-render when the list actually changes.\n */\nexport type WorkerVariables = readonly dh.ide.VariableDefinition[];\n\n/** Default key used when a host exposes a single connection (e.g. DHC). */\nexport const DEFAULT_WORKER_KEY = 'default';\n\n/**\n * Derive a stable string key identifying the worker that owns the variable\n * described by `descriptor`. Used by {@link WorkerVariablesStore} to dedup\n * subscriptions across consumers that target the same worker.\n *\n * The base `dh.ide.VariableDescriptor` type only carries `type`/`id`/`name`,\n * but DHE attaches routing fields (`querySerial`, `queryName`, `sessionId`).\n * Those are read defensively so this helper works in DHC too — where every\n * descriptor maps to {@link DEFAULT_WORKER_KEY}.\n */\nexport function getWorkerKey(\n descriptor:\n | Partial<dh.ide.VariableDescriptor>\n | Record<string, unknown>\n | null\n | undefined\n): string {\n if (descriptor == null) return DEFAULT_WORKER_KEY;\n const d = descriptor as Record<string, unknown>;\n if (typeof d.querySerial === 'string' && d.querySerial.length > 0) {\n return `q:${d.querySerial}`;\n }\n if (typeof d.queryName === 'string' && d.queryName.length > 0) {\n return `qn:${d.queryName}`;\n }\n if (typeof d.sessionId === 'string' && d.sessionId.length > 0) {\n return `s:${d.sessionId}`;\n }\n return DEFAULT_WORKER_KEY;\n}\n\n/**\n * Resolves the IDE connection that owns the worker identified by `key`. Return\n * `null` if the worker is not currently reachable (e.g. query is stopped). The\n * store will retry on the next subscribe or {@link WorkerVariablesStore.invalidate}.\n */\nexport type ResolveConnection = (\n key: string\n) => Promise<dh.IdeConnection | null>;\n\n/**\n * Identify a variable for delta matching. `dh.ide.VariableDefinition` declares\n * a non-optional `id`, but at runtime instances are frequently created as just\n * `{ name, type }` (e.g. field-update payloads and test fixtures), so `id` may\n * be absent. Fall back to `name`, then `title`, and return `undefined` when no\n * usable key exists so such items are never matched against a delta. Keys are\n * namespaced by source field so an `id` of `\"x\"` never collides with a `name`\n * of `\"x\"`.\n */\nfunction getVariableKey(v: dh.ide.VariableDefinition): string | undefined {\n if (typeof v.id === 'string' && v.id.length > 0) {\n return `id:${v.id}`;\n }\n if (typeof v.name === 'string' && v.name.length > 0) {\n return `name:${v.name}`;\n }\n if (typeof v.title === 'string' && v.title.length > 0) {\n return `title:${v.title}`;\n }\n return undefined;\n}\n\n/**\n * A ref-counted store of worker variable lists, keyed by worker. Wraps\n * `IdeConnection.subscribeToFieldUpdates` so the underlying push subscription\n * is opened once per worker regardless of the number of React consumers.\n */\nexport type WorkerVariablesStore = {\n /** Current list for `key`, or `null` if not yet resolved. */\n snapshot: (key: string) => WorkerVariables | null;\n /**\n * Subscribe to changes for `key`. The listener fires after each delta is\n * applied. Returns an unsubscribe function; the underlying field-updates\n * subscription is closed when the last listener for `key` unsubscribes.\n */\n subscribe: (key: string, listener: () => void) => () => void;\n /**\n * Drop the cached list and subscription for `key`. Active subscribers will\n * be notified (snapshot becomes `null`) and a fresh resolve+subscribe will\n * kick off. Use when an external signal indicates the worker behind `key`\n * has been replaced (e.g. DHE query restart).\n */\n invalidate: (key: string) => void;\n /** Tear down all entries. Call when the owning provider unmounts. */\n destroy: () => void;\n};\n\ntype Entry = {\n list: WorkerVariables | null;\n listeners: Set<() => void>;\n unsubscribeFieldUpdates: (() => void) | null;\n resolving: boolean;\n generation: number;\n};\n\n/**\n * Create a {@link WorkerVariablesStore} backed by `resolveConnection`. The\n * store is framework-free; pair it with a React provider/hook (see\n * `@deephaven/jsapi-bootstrap`'s `WorkerVariablesContext`/`useWorkerVariables`).\n */\nexport function createWorkerVariablesStore(\n resolveConnection: ResolveConnection\n): WorkerVariablesStore {\n const entries = new Map<string, Entry>();\n\n /** Get the entry for `key`, creating an empty one if it doesn't exist. */\n function getOrCreate(key: string): Entry {\n let entry = entries.get(key);\n if (entry == null) {\n entry = {\n list: null,\n listeners: new Set(),\n unsubscribeFieldUpdates: null,\n resolving: false,\n generation: 0,\n };\n entries.set(key, entry);\n }\n return entry;\n }\n\n /** Invoke every listener on `entry`, isolating listener errors. */\n function notify(entry: Entry): void {\n entry.listeners.forEach(listener => {\n try {\n listener();\n } catch (e) {\n log.error('WorkerVariables listener threw', e);\n }\n });\n }\n\n /** Close the field-updates subscription for `key`, if any. */\n function teardown(key: string): void {\n const entry = entries.get(key);\n if (entry?.unsubscribeFieldUpdates != null) {\n try {\n entry.unsubscribeFieldUpdates();\n } catch (e) {\n log.warn('Error unsubscribing from field updates', e);\n }\n entry.unsubscribeFieldUpdates = null;\n }\n }\n\n /** Resolve the connection for `key` and open its field-updates subscription. */\n async function start(key: string): Promise<void> {\n const entry = entries.get(key);\n if (\n entry == null ||\n entry.resolving ||\n entry.unsubscribeFieldUpdates != null\n ) {\n return;\n }\n entry.resolving = true;\n const gen = entry.generation;\n try {\n const connection = await resolveConnection(key);\n if (\n gen !== entry.generation ||\n entry.listeners.size === 0 ||\n entries.get(key) !== entry\n ) {\n return;\n }\n if (connection == null) {\n log.debug('No connection available for worker', key);\n return;\n }\n // entry.list is replaced with a fresh array each delta so snapshot\n // identity is stable for `useSyncExternalStore` consumers.\n const unsubscribe = connection.subscribeToFieldUpdates(changes => {\n if (gen !== entry.generation) return;\n const removedKeys = new Set(\n changes.removed.map(getVariableKey).filter(k => k != null)\n );\n const updatedKeys = new Set(\n changes.updated.map(getVariableKey).filter(k => k != null)\n );\n // Keep keyless items (they can't be matched) and items whose key was\n // not removed or updated; updated/created items are re-appended below.\n const next = (entry.list ?? []).filter(v => {\n const k = getVariableKey(v);\n return k == null || (!removedKeys.has(k) && !updatedKeys.has(k));\n });\n next.push(...changes.updated, ...changes.created);\n entry.list = next;\n notify(entry);\n });\n entry.unsubscribeFieldUpdates = unsubscribe;\n } catch (e) {\n log.error('Failed to resolve worker connection', key, e);\n } finally {\n entry.resolving = false;\n // If `invalidate` ran while this resolve was in flight, it bumped\n // `generation` but couldn't start a fresh resolve (this one was still\n // marked `resolving`). The in-flight resolve above then bailed out as\n // stale, so kick off another resolve now that `resolving` is cleared —\n // otherwise the entry would be stuck with `list === null` and no\n // subscription until the next `invalidate`/subscribe. `gen` now equals\n // `entry.generation` when no invalidation occurred, so this never loops.\n if (\n entries.get(key) === entry &&\n gen !== entry.generation &&\n entry.unsubscribeFieldUpdates == null &&\n entry.listeners.size > 0\n ) {\n start(key).catch(() => undefined);\n }\n }\n }\n\n /** Current list for `key`, or `null` if not yet resolved. */\n function snapshot(key: string): WorkerVariables | null {\n return entries.get(key)?.list ?? null;\n }\n\n /** Register `listener` for `key`, starting the subscription on first listener. */\n function subscribe(key: string, listener: () => void): () => void {\n const entry = getOrCreate(key);\n entry.listeners.add(listener);\n if (entry.unsubscribeFieldUpdates == null && !entry.resolving) {\n // start handles its own errors; nothing to do on rejection\n start(key).catch(() => undefined);\n }\n return () => {\n entry.listeners.delete(listener);\n if (entry.listeners.size === 0) {\n teardown(key);\n entry.list = null;\n entries.delete(key);\n }\n };\n }\n\n /** Drop the cached list/subscription for `key` and re-resolve if observed. */\n function invalidate(key: string): void {\n const entry = entries.get(key);\n if (entry == null) return;\n entry.generation += 1;\n teardown(key);\n entry.list = null;\n notify(entry);\n if (entry.listeners.size > 0) {\n // start handles its own errors; nothing to do on rejection\n start(key).catch(() => undefined);\n }\n }\n\n /** Tear down every entry and clear all state. */\n function destroy(): void {\n Array.from(entries.keys()).forEach(key => {\n teardown(key);\n });\n entries.clear();\n }\n\n return { snapshot, subscribe, invalidate, destroy };\n}\n"],"mappings":";;AACA,OAAOA,GAAG,MAAM,gBAAgB;AAEhC,IAAMC,GAAG,GAAGD,GAAG,CAACE,MAAM,CAAC,6CAA6C,CAAC;;AAErE;AACA;AACA;AACA;AACA;;AAGA;AACA,OAAO,IAAMC,kBAAkB,GAAG,SAAS;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,YAAYA,CAC1BC,UAIa,EACL;EACR,IAAIA,UAAU,IAAI,IAAI,EAAE,OAAOF,kBAAkB;EACjD,IAAMG,CAAC,GAAGD,UAAqC;EAC/C,IAAI,OAAOC,CAAC,CAACC,WAAW,KAAK,QAAQ,IAAID,CAAC,CAACC,WAAW,CAACC,MAAM,GAAG,CAAC,EAAE;IACjE,YAAAC,MAAA,CAAYH,CAAC,CAACC,WAAW;EAC3B;EACA,IAAI,OAAOD,CAAC,CAACI,SAAS,KAAK,QAAQ,IAAIJ,CAAC,CAACI,SAAS,CAACF,MAAM,GAAG,CAAC,EAAE;IAC7D,aAAAC,MAAA,CAAaH,CAAC,CAACI,SAAS;EAC1B;EACA,IAAI,OAAOJ,CAAC,CAACK,SAAS,KAAK,QAAQ,IAAIL,CAAC,CAACK,SAAS,CAACH,MAAM,GAAG,CAAC,EAAE;IAC7D,YAAAC,MAAA,CAAYH,CAAC,CAACK,SAAS;EACzB;EACA,OAAOR,kBAAkB;AAC3B;;AAEA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASS,cAAcA,CAACC,CAA4B,EAAsB;EACxE,IAAI,OAAOA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;IACF,CAAC;EACH;;EAEA;EACA,SAASiD,UAAUA,CAACjD,GAAW,EAAQ;IACrC,IAAMC,KAAK,GAAGJ,OAAO,CAACK,GAAG,CAACF,GAAG,CAAC;IAC9B,IAAIC,KAAK,IAAI,IAAI,EAAE;IACnBA,KAAK,CAACO,UAAU,IAAI,CAAC;IACrBO,QAAQ,CAACf,GAAG,CAAC;IACbC,KAAK,CAACE,IAAI,GAAG,IAAI;IACjBO,MAAM,CAACT,KAAK,CAAC;IACb,IAAIA,KAAK,CAACG,SAAS,CAACqB,IAAI,GAAG,CAAC,EAAE;MAC5B;MACAR,KAAK,CAACjB,GAAG,CAAC,CAAC0C,KAAK,CAAC,MAAMhD,SAAS,CAAC;IACnC;EACF;;EAEA;EACA,SAASwD,OAAOA,CAAA,EAAS;IACvBC,KAAK,CAACC,IAAI,CAACvD,OAAO,CAACwD,IAAI,CAAC,CAAC,CAAC,CAAC1C,OAAO,CAACX,GAAG,IAAI;MACxCe,QAAQ,CAACf,GAAG,CAAC;IACf,CAAC,CAAC;IACFH,OAAO,CAACyD,KAAK,CAAC,CAAC;EACjB;EAEA,OAAO;IAAEX,QAAQ;IAAEG,SAAS;IAAEG,UAAU;IAAEC;EAAQ,CAAC;AACrD","ignoreList":[]}
package/dist/index.d.ts CHANGED
@@ -12,4 +12,5 @@ export * from './SessionUtils';
12
12
  export * from './Settings';
13
13
  export * from './TableUtils';
14
14
  export * from './ViewportDataUtils';
15
+ export * from './WorkerVariablesStore';
15
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC"}
package/dist/index.js CHANGED
@@ -12,4 +12,5 @@ export * from "./SessionUtils.js";
12
12
  export * from "./Settings.js";
13
13
  export * from "./TableUtils.js";
14
14
  export * from "./ViewportDataUtils.js";
15
+ export * from "./WorkerVariablesStore.js";
15
16
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","FormatterUtils"],"sources":["../src/index.ts"],"sourcesContent":["export * from './ConnectionUtils';\nexport * from './formatters';\nexport * from './DateUtils';\nexport * from './FilterUtils';\nexport * from './Formatter';\nexport { default as FormatterUtils } from './FormatterUtils';\nexport * from './FormatterUtils';\nexport * from './MessageUtils';\nexport * from './NewTableColumnTypes';\nexport * from './NoConsolesError';\nexport * from './SessionUtils';\nexport * from './Settings';\nexport * from './TableUtils';\nexport * from './ViewportDataUtils';\n"],"mappings":";;;;;SAKSA,OAAO,IAAIC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["default","FormatterUtils"],"sources":["../src/index.ts"],"sourcesContent":["export * from './ConnectionUtils';\nexport * from './formatters';\nexport * from './DateUtils';\nexport * from './FilterUtils';\nexport * from './Formatter';\nexport { default as FormatterUtils } from './FormatterUtils';\nexport * from './FormatterUtils';\nexport * from './MessageUtils';\nexport * from './NewTableColumnTypes';\nexport * from './NoConsolesError';\nexport * from './SessionUtils';\nexport * from './Settings';\nexport * from './TableUtils';\nexport * from './ViewportDataUtils';\nexport * from './WorkerVariablesStore';\n"],"mappings":";;;;;SAKSA,OAAO,IAAIC,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven/jsapi-utils",
3
- "version": "1.22.2-alpha-pivot-builder.0+e2a2077",
3
+ "version": "1.23.0",
4
4
  "description": "Deephaven JSAPI Utils",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "Apache-2.0",
@@ -21,16 +21,16 @@
21
21
  "build:babel": "babel ./src --out-dir ./dist --extensions \".ts,.tsx,.js,.jsx\" --source-maps --root-mode upward"
22
22
  },
23
23
  "dependencies": {
24
- "@deephaven/filters": "^1.22.2-alpha-pivot-builder.0+e2a2077",
24
+ "@deephaven/filters": "^1.1.0",
25
25
  "@deephaven/jsapi-types": "^1.0.0-dev0.40.4",
26
- "@deephaven/log": "^1.22.2-alpha-pivot-builder.0+e2a2077",
27
- "@deephaven/utils": "^1.22.2-alpha-pivot-builder.0+e2a2077",
26
+ "@deephaven/log": "^1.8.0",
27
+ "@deephaven/utils": "^1.10.0",
28
28
  "lodash.clamp": "^4.0.3",
29
29
  "nanoid": "^5.0.7"
30
30
  },
31
31
  "devDependencies": {
32
- "@deephaven/jsapi-shim": "^1.22.2-alpha-pivot-builder.0+e2a2077",
33
- "@deephaven/test-utils": "^1.22.2-alpha-pivot-builder.0+e2a2077"
32
+ "@deephaven/jsapi-shim": "^1.9.0",
33
+ "@deephaven/test-utils": "^1.8.0"
34
34
  },
35
35
  "files": [
36
36
  "dist"
@@ -39,5 +39,5 @@
39
39
  "publishConfig": {
40
40
  "access": "public"
41
41
  },
42
- "gitHead": "e2a207700c2da1195164130643e7c5e5b223485a"
42
+ "gitHead": "0c7d87c2dcadbb0bec968a9366078c4f4f3ac9b7"
43
43
  }