@vuu-ui/vuu-protocol-types 0.8.84 → 0.8.85

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 +186 -125
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -4,8 +4,8 @@
4
4
  * All messages, in both directions (client to server and server to client) carry
5
5
  * a set of common properties. All variation is found within the message.body.
6
6
  */
7
- export interface VuuClientToServerMessage<
8
- TBody extends ClientToServerBody = ClientToServerBody
7
+ export interface VuuClientMessage<
8
+ TBody extends ClientMessageBody = ClientMessageBody,
9
9
  > {
10
10
  body: TBody;
11
11
  module: string;
@@ -15,8 +15,8 @@ export interface VuuClientToServerMessage<
15
15
  user: string;
16
16
  }
17
17
 
18
- export interface VuuServerToClientMessage<
19
- TBody extends ServerToClientBody = ServerToClientBody
18
+ export interface VuuServerMessage<
19
+ TBody extends ServerMessageBody = ServerMessageBody,
20
20
  > {
21
21
  body: TBody;
22
22
  module: string;
@@ -40,44 +40,44 @@ export interface VuuServerToClientMessage<
40
40
  * account existing active subscriptions within the users session
41
41
  * and can therefore change from one call to another.
42
42
  */
43
- export interface ClientToServerTableList {
43
+ export interface VuuTableListRequest {
44
44
  type: "GET_TABLE_LIST";
45
45
  }
46
46
 
47
- export interface ServerToClientTableList {
47
+ export interface VuuTableListResponse {
48
48
  type: "TABLE_LIST_RESP";
49
49
  tables: VuuTable[];
50
50
  }
51
51
 
52
- export interface ClientToServerTableMeta {
52
+ export interface VuuTableMetaRequest {
53
53
  type: "GET_TABLE_META";
54
54
  table: VuuTable;
55
55
  }
56
56
 
57
- export interface ServerToClientTableMeta {
57
+ export interface VuuTableMetaResponse {
58
58
  columns: VuuColumns;
59
59
  dataTypes: VuuColumnDataType[];
60
60
  key: string;
61
61
  table: VuuTable;
62
62
  type: "TABLE_META_RESP";
63
63
  }
64
- export interface ClientToServerMenus {
64
+ export interface VuuViewportMenusRequest {
65
65
  type: "GET_VIEW_PORT_MENUS";
66
66
  vpId: string;
67
67
  }
68
68
 
69
- export interface ServerToClientMenus {
69
+ export interface VuuViewportMenusResponse {
70
70
  type: "VIEW_PORT_MENUS_RESP";
71
71
  menu: VuuMenu;
72
72
  vpId: string;
73
73
  }
74
74
 
75
- export interface ClientToServerVisualLinks {
75
+ export interface VuuViewportVisualLinksRequest {
76
76
  type: "GET_VP_VISUAL_LINKS";
77
77
  vpId: string;
78
78
  }
79
79
 
80
- export interface ServerToClientViewPortVisualLinks {
80
+ export interface VuuViewportVisualLinksResponse {
81
81
  type: "VP_VISUAL_LINKS_RESP";
82
82
  links: VuuLinkDescriptor[];
83
83
  vpId: string;
@@ -87,7 +87,18 @@ export interface ServerToClientViewPortVisualLinks {
87
87
  * Viewport manipulation messages
88
88
  *
89
89
  */
90
- export interface ServerToClientCreateViewPortSuccess {
90
+
91
+ export interface VuuViewportCreateRequest {
92
+ columns: VuuColumns;
93
+ filterSpec: VuuFilter;
94
+ groupBy: string[];
95
+ type: "CREATE_VP";
96
+ range: VuuRange;
97
+ sort: VuuSort;
98
+ table: VuuTable;
99
+ }
100
+
101
+ export interface VuuViewportCreateResponse {
91
102
  aggregations: VuuAggregation[];
92
103
  columns: VuuColumns;
93
104
  filterSpec: VuuFilter;
@@ -98,7 +109,17 @@ export interface ServerToClientCreateViewPortSuccess {
98
109
  table: string;
99
110
  viewPortId: string;
100
111
  }
101
- export interface ServerToClientChangeViewPortSuccess {
112
+ export interface VuuViewportChangeRequest {
113
+ aggregations: VuuAggregation[];
114
+ columns: VuuColumns;
115
+ filterSpec: VuuFilter;
116
+ groupBy: string[];
117
+ sort: VuuSort;
118
+ type: "CHANGE_VP";
119
+ viewPortId: string;
120
+ }
121
+
122
+ export interface VuuViewportChangeResponse {
102
123
  aggregations: VuuAggregation[];
103
124
  columns: VuuColumns;
104
125
  filterSpec: VuuFilter;
@@ -108,7 +129,7 @@ export interface ServerToClientChangeViewPortSuccess {
108
129
  viewPortId: string;
109
130
  }
110
131
 
111
- export interface ServerToClientChangeViewPortRangeSuccess {
132
+ export interface VuuViewportRangeRequest {
112
133
  type: "CHANGE_VP_RANGE_SUCCESS";
113
134
  viewPortId: string;
114
135
  from: number;
@@ -131,18 +152,6 @@ export interface ServerToClientSelectSuccess {
131
152
  vpId: string;
132
153
  }
133
154
 
134
- export interface ServerToClientEditRPC {
135
- action: unknown;
136
- type: "VP_EDIT_RPC_RESPONSE";
137
- rpcName: string;
138
- vpId: string;
139
- }
140
- export interface ServerToClientEditRPCRejected {
141
- error: string;
142
- rpcName: string;
143
- type: "VP_EDIT_RPC_REJECT";
144
- vpId: string;
145
- }
146
155
  export interface ServerToClientOpenTreeNodeSuccess {
147
156
  type: "OPEN_TREE_SUCCESS";
148
157
  }
@@ -171,34 +180,34 @@ export interface ServerToClientTableRows {
171
180
  timeStamp: number;
172
181
  type: "TABLE_ROW";
173
182
  }
174
- export declare type ServerToClientBody =
183
+ export declare type ServerMessageBody =
175
184
  | ServerToClientHeartBeat
176
185
  | ServerToClientLoginSuccess
177
- | ServerToClientCreateViewPortSuccess
178
- | ServerToClientChangeViewPortSuccess
179
- | ServerToClientChangeViewPortRangeSuccess
186
+ | VuuViewportCreateResponse
187
+ | VuuViewportChangeResponse
188
+ | VuuViewportRangeRequest
180
189
  | ServerToClientDisableViewPortSuccess
181
190
  | ServerToClientEnableViewPortSuccess
182
191
  | ServerToClientRemoveViewPortSuccess
183
192
  | ServerToClientSelectSuccess
184
- | ServerToClientTableMeta
185
- | ServerToClientTableList
193
+ | VuuTableMetaResponse
194
+ | VuuTableListResponse
186
195
  | ServerToClientTableRows
187
- | ServerToClientMenus
188
- | ServerToClientMenuResponse
189
- | ServerToClientMenuReject
196
+ | VuuViewportMenusResponse
197
+ | VuuRpcMenuSuccess
198
+ | VuuRpcMenuError
190
199
  | ServerToClientMenuSessionTableAction
191
- | ServerToClientRPC
192
- | ServerToClientViewportRpcResponse
193
- | ServerToClientViewPortVisualLinks
200
+ | VuuRpcServiceResponse
201
+ | VuuRpcViewportResponse
202
+ | VuuViewportVisualLinksResponse
194
203
  | ServerToClientOpenTreeNodeSuccess
195
204
  | ServerToClientCloseTreeNodeSuccess
196
205
  | ServerToClientCreateLinkSuccess
197
206
  | ServerToClientRemoveLinkSuccess
198
207
  | ServerToClientError
199
- | ServerToClientEditRPC
200
- | ServerToClientEditRPC
201
- | ServerToClientEditRPCRejected;
208
+ | VuuRpcEditSuccess
209
+ | VuuRpcEditSuccess
210
+ | VuuRpcEditError;
202
211
  export interface ClientToServerAuth {
203
212
  type: "AUTH";
204
213
  username: string;
@@ -221,24 +230,6 @@ export interface ClientToServerEnable {
221
230
  type: "ENABLE_VP";
222
231
  viewPortId: string;
223
232
  }
224
- export interface ClientToServerCreateViewPort {
225
- columns: VuuColumns;
226
- filterSpec: VuuFilter;
227
- groupBy: string[];
228
- type: "CREATE_VP";
229
- range: VuuRange;
230
- sort: VuuSort;
231
- table: VuuTable;
232
- }
233
- export interface ClientToServerChangeViewPort {
234
- aggregations: VuuAggregation[];
235
- columns: VuuColumns;
236
- filterSpec: VuuFilter;
237
- groupBy: string[];
238
- sort: VuuSort;
239
- type: "CHANGE_VP";
240
- viewPortId: string;
241
- }
242
233
  export interface ClientToServerRemoveViewPort {
243
234
  type: "REMOVE_VP";
244
235
  viewPortId: string;
@@ -287,40 +278,7 @@ export declare type TypeAheadMethod =
287
278
 
288
279
  export declare type RpcMethod = TypeAheadMethod | "addRowsFromInstruments";
289
280
 
290
- export interface ClientToServerEditCellRpc {
291
- rowKey: string;
292
- type: "VP_EDIT_CELL_RPC";
293
- field: string;
294
- value: VuuRowDataItemType;
295
- }
296
- export interface ClientToServerEditRowRpc {
297
- rowKey: string;
298
- type: "VP_EDIT_ROW_RPC";
299
- row: VuuDataRow;
300
- }
301
-
302
- export type VuuDataRowDto = { [key: string]: VuuRowDataItemType };
303
- export interface ClientToServerAddRowRpc {
304
- rowKey: string;
305
- type: "VP_EDIT_ADD_ROW_RPC";
306
- data: VuuDataRowDto;
307
- }
308
- export interface ClientToServerDeleteRowRpc {
309
- rowKey: string;
310
- type: "VP_EDIT_DELETE_ROW_RPC";
311
- }
312
- export interface ClientToServerSubmitFormRpc {
313
- type: "VP_EDIT_SUBMIT_FORM_RPC";
314
- }
315
-
316
- export type ClientToServerEditRpc =
317
- | ClientToServerEditCellRpc
318
- | ClientToServerAddRowRpc
319
- | ClientToServerDeleteRowRpc
320
- | ClientToServerEditRowRpc
321
- | ClientToServerSubmitFormRpc;
322
-
323
- export type ClientToServerMenuRPCType =
281
+ export declare type ClientToServerMenuRPCType =
324
282
  | "VIEW_PORT_MENUS_SELECT_RPC"
325
283
  | "VIEW_PORT_MENU_TABLE_RPC"
326
284
  | "VIEW_PORT_MENU_ROW_RPC"
@@ -328,30 +286,30 @@ export type ClientToServerMenuRPCType =
328
286
 
329
287
  export declare type VuuRpcMessagesOut =
330
288
  | ClientToServerMenuSelectRPC
331
- | ClientToServerEditCellRpc;
289
+ | VuuRpcEditCellRequest;
332
290
 
333
- export declare type ClientToServerBody =
291
+ export declare type ClientMessageBody =
334
292
  | ClientToServerAuth
335
293
  | ClientToServerLogin
336
294
  | ClientToServerHeartBeat
337
295
  | ClientToServerDisable
338
296
  | ClientToServerEnable
339
- | ClientToServerTableList
340
- | ClientToServerTableMeta
341
- | ClientToServerCreateViewPort
342
- | ClientToServerChangeViewPort
297
+ | VuuTableListRequest
298
+ | VuuTableMetaRequest
299
+ | VuuViewportCreateRequest
300
+ | VuuViewportChangeRequest
343
301
  | ClientToServerRemoveViewPort
344
302
  | ClientToServerSelection
345
303
  | ClientToServerViewPortRange
346
- | ClientToServerVisualLinks
347
- | ClientToServerMenus
304
+ | VuuViewportVisualLinksRequest
305
+ | VuuViewportMenusRequest
348
306
  | ClientToServerOpenTreeNode
349
307
  | ClientToServerCloseTreeNode
350
308
  | ClientToServerCreateLink
351
309
  | ClientToServerRemoveLink
352
- | ClientToServerMenuRPC
353
- | ClientToServerViewportRpcCall
354
- | ClientToServerRpcRequest;
310
+ | VuuRpcMenuRequest
311
+ | VuuRpcViewportRequest
312
+ | VuuRpcServiceRequest;
355
313
 
356
314
  /**
357
315
  * RPC type messages
@@ -386,7 +344,20 @@ export declare type ClientToServerBody =
386
344
  */
387
345
 
388
346
  // RPC
389
- export declare type ClientToServerRpcRequest = {
347
+
348
+ export declare type VuuRpcRequest =
349
+ | VuuRpcServiceRequest
350
+ | VuuRpcViewportRequest
351
+ | VuuRpcMenuRequest
352
+ | VuuRpcEditRequest;
353
+
354
+ export declare type VuuRpcResponse =
355
+ | VuuRpcServiceResponse
356
+ | VuuRpcViewportResponse
357
+ | VuuRpcMenuResponse
358
+ | VuuRpcEditResponse;
359
+
360
+ export declare type VuuRpcServiceRequest = {
390
361
  type: "RPC_CALL";
391
362
  service: "TypeAheadRpcHandler";
392
363
  } & (
@@ -400,42 +371,44 @@ export declare type ClientToServerRpcRequest = {
400
371
  }
401
372
  );
402
373
 
403
- export interface ServerToClientRPC {
374
+ export interface VuuRpcServiceResponse {
404
375
  error: null | unknown;
405
376
  type: "RPC_RESP";
406
377
  method: "getUniqueFieldValues" | "getUniqueFieldValuesStartingWith";
407
378
  result: string[];
408
379
  }
409
380
 
381
+ export declare type RpcNamedParams = {
382
+ [key: string]: VuuRowDataItemType | VuuTable | string[];
383
+ };
384
+
410
385
  // ViewportRPC
411
- export interface ClientToServerViewportRpcCall {
386
+ export interface VuuRpcViewportRequest {
412
387
  type: "VIEW_PORT_RPC_CALL";
413
388
  rpcName: string;
414
- namedParams: { [key: string]: VuuRowDataItemType | VuuTable };
389
+ namedParams: RpcNamedParams;
415
390
  params: string[];
416
391
  vpId: string;
417
392
  }
418
393
 
419
- export interface ServerToClientViewportRpcResponse {
420
- action: {
421
- key?: string;
422
- msg?: string;
423
- type: "VP_RPC_FAILURE" | "VP_RPC_SUCCESS" | "VP_CREATE_SUCCESS";
424
- };
394
+ export interface VuuRpcViewportResponse {
395
+ action: VuuRpcViewportAction;
425
396
  type: "VIEW_PORT_RPC_REPONSE";
426
- method: string;
397
+ // method: string;
427
398
  namedParams: { [key: string]: VuuRowDataItemType | VuuTable };
428
399
  params: string[];
429
400
  vpId: string;
430
401
  }
431
402
 
432
403
  // MenuRPC
433
- export type ClientToServerMenuRPC =
404
+ export declare type VuuRpcMenuRequest =
434
405
  | ClientToServerMenuRowRPC
435
406
  | ClientToServerMenuCellRPC
436
407
  | ClientToServerMenuSelectRPC
437
408
  | ClientToServerMenuGridRPC;
438
409
 
410
+ export declare type VuuRpcMenuResponse = VuuRpcMenuSuccess | VuuRpcMenuError;
411
+
439
412
  export interface ClientToServerMenuSelectRPC {
440
413
  rpcName: string;
441
414
  type: "VIEW_PORT_MENUS_SELECT_RPC";
@@ -463,20 +436,105 @@ export interface ClientToServerMenuCellRPC {
463
436
  vpId: string;
464
437
  }
465
438
 
466
- export interface ServerToClientMenuResponse {
467
- action: OpenDialogAction | NoAction | ShowNotificationAction;
439
+ export interface VuuRpcMenuSuccess<
440
+ T extends VuuRpcMenuAction | VuuRpcEditAction = VuuRpcMenuAction,
441
+ > {
442
+ action: T;
468
443
  rpcName: string;
469
444
  type: "VIEW_PORT_MENU_RESP";
470
445
  vpId: string;
471
446
  }
472
447
 
473
- export interface ServerToClientMenuReject {
448
+ export interface VuuRpcMenuError {
474
449
  error: string;
475
450
  rpcName: string;
476
451
  type: "VIEW_PORT_MENU_REJ";
477
452
  vpId: string;
478
453
  }
479
454
 
455
+ /**
456
+ * Note VuuRpcEditCellRequest gets success response of type VuuRpcMenuSuccess, with
457
+ * rpcName "VP_EDIT_CELL_RPC"
458
+ * with action of type "VP_EDIT_SUCCESS"
459
+ *
460
+ * VuuRpcEditCommitRequest gets response of type VuuRpcEditSuccess or VuuRpcEditError
461
+ */
462
+ // Edit RPC
463
+ export declare type VuuRpcEditRequest =
464
+ | VuuRpcEditCellRequest
465
+ | VuuRpcEditAddRowRequest
466
+ | VuuRpcEditDeleteRowRequest
467
+ | VuuRpcEditUpdateRowRequest
468
+ | VuuRpcEditCommitRequest;
469
+
470
+ export declare type VuuRpcEditResponse = VuuRpcEditSuccess | VuuRpcEditError;
471
+ export interface VuuRpcEditSuccess {
472
+ action: unknown;
473
+ type: "VP_EDIT_RPC_RESPONSE";
474
+ rpcName: "VP_EDIT_SUBMIT_FORM_RPC";
475
+ vpId: string;
476
+ }
477
+ export interface VuuRpcEditError {
478
+ error: string;
479
+ rpcName: string;
480
+ type: "VP_EDIT_RPC_REJECT";
481
+ vpId: string;
482
+ }
483
+
484
+ export interface VuuRpcEditCellRequest {
485
+ rowKey: string;
486
+ type: "VP_EDIT_CELL_RPC";
487
+ field: string;
488
+ value: VuuRowDataItemType;
489
+ vpId: string;
490
+ }
491
+ export interface VuuRpcEditUpdateRowRequest {
492
+ rowKey: string;
493
+ type: "VP_EDIT_ROW_RPC";
494
+ row: VuuDataRow;
495
+ vpId: string;
496
+ }
497
+
498
+ export declare type VuuDataRowDto = { [key: string]: VuuRowDataItemType };
499
+ export interface VuuRpcEditAddRowRequest {
500
+ rowKey: string;
501
+ type: "VP_EDIT_ADD_ROW_RPC";
502
+ data: VuuDataRowDto;
503
+ vpId: string;
504
+ }
505
+ export interface VuuRpcEditDeleteRowRequest {
506
+ rowKey: string;
507
+ type: "VP_EDIT_DELETE_ROW_RPC";
508
+ vpId: string;
509
+ }
510
+ export interface VuuRpcEditCommitRequest {
511
+ type: "VP_EDIT_SUBMIT_FORM_RPC";
512
+ vpId: string;
513
+ }
514
+
515
+ export declare type VuuRpcEditAction = {
516
+ error?: string;
517
+ type: "VP_EDIT_SUCCESS";
518
+ };
519
+
520
+ export declare type VuuRpcAction =
521
+ | VuuRpcViewportAction
522
+ | VuuRpcMenuAction
523
+ | VuuRpcEditAction;
524
+
525
+ export declare type VuuRpcViewportAction = {
526
+ key?: string;
527
+ msg?: string;
528
+ type: "VP_RPC_FAILURE" | "VP_RPC_SUCCESS" | "VP_CREATE_SUCCESS";
529
+ };
530
+
531
+ export declare type VuuRpcMenuAction =
532
+ | OpenDialogAction
533
+ | CloseDialogAction
534
+ | NoAction
535
+ | ShowNotificationAction
536
+ | VuuRpcEditAction;
537
+
480
538
  // prettier-ignore
481
539
  export declare type VuuColumnDataType = "int" | "long" | "double" | "string" | "char" | "boolean";
482
540
  export declare type VuuMenuContext = "cell" | "row" | "grid" | "selected-rows";
@@ -513,9 +571,9 @@ export interface VuuMenu {
513
571
  menus: (VuuMenuItem | VuuMenu)[];
514
572
  }
515
573
 
516
- export type VuuRowDataItemType = string | number | boolean;
574
+ export declare type VuuRowDataItemType = string | number | boolean;
517
575
 
518
- export type VuuDataRow = VuuRowDataItemType[];
576
+ export declare type VuuDataRow = VuuRowDataItemType[];
519
577
 
520
578
  export declare type VuuRow = {
521
579
  data: VuuDataRow;
@@ -558,7 +616,7 @@ export declare type VuuLinkDescriptor = {
558
616
  };
559
617
 
560
618
  // used in MenuRPC row message
561
- export type VuuRowRecord = { [key: string]: VuuRowDataItemType };
619
+ export declare type VuuRowRecord = { [key: string]: VuuRowDataItemType };
562
620
 
563
621
  /**
564
622
  * LinkDescriptor with label is not strictly part of the Vuu Protocol
@@ -569,7 +627,7 @@ export type VuuRowRecord = { [key: string]: VuuRowDataItemType };
569
627
  * client vpId persists across sessions, whereas the server vpId does
570
628
  * not.
571
629
  */
572
- export type LinkDescriptorWithLabel = VuuLinkDescriptor & {
630
+ export declare type LinkDescriptorWithLabel = VuuLinkDescriptor & {
573
631
  label?: string;
574
632
  parentClientVpId: string;
575
633
  };
@@ -585,7 +643,7 @@ export interface ServerToClientLoginSuccess {
585
643
  token: string;
586
644
  }
587
645
 
588
- export type VuuTableList = Pick<ServerToClientTableList, "tables">;
646
+ export declare type VuuTableList = Pick<VuuTableListResponse, "tables">;
589
647
 
590
648
  // Menu Response Actions
591
649
  export interface ShowNotificationAction {
@@ -602,3 +660,6 @@ export interface OpenDialogAction {
602
660
  export interface NoAction {
603
661
  type: "NO_ACTION";
604
662
  }
663
+ export interface CloseDialogAction {
664
+ type: "CLOSE_DIALOG_ACTION";
665
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuu-ui/vuu-protocol-types",
3
- "version": "0.8.84",
3
+ "version": "0.8.85",
4
4
  "author": "heswell",
5
5
  "license": "Apache-2.0",
6
6
  "dependencies": {},