@deephaven-enterprise/jsapi-types 1.20240723.536-alpha-npm-publish.23386 → 1.20250219.123-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deephaven-enterprise/jsapi-types",
3
- "version": "1.20240723.536-alpha-npm-publish.23386+75966764aa",
3
+ "version": "1.20250219.123-beta",
4
4
  "description": "Deephaven Enterprise Jsapi Types",
5
5
  "author": "Deephaven Data Labs LLC",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -17,10 +17,9 @@
17
17
  ],
18
18
  "sideEffects": false,
19
19
  "dependencies": {
20
- "@deephaven/jsapi-types": "^1.0.0-dev0.34.3"
20
+ "@deephaven/jsapi-types": "^1.0.0-dev0.36.1"
21
21
  },
22
22
  "publishConfig": {
23
23
  "access": "public"
24
- },
25
- "gitHead": "75966764aad5efa8cbcf8358c9034dc8c3572116"
24
+ }
26
25
  }
@@ -3,7 +3,7 @@ import type {
3
3
  ConsoleServerAddress,
4
4
  QueryConfigurationType,
5
5
  QueryConstants,
6
- } from './Iris';
6
+ } from './Iris.js';
7
7
 
8
8
  /** Copied from @deephaven/redux to avoid the dependency */
9
9
  export interface UserPermissions {
@@ -43,6 +43,12 @@ export interface EnterpriseUserPermissions extends UserPermissions {
43
43
  /** Not allowed to use the web UI at all */
44
44
  isNonInteractive: boolean;
45
45
 
46
+ /** Can manage queries */
47
+ isQueryManager: boolean;
48
+
49
+ /** Can manage schemas */
50
+ isSchemaManager: boolean;
51
+
46
52
  /** Can create new dashboards */
47
53
  canCreateDashboard: boolean;
48
54
 
@@ -63,6 +69,9 @@ export interface EnterpriseUserPermissions extends UserPermissions {
63
69
 
64
70
  /** Can view the list of users a query is shared with for a query they are a viewer of */
65
71
  canViewQuerySharedUsers: boolean;
72
+
73
+ /** Can logout */
74
+ canLogout: boolean;
66
75
  }
67
76
 
68
77
  export type EnterpriseUser = User & {
@@ -80,7 +89,7 @@ export type QueryVariableDescriptor = dh.ide.VariableDescriptor & {
80
89
  */
81
90
  export type LegacyQueryVariableDescriptor = {
82
91
  querySerial: string;
83
- query: string;
92
+ query?: string;
84
93
  };
85
94
 
86
95
  /** In some cases such as a console panel, we may not have a descriptor but still want to fetch the deferred API. */
package/types/Iris.d.ts CHANGED
@@ -1,13 +1,17 @@
1
+ /* eslint-disable max-classes-per-file */
1
2
  // The iris api script isn't packaged as a module (yet), and is just included in index.html, exported to the global namespace
2
3
  // This include file is simply a wrapper so that it behaves like a module, and can be mocked easily for unit tests.
3
4
  // https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#using-global-variables
4
5
  import type { dh as DhType } from '@deephaven/jsapi-types';
5
6
 
6
7
  import {
7
- Parameterized,
8
- ParameterizedQueryVariableType,
9
- } from './parameterizedQueryTypes';
10
- import { ControllerQueryConstants, WorkerKind } from './CommonTypes';
8
+ type Parameterized,
9
+ type ParameterizedQueryVariableType,
10
+ } from './parameterizedQueryTypes.js';
11
+ import {
12
+ type ControllerQueryConstants,
13
+ type WorkerKind,
14
+ } from './CommonTypes.js';
11
15
 
12
16
  export type CancelablePromise<T> = Promise<T> & { cancel: () => undefined };
13
17
 
@@ -60,6 +64,21 @@ export type BaseQueryInfo = {
60
64
  assignmentPolicyParams: string | null;
61
65
  };
62
66
 
67
+ /**
68
+ * Plain object representing a query configuration
69
+ * with properties matching {@link EditableQueryInfo}
70
+ * Used as input for the `saveQuery` and `createQuery` methods.
71
+ */
72
+ export type PlainEditableQueryInfo = BaseQueryInfo & {
73
+ scriptCode: string | null;
74
+ serial: string | null;
75
+
76
+ genericWorkerControl: string | null;
77
+ kubernetesControl: string | null;
78
+ pythonControl: string | null;
79
+ workerKind: string | null;
80
+ };
81
+
63
82
  export type BaseQueryInfoReadonly = Readonly<
64
83
  BaseQueryInfo & {
65
84
  /**
@@ -85,6 +104,9 @@ export type BaseQueryInfoReadonly = Readonly<
85
104
  */
86
105
  runningVersion: string;
87
106
  serial: string;
107
+ /**
108
+ * @deprecated use `designated.status` instead
109
+ */
88
110
  status: string;
89
111
  workerKind: string;
90
112
  }
@@ -95,9 +117,118 @@ export type TypeSpecificFields<T extends string = string> = Record<
95
117
  { value: unknown; type: string }
96
118
  >;
97
119
 
98
- export type EditableQueryInfo = BaseQueryInfo & {
99
- scriptCode: string;
100
- serial: string | null;
120
+ /**
121
+ * The EditableQueryInfo class uses getter and setter methods for accessing and modifying its properties.
122
+ * As a result, it cannot be directly used with the spread operator.
123
+ */
124
+ export declare class EditableQueryInfo implements PlainEditableQueryInfo {
125
+ get adminGroups(): readonly string[];
126
+
127
+ set adminGroups(value: readonly string[]);
128
+
129
+ get dataMemoryRatio(): number;
130
+
131
+ set dataMemoryRatio(value: number);
132
+
133
+ get dbServerName(): string;
134
+
135
+ set dbServerName(value: string);
136
+
137
+ get enabled(): boolean;
138
+
139
+ set enabled(value: boolean);
140
+
141
+ get enableGcLogs(): boolean;
142
+
143
+ set enableGcLogs(value: boolean);
144
+
145
+ get envVars(): string;
146
+
147
+ set envVars(value: string);
148
+
149
+ get extraClasspaths(): string;
150
+
151
+ set extraClasspaths(value: string);
152
+
153
+ get heapSize(): number;
154
+
155
+ set heapSize(value: number);
156
+
157
+ get additionalMemory(): number;
158
+
159
+ set additionalMemory(value: number);
160
+
161
+ get jvmArgs(): string;
162
+
163
+ set jvmArgs(value: string);
164
+
165
+ get jvmProfile(): string;
166
+
167
+ set jvmProfile(value: string);
168
+
169
+ get name(): string;
170
+
171
+ set name(value: string);
172
+
173
+ get owner(): string;
174
+
175
+ set owner(value: string);
176
+
177
+ get restartUsers(): number;
178
+
179
+ set restartUsers(value: number);
180
+
181
+ get scheduling(): readonly string[];
182
+
183
+ set scheduling(value: readonly string[]);
184
+
185
+ get scriptLanguage(): string | null;
186
+
187
+ set scriptLanguage(value: string | null);
188
+
189
+ get scriptPath(): string | null;
190
+
191
+ set scriptPath(value: string | null);
192
+
193
+ get timeout(): number;
194
+
195
+ set timeout(value: number);
196
+
197
+ get type(): string;
198
+
199
+ set type(value: string);
200
+
201
+ get typeSpecificFields(): TypeSpecificFields | null;
202
+
203
+ set typeSpecificFields(value: TypeSpecificFields | null);
204
+
205
+ get viewerGroups(): readonly string[];
206
+
207
+ set viewerGroups(value: readonly string[]);
208
+
209
+ get replicaCount(): number;
210
+
211
+ set replicaCount(value: number);
212
+
213
+ get spareCount(): number;
214
+
215
+ set spareCount(value: number);
216
+
217
+ get assignmentPolicy(): string | null;
218
+
219
+ set assignmentPolicy(value: string | null);
220
+
221
+ get assignmentPolicyParams(): string | null;
222
+
223
+ set assignmentPolicyParams(value: string | null);
224
+
225
+ get scriptCode(): string | null;
226
+
227
+ set scriptCode(value: string | null);
228
+
229
+ get serial(): string | null;
230
+
231
+ set serial(value: string | null);
101
232
 
102
233
  /**
103
234
  * Store the Kubernetes, Python, and Generic Worker Control values as string.
@@ -105,12 +236,22 @@ export type EditableQueryInfo = BaseQueryInfo & {
105
236
  * want to lose any parameters that may have been set on the server that the
106
237
  * Web UI doesn't know about.
107
238
  */
108
- kubernetesControl?: string | null;
109
- genericWorkerControl?: string | null;
110
- pythonControl?: string | null;
239
+ get kubernetesControl(): string | null;
111
240
 
112
- workerKind?: string | null;
113
- };
241
+ set kubernetesControl(value: string | null);
242
+
243
+ get genericWorkerControl(): string | null;
244
+
245
+ set genericWorkerControl(value: string | null);
246
+
247
+ get pythonControl(): string | null;
248
+
249
+ set pythonControl(value: string | null);
250
+
251
+ get workerKind(): string | null;
252
+
253
+ set workerKind(value: string | null);
254
+ }
114
255
 
115
256
  export interface ReplicaStatus {
116
257
  objects: readonly DhType.ide.VariableDefinition[];
@@ -129,8 +270,19 @@ export interface ReplicaStatus {
129
270
  websocketPort: number | null;
130
271
  workerPort: number | null;
131
272
  initStartTime: DhType.DateWrapper | null;
273
+ dispatcherHost: string | null;
274
+ dispatcherPort: number | null;
132
275
  processInfoId: string | null;
133
- createWorkspaceData(data: { id?: string; data: string }): Promise<string>;
276
+ createWorkspaceData(data: {
277
+ id?: string;
278
+ data: string;
279
+ version?: number;
280
+ }): Promise<string>;
281
+ saveWorkspaceData(data: {
282
+ id?: string;
283
+ data: string;
284
+ version?: number;
285
+ }): Promise<void>;
134
286
  getObject(
135
287
  object: DhType.ide.VariableDescriptor
136
288
  ): Promise<DhType.ide.VariableDefinition>;
@@ -280,6 +432,13 @@ export interface QuerySelectionPermissions {
280
432
  allAdmin: boolean;
281
433
  allOwner: boolean;
282
434
  allRestartable: boolean;
435
+ allStoppable: boolean;
436
+ allStopped: boolean;
437
+ allDisabled: boolean;
438
+ allEnabled: boolean;
439
+ allTemporary: boolean;
440
+ allImportMerge: boolean;
441
+ readOnlyUser: boolean;
283
442
  }
284
443
 
285
444
  export interface ClientListenerEvent<TDetail = unknown> {
@@ -301,6 +460,8 @@ export interface AssignmentPolicyType {
301
460
 
302
461
  export type AssignmentPolicyTypes = Map<string, AssignmentPolicyType>;
303
462
 
463
+ export type RefreshToken = DhType.RefreshToken;
464
+
304
465
  export interface EnterpriseClient {
305
466
  /**
306
467
  * Get available assignment policy types.
@@ -318,28 +479,26 @@ export interface EnterpriseClient {
318
479
  type: string,
319
480
  listener: (event: CustomEvent) => void
320
481
  ): () => void;
321
- removeEventListener(
482
+ removeEventListener<T>(
322
483
  type: string,
323
- listener: (event: ClientListenerEvent) => void
484
+ listener: (event: ClientListenerEvent<T>) => void
324
485
  ): void;
325
- disconnect(): void;
326
- getDispatcher(
327
- serverGroup: string,
328
- heapSizeMB: number,
329
- engine: string
330
- ): Promise<ConsoleServerAddress>;
331
- saveQuery(query: EditableQueryInfo, doRestart: boolean): Promise<void>;
332
- createQuery(query: EditableQueryInfo): Promise<string>;
486
+ disconnect(fireEvents?: boolean): void;
487
+ saveQuery(query: PlainEditableQueryInfo, doRestart: boolean): Promise<void>;
488
+ createQuery(query: PlainEditableQueryInfo): Promise<string>;
333
489
  createAuthToken(key: string): Promise<string>;
334
490
  /** Imports the XML string as queries, and returns the query info. Does _not_ actually create them, use `saveQueries()` to save them. */
335
491
  importQueries: (xml: string) => Promise<QueryInfo[]>;
336
492
  /** Returns a string containing the XML of all queries specified */
337
493
  exportQueries: (serialIds: string[]) => Promise<string>;
338
- relogin(token: unknown): Promise<void>;
494
+ relogin(token: RefreshToken): Promise<void>;
339
495
  getAllGroups(): Promise<string[]>;
340
496
  getAllUsers(): Promise<string[]>;
341
497
  getTemporaryQueueNames(): Promise<string[]>;
342
498
  getScriptPaths(serialId: string | null, owner?: string): Promise<string[]>;
499
+ /**
500
+ * @deprecated
501
+ */
343
502
  getQuerySerialsForDependent(isTemporary: boolean): Promise<string[]>;
344
503
  getDbServersForType(type: string): Promise<ConsoleServerAddress[]>;
345
504
  getJdbcDriverWrappers(): Promise<DriverWrapper[]>;
@@ -350,7 +509,7 @@ export interface EnterpriseClient {
350
509
  * @param replaceExisting Whether to replace existing queries or create new ones. If a serial is specified on a query and it is saved and `replaceExisting` is false, it will throw an error if a query with that serial already exists.
351
510
  */
352
511
  saveQueries: (
353
- queries: readonly EditableQueryInfo[],
512
+ queries: readonly PlainEditableQueryInfo[],
354
513
  replaceExisting: boolean
355
514
  ) => Promise<SaveQueriesResult>;
356
515
  getAuthConfigValues(): Promise<string[][]>;
@@ -379,6 +538,38 @@ export interface EnterpriseClient {
379
538
  table: string,
380
539
  type: ImportSourceTypeOption
381
540
  ): Promise<string[]>;
541
+
542
+ /**
543
+ * Authenticate a user using a signed nonce + public key.
544
+ * @param base64SignedNonce Nonce returned by `getChallengeNonce` and signed
545
+ * with a private key.
546
+ * @param publicKeyWithSentinel Public key corresponding to the private key
547
+ * used to sign the nonce. Includes a sentinel prefix that identifies the
548
+ * algorithm used to generate the keypair.
549
+ * @param username Username to authenticate as.
550
+ * @param operateAs Optional username to operate as. Defaults to `username`.
551
+ * @returns null if successful. Throws if authentication fails.
552
+ */
553
+ challengeResponse: (
554
+ base64SignedNonce: string,
555
+ publicKeyWithSentinel: string,
556
+ username: string,
557
+ operateAs: string
558
+ ) => Promise<null>;
559
+
560
+ /** True if the client is currently connected */
561
+ readonly isConnected: boolean;
562
+
563
+ /**
564
+ * Get a Base64 encoded challenge nonce for that can be signed and passed to
565
+ * `challengeResponse()` for private / public key authentication.
566
+ */
567
+ getChallengeNonce(): Promise<ChallengeNonce>;
568
+ }
569
+
570
+ export interface ChallengeNonce {
571
+ algorithm: 'SHA256withDSA';
572
+ nonce: string;
382
573
  }
383
574
 
384
575
  export interface LoginCredentials {
@@ -413,27 +604,17 @@ export interface EnterpriseClientConstructor {
413
604
  new (websocketUrl: string): EnterpriseClient;
414
605
  }
415
606
 
607
+ /**
608
+ * @deprecated should be replaced with `EditableQueryInfo`
609
+ */
416
610
  export interface ConsoleConfigConstructor {
417
611
  new (): ConsoleConfig;
418
612
  }
419
613
 
420
- export interface DhcConnectionDetails {
421
- readonly envoyPrefix: string | null;
422
- readonly grpcUrl: string;
423
- readonly ideUrl: string;
424
- readonly jsApiUrl: string;
425
- readonly serviceId: string;
426
- readonly processInfoId: string;
427
- readonly workerName: string;
428
-
429
- close(): void;
430
- addEventListener: (
431
- name: string,
432
- callback: (event: CustomEvent) => void
433
- ) => () => void;
434
- removeEventListener(type: string, listener: () => void): void;
435
- }
436
-
614
+ /**
615
+ * @deprecated use the `EditableQueryInfo` going forward, which can be used to represent the PersistentQuery backing a
616
+ * Code Studio without an intermediate stage
617
+ */
437
618
  export interface ConsoleConfig {
438
619
  dispatcherHost?: string;
439
620
  dispatcherPort?: number;
@@ -455,8 +636,7 @@ export interface IdeConstructor {
455
636
  }
456
637
 
457
638
  export interface Ide {
458
- createConsole(config: ConsoleConfig): CancelablePromise<IdeConnection>;
459
- startWorker(config: ConsoleConfig): CancelablePromise<DhcConnectionDetails>;
639
+ getQueryConnection(queryInfo: QueryInfo): Promise<IdeConnection>;
460
640
  }
461
641
 
462
642
  export type ConsoleServerAddressType = {
@@ -536,6 +716,15 @@ export interface ServerConfigValues {
536
716
  kubernetes: boolean;
537
717
  webgl: boolean;
538
718
  webglEditable: boolean;
719
+ gridDensity: 'compact' | 'regular' | 'spacious';
720
+ gridDensityEditable: boolean;
721
+ ruffSettings: Record<string, unknown> | null;
722
+ ruffEnabled: boolean;
723
+ ruffEditable: boolean;
724
+ showEmptyStrings: boolean;
725
+ showEmptyStringsEditable: boolean;
726
+ showNullStrings: boolean;
727
+ showNullStringsEditable: boolean;
539
728
  }
540
729
 
541
730
  export interface ApplyParametersResult {
@@ -583,6 +772,9 @@ export type EnterpriseDhType = typeof DhType & {
583
772
  VariableType: typeof VariableType;
584
773
  ConsoleServerAddress: ConsoleServerAddress;
585
774
  Ide: IdeConstructor;
775
+ /**
776
+ * @deprecated instead of washing the Code Studio configuration through an old object, directly use an `EditableQueryInfo`
777
+ */
586
778
  ConsoleConfig: ConsoleConfigConstructor;
587
779
  QueryInfo: QueryInfoStatic;
588
780
  ImportSourceType: typeof ImportSourceType;
package/types/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './CommonTypes';
2
- export * from './parameterizedQueryTypes';
3
- export * from './CommonTypes';
4
- export * from './Iris';
1
+ export * from './CommonTypes.js';
2
+ export * from './parameterizedQueryTypes.js';
3
+ export * from './CommonTypes.js';
4
+ export * from './Iris.js';