@vuu-ui/vuu-protocol-types 0.5.14 → 0.5.16

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.
Files changed (2) hide show
  1. package/index.d.ts +505 -0
  2. package/package.json +1 -2
package/index.d.ts ADDED
@@ -0,0 +1,505 @@
1
+ // prettier-ignore
2
+ export declare type VuuColumnDataType = "int" | "long" | "double" | "string" | "char";
3
+ export declare type VuuMenuContext = "cell" | "row" | "grid" | "selected-rows";
4
+ export interface VuuMenuItem {
5
+ context: VuuMenuContext;
6
+ filter: string;
7
+ name: string;
8
+ rpcName: string;
9
+ }
10
+ export declare type VuuTable = {
11
+ table: string;
12
+ module: string;
13
+ };
14
+ export declare type VuuRange = {
15
+ from: number;
16
+ to: number;
17
+ };
18
+
19
+ export declare type VuuSortType = "A" | "D";
20
+
21
+ export declare type VuuSortCol = {
22
+ column: string;
23
+ sortType: VuuSortType;
24
+ };
25
+ export declare type VuuSort = {
26
+ sortDefs: VuuSortCol[];
27
+ };
28
+ export declare type VuuFilter = {
29
+ filter: string;
30
+ };
31
+ export interface VuuMenu {
32
+ name: string;
33
+ menus: VuuMenuItem[];
34
+ }
35
+
36
+ export type VuuRowDataItemType = string | number | boolean;
37
+
38
+ export type VuuDataRow = [number, number, ...data: VuuRowDataItemType[]];
39
+
40
+ export declare type VuuRow = {
41
+ data: VuuDataRow;
42
+ rowIndex: number;
43
+ rowKey: string;
44
+ sel: 0 | 1;
45
+ ts: number;
46
+ updateType: "U" | "D" | "SIZE";
47
+ viewPortId: string;
48
+ vpSize: number;
49
+ vpVersion: string;
50
+ };
51
+ export declare type AggTypeSum = 1;
52
+ export declare type AggTypeAverage = 2;
53
+ export declare type AggTypeCount = 3;
54
+ export declare type AggTypeHigh = 4;
55
+ export declare type AggTypeLow = 5;
56
+ export declare type VuuAggType =
57
+ | AggTypeSum
58
+ | AggTypeAverage
59
+ | AggTypeCount
60
+ | AggTypeHigh
61
+ | AggTypeLow;
62
+ export declare type VuuAggregation = {
63
+ column: string;
64
+ aggType: VuuAggType;
65
+ };
66
+ export declare type VuuLink = {
67
+ parentVpId: string;
68
+ link: {
69
+ fromColumn: string;
70
+ toTable: string;
71
+ toColumn: string;
72
+ };
73
+ };
74
+ export declare type VuuColumns = string[];
75
+ export declare type VuuGroupBy = string[];
76
+ export interface ServerToClientHeartBeat {
77
+ type: "HB";
78
+ ts: number;
79
+ }
80
+ export interface ServerToClientLoginSuccess {
81
+ type: "LOGIN_SUCCESS";
82
+ token: string;
83
+ }
84
+ export interface ServerToClientTableList {
85
+ type: "TABLE_LIST_RESP";
86
+ tables: VuuTable[];
87
+ }
88
+
89
+ export type VuuTableList = Pick<ServerToClientTableList, "tables">;
90
+
91
+ export interface ServerToClientTableMeta {
92
+ columns: VuuColumns;
93
+ dataTypes: VuuColumnDataType[];
94
+ type: "TABLE_META_RESP";
95
+ table: VuuTable;
96
+ }
97
+
98
+ export type VuuTableMeta = Pick<
99
+ ServerToClientTableMeta,
100
+ "columns" | "dataTypes" | "table"
101
+ >;
102
+
103
+ export interface ServerToClientMenus {
104
+ type: "VIEW_PORT_MENUS_RESP";
105
+ menu: VuuMenu;
106
+ vpId: string;
107
+ }
108
+ export interface ServerToClientMenu {
109
+ rpcName: "ADD_ROWS_TO_ORDERS";
110
+ type: "VIEW_PORT_MENU_RESP";
111
+ action: {
112
+ table: VuuTable;
113
+ type: "OPEN_DIALOG_ACTION";
114
+ };
115
+ vpId: string;
116
+ }
117
+ export interface ServerToClientViewPortVisualLinks {
118
+ type: "VP_VISUAL_LINKS_RESP";
119
+ links: VuuLink[];
120
+ vpId: string;
121
+ }
122
+ export interface ServerToClientCreateViewPortSuccess {
123
+ aggregations: VuuAggregation[];
124
+ columns: VuuColumns;
125
+ filterSpec: VuuFilter;
126
+ groupBy: VuuGroupBy;
127
+ range: VuuRange;
128
+ sort: VuuSort;
129
+ type: "CREATE_VP_SUCCESS";
130
+ table: string;
131
+ viewPortId: string;
132
+ }
133
+ export interface ServerToClientChangeViewPortSuccess {
134
+ type: "CHANGE_VP_SUCCESS";
135
+ viewPortId: string;
136
+ }
137
+ export interface ServerToClientChangeViewPortRangeSuccess {
138
+ type: "CHANGE_VP_RANGE_SUCCESS";
139
+ viewPortId: string;
140
+ from: number;
141
+ to: number;
142
+ }
143
+ export interface ServerToClientDisableViewPortSuccess {
144
+ type: "DISABLE_VP_SUCCESS";
145
+ viewPortId: string;
146
+ }
147
+ export interface ServerToClientEnableViewPortSuccess {
148
+ type: "ENABLE_VP_SUCCESS";
149
+ viewPortId: string;
150
+ }
151
+ export interface ServerToClientRemoveViewPortSuccess {
152
+ type: "REMOVE_VP_SUCCESS";
153
+ viewPortId: string;
154
+ }
155
+ export interface ServerToClientSelectSuccess {
156
+ type: "SET_SELECTION_SUCCESS";
157
+ vpId: string;
158
+ }
159
+ export interface ServerToClientRPC {
160
+ type: "RPC_RESP";
161
+ method: string;
162
+ result: any;
163
+ }
164
+ export interface ServerToClientOpenTreeNodeSuccess {
165
+ type: "OPEN_TREE_SUCCESS";
166
+ }
167
+ export interface ServerToClientCloseTreeNodeSuccess {
168
+ type: "CLOSE_TREE_SUCCESS";
169
+ }
170
+ export interface ServerToClientError {
171
+ msg: string;
172
+ type: "ERROR";
173
+ }
174
+ export interface ServerToClientCreateLinkSuccess {
175
+ childVpId: string;
176
+ childColumnName: string;
177
+ parentVpId: string;
178
+ parentColumnName: string;
179
+ type: "CREATE_VISUAL_LINK_SUCCESS";
180
+ }
181
+ export interface ServerToClientRemoveLinkSuccess {
182
+ childVpId: string;
183
+ type: "REMOVE_VISUAL_LINK_SUCCESS";
184
+ }
185
+ export interface ServerToClientTableRows {
186
+ batch: string;
187
+ isLast: boolean;
188
+ rows: VuuRow[];
189
+ timeStamp: number;
190
+ type: "TABLE_ROW";
191
+ }
192
+ export declare type ServerToClientBody =
193
+ | ServerToClientHeartBeat
194
+ | ServerToClientLoginSuccess
195
+ | ServerToClientCreateViewPortSuccess
196
+ | ServerToClientChangeViewPortSuccess
197
+ | ServerToClientChangeViewPortRangeSuccess
198
+ | ServerToClientDisableViewPortSuccess
199
+ | ServerToClientEnableViewPortSuccess
200
+ | ServerToClientRemoveViewPortSuccess
201
+ | ServerToClientSelectSuccess
202
+ | ServerToClientTableMeta
203
+ | ServerToClientTableList
204
+ | ServerToClientTableRows
205
+ | ServerToClientMenus
206
+ | ServerToClientMenu
207
+ | ServerToClientRPC
208
+ | ServerToClientViewPortVisualLinks
209
+ | ServerToClientOpenTreeNodeSuccess
210
+ | ServerToClientCloseTreeNodeSuccess
211
+ | ServerToClientCreateLinkSuccess
212
+ | ServerToClientRemoveLinkSuccess
213
+ | ServerToClientError;
214
+ export interface ServerToClientMessage<
215
+ TBody extends ServerToClientBody = ServerToClientBody
216
+ > {
217
+ body: TBody;
218
+ module: string;
219
+ requestId: string;
220
+ sessionId?: string;
221
+ token: string;
222
+ user: string;
223
+ }
224
+ export interface ClientToServerAuth {
225
+ type: "AUTH";
226
+ username: string;
227
+ password: string;
228
+ }
229
+ export interface ClientToServerLogin {
230
+ token: string;
231
+ type: "LOGIN";
232
+ user: string;
233
+ }
234
+ export interface ClientToServerHeartBeat {
235
+ type: "HB_RESP";
236
+ ts: number;
237
+ }
238
+ export interface ClientToServerDisable {
239
+ type: "DISABLE_VP";
240
+ viewPortId: string;
241
+ }
242
+ export interface ClientToServerEnable {
243
+ type: "ENABLE_VP";
244
+ viewPortId: string;
245
+ }
246
+ export interface ClientToServerTableList {
247
+ type: "GET_TABLE_LIST";
248
+ }
249
+ export interface ClientToServerTableMeta {
250
+ type: "GET_TABLE_META";
251
+ table: VuuTable;
252
+ }
253
+ export interface ClientToServerCreateViewPort {
254
+ columns: VuuColumns;
255
+ filterSpec: VuuFilter;
256
+ groupBy: string[];
257
+ type: "CREATE_VP";
258
+ range: VuuRange;
259
+ sort: VuuSort;
260
+ table: VuuTable;
261
+ }
262
+ export interface ClientToServerChangeViewPort {
263
+ aggregations: any[];
264
+ columns: VuuColumns;
265
+ filterSpec: VuuFilter;
266
+ groupBy: string[];
267
+ sort: VuuSort;
268
+ type: "CHANGE_VP";
269
+ viewPortId: string;
270
+ }
271
+ export interface ClientToServerRemoveViewPort {
272
+ type: "REMOVE_VP";
273
+ viewPortId: string;
274
+ }
275
+ export interface ClientToServerSelection {
276
+ type: "SET_SELECTION";
277
+ selection: number[];
278
+ vpId: string;
279
+ }
280
+ export interface ClientToServerViewPortRange {
281
+ from: number;
282
+ to: number;
283
+ type: "CHANGE_VP_RANGE";
284
+ viewPortId: string;
285
+ }
286
+ export interface ClientToServerVisualLinks {
287
+ type: "GET_VP_VISUAL_LINKS";
288
+ vpId: string;
289
+ }
290
+ export interface ClientToServerMenus {
291
+ type: "GET_VIEW_PORT_MENUS";
292
+ vpId: string;
293
+ }
294
+ export interface ClientToServerOpenTreeNode {
295
+ type: "OPEN_TREE_NODE";
296
+ vpId: string;
297
+ treeKey: string;
298
+ }
299
+ export interface ClientToServerCloseTreeNode {
300
+ type: "CLOSE_TREE_NODE";
301
+ vpId: string;
302
+ treeKey: string;
303
+ }
304
+ export interface ClientToServerCreateLink {
305
+ childVpId: string;
306
+ parentColumnName: string;
307
+ parentVpId: string;
308
+ type: "CREATE_VISUAL_LINK";
309
+ }
310
+ export interface ClientToServerRemoveLink {
311
+ childVpId: string;
312
+ type: "REMOVE_VISUAL_LINK";
313
+ }
314
+
315
+ export declare type RpcService = "TypeAheadRpcHandler" | "OrderEntryRpcHandler";
316
+
317
+ export declare type TypeaheadParams =
318
+ | [VuuTable, string]
319
+ | [VuuTable, string, string];
320
+
321
+ export declare type TypeAheadMethod =
322
+ | "getUniqueFieldValues"
323
+ | "getUniqueFieldValuesStartingWith";
324
+
325
+ export declare type RpcMethod = TypeAheadMethod | "addRowsFromInstruments";
326
+ export interface ClientToServerGetUniqueValues {
327
+ type: "RPC_CALL";
328
+ method: "getUniqueFieldValues";
329
+ service: "TypeAheadRpcHandler";
330
+ params: [VuuTable, string];
331
+ }
332
+ export interface ClientToServerGetUniqueValuesStartingWith {
333
+ type: "RPC_CALL";
334
+ method: "getUniqueFieldValuesStartingWith";
335
+ service: "TypeAheadRpcHandler";
336
+ params: [VuuTable, string, string];
337
+ }
338
+
339
+ export declare type VuuRpcRequest =
340
+ | ClientToServerGetUniqueValues
341
+ | ClientToServerGetUniqueValuesStartingWith;
342
+ // add remaining Rpc calls here
343
+
344
+ export interface ClientToServerMenuSelectRPC {
345
+ type: "VIEW_PORT_MENUS_SELECT_RPC";
346
+ rpcName: string;
347
+ vpId: string;
348
+ }
349
+ export interface ClientToServerMenuTableRPC {
350
+ type: "VIEW_PORT_MENU_TABLE_RPC";
351
+ rpcName: string;
352
+ vpId: string;
353
+ }
354
+ export interface ClientToServerMenuRowRPC {
355
+ type: "VIEW_PORT_MENU_ROW_RPC";
356
+ rpcName: string;
357
+ vpId: string;
358
+ }
359
+ export interface ClientToServerMenuCellRPC {
360
+ type: "VIEW_PORT_MENU_CELL_RPC";
361
+ rpcName: string;
362
+ vpId: string;
363
+ }
364
+
365
+ export type ClientToServerMenuRPCType =
366
+ | "VIEW_PORT_MENUS_SELECT_RPC"
367
+ | "VIEW_PORT_MENU_TABLE_RPC"
368
+ | "VIEW_PORT_MENU_ROW_RPC"
369
+ | "VIEW_PORT_MENU_CELL_RPC";
370
+
371
+ export type ClientToServerMenuRPC =
372
+ | ClientToServerMenuSelectRPC
373
+ | ClientToServerMenuTableRPC
374
+ | ClientToServerMenuRowRPC
375
+ | ClientToServerMenuCellRPC;
376
+
377
+ export declare type VuuRpcMessagesOut = ClientToServerMenuSelectRPC;
378
+ export declare type ClientToServerBody =
379
+ | ClientToServerAuth
380
+ | ClientToServerLogin
381
+ | ClientToServerHeartBeat
382
+ | ClientToServerDisable
383
+ | ClientToServerEnable
384
+ | ClientToServerTableList
385
+ | ClientToServerTableMeta
386
+ | ClientToServerCreateViewPort
387
+ | ClientToServerChangeViewPort
388
+ | ClientToServerRemoveViewPort
389
+ | ClientToServerSelection
390
+ | ClientToServerViewPortRange
391
+ | ClientToServerVisualLinks
392
+ | ClientToServerMenus
393
+ | ClientToServerOpenTreeNode
394
+ | ClientToServerCloseTreeNode
395
+ | ClientToServerCreateLink
396
+ | ClientToServerRemoveLink
397
+ | ClientToServerMenuRPC
398
+ | VuuRpcRequest
399
+ | VuuMenuRpcRequest;
400
+ export interface ClientToServerMessage<
401
+ TBody extends ClientToServerBody = ClientToServerBody
402
+ > {
403
+ body: TBody;
404
+ module: string;
405
+ requestId: string;
406
+ sessionId: string;
407
+ token: string;
408
+ user: string;
409
+ }
410
+
411
+ /** Menu RPC services */
412
+ export interface OpenDialogAction {
413
+ type: "OPEN_DIALOG_ACTION";
414
+ table: VuuTable;
415
+ }
416
+ export interface NoAction {
417
+ type: "NO_ACTION";
418
+ }
419
+
420
+ export declare type MenuRpcAction = OpenDialogAction | NoAction;
421
+ export interface VuuAddRowsToOrdersSelectMenuRpcRequest {
422
+ type: "VIEW_PORT_MENU_RESP";
423
+ rpcName: "ADD_ROWS_TO_ORDERS";
424
+ vpId: string;
425
+ }
426
+
427
+ export interface VuuAddRowsToOrdersSelectMenuRpcResponse {
428
+ action: OpenDialogAction;
429
+ rpcName: "ADD_ROWS_TO_ORDERS";
430
+ type: "VIEW_PORT_MENUS_SELECT_RPC";
431
+ vpId: string;
432
+ }
433
+
434
+ export interface VuuTestTableMenuRpcRequest {
435
+ type: "VIEW_PORT_MENU_TABLE_RPC";
436
+ rpcName: "TEST_TABLE";
437
+ vpId: string;
438
+ }
439
+
440
+ export interface VuuTestTableMenuRpcResponse {
441
+ action: NoAction;
442
+ rpcName: "TEST_TABLE";
443
+ type: "VIEW_PORT_MENU_RESP";
444
+ vpId: string;
445
+ }
446
+
447
+ export interface VuuTestSelectMenuRpcRequest {
448
+ type: "VIEW_PORT_MENUS_SELECT_RPC";
449
+ rpcName: "TEST_SELECT";
450
+ vpId: string;
451
+ }
452
+
453
+ export interface VuuTestSelectMenuRpcResponse {
454
+ action: OpenDialogAction;
455
+ rpcName: "TEST_SELECT";
456
+ type: "VIEW_PORT_MENU_RESP";
457
+ vpId: string;
458
+ }
459
+
460
+ // Should really be a table option rather than select option
461
+ export interface VuuTickSpeedSelectMenuRpcRequest {
462
+ type: "VIEW_PORT_MENUS_SELECT_RPC";
463
+ rpcName: "SET_SPEED_MED" | "SET_SPEED_SLOW" | "SET_SPEED_FAST";
464
+ vpId: string;
465
+ }
466
+
467
+ export interface VuuTickSpeedSelectMenuRpcResponse {
468
+ action: NoAction;
469
+ rpcName: "SET_SPEED_MED" | "SET_SPEED_SLOW" | "SET_SPEED_FAST";
470
+ type: "VIEW_PORT_MENU_RESP";
471
+ vpId: string;
472
+ }
473
+
474
+ export interface VuuTestRowMenuRpcRequest {
475
+ type: "VIEW_PORT_MENU_ROW_RPC";
476
+ rpcName: "TEST_ROW";
477
+ vpId: string;
478
+ }
479
+
480
+ export interface VuuTestRowMenuRpcResponse {
481
+ action: NoAction;
482
+ rpcName: "TEST_ROW";
483
+ type: "VIEW_PORT_MENU_RESP";
484
+ vpId: string;
485
+ }
486
+ export interface VuuTestCellMenuRpcRequest {
487
+ type: "VIEW_PORT_MENU_CELL_RPC";
488
+ rpcName: "TEST_CELL";
489
+ vpId: string;
490
+ }
491
+
492
+ export interface VuuTestCellMenuRpcResponse {
493
+ action: NoAction;
494
+ rpcName: "TEST_CELL";
495
+ type: "VIEW_PORT_MENU_RESP";
496
+ vpId: string;
497
+ }
498
+
499
+ export declare type VuuMenuRpcRequest =
500
+ | VuuAddRowsToOrdersSelectMenuRpcRequest
501
+ | VuuTestTableMenuRpcRequest
502
+ | VuuTestSelectMenuRpcRequest
503
+ | VuuTestRowMenuRpcRequest
504
+ | VuuTestCellMenuRpcRequest
505
+ | VuuTickSpeedSelectMenuRpcRequest;
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@vuu-ui/vuu-protocol-types",
3
- "version": "0.5.14",
3
+ "version": "0.5.16",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
6
6
  "dependencies": {},
7
7
  "peerDependencies": {},
8
8
  "files": [
9
- "cjs",
10
9
  "index.d.ts",
11
10
  "README.md"
12
11
  ],