@deephaven/jsapi-utils 0.38.1-chart-refactor.20 → 0.38.1-deglobalized-jsapi.15
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/SessionUtils.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface SessionWrapper {
|
|
|
12
12
|
connection: IdeConnection;
|
|
13
13
|
config: SessionConfig;
|
|
14
14
|
details?: SessionDetails;
|
|
15
|
+
dh: DhType;
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* @returns New connection to the server
|
|
@@ -21,8 +22,8 @@ export declare function createConnection(dh: DhType, websocketUrl: string): IdeC
|
|
|
21
22
|
* Create a new session using the default URL
|
|
22
23
|
* @returns A session and config that is ready to use
|
|
23
24
|
*/
|
|
24
|
-
export declare function createSessionWrapper(connection: IdeConnection, details: SessionDetails): Promise<SessionWrapper>;
|
|
25
|
+
export declare function createSessionWrapper(dh: DhType, connection: IdeConnection, details: SessionDetails): Promise<SessionWrapper>;
|
|
25
26
|
export declare function createCoreClient(dh: DhType, websocketUrl: string, options?: ConnectOptions): CoreClient;
|
|
26
27
|
export declare function getSessionDetails(): Promise<SessionDetails>;
|
|
27
|
-
export declare function loadSessionWrapper(connection: IdeConnection, sessionDetails: SessionDetails): Promise<SessionWrapper | undefined>;
|
|
28
|
+
export declare function loadSessionWrapper(dh: DhType, connection: IdeConnection, sessionDetails: SessionDetails): Promise<SessionWrapper | undefined>;
|
|
28
29
|
//# sourceMappingURL=SessionUtils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionUtils.d.ts","sourceRoot":"","sources":["../src/SessionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,EAAE,IAAI,MAAM,EACZ,aAAa,EACb,UAAU,EACX,MAAM,wBAAwB,CAAC;AAWhC,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;I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D,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,cAAc,CAAC,CAOjE;AAED,wBAAsB,kBAAkB,CACtC,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,aAAa,EACzB,cAAc,EAAE,cAAc,GAC7B,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAWrC"}
|
package/dist/SessionUtils.js
CHANGED
|
@@ -17,11 +17,11 @@ export function createConnection(dh, websocketUrl) {
|
|
|
17
17
|
* Create a new session using the default URL
|
|
18
18
|
* @returns A session and config that is ready to use
|
|
19
19
|
*/
|
|
20
|
-
export function createSessionWrapper(_x, _x2) {
|
|
20
|
+
export function createSessionWrapper(_x, _x2, _x3) {
|
|
21
21
|
return _createSessionWrapper.apply(this, arguments);
|
|
22
22
|
}
|
|
23
23
|
function _createSessionWrapper() {
|
|
24
|
-
_createSessionWrapper = _asyncToGenerator(function* (connection, details) {
|
|
24
|
+
_createSessionWrapper = _asyncToGenerator(function* (dh, connection, details) {
|
|
25
25
|
log.info('Getting console types...');
|
|
26
26
|
var types = yield connection.getConsoleTypes();
|
|
27
27
|
if (types.length === 0) {
|
|
@@ -40,7 +40,8 @@ function _createSessionWrapper() {
|
|
|
40
40
|
session,
|
|
41
41
|
config,
|
|
42
42
|
connection,
|
|
43
|
-
details
|
|
43
|
+
details,
|
|
44
|
+
dh
|
|
44
45
|
};
|
|
45
46
|
});
|
|
46
47
|
return _createSessionWrapper.apply(this, arguments);
|
|
@@ -79,14 +80,14 @@ function _getSessionDetails() {
|
|
|
79
80
|
});
|
|
80
81
|
return _getSessionDetails.apply(this, arguments);
|
|
81
82
|
}
|
|
82
|
-
export function loadSessionWrapper(
|
|
83
|
+
export function loadSessionWrapper(_x4, _x5, _x6) {
|
|
83
84
|
return _loadSessionWrapper.apply(this, arguments);
|
|
84
85
|
}
|
|
85
86
|
function _loadSessionWrapper() {
|
|
86
|
-
_loadSessionWrapper = _asyncToGenerator(function* (connection, sessionDetails) {
|
|
87
|
+
_loadSessionWrapper = _asyncToGenerator(function* (dh, connection, sessionDetails) {
|
|
87
88
|
var sessionWrapper;
|
|
88
89
|
try {
|
|
89
|
-
sessionWrapper = yield createSessionWrapper(connection, sessionDetails);
|
|
90
|
+
sessionWrapper = yield createSessionWrapper(dh, connection, sessionDetails);
|
|
90
91
|
} catch (e) {
|
|
91
92
|
// Consoles may be disabled on the server, but we should still be able to start up and open existing objects
|
|
92
93
|
if (!isNoConsolesError(e)) {
|
package/dist/SessionUtils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionUtils.js","names":["requestParentResponse","SESSION_DETAILS_REQUEST","Log","shortid","NoConsolesError","isNoConsolesError","log","module","createConnection","dh","websocketUrl","info","IdeConnection","createSessionWrapper","connection","details","types","getConsoleTypes","length","type","session","startSession","config","id","generate","createCoreClient","options","CoreClient","isSessionDetails","obj","requestParentSessionDetails","response","Error","getSessionDetails","searchParams","URLSearchParams","window","location","search","get","loadSessionWrapper","sessionDetails","sessionWrapper","e"],"sources":["../src/SessionUtils.ts"],"sourcesContent":["import type {\n ConnectOptions,\n CoreClient,\n dh as DhType,\n IdeConnection,\n IdeSession,\n} from '@deephaven/jsapi-types';\nimport {\n requestParentResponse,\n SESSION_DETAILS_REQUEST,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport shortid from 'shortid';\nimport NoConsolesError, { isNoConsolesError } from './NoConsolesError';\n\nconst log = Log.module('SessionUtils');\n\nexport interface SessionConfig {\n type: string;\n id: string;\n}\n\nexport interface SessionDetails {\n workerName?: string;\n processInfoId?: string;\n}\n\nexport interface SessionWrapper {\n session: IdeSession;\n connection: IdeConnection;\n config: SessionConfig;\n details?: SessionDetails;\n}\n\n/**\n * @returns New connection to the server\n */\nexport function createConnection(\n dh: DhType,\n websocketUrl: string\n): IdeConnection {\n log.info(`Starting connection to '${websocketUrl}'...`);\n\n return new dh.IdeConnection(websocketUrl);\n}\n\n/**\n * Create a new session using the default URL\n * @returns A session and config that is ready to use\n */\nexport async function createSessionWrapper(\n connection: IdeConnection,\n details: SessionDetails\n): Promise<SessionWrapper> {\n log.info('Getting console types...');\n\n const types = await connection.getConsoleTypes();\n\n if (types.length === 0) {\n throw new NoConsolesError('No console types available');\n }\n\n log.info('Available types:', types);\n\n const type = types[0];\n\n log.info('Starting session with type', type);\n\n const session = await connection.startSession(type);\n\n const config = { type, id: shortid.generate() };\n\n log.info('Console session established', config);\n\n return {\n session,\n config,\n connection,\n details,\n };\n}\n\nexport function createCoreClient(\n dh: DhType,\n websocketUrl: string,\n options?: ConnectOptions\n): CoreClient {\n log.info('createCoreClient', websocketUrl);\n\n return new dh.CoreClient(websocketUrl, options);\n}\n\nfunction isSessionDetails(obj: unknown): obj is SessionDetails {\n return obj != null && typeof obj === 'object';\n}\n\nasync function requestParentSessionDetails(): Promise<SessionDetails> {\n const response = await requestParentResponse(SESSION_DETAILS_REQUEST);\n if (!isSessionDetails(response)) {\n throw new Error(`Unexpected session details response: ${response}`);\n }\n return response;\n}\n\nexport async function getSessionDetails(): Promise<SessionDetails> {\n const searchParams = new URLSearchParams(window.location.search);\n switch (searchParams.get('authProvider')) {\n case 'parent':\n return requestParentSessionDetails();\n }\n return {};\n}\n\nexport async function loadSessionWrapper(\n connection: IdeConnection,\n sessionDetails: SessionDetails\n): Promise<SessionWrapper | undefined> {\n let sessionWrapper: SessionWrapper | undefined;\n try {\n sessionWrapper = await createSessionWrapper(connection, sessionDetails);\n } catch (e) {\n // Consoles may be disabled on the server, but we should still be able to start up and open existing objects\n if (!isNoConsolesError(e)) {\n throw e;\n }\n }\n return sessionWrapper;\n}\n"],"mappings":";;AAOA,SACEA,qBAAqB,EACrBC,uBAAuB,QAClB,wBAAwB;AAC/B,OAAOC,GAAG,MAAM,gBAAgB;AAChC,OAAOC,OAAO,MAAM,SAAS;AAAC,OACvBC,eAAe,IAAIC,iBAAiB;AAE3C,IAAMC,GAAG,GAAGJ,GAAG,CAACK,MAAM,CAAC,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"SessionUtils.js","names":["requestParentResponse","SESSION_DETAILS_REQUEST","Log","shortid","NoConsolesError","isNoConsolesError","log","module","createConnection","dh","websocketUrl","info","IdeConnection","createSessionWrapper","connection","details","types","getConsoleTypes","length","type","session","startSession","config","id","generate","createCoreClient","options","CoreClient","isSessionDetails","obj","requestParentSessionDetails","response","Error","getSessionDetails","searchParams","URLSearchParams","window","location","search","get","loadSessionWrapper","sessionDetails","sessionWrapper","e"],"sources":["../src/SessionUtils.ts"],"sourcesContent":["import type {\n ConnectOptions,\n CoreClient,\n dh as DhType,\n IdeConnection,\n IdeSession,\n} from '@deephaven/jsapi-types';\nimport {\n requestParentResponse,\n SESSION_DETAILS_REQUEST,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport shortid from 'shortid';\nimport NoConsolesError, { isNoConsolesError } from './NoConsolesError';\n\nconst log = Log.module('SessionUtils');\n\nexport interface SessionConfig {\n type: string;\n id: string;\n}\n\nexport interface SessionDetails {\n workerName?: string;\n processInfoId?: string;\n}\n\nexport interface SessionWrapper {\n session: IdeSession;\n connection: IdeConnection;\n config: SessionConfig;\n details?: SessionDetails;\n dh: DhType;\n}\n\n/**\n * @returns New connection to the server\n */\nexport function createConnection(\n dh: DhType,\n websocketUrl: string\n): IdeConnection {\n log.info(`Starting connection to '${websocketUrl}'...`);\n\n return new dh.IdeConnection(websocketUrl);\n}\n\n/**\n * Create a new session using the default URL\n * @returns A session and config that is ready to use\n */\nexport async function createSessionWrapper(\n dh: DhType,\n connection: IdeConnection,\n details: SessionDetails\n): Promise<SessionWrapper> {\n log.info('Getting console types...');\n\n const types = await connection.getConsoleTypes();\n\n if (types.length === 0) {\n throw new NoConsolesError('No console types available');\n }\n\n log.info('Available types:', types);\n\n const type = types[0];\n\n log.info('Starting session with type', type);\n\n const session = await connection.startSession(type);\n\n const config = { type, id: shortid.generate() };\n\n log.info('Console session established', config);\n\n return {\n session,\n config,\n connection,\n details,\n dh,\n };\n}\n\nexport function createCoreClient(\n dh: DhType,\n websocketUrl: string,\n options?: ConnectOptions\n): CoreClient {\n log.info('createCoreClient', websocketUrl);\n\n return new dh.CoreClient(websocketUrl, options);\n}\n\nfunction isSessionDetails(obj: unknown): obj is SessionDetails {\n return obj != null && typeof obj === 'object';\n}\n\nasync function requestParentSessionDetails(): Promise<SessionDetails> {\n const response = await requestParentResponse(SESSION_DETAILS_REQUEST);\n if (!isSessionDetails(response)) {\n throw new Error(`Unexpected session details response: ${response}`);\n }\n return response;\n}\n\nexport async function getSessionDetails(): Promise<SessionDetails> {\n const searchParams = new URLSearchParams(window.location.search);\n switch (searchParams.get('authProvider')) {\n case 'parent':\n return requestParentSessionDetails();\n }\n return {};\n}\n\nexport async function loadSessionWrapper(\n dh: DhType,\n connection: IdeConnection,\n sessionDetails: SessionDetails\n): Promise<SessionWrapper | undefined> {\n let sessionWrapper: SessionWrapper | undefined;\n try {\n sessionWrapper = await createSessionWrapper(dh, connection, sessionDetails);\n } catch (e) {\n // Consoles may be disabled on the server, but we should still be able to start up and open existing objects\n if (!isNoConsolesError(e)) {\n throw e;\n }\n }\n return sessionWrapper;\n}\n"],"mappings":";;AAOA,SACEA,qBAAqB,EACrBC,uBAAuB,QAClB,wBAAwB;AAC/B,OAAOC,GAAG,MAAM,gBAAgB;AAChC,OAAOC,OAAO,MAAM,SAAS;AAAC,OACvBC,eAAe,IAAIC,iBAAiB;AAE3C,IAAMC,GAAG,GAAGJ,GAAG,CAACK,MAAM,CAAC,cAAc,CAAC;AAoBtC;AACA;AACA;AACA,OAAO,SAASC,gBAAgB,CAC9BC,EAAU,EACVC,YAAoB,EACL;EACfJ,GAAG,CAACK,IAAI,mCAA4BD,YAAY,UAAO;EAEvD,OAAO,IAAID,EAAE,CAACG,aAAa,CAACF,YAAY,CAAC;AAC3C;;AAEA;AACA;AACA;AACA;AACA,gBAAsBG,oBAAoB;EAAA;AAAA;AAgCzC;EAAA,0CAhCM,WACLJ,EAAU,EACVK,UAAyB,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AAyCD,QAAQ,EAAG;IACrE;IACA,OAAOA,QAAQ;EACjB,CAAC;EAAA;AAAA;AAED,gBAAsBE,iBAAiB;EAAA;AAAA;AAOtC;EAAA,uCAPM,aAA4D;IACjE,IAAMC,YAAY,GAAG,IAAIC,eAAe,CAACC,MAAM,CAACC,QAAQ,CAACC,MAAM,CAAC;IAChE,QAAQJ,YAAY,CAACK,GAAG,CAAC,cAAc,CAAC;MACtC,KAAK,QAAQ;QACX,OAAOT,2BAA2B,EAAE;IAAC;IAEzC,OAAO,CAAC,CAAC;EACX,CAAC;EAAA;AAAA;AAED,gBAAsBU,kBAAkB;EAAA;AAAA;AAevC;EAAA,wCAfM,WACL/B,EAAU,EACVK,UAAyB,EACzB2B,cAA8B,EACO;IACrC,IAAIC,cAA0C;IAC9C,IAAI;MACFA,cAAc,SAAS7B,oBAAoB,CAACJ,EAAE,EAAEK,UAAU,EAAE2B,cAAc,CAAC;IAC7E,CAAC,CAAC,OAAOE,CAAC,EAAE;MACV;MACA,IAAI,CAACtC,iBAAiB,CAACsC,CAAC,CAAC,EAAE;QACzB,MAAMA,CAAC;MACT;IACF;IACA,OAAOD,cAAc;EACvB,CAAC;EAAA;AAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven/jsapi-utils",
|
|
3
|
-
"version": "0.38.1-
|
|
3
|
+
"version": "0.38.1-deglobalized-jsapi.15+df192d73",
|
|
4
4
|
"description": "Deephaven JSAPI Utils",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -21,17 +21,17 @@
|
|
|
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.38.1-
|
|
25
|
-
"@deephaven/jsapi-types": "^0.38.1-
|
|
26
|
-
"@deephaven/log": "^0.38.1-
|
|
27
|
-
"@deephaven/utils": "^0.38.1-
|
|
24
|
+
"@deephaven/filters": "^0.38.1-deglobalized-jsapi.15+df192d73",
|
|
25
|
+
"@deephaven/jsapi-types": "^0.38.1-deglobalized-jsapi.15+df192d73",
|
|
26
|
+
"@deephaven/log": "^0.38.1-deglobalized-jsapi.15+df192d73",
|
|
27
|
+
"@deephaven/utils": "^0.38.1-deglobalized-jsapi.15+df192d73",
|
|
28
28
|
"@react-stately/data": "^3.9.1",
|
|
29
29
|
"lodash.clamp": "^4.0.3",
|
|
30
30
|
"shortid": "^2.2.16"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@deephaven/jsapi-shim": "^0.38.1-
|
|
34
|
-
"@deephaven/tsconfig": "^0.38.1-
|
|
33
|
+
"@deephaven/jsapi-shim": "^0.38.1-deglobalized-jsapi.15+df192d73",
|
|
34
|
+
"@deephaven/tsconfig": "^0.38.1-deglobalized-jsapi.15+df192d73"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"dist"
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "df192d73ab01ecfda333d5c599a0c3cea948af79"
|
|
44
44
|
}
|