@deephaven/jsapi-utils 0.22.3-beta.7 → 0.22.3-embed-pandas.11
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/dist/ConnectionUtils.d.ts +12 -0
- package/dist/ConnectionUtils.d.ts.map +1 -0
- package/dist/ConnectionUtils.js +43 -0
- package/dist/ConnectionUtils.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IdeConnection, VariableDefinition } from '@deephaven/jsapi-shim';
|
|
2
|
+
/** Default timeout for fetching a variable definition */
|
|
3
|
+
export declare const FETCH_TIMEOUT = 10000;
|
|
4
|
+
/**
|
|
5
|
+
* Fetch the definition for a variable given a connection. Subscribes to field updates and triggers when the variable is found.
|
|
6
|
+
* @param connection Connection to get the variable from
|
|
7
|
+
* @param name Name of the definition to fetch
|
|
8
|
+
* @param timeout Timeout for the fetch
|
|
9
|
+
* @returns Promise the resolves to the variable definition if found, or rejects if there's an error or the timeout has exceeded
|
|
10
|
+
*/
|
|
11
|
+
export declare function fetchVariableDefinition(connection: IdeConnection, name: string, timeout?: number): Promise<VariableDefinition>;
|
|
12
|
+
//# sourceMappingURL=ConnectionUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionUtils.d.ts","sourceRoot":"","sources":["../src/ConnectionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,kBAAkB,EACnB,MAAM,uBAAuB,CAAC;AAG/B,yDAAyD;AACzD,eAAO,MAAM,aAAa,QAAS,CAAC;AAEpC;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,aAAa,EACzB,IAAI,EAAE,MAAM,EACZ,OAAO,SAAgB,GACtB,OAAO,CAAC,kBAAkB,CAAC,CAwB7B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TimeoutError } from '@deephaven/utils';
|
|
2
|
+
/** Default timeout for fetching a variable definition */
|
|
3
|
+
|
|
4
|
+
export var FETCH_TIMEOUT = 10000;
|
|
5
|
+
/**
|
|
6
|
+
* Fetch the definition for a variable given a connection. Subscribes to field updates and triggers when the variable is found.
|
|
7
|
+
* @param connection Connection to get the variable from
|
|
8
|
+
* @param name Name of the definition to fetch
|
|
9
|
+
* @param timeout Timeout for the fetch
|
|
10
|
+
* @returns Promise the resolves to the variable definition if found, or rejects if there's an error or the timeout has exceeded
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
export function fetchVariableDefinition(connection, name) {
|
|
14
|
+
var timeout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : FETCH_TIMEOUT;
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
var removeListener;
|
|
17
|
+
var timeoutId = setTimeout(() => {
|
|
18
|
+
var _removeListener;
|
|
19
|
+
|
|
20
|
+
(_removeListener = removeListener) === null || _removeListener === void 0 ? void 0 : _removeListener();
|
|
21
|
+
reject(new TimeoutError("Variable ".concat(name, " not found")));
|
|
22
|
+
}, timeout);
|
|
23
|
+
/**
|
|
24
|
+
* Checks if the variable we're looking for is in the changes, and resolves the promise if it does
|
|
25
|
+
* @param changes Variables changes that have occurred
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
function handleFieldUpdates(changes) {
|
|
29
|
+
var definition = changes.created.find(def => def.title === name);
|
|
30
|
+
|
|
31
|
+
if (definition != null) {
|
|
32
|
+
var _removeListener2;
|
|
33
|
+
|
|
34
|
+
clearTimeout(timeoutId);
|
|
35
|
+
(_removeListener2 = removeListener) === null || _removeListener2 === void 0 ? void 0 : _removeListener2();
|
|
36
|
+
resolve(definition);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
removeListener = connection.subscribeToFieldUpdates(handleFieldUpdates);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=ConnectionUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionUtils.js","names":["TimeoutError","FETCH_TIMEOUT","fetchVariableDefinition","connection","name","timeout","Promise","resolve","reject","removeListener","timeoutId","setTimeout","handleFieldUpdates","changes","definition","created","find","def","title","clearTimeout","subscribeToFieldUpdates"],"sources":["../src/ConnectionUtils.ts"],"sourcesContent":["import {\n IdeConnection,\n VariableChanges,\n VariableDefinition,\n} from '@deephaven/jsapi-shim';\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. Subscribes to field updates and triggers when the variable is found.\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 the resolves to the variable definition if found, or rejects if there's an error or the timeout has exceeded\n */\nexport function fetchVariableDefinition(\n connection: IdeConnection,\n name: string,\n timeout = FETCH_TIMEOUT\n): Promise<VariableDefinition> {\n return new Promise<VariableDefinition>((resolve, reject) => {\n let removeListener: () => void;\n\n const timeoutId = setTimeout(() => {\n removeListener?.();\n reject(new TimeoutError(`Variable ${name} not found`));\n }, timeout);\n\n /**\n * Checks if the variable we're looking for is in the changes, and resolves the promise if it does\n * @param changes Variables changes that have occurred\n */\n function handleFieldUpdates(changes: VariableChanges): void {\n const definition = changes.created.find(def => def.title === name);\n if (definition != null) {\n clearTimeout(timeoutId);\n removeListener?.();\n resolve(definition);\n }\n }\n\n removeListener = connection.subscribeToFieldUpdates(handleFieldUpdates);\n });\n}\n"],"mappings":"AAKA,SAASA,YAAT,QAA6B,kBAA7B;AAEA;;AACA,OAAO,IAAMC,aAAa,GAAG,KAAtB;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,uBAAT,CACLC,UADK,EAELC,IAFK,EAIwB;EAAA,IAD7BC,OAC6B,uEADnBJ,aACmB;EAC7B,OAAO,IAAIK,OAAJ,CAAgC,CAACC,OAAD,EAAUC,MAAV,KAAqB;IAC1D,IAAIC,cAAJ;IAEA,IAAMC,SAAS,GAAGC,UAAU,CAAC,MAAM;MAAA;;MACjC,mBAAAF,cAAc,UAAd;MACAD,MAAM,CAAC,IAAIR,YAAJ,oBAA6BI,IAA7B,gBAAD,CAAN;IACD,CAH2B,EAGzBC,OAHyB,CAA5B;IAKA;AACJ;AACA;AACA;;IACI,SAASO,kBAAT,CAA4BC,OAA5B,EAA4D;MAC1D,IAAMC,UAAU,GAAGD,OAAO,CAACE,OAAR,CAAgBC,IAAhB,CAAqBC,GAAG,IAAIA,GAAG,CAACC,KAAJ,KAAcd,IAA1C,CAAnB;;MACA,IAAIU,UAAU,IAAI,IAAlB,EAAwB;QAAA;;QACtBK,YAAY,CAACT,SAAD,CAAZ;QACA,oBAAAD,cAAc,UAAd;QACAF,OAAO,CAACO,UAAD,CAAP;MACD;IACF;;IAEDL,cAAc,GAAGN,UAAU,CAACiB,uBAAX,CAAmCR,kBAAnC,CAAjB;EACD,CAtBM,CAAP;AAuBD"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,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,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","FormatterUtils"],"sources":["../src/index.ts"],"sourcesContent":["export * from './formatters';\nexport * from './DateUtils';\nexport * from './Formatter';\nexport { default as FormatterUtils } from './FormatterUtils';\nexport * from './FormatterUtils';\nexport * from './Settings';\nexport * from './TableUtils';\n"],"mappings":"
|
|
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 './Formatter';\nexport { default as FormatterUtils } from './FormatterUtils';\nexport * from './FormatterUtils';\nexport * from './Settings';\nexport * from './TableUtils';\n"],"mappings":";;;;SAISA,OAAO,IAAIC,c"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/jsapi-utils",
|
|
3
|
-
"version": "0.22.3-
|
|
3
|
+
"version": "0.22.3-embed-pandas.11+52f2c19",
|
|
4
4
|
"description": "Deephaven JSAPI Utils",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -21,13 +21,13 @@
|
|
|
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": "^0.22.3-
|
|
25
|
-
"@deephaven/jsapi-shim": "^0.22.3-
|
|
26
|
-
"@deephaven/log": "^0.22.3-
|
|
27
|
-
"@deephaven/utils": "^0.22.3-
|
|
24
|
+
"@deephaven/filters": "^0.22.3-embed-pandas.11+52f2c19",
|
|
25
|
+
"@deephaven/jsapi-shim": "^0.22.3-embed-pandas.11+52f2c19",
|
|
26
|
+
"@deephaven/log": "^0.22.3-embed-pandas.11+52f2c19",
|
|
27
|
+
"@deephaven/utils": "^0.22.3-embed-pandas.11+52f2c19"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@deephaven/tsconfig": "^0.22.3-
|
|
30
|
+
"@deephaven/tsconfig": "^0.22.3-embed-pandas.11+52f2c19"
|
|
31
31
|
},
|
|
32
32
|
"files": [
|
|
33
33
|
"dist"
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "52f2c1902051cdeab9086d6331e223e29e0c6d27"
|
|
39
39
|
}
|