@deephaven-enterprise/query-utils 1.20250801.264-beta → 1.20250801.266-beta
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/DraftQuery.d.ts +12 -11
- package/dist/DraftQuery.js +41 -35
- package/package.json +2 -2
package/dist/DraftQuery.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { EditableQueryInfo, TypeSpecificFields } from '@deephaven-enterprise/jsapi-types';
|
|
1
|
+
import type { EditableQueryInfo, PlainEditableQueryInfo, TypeSpecificFields } from '@deephaven-enterprise/jsapi-types';
|
|
2
2
|
import QueryScheduler from './QueryScheduler';
|
|
3
3
|
export type ScriptDraftQuery = IDraftQuery & {
|
|
4
4
|
scriptLanguage: string;
|
|
@@ -10,7 +10,7 @@ export type ScriptDraftQuery = IDraftQuery & {
|
|
|
10
10
|
* it causes issues upstream where `Record<string, unknown>` generics are expected.
|
|
11
11
|
* e.g. `WorkspaceStorageItem<IDraftQuery>`
|
|
12
12
|
*/
|
|
13
|
-
export type IDraftQuery =
|
|
13
|
+
export type IDraftQuery = PlainEditableQueryInfo & {
|
|
14
14
|
isClientSide: boolean;
|
|
15
15
|
draftOwner: string;
|
|
16
16
|
initializationThreads?: string;
|
|
@@ -96,23 +96,23 @@ export declare class DraftQuery implements IDraftQuery {
|
|
|
96
96
|
dbServerName: string;
|
|
97
97
|
scriptLanguage: string | null;
|
|
98
98
|
scriptPath: string | null;
|
|
99
|
-
scriptCode: string;
|
|
99
|
+
scriptCode: string | null;
|
|
100
100
|
scheduling: readonly string[];
|
|
101
101
|
adminGroups: readonly string[];
|
|
102
102
|
viewerGroups: readonly string[];
|
|
103
103
|
restartUsers: number;
|
|
104
104
|
timeout: number;
|
|
105
105
|
scheduler: QueryScheduler;
|
|
106
|
-
kubernetesControl
|
|
107
|
-
pythonControl
|
|
108
|
-
genericWorkerControl
|
|
106
|
+
kubernetesControl: string | null;
|
|
107
|
+
pythonControl: string | null;
|
|
108
|
+
genericWorkerControl: string | null;
|
|
109
109
|
/**
|
|
110
110
|
* Should be the name (not title) of the workerKind
|
|
111
111
|
* The server gives null if it should be the default
|
|
112
112
|
* Not sure if the value will be set if the PQ is from pre-vermilion and the customer upgrades
|
|
113
113
|
* Treat both null and undefined as server default (not necessarily 1st option in the UI)
|
|
114
114
|
*/
|
|
115
|
-
workerKind: string | null
|
|
115
|
+
workerKind: string | null;
|
|
116
116
|
typeSpecificFields: TypeSpecificFields | null;
|
|
117
117
|
replicaCount: number;
|
|
118
118
|
spareCount: number;
|
|
@@ -139,7 +139,7 @@ export declare class DraftQuery implements IDraftQuery {
|
|
|
139
139
|
*
|
|
140
140
|
* @param editableQuery the Editable Query from the Server
|
|
141
141
|
*/
|
|
142
|
-
saveDraftToQuery(editableQuery: Partial<
|
|
142
|
+
saveDraftToQuery<T extends EditableQueryInfo>(editableQuery: Partial<T> & Pick<T, 'serial'>): T;
|
|
143
143
|
/**
|
|
144
144
|
* Updates the JVM args to include the thread count for initialization and update threads.
|
|
145
145
|
* It is safe to call from saveDraftToQuery because the the thead counts will be set to
|
|
@@ -148,9 +148,10 @@ export declare class DraftQuery implements IDraftQuery {
|
|
|
148
148
|
* manually in that case.
|
|
149
149
|
*/
|
|
150
150
|
addThreadCountToJVMArgs(): void;
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
151
|
+
/**
|
|
152
|
+
* Get a PlainEditableQueryInfo object populated from this DraftQuery
|
|
153
|
+
*/
|
|
154
|
+
toEditableQueryInfo(): PlainEditableQueryInfo;
|
|
154
155
|
toRowMap(queryTypes: Map<string, string>): Map<string, string>;
|
|
155
156
|
formatIdForSerialColumn(): string;
|
|
156
157
|
}
|
package/dist/DraftQuery.js
CHANGED
|
@@ -26,7 +26,7 @@ export class DraftQuery {
|
|
|
26
26
|
// Remove the 'Draft ID: ' marking
|
|
27
27
|
return serial === null || serial === void 0 ? void 0 : serial.substring(DRAFT_SERIAL_PREFIX.length);
|
|
28
28
|
}
|
|
29
|
-
constructor({ isClientSide = false, draftOwner, serial = DraftQuery.NO_SERIAL, name, owner, type = QueryType.SCRIPT, enabled = true, enableGcLogs = true, envVars = '', heapSize = 4.0, additionalMemory = 0.0, dataMemoryRatio = 0.25, jvmArgs = '', extraClasspaths = '', jvmProfile = 'Default', dbServerName, scriptLanguage = 'Groovy', scriptPath = null, scriptCode = '', scheduling, adminGroups = [], viewerGroups = [], restartUsers = DraftQuery.RESTART_MODE.ADMIN, timeout = 0, workerKind, kubernetesControl, pythonControl, genericWorkerControl, typeSpecificFields = null, replicaCount = 1, spareCount = 0, assignmentPolicy = null, assignmentPolicyParams = null, initializationThreads = undefined, updateThreads = undefined, }) {
|
|
29
|
+
constructor({ isClientSide = false, draftOwner, serial = DraftQuery.NO_SERIAL, name, owner, type = QueryType.SCRIPT, enabled = true, enableGcLogs = true, envVars = '', heapSize = 4.0, additionalMemory = 0.0, dataMemoryRatio = 0.25, jvmArgs = '', extraClasspaths = '', jvmProfile = 'Default', dbServerName, scriptLanguage = 'Groovy', scriptPath = null, scriptCode = '', scheduling, adminGroups = [], viewerGroups = [], restartUsers = DraftQuery.RESTART_MODE.ADMIN, timeout = 0, workerKind = null, kubernetesControl = null, pythonControl = null, genericWorkerControl = null, typeSpecificFields = null, replicaCount = 1, spareCount = 0, assignmentPolicy = null, assignmentPolicyParams = null, initializationThreads = undefined, updateThreads = undefined, }) {
|
|
30
30
|
this.scheduling = [];
|
|
31
31
|
// Meta Data
|
|
32
32
|
this.id = shortid.generate();
|
|
@@ -105,38 +105,43 @@ export class DraftQuery {
|
|
|
105
105
|
* @param editableQuery the Editable Query from the Server
|
|
106
106
|
*/
|
|
107
107
|
saveDraftToQuery(editableQuery) {
|
|
108
|
-
var _a, _b;
|
|
109
108
|
this.addThreadCountToJVMArgs();
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
109
|
+
// Type check to make sure none of the required fields are missing
|
|
110
|
+
const completeQuery = {
|
|
111
|
+
serial: editableQuery.serial,
|
|
112
|
+
name: this.name,
|
|
113
|
+
owner: this.owner,
|
|
114
|
+
type: this.type,
|
|
115
|
+
enabled: this.enabled,
|
|
116
|
+
enableGcLogs: this.enableGcLogs,
|
|
117
|
+
envVars: this.envVars,
|
|
118
|
+
heapSize: this.heapSize,
|
|
119
|
+
dataMemoryRatio: this.dataMemoryRatio,
|
|
120
|
+
additionalMemory: this.additionalMemory,
|
|
121
|
+
jvmArgs: this.jvmArgs,
|
|
122
|
+
extraClasspaths: this.extraClasspaths,
|
|
123
|
+
jvmProfile: this.jvmProfile,
|
|
124
|
+
dbServerName: this.dbServerName,
|
|
125
|
+
scriptLanguage: this.scriptLanguage,
|
|
126
|
+
scriptPath: this.scriptPath,
|
|
127
|
+
scriptCode: this.scriptCode,
|
|
128
|
+
scheduling: this.scheduler.toStringArray(),
|
|
129
|
+
adminGroups: [...this.adminGroups],
|
|
130
|
+
viewerGroups: this.viewerGroups,
|
|
131
|
+
restartUsers: this.restartUsers,
|
|
132
|
+
timeout: this.timeout,
|
|
133
|
+
workerKind: this.workerKind,
|
|
134
|
+
kubernetesControl: this.kubernetesControl,
|
|
135
|
+
pythonControl: this.pythonControl,
|
|
136
|
+
genericWorkerControl: this.genericWorkerControl,
|
|
137
|
+
typeSpecificFields: this.typeSpecificFields,
|
|
138
|
+
replicaCount: this.replicaCount,
|
|
139
|
+
spareCount: this.spareCount,
|
|
140
|
+
assignmentPolicy: this.assignmentPolicy,
|
|
141
|
+
assignmentPolicyParams: this.assignmentPolicyParams,
|
|
142
|
+
};
|
|
143
|
+
Object.assign(editableQuery, completeQuery);
|
|
144
|
+
return editableQuery;
|
|
140
145
|
}
|
|
141
146
|
/**
|
|
142
147
|
* Updates the JVM args to include the thread count for initialization and update threads.
|
|
@@ -149,10 +154,11 @@ export class DraftQuery {
|
|
|
149
154
|
const { initializationThreads, updateThreads } = this;
|
|
150
155
|
this.jvmArgs = WorkerThreadUtils.addArgs(this.jvmArgs, initializationThreads, updateThreads);
|
|
151
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Get a PlainEditableQueryInfo object populated from this DraftQuery
|
|
159
|
+
*/
|
|
152
160
|
toEditableQueryInfo() {
|
|
153
|
-
|
|
154
|
-
this.saveDraftToQuery(editableQuery);
|
|
155
|
-
return editableQuery;
|
|
161
|
+
return this.saveDraftToQuery({ serial: this.serial });
|
|
156
162
|
}
|
|
157
163
|
toRowMap(queryTypes) {
|
|
158
164
|
var _a, _b, _c, _d, _e, _f;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deephaven-enterprise/query-utils",
|
|
3
|
-
"version": "1.20250801.
|
|
3
|
+
"version": "1.20250801.266-beta",
|
|
4
4
|
"description": "Deephaven Enterprise Query Utils",
|
|
5
5
|
"author": "Deephaven Data Labs LLC",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -29,5 +29,5 @@
|
|
|
29
29
|
"publishConfig": {
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
|
-
"gitHead": "
|
|
32
|
+
"gitHead": "a0b6108c8cfdda6363d2cdefc6933f1181cc1ff9"
|
|
33
33
|
}
|