@vuu-ui/vuu-protocol-types 0.0.27

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 +371 -0
  2. package/package.json +16 -0
package/index.d.ts ADDED
@@ -0,0 +1,371 @@
1
+ export declare type ColumnDataType =
2
+ | "int"
3
+ | "long"
4
+ | "double"
5
+ | "string"
6
+ | "char";
7
+ export declare type VuuMenuContext = "cell" | "row" | "grid" | "selected-rows";
8
+ export interface VuuMenuItem {
9
+ context: VuuMenuContext;
10
+ filter: string;
11
+ name: string;
12
+ rpcName: string;
13
+ }
14
+ export declare type VuuTable = {
15
+ table: string;
16
+ module: string;
17
+ };
18
+ export declare type VuuRange = {
19
+ from: number;
20
+ to: number;
21
+ };
22
+ export declare type VuuSortCol = {
23
+ column: string;
24
+ sortType: "A" | "D";
25
+ };
26
+ export declare type VuuSort = {
27
+ sortDefs: VuuSortCol[];
28
+ };
29
+ export declare type VuuFilter = {
30
+ filter: string;
31
+ };
32
+ export interface VuuMenu {
33
+ name: string;
34
+ menus: VuuMenuItem[];
35
+ }
36
+
37
+ export type VuuRowDataItemType = string | number | boolean;
38
+
39
+ export type VuuDataRow = [number, number, ...data: VuuRowDataItemType[]];
40
+
41
+ export declare type VuuRow = {
42
+ data: VuuDataRow;
43
+ rowIndex: number;
44
+ rowKey: string;
45
+ sel: 0 | 1;
46
+ ts: number;
47
+ updateType: "U" | "D" | "SIZE";
48
+ viewPortId: string;
49
+ vpSize: number;
50
+ vpVersion: string;
51
+ };
52
+ export declare type AggTypeSum = 1;
53
+ export declare type AggTypeAverage = 2;
54
+ export declare type AggTypeCount = 3;
55
+ export declare type AggTypeHigh = 4;
56
+ export declare type AggTypeLow = 5;
57
+ export declare type AggType =
58
+ | AggTypeSum
59
+ | AggTypeAverage
60
+ | AggTypeCount
61
+ | AggTypeHigh
62
+ | AggTypeLow;
63
+ export declare type VuuAggregation = {
64
+ column: string;
65
+ aggType: AggType;
66
+ };
67
+ export declare type VuuLink = {
68
+ parentVpId: string;
69
+ link: {
70
+ fromColumn: string;
71
+ toTable: string;
72
+ toColumn: string;
73
+ };
74
+ };
75
+ export declare type VuuColumns = string[];
76
+ export declare type VuuGroupBy = string[];
77
+ export interface ServerToClientHeartBeat {
78
+ type: "HB";
79
+ ts: number;
80
+ }
81
+ export interface ServerToClientLoginSuccess {
82
+ type: "LOGIN_SUCCESS";
83
+ token: string;
84
+ }
85
+ export interface ServerToClientTableList {
86
+ type: "TABLE_LIST_RESP";
87
+ tables: VuuTable[];
88
+ }
89
+ export interface ServerToClientTableMeta {
90
+ columns: VuuColumns;
91
+ dataTypes: ColumnDataType[];
92
+ type: "TABLE_META_RESP";
93
+ table: VuuTable;
94
+ }
95
+ export interface ServerToClientMenus {
96
+ type: "VIEW_PORT_MENUS_RESP";
97
+ menu: VuuMenu;
98
+ vpId: string;
99
+ }
100
+ export interface ServerToClientMenu {
101
+ rpcName: "ADD_ROWS_TO_ORDERS";
102
+ type: "VIEW_PORT_MENU_RESP";
103
+ action: {
104
+ table: VuuTable;
105
+ type: "OPEN_DIALOG_ACTION";
106
+ };
107
+ vpId: string;
108
+ }
109
+ export interface ServerToClientViewPortVisualLinks {
110
+ type: "VP_VISUAL_LINKS_RESP";
111
+ links: VuuLink[];
112
+ vpId: string;
113
+ }
114
+ export interface ServerToClientCreateViewPortSuccess {
115
+ aggregations: VuuAggregation[];
116
+ columns: VuuColumns;
117
+ filterSpec: VuuFilter;
118
+ groupBy: VuuGroupBy;
119
+ range: VuuRange;
120
+ sort: VuuSort;
121
+ type: "CREATE_VP_SUCCESS";
122
+ table: string;
123
+ viewPortId: string;
124
+ }
125
+ export interface ServerToClientChangeViewPortSuccess {
126
+ type: "CHANGE_VP_SUCCESS";
127
+ viewPortId: string;
128
+ }
129
+ export interface ServerToClientChangeViewPortRangeSuccess {
130
+ type: "CHANGE_VP_RANGE_SUCCESS";
131
+ viewPortId: string;
132
+ from: number;
133
+ to: number;
134
+ }
135
+ export interface ServerToClientDisableViewPortSuccess {
136
+ type: "DISABLE_VP_SUCCESS";
137
+ viewPortId: string;
138
+ }
139
+ export interface ServerToClientEnableViewPortSuccess {
140
+ type: "ENABLE_VP_SUCCESS";
141
+ viewPortId: string;
142
+ }
143
+ export interface ServerToClientRemoveViewPortSuccess {
144
+ type: "REMOVE_VP_SUCCESS";
145
+ viewPortId: string;
146
+ }
147
+ export interface ServerToClientSelectSuccess {
148
+ type: "SET_SELECTION_SUCCESS";
149
+ vpId: string;
150
+ }
151
+ export interface ServerToClientRPC {
152
+ type: "RPC_RESP";
153
+ method: string;
154
+ result: any;
155
+ }
156
+ export interface ServerToClientOpenTreeNodeSuccess {
157
+ type: "OPEN_TREE_SUCCESS";
158
+ }
159
+ export interface ServerToClientCloseTreeNodeSuccess {
160
+ type: "CLOSE_TREE_SUCCESS";
161
+ }
162
+ export interface ServerToClientError {
163
+ msg: string;
164
+ type: "ERROR";
165
+ }
166
+ export interface ServerToClientCreateLinkSuccess {
167
+ childVpId: string;
168
+ childColumnName: string;
169
+ parentVpId: string;
170
+ parentColumnName: string;
171
+ type: "CREATE_VISUAL_LINK_SUCCESS";
172
+ }
173
+ export interface ServerToClientRemoveLinkSuccess {
174
+ childVpId: string;
175
+ type: "REMOVE_VISUAL_LINK_SUCCESS";
176
+ }
177
+ export interface ServerToClientTableRows {
178
+ batch: string;
179
+ isLast: boolean;
180
+ rows: VuuRow[];
181
+ timeStamp: number;
182
+ type: "TABLE_ROW";
183
+ }
184
+ export declare type ServerToClientBody =
185
+ | ServerToClientHeartBeat
186
+ | ServerToClientLoginSuccess
187
+ | ServerToClientCreateViewPortSuccess
188
+ | ServerToClientChangeViewPortSuccess
189
+ | ServerToClientChangeViewPortRangeSuccess
190
+ | ServerToClientDisableViewPortSuccess
191
+ | ServerToClientEnableViewPortSuccess
192
+ | ServerToClientRemoveViewPortSuccess
193
+ | ServerToClientSelectSuccess
194
+ | ServerToClientTableMeta
195
+ | ServerToClientTableList
196
+ | ServerToClientTableRows
197
+ | ServerToClientMenus
198
+ | ServerToClientMenu
199
+ | ServerToClientRPC
200
+ | ServerToClientViewPortVisualLinks
201
+ | ServerToClientOpenTreeNodeSuccess
202
+ | ServerToClientCloseTreeNodeSuccess
203
+ | ServerToClientCreateLinkSuccess
204
+ | ServerToClientRemoveLinkSuccess
205
+ | ServerToClientError;
206
+ export interface ServerToClientMessage<
207
+ TBody extends ServerToClientBody = ServerToClientBody
208
+ > {
209
+ body: TBody;
210
+ module: string;
211
+ requestId: string;
212
+ sessionId?: string;
213
+ token: string;
214
+ user: string;
215
+ }
216
+ export interface ClientToServerAuth {
217
+ type: "AUTH";
218
+ username: string;
219
+ password: string;
220
+ }
221
+ export interface ClientToServerLogin {
222
+ token: string;
223
+ type: "LOGIN";
224
+ user: string;
225
+ }
226
+ export interface ClientToServerHeartBeat {
227
+ type: "HB_RESP";
228
+ ts: number;
229
+ }
230
+ export interface ClientToServerDisable {
231
+ type: "DISABLE_VP";
232
+ viewPortId: string;
233
+ }
234
+ export interface ClientToServerEnable {
235
+ type: "ENABLE_VP";
236
+ viewPortId: string;
237
+ }
238
+ export interface ClientToServerTableList {
239
+ type: "GET_TABLE_LIST";
240
+ }
241
+ export interface ClientToServerTableMeta {
242
+ type: "GET_TABLE_META";
243
+ table: VuuTable;
244
+ }
245
+ export interface ClientToServerCreateViewPort {
246
+ columns: VuuColumns;
247
+ filterSpec: VuuFilter;
248
+ groupBy: string[];
249
+ type: "CREATE_VP";
250
+ range: VuuRange;
251
+ sort: VuuSort;
252
+ table: VuuTable;
253
+ }
254
+ export interface ClientToServerChangeViewPort {
255
+ aggregations: any[];
256
+ columns: VuuColumns;
257
+ filterSpec: VuuFilter;
258
+ groupBy: string[];
259
+ sort: VuuSort;
260
+ type: "CHANGE_VP";
261
+ viewPortId: string;
262
+ }
263
+ export interface ClientToServerRemoveViewPort {
264
+ type: "REMOVE_VP";
265
+ viewPortId: string;
266
+ }
267
+ export interface ClientToServerSelection {
268
+ type: "SET_SELECTION";
269
+ selection: number[];
270
+ vpId: string;
271
+ }
272
+ export interface ClientToServerViewPortRange {
273
+ from: number;
274
+ to: number;
275
+ type: "CHANGE_VP_RANGE";
276
+ viewPortId: string;
277
+ }
278
+ export interface ClientToServerVisualLinks {
279
+ type: "GET_VP_VISUAL_LINKS";
280
+ vpId: string;
281
+ }
282
+ export interface ClientToServerMenus {
283
+ type: "GET_VIEW_PORT_MENUS";
284
+ vpId: string;
285
+ }
286
+ export interface ClientToServerOpenTreeNode {
287
+ type: "OPEN_TREE_NODE";
288
+ vpId: string;
289
+ treeKey: string;
290
+ }
291
+ export interface ClientToServerCloseTreeNode {
292
+ type: "CLOSE_TREE_NODE";
293
+ vpId: string;
294
+ treeKey: string;
295
+ }
296
+ export interface ClientToServerCreateLink {
297
+ childVpId: string;
298
+ parentColumnName: string;
299
+ parentVpId: string;
300
+ type: "CREATE_VISUAL_LINK";
301
+ }
302
+ export interface ClientToServerRemoveLink {
303
+ childVpId: string;
304
+ type: "REMOVE_VISUAL_LINK";
305
+ }
306
+
307
+ export declare type RpcService = "TypeAheadRpcHandler";
308
+
309
+ export declare type TypeaheadParams =
310
+ | [VuuTable, string]
311
+ | [VuuTable, string, string];
312
+
313
+ export declare type TypeAheadMethod =
314
+ | "getUniqueFieldValues"
315
+ | "getUniqueFieldValuesStartingWith";
316
+ export declare type RpcMethod = TypeAheadMethod | "addRowsFromInstruments";
317
+ export interface ClientToServerGetUniqueValues {
318
+ type: "RPC_CALL";
319
+ method: "getUniqueFieldValues";
320
+ service: "TypeAheadRpcHandler";
321
+ params: [VuuTable, string];
322
+ }
323
+ export interface ClientToServerGetUniqueValuesStartingWith {
324
+ type: "RPC_CALL";
325
+ method: "getUniqueFieldValuesStartingWith";
326
+ service: "TypeAheadRpcHandler";
327
+ params: [VuuTable, string, string];
328
+ }
329
+ // add remaining Rpc calls here
330
+
331
+ export declare type ClientToServerRpcCall =
332
+ | ClientToServerGetUniqueValues
333
+ | ClientToServerGetUniqueValuesStartingWith;
334
+
335
+ export interface ClientToServerMenuSelectRPC {
336
+ type: "VIEW_PORT_MENUS_SELECT_RPC";
337
+ rpcName: string;
338
+ vpId: string;
339
+ }
340
+ export declare type VuuRpcMessagesOut = ClientToServerMenuSelectRPC;
341
+ export declare type ClientToServerBody =
342
+ | ClientToServerAuth
343
+ | ClientToServerLogin
344
+ | ClientToServerHeartBeat
345
+ | ClientToServerDisable
346
+ | ClientToServerEnable
347
+ | ClientToServerTableList
348
+ | ClientToServerTableMeta
349
+ | ClientToServerCreateViewPort
350
+ | ClientToServerChangeViewPort
351
+ | ClientToServerRemoveViewPort
352
+ | ClientToServerSelection
353
+ | ClientToServerViewPortRange
354
+ | ClientToServerVisualLinks
355
+ | ClientToServerMenus
356
+ | ClientToServerOpenTreeNode
357
+ | ClientToServerCloseTreeNode
358
+ | ClientToServerCreateLink
359
+ | ClientToServerRemoveLink
360
+ | ClientToServerMenuSelectRPC
361
+ | ClientToServerRpcCall;
362
+ export interface ClientToServerMessage<
363
+ TBody extends ClientToServerBody = ClientToServerBody
364
+ > {
365
+ body: TBody;
366
+ module: string;
367
+ requestId: string;
368
+ sessionId: string;
369
+ token: string;
370
+ user: string;
371
+ }
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@vuu-ui/vuu-protocol-types",
3
+ "version": "0.0.27",
4
+ "main": "",
5
+ "scripts": {
6
+ "build": "node ../../scripts/run-build.mjs"
7
+ },
8
+ "types": "index.d.ts",
9
+ "files": [
10
+ "index.d.ts"
11
+ ],
12
+ "author": "heswell",
13
+ "license": "Apache-2.0",
14
+ "dependencies": {},
15
+ "peerDependencies": {}
16
+ }