@vuu-ui/vuu-data-test 3.5.7 → 3.5.8
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 +6 -6
- package/types/core/filter/PermissionFilter.d.ts +41 -0
- package/types/core/filter/PermissionFilteredTable.d.ts +24 -0
- package/types/core/user/CurrentUser.d.ts +14 -0
- package/types/module-admin/ModuleAdminModule.d.ts +32 -0
- package/types/module-admin/index.d.ts +4 -0
- package/types/module-admin/module-admin-schemas.d.ts +4 -0
- package/types/module-admin/snapshot-projection.d.ts +13 -0
- package/types/notifications/NotificationModule.d.ts +60 -0
- package/types/notifications/NotificationsSchema.d.ts +20 -0
- package/types/notifications/index.d.ts +6 -0
- package/types/notifications/simulated/DismissNotificationRpcHandler.d.ts +8 -0
- package/types/notifications/simulated/SimulatedNotificationsModule.d.ts +9 -0
- package/types/notifications/simulated/SimulatedNotificationsProvider.d.ts +21 -0
- package/types/notifications/simulated/notificationsModule.d.ts +5 -0
- package/types/src/ArrayProxy.d.ts +8 -0
- package/types/src/RuntimeVisualLink.d.ts +9 -0
- package/types/src/Table.d.ts +34 -0
- package/types/src/TickingArrayDataSource.d.ts +44 -0
- package/types/src/UpdateGenerator.d.ts +18 -0
- package/types/src/basket/BasketModule.d.ts +55 -0
- package/types/src/basket/basket-schemas.d.ts +9 -0
- package/types/src/basket/index.d.ts +2 -0
- package/types/src/basket/reference-data/constituents.d.ts +3 -0
- package/types/src/basket/reference-data/ftse100.d.ts +2 -0
- package/types/src/basket/reference-data/hsi.d.ts +2 -0
- package/types/src/basket/reference-data/nasdaq100.d.ts +2 -0
- package/types/src/basket/reference-data/prices.d.ts +24 -0
- package/types/src/basket/reference-data/sp500.d.ts +2 -0
- package/types/src/core/module/ModuleContainer.d.ts +11 -0
- package/types/src/core/module/VuuModule.d.ts +81 -0
- package/types/src/core/table/TableContainer.d.ts +16 -0
- package/types/src/data-utils.d.ts +7 -0
- package/types/src/default-column-definitions.d.ts +2 -0
- package/types/src/index.d.ts +12 -0
- package/types/src/local-datasource-provider/LocalDatasourceProvider.d.ts +4 -0
- package/types/src/makeSuggestions.d.ts +3 -0
- package/types/src/rowUpdates.d.ts +15 -0
- package/types/src/schemas.d.ts +8 -0
- package/types/src/session-table-utils.d.ts +6 -0
- package/types/src/simul/SimulModule.d.ts +24 -0
- package/types/src/simul/index.d.ts +2 -0
- package/types/src/simul/reference-data/accounts.d.ts +1 -0
- package/types/src/simul/reference-data/algos.d.ts +1 -0
- package/types/src/simul/reference-data/currencies.d.ts +1 -0
- package/types/src/simul/reference-data/index.d.ts +5 -0
- package/types/src/simul/reference-data/instrument-prices.d.ts +60 -0
- package/types/src/simul/reference-data/instruments-extended.d.ts +1 -0
- package/types/src/simul/reference-data/instruments.d.ts +35 -0
- package/types/src/simul/reference-data/isin-generator/convert-string-to-base-ten-number.d.ts +1 -0
- package/types/src/simul/reference-data/isin-generator/fixtures/alphabet.d.ts +1 -0
- package/types/src/simul/reference-data/isin-generator/fixtures/alphanumeric-values.d.ts +1 -0
- package/types/src/simul/reference-data/isin-generator/fixtures/base-ten-numbers.d.ts +1 -0
- package/types/src/simul/reference-data/isin-generator/generate-cusip-check-code.d.ts +1 -0
- package/types/src/simul/reference-data/isin-generator/generate-cusip-without-check-code.d.ts +1 -0
- package/types/src/simul/reference-data/isin-generator/generate-cusip.d.ts +1 -0
- package/types/src/simul/reference-data/isin-generator/generate-random-alphanumeric.d.ts +1 -0
- package/types/src/simul/reference-data/isin-generator/generate-random-base-ten-number.d.ts +1 -0
- package/types/src/simul/reference-data/isin-generator/generate-random-string-of-alphanumeric-chars.d.ts +1 -0
- package/types/src/simul/reference-data/isin-generator/generate-random-string-of-base-ten-chars.d.ts +1 -0
- package/types/src/simul/reference-data/isin-generator/index.d.ts +1 -0
- package/types/src/simul/reference-data/isin-generator/is-odd.d.ts +1 -0
- package/types/src/simul/reference-data/locations.d.ts +4 -0
- package/types/src/simul/reference-data/lotsizes.d.ts +1 -0
- package/types/src/simul/reference-data/orderStatus.d.ts +1 -0
- package/types/src/simul/reference-data/orders.d.ts +36 -0
- package/types/src/simul/reference-data/parent-child-orders.d.ts +4 -0
- package/types/src/simul/reference-data/priceStrategies.d.ts +1 -0
- package/types/src/simul/reference-data/prices.d.ts +34 -0
- package/types/src/simul/reference-data/sides.d.ts +1 -0
- package/types/src/simul/simul-schemas.d.ts +9 -0
- package/types/src/test/TestModule.d.ts +16 -0
- package/types/src/test/index.d.ts +1 -0
- package/types/src/vuu-row-generator.d.ts +17 -0
- package/types/user-admin/UserAdminModule.d.ts +54 -0
- package/types/user-admin/index.d.ts +3 -0
- package/types/user-admin/initialSnapshot.d.ts +2 -0
- package/types/user-admin/snapshot-projection.d.ts +9 -0
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "3.5.
|
|
2
|
+
"version": "3.5.8",
|
|
3
3
|
"main": "./src/index.js",
|
|
4
4
|
"author": "heswell",
|
|
5
5
|
"license": "Apache-2.0",
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
"type-defs": "node ../../scripts/build-type-defs.mjs"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@vuu-ui/vuu-data-local": "3.5.
|
|
13
|
-
"@vuu-ui/vuu-utils": "3.5.
|
|
12
|
+
"@vuu-ui/vuu-data-local": "3.5.8",
|
|
13
|
+
"@vuu-ui/vuu-utils": "3.5.8"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@vuu-ui/vuu-protocol-types": "3.5.
|
|
17
|
-
"@vuu-ui/vuu-data-types": "3.5.
|
|
18
|
-
"@vuu-ui/vuu-table-types": "3.5.
|
|
16
|
+
"@vuu-ui/vuu-protocol-types": "3.5.8",
|
|
17
|
+
"@vuu-ui/vuu-data-types": "3.5.8",
|
|
18
|
+
"@vuu-ui/vuu-table-types": "3.5.8"
|
|
19
19
|
},
|
|
20
20
|
"sideEffects": false,
|
|
21
21
|
"files": [
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
+
import type { VuuModuleUser } from "../user/CurrentUser";
|
|
3
|
+
import type { ColumnMap } from "@vuu-ui/vuu-utils";
|
|
4
|
+
import type tableContainer from "../table/TableContainer";
|
|
5
|
+
export type TableRow = Array<bigint | VuuRowDataItemType>;
|
|
6
|
+
export type RowPredicate = (row: TableRow) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Read access to a single row, by column name.
|
|
9
|
+
*/
|
|
10
|
+
export interface RowData {
|
|
11
|
+
get: (columnName: string) => bigint | VuuRowDataItemType | undefined;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Restricts the rows of a table visible through a viewport, typically
|
|
15
|
+
* based on the user that owns the viewport. Permission filters are applied
|
|
16
|
+
* in addition to any client filter.
|
|
17
|
+
*/
|
|
18
|
+
export interface PermissionFilter {
|
|
19
|
+
/**
|
|
20
|
+
* Bind this permission filter to the column layout of a table, returning a
|
|
21
|
+
* predicate that can be evaluated against raw table rows.
|
|
22
|
+
*/
|
|
23
|
+
createPredicate: (columnMap: ColumnMap) => RowPredicate;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The subset of viewport state available to a PermissionFunction.
|
|
27
|
+
*/
|
|
28
|
+
export interface PermissionViewport {
|
|
29
|
+
id: string;
|
|
30
|
+
user: VuuModuleUser;
|
|
31
|
+
}
|
|
32
|
+
export type TableContainer = typeof tableContainer;
|
|
33
|
+
/**
|
|
34
|
+
* Creates the PermissionFilter for a viewport. Configured per table on a VuuModule.
|
|
35
|
+
*/
|
|
36
|
+
export type PermissionFunction = (viewport: PermissionViewport, tableContainer: TableContainer) => PermissionFilter;
|
|
37
|
+
export declare const AllowAllPermissionFilter: PermissionFilter;
|
|
38
|
+
export declare const DenyAllPermissionFilter: PermissionFilter;
|
|
39
|
+
export declare function PermissionFilter(rowPredicate: (row: RowData) => boolean): PermissionFilter;
|
|
40
|
+
export declare function PermissionFilter(columnName: string, allowedValues: Set<string>): PermissionFilter;
|
|
41
|
+
export declare function PermissionFilter(filters: Iterable<PermissionFilter>): PermissionFilter;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Table } from "../../Table";
|
|
2
|
+
import type { RowPredicate } from "./PermissionFilter";
|
|
3
|
+
/**
|
|
4
|
+
* A per-viewport view of a source table, containing only those rows that
|
|
5
|
+
* satisfy a permission predicate. Changes to the source table are mirrored,
|
|
6
|
+
* an update that moves a row into or out of the permitted set is emitted as
|
|
7
|
+
* an insert or delete.
|
|
8
|
+
*/
|
|
9
|
+
export declare class PermissionFilteredTable extends Table {
|
|
10
|
+
#private;
|
|
11
|
+
constructor(source: Table, predicate: RowPredicate);
|
|
12
|
+
get source(): Table;
|
|
13
|
+
/**
|
|
14
|
+
* Start mirroring changes from the source table. Invoked on construction,
|
|
15
|
+
* only needs to be called again following dispose.
|
|
16
|
+
*/
|
|
17
|
+
attach(): void;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
private contains;
|
|
20
|
+
private handleSourceInsert;
|
|
21
|
+
private handleSourceUpdate;
|
|
22
|
+
private handleSourceDelete;
|
|
23
|
+
private replaceRow;
|
|
24
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The user that owns a viewport, as seen by permission functions and
|
|
3
|
+
* rpc services.
|
|
4
|
+
*/
|
|
5
|
+
export interface VuuModuleUser {
|
|
6
|
+
authorizations: string[];
|
|
7
|
+
name: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const getCurrentUser: () => VuuModuleUser;
|
|
10
|
+
/**
|
|
11
|
+
* Applies to viewports created after the change. Pass undefined to restore
|
|
12
|
+
* the default user.
|
|
13
|
+
*/
|
|
14
|
+
export declare const setCurrentUser: (user?: string | VuuModuleUser) => void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type ManagedModule } from "@heswell/module-admin/contracts";
|
|
2
|
+
import type { TableSchema } from "@vuu-ui/vuu-data-types";
|
|
3
|
+
import { VuuModule, type RpcService } from "../core/module/VuuModule";
|
|
4
|
+
import { type Table } from "../Table";
|
|
5
|
+
import { type ModuleAdminTableName } from "./module-admin-schemas";
|
|
6
|
+
import { type ModuleAdminSnapshot } from "./snapshot-projection";
|
|
7
|
+
type ModuleAdminTables = Record<ModuleAdminTableName, Table>;
|
|
8
|
+
export declare const MODULE_ADMIN_INITIAL_SNAPSHOT: ModuleAdminSnapshot;
|
|
9
|
+
/**
|
|
10
|
+
* In-browser MODULE_DISCOVERY server. Supports the module admin RPCs from
|
|
11
|
+
* `@heswell/module-admin/contracts` on both tables; state is held in memory.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ModuleAdminModule extends VuuModule<ModuleAdminTableName> {
|
|
14
|
+
#private;
|
|
15
|
+
private readonly now;
|
|
16
|
+
constructor(snapshot?: ModuleAdminSnapshot, now?: () => number);
|
|
17
|
+
/** Current module state. */
|
|
18
|
+
get modules(): readonly ManagedModule[];
|
|
19
|
+
get menus(): {
|
|
20
|
+
modulePermissions: undefined;
|
|
21
|
+
modules: undefined;
|
|
22
|
+
};
|
|
23
|
+
protected get includeDefaultServices(): boolean;
|
|
24
|
+
get menuServices(): undefined;
|
|
25
|
+
get schemas(): Record<ModuleAdminTableName, Readonly<TableSchema>>;
|
|
26
|
+
private service;
|
|
27
|
+
get services(): Record<ModuleAdminTableName, RpcService[]>;
|
|
28
|
+
get tables(): ModuleAdminTables;
|
|
29
|
+
get visualLinks(): undefined;
|
|
30
|
+
}
|
|
31
|
+
export declare const moduleAdminModule: ModuleAdminModule;
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { ModuleAdminModule, MODULE_ADMIN_INITIAL_SNAPSHOT, moduleAdminModule, } from "./ModuleAdminModule";
|
|
2
|
+
export { MODULE_ADMIN_MODULE_NAME, MODULE_ADMIN_TABLE_SCHEMAS, type ModuleAdminTableName, } from "./module-admin-schemas";
|
|
3
|
+
export { projectModuleAdminSnapshot, reconcileModuleAdminTables, type ModuleAdminSnapshot, } from "./snapshot-projection";
|
|
4
|
+
export type { ManagedModule, ModuleAccessRole, ModuleConfig, ModuleDefinition, ModulePermissionRow, ModuleRow, } from "@heswell/module-admin/contracts";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { TableSchema } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
export declare const MODULE_ADMIN_MODULE_NAME = "MODULE_DISCOVERY";
|
|
3
|
+
export type ModuleAdminTableName = "modules" | "modulePermissions";
|
|
4
|
+
export declare const MODULE_ADMIN_TABLE_SCHEMAS: Readonly<Record<ModuleAdminTableName, Readonly<TableSchema>>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ManagedModule } from "@heswell/module-admin/contracts";
|
|
2
|
+
import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
import type { Table } from "../Table";
|
|
4
|
+
import type { ModuleAdminTableName } from "./module-admin-schemas";
|
|
5
|
+
type Row = Array<bigint | VuuRowDataItemType>;
|
|
6
|
+
type Tables = Record<ModuleAdminTableName, Table>;
|
|
7
|
+
export type ModuleAdminSnapshot = {
|
|
8
|
+
modules: readonly ManagedModule[];
|
|
9
|
+
};
|
|
10
|
+
export declare const projectModuleAdminSnapshot: (snapshot: ModuleAdminSnapshot, tables: Tables) => Record<ModuleAdminTableName, Row[]>;
|
|
11
|
+
/** Brings the tables into line with the snapshot, emitting row-level updates. */
|
|
12
|
+
export declare const reconcileModuleAdminTables: (snapshot: ModuleAdminSnapshot, tables: Tables) => void;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { TableSchema } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
import { type RpcService, VuuModule } from "../core/module/VuuModule";
|
|
4
|
+
import type { PermissionFunction } from "../core/filter/PermissionFilter";
|
|
5
|
+
import { type Table } from "../Table";
|
|
6
|
+
import { type ColumnDefinition } from "./NotificationsSchema";
|
|
7
|
+
export type NotificationsTableName = "notifications";
|
|
8
|
+
/**
|
|
9
|
+
* Source of notifications. Started when the first dataSource is
|
|
10
|
+
* created for the notifications table, or explicitly via module.start().
|
|
11
|
+
*/
|
|
12
|
+
export interface NotificationsProvider {
|
|
13
|
+
start: () => void;
|
|
14
|
+
stop: () => void;
|
|
15
|
+
}
|
|
16
|
+
export type NotificationsProviderFactory = (table: Table) => NotificationsProvider;
|
|
17
|
+
/**
|
|
18
|
+
* A notification to publish. Values are keyed by column name; columns not
|
|
19
|
+
* supplied are defaulted. `expiryTime` (epoch ms) schedules deletion of the row.
|
|
20
|
+
*/
|
|
21
|
+
export interface NotificationInput {
|
|
22
|
+
id?: string;
|
|
23
|
+
type?: string;
|
|
24
|
+
expiryTime?: number;
|
|
25
|
+
title?: string;
|
|
26
|
+
message?: string;
|
|
27
|
+
level?: string;
|
|
28
|
+
audience?: string;
|
|
29
|
+
[columnName: string]: VuuRowDataItemType | undefined;
|
|
30
|
+
}
|
|
31
|
+
export type NotificationsServiceFactory = (table: Table, module: NotificationModule) => RpcService[];
|
|
32
|
+
/**
|
|
33
|
+
* A generic Notifications module, exposing a single 'notifications' table.
|
|
34
|
+
* The source of notifications (provider), the rows visible to each user
|
|
35
|
+
* (permissionFunction) and any rpc services (serviceFactory) are supplied
|
|
36
|
+
* by the consumer. Any additional columns are appended to the generic
|
|
37
|
+
* notification columns (see NotificationsSchema).
|
|
38
|
+
*/
|
|
39
|
+
export declare class NotificationModule extends VuuModule<NotificationsTableName> {
|
|
40
|
+
#private;
|
|
41
|
+
static readonly NAME = "NOTIFICATIONS";
|
|
42
|
+
static readonly TABLE_NAME: "notifications";
|
|
43
|
+
constructor(providerFactory: NotificationsProviderFactory, permissionFunction: PermissionFunction, serviceFactory: NotificationsServiceFactory, ...additionalColumns: ColumnDefinition[]);
|
|
44
|
+
protected beforeCreateDataSource(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Inserts a notification row, as a server-side publisher would. Defaults:
|
|
47
|
+
* a random `id`, `type` "toast", `level` "INFO", `audience` "all" and
|
|
48
|
+
* empty strings for other string columns. Returns the row id.
|
|
49
|
+
*/
|
|
50
|
+
publish(notification?: NotificationInput): string;
|
|
51
|
+
get isRunning(): boolean;
|
|
52
|
+
start(): void;
|
|
53
|
+
stop(): void;
|
|
54
|
+
get menus(): undefined;
|
|
55
|
+
get menuServices(): undefined;
|
|
56
|
+
get schemas(): Record<"notifications", TableSchema>;
|
|
57
|
+
get services(): Record<"notifications", RpcService[]>;
|
|
58
|
+
get tables(): Record<"notifications", Table>;
|
|
59
|
+
get visualLinks(): undefined;
|
|
60
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SchemaColumn } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
/**
|
|
3
|
+
* Accepts either a SchemaColumn or a column definition in the Scala server
|
|
4
|
+
* 'name:Type' format, e.g. "source:String", "priority:Int".
|
|
5
|
+
*/
|
|
6
|
+
export type ColumnDefinition = SchemaColumn | string;
|
|
7
|
+
export declare const toColumn: (columnDefinition: ColumnDefinition) => SchemaColumn;
|
|
8
|
+
export declare const NotificationsSchema: {
|
|
9
|
+
Id: string;
|
|
10
|
+
Type: string;
|
|
11
|
+
ExpiryTime: string;
|
|
12
|
+
Title: string;
|
|
13
|
+
Message: string;
|
|
14
|
+
Level: string;
|
|
15
|
+
Audience: string;
|
|
16
|
+
/**
|
|
17
|
+
* The generic notification columns, plus any additional columns.
|
|
18
|
+
*/
|
|
19
|
+
allFrom: (...additionalColumns: ColumnDefinition[]) => SchemaColumn[];
|
|
20
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from "./NotificationModule";
|
|
2
|
+
export * from "./NotificationsSchema";
|
|
3
|
+
export * from "./simulated/DismissNotificationRpcHandler";
|
|
4
|
+
export * from "./simulated/SimulatedNotificationsModule";
|
|
5
|
+
export * from "./simulated/SimulatedNotificationsProvider";
|
|
6
|
+
export * from "./simulated/notificationsModule";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RpcService } from "../../core/module/VuuModule";
|
|
2
|
+
import type { Table } from "../../Table";
|
|
3
|
+
import type { NotificationModule } from "../NotificationModule";
|
|
4
|
+
/**
|
|
5
|
+
* Marks the notifications selected in the requesting viewport as dismissed
|
|
6
|
+
* by the user that owns the viewport.
|
|
7
|
+
*/
|
|
8
|
+
export declare const DismissNotificationRpcHandler: (table: Table, module: NotificationModule) => RpcService[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { NotificationModule } from "../NotificationModule";
|
|
2
|
+
export interface SimulatedNotificationsModuleOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Generate random notifications. When false, notifications are only
|
|
5
|
+
* created by calls to `publish`. Default true.
|
|
6
|
+
*/
|
|
7
|
+
simulate?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare const SimulatedNotificationsModule: ({ simulate, }?: SimulatedNotificationsModuleOptions) => NotificationModule;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Table } from "../../Table";
|
|
2
|
+
import type { NotificationsProvider } from "../NotificationModule";
|
|
3
|
+
/**
|
|
4
|
+
* Minimal implementation of the subset of Java String.format used by
|
|
5
|
+
* the message templates: %d, %0nd and %%. Args are consumed in order.
|
|
6
|
+
*/
|
|
7
|
+
export declare const formatMessage: (format: string, ...args: number[]) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Generates random notifications. Seeds an initial set of notifications on
|
|
10
|
+
* start then, on each cycle, deletes expired notifications and adds a new
|
|
11
|
+
* notification if fewer than the maximum are active.
|
|
12
|
+
*/
|
|
13
|
+
export declare class SimulatedNotificationsProvider implements NotificationsProvider {
|
|
14
|
+
#private;
|
|
15
|
+
constructor(table: Table);
|
|
16
|
+
start(): void;
|
|
17
|
+
stop(): void;
|
|
18
|
+
runOnce: () => void;
|
|
19
|
+
private generateRandomNotification;
|
|
20
|
+
private toDataRow;
|
|
21
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type RowAtIndexFunc<T = unknown> = (index: number) => T | undefined;
|
|
2
|
+
export declare class ArrayProxy<T = string> {
|
|
3
|
+
#private;
|
|
4
|
+
length: number;
|
|
5
|
+
constructor(size: number, getRow: RowAtIndexFunc);
|
|
6
|
+
map: (func: (item: T, i: number) => unknown) => ArrayProxy<string>;
|
|
7
|
+
slice: (from: number, to: number) => unknown[];
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DataSourceBase, DataSourceRowWithBigint, RowSelectionEventHandler } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
export declare class RuntimeVisualLink {
|
|
3
|
+
#private;
|
|
4
|
+
constructor(childDataSource: DataSourceBase<DataSourceRowWithBigint>, parentDataSource: DataSourceBase<DataSourceRowWithBigint>, childColumnName: string, parentColumnName: string);
|
|
5
|
+
destroy(): void;
|
|
6
|
+
remove(): void;
|
|
7
|
+
handleParentSelectEvent: RowSelectionEventHandler;
|
|
8
|
+
private pickUniqueSelectedValues;
|
|
9
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { TableSchema } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
import { ColumnMap, EventEmitter } from "@vuu-ui/vuu-utils";
|
|
4
|
+
import { UpdateGenerator } from "./rowUpdates";
|
|
5
|
+
export type TableEvents = {
|
|
6
|
+
delete: (key: string) => void;
|
|
7
|
+
insert: (row: Array<bigint | VuuRowDataItemType>) => void;
|
|
8
|
+
update: (row: Array<bigint | VuuRowDataItemType>, columnName?: string, sessionId?: string) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare class Table extends EventEmitter<TableEvents> {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(schema: TableSchema, data: Array<Array<VuuRowDataItemType | bigint>>, dataMap: ColumnMap, updateGenerator?: UpdateGenerator);
|
|
13
|
+
private buildIndex;
|
|
14
|
+
get data(): (bigint | VuuRowDataItemType)[][];
|
|
15
|
+
get map(): ColumnMap;
|
|
16
|
+
get schema(): TableSchema;
|
|
17
|
+
get name(): string;
|
|
18
|
+
delete(key: string, emitEvent?: boolean): void;
|
|
19
|
+
insert(row: Array<bigint | VuuRowDataItemType>, emitEvent?: boolean): void;
|
|
20
|
+
findByKey(key: string): (bigint | VuuRowDataItemType)[];
|
|
21
|
+
update(key: string, columnName: string, value: bigint | VuuRowDataItemType): void;
|
|
22
|
+
updateRow(row: Array<bigint | VuuRowDataItemType>): void;
|
|
23
|
+
}
|
|
24
|
+
export declare function buildDataColumnMapFromSchema(schema: Readonly<TableSchema>): ColumnMap;
|
|
25
|
+
/**
|
|
26
|
+
* Build a data ColumnMap for a table in the provided schema.
|
|
27
|
+
* A data ColumnMap is a mapping from a raw data array to a map, keyed
|
|
28
|
+
* by column name with no additional metadata.
|
|
29
|
+
*
|
|
30
|
+
* @param schemas
|
|
31
|
+
* @param tableName
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
export declare function buildDataColumnMap<TableName extends string = string>(schemas: Readonly<Record<TableName, Readonly<TableSchema>>>, tableName: TableName): ColumnMap;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ArrayDataSource, type ArrayDataSourceConstructorProps } from "@vuu-ui/vuu-data-local";
|
|
2
|
+
import type { DataSourceBase, DataSource, DataSourceRowWithBigint, DataSourceSubscribeCallback, DataSourceSubscribeProps, DataSourceVisualLinkCreatedMessage, DeleteRowMode, CopyOption, EditSessionMode, SessionDataSourceOverrides, SessionType } from "@vuu-ui/vuu-data-types";
|
|
3
|
+
import type { LinkDescriptorWithLabel, RpcResult, RpcResultError, RpcResultSuccess, VuuCreateVisualLink, VuuMenu, VuuRemoveVisualLink, VuuRowDataItemType, VuuRpcMenuRequest, VuuRpcMenuResponse, VuuRpcServiceRequest } from "@vuu-ui/vuu-protocol-types";
|
|
4
|
+
import type { IVuuModule, RpcMenuService, RpcService } from "./core/module/VuuModule";
|
|
5
|
+
import type { Table } from "./Table";
|
|
6
|
+
export type VisualLinkHandler = (message: VuuCreateVisualLink | VuuRemoveVisualLink) => Promise<DataSourceVisualLinkCreatedMessage | void>;
|
|
7
|
+
export interface TickingArrayDataSourceConstructorProps extends Omit<ArrayDataSourceConstructorProps, "data"> {
|
|
8
|
+
data?: Array<VuuRowDataItemType[]>;
|
|
9
|
+
getVisualLinks?: (tableName: string) => LinkDescriptorWithLabel[] | undefined;
|
|
10
|
+
menu?: VuuMenu;
|
|
11
|
+
rpcMenuServices?: RpcMenuService[];
|
|
12
|
+
rpcServices?: RpcService[];
|
|
13
|
+
table?: Table;
|
|
14
|
+
visualLinkService?: VisualLinkHandler;
|
|
15
|
+
vuuModule?: IVuuModule;
|
|
16
|
+
}
|
|
17
|
+
export declare class TickingArrayDataSource extends ArrayDataSource {
|
|
18
|
+
#private;
|
|
19
|
+
constructor({ data, getVisualLinks, rpcServices, rpcMenuServices, session, table, menu, visualLink, visualLinkService, vuuModule, ...arrayDataSourceProps }: TickingArrayDataSourceConstructorProps);
|
|
20
|
+
updateRowWithSessionCheck: (row: Array<bigint | VuuRowDataItemType>, columnName?: string, sessionId?: string) => void;
|
|
21
|
+
subscribe(subscribeProps: DataSourceSubscribeProps, callback: DataSourceSubscribeCallback): Promise<void>;
|
|
22
|
+
unsubscribe(): void;
|
|
23
|
+
set links(links: LinkDescriptorWithLabel[] | undefined);
|
|
24
|
+
get links(): LinkDescriptorWithLabel[] | undefined;
|
|
25
|
+
getSelectedRowIds(): string[];
|
|
26
|
+
isSessionDataSourceOf(dataSource: DataSource): boolean;
|
|
27
|
+
createSessionDataSource(copyOption: CopyOption, sessionType?: SessionType, overrides?: SessionDataSourceOverrides): Promise<DataSourceBase<DataSourceRowWithBigint> | undefined>;
|
|
28
|
+
beginEditSession(editSessionMode?: EditSessionMode, overrides?: SessionDataSourceOverrides): Promise<DataSourceBase<DataSourceRowWithBigint> | undefined>;
|
|
29
|
+
editCell(key: string, column: string, data: VuuRowDataItemType): Promise<RpcResultError | RpcResultSuccess>;
|
|
30
|
+
addRow: (rowData?: Record<string, VuuRowDataItemType>) => Promise<RpcResult>;
|
|
31
|
+
deleteRow: (key: string, mode?: DeleteRowMode) => Promise<true | string>;
|
|
32
|
+
deleteSelectedRows: (mode?: DeleteRowMode) => Promise<RpcResultSuccess | RpcResultError>;
|
|
33
|
+
undoRowChange: (key: string) => Promise<RpcResultSuccess | RpcResultError>;
|
|
34
|
+
set columns(columns: string[]);
|
|
35
|
+
get columns(): string[];
|
|
36
|
+
endEditSession(saveChanges?: boolean): Promise<void>;
|
|
37
|
+
rpcRequest(rpcRequest: Omit<VuuRpcServiceRequest, "context">): Promise<RpcResultSuccess | RpcResultError>;
|
|
38
|
+
menuRpcCall(rpcRequest: Omit<VuuRpcMenuRequest, "vpId">): Promise<VuuRpcMenuResponse>;
|
|
39
|
+
getTypeaheadSuggestions(column: string, pattern?: string): Promise<string[]>;
|
|
40
|
+
get visualLink(): LinkDescriptorWithLabel | undefined;
|
|
41
|
+
set visualLink(visualLink: LinkDescriptorWithLabel | undefined);
|
|
42
|
+
freeze(): void;
|
|
43
|
+
unfreeze(): void;
|
|
44
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { VuuRange } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
+
import type { UpdateGenerator } from "./rowUpdates";
|
|
3
|
+
import { Table } from "./Table";
|
|
4
|
+
export declare class BaseUpdateGenerator implements UpdateGenerator {
|
|
5
|
+
private table;
|
|
6
|
+
private range;
|
|
7
|
+
private updating;
|
|
8
|
+
private timer;
|
|
9
|
+
private tickingColumns;
|
|
10
|
+
constructor(tickingColumns: {
|
|
11
|
+
[key: string]: number;
|
|
12
|
+
});
|
|
13
|
+
setRange(range: VuuRange): void;
|
|
14
|
+
setTable(table: Table): void;
|
|
15
|
+
private startUpdating;
|
|
16
|
+
private stopUpdating;
|
|
17
|
+
update: () => void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { VuuMenu } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
+
import { RpcMenuService, ServiceHandler, VuuModule } from "../core/module/VuuModule";
|
|
3
|
+
import { BasketsTableName } from "./basket-schemas";
|
|
4
|
+
import { type Table } from "../Table";
|
|
5
|
+
export declare const createBasketTradingRow: (basketId: string, basketName: string, side?: string, status?: string) => (string | number)[];
|
|
6
|
+
/**
|
|
7
|
+
* This is an example of how we might extend the built-in VuuModule to
|
|
8
|
+
* implement a module-specific service in such a way that it can invoke
|
|
9
|
+
* methods on the VuuModule.
|
|
10
|
+
*/
|
|
11
|
+
export declare class BasketModule extends VuuModule<BasketsTableName> {
|
|
12
|
+
#private;
|
|
13
|
+
constructor();
|
|
14
|
+
get menus(): Record<BasketsTableName, VuuMenu | undefined>;
|
|
15
|
+
get schemas(): Readonly<Record<BasketsTableName, Readonly<import("@vuu-ui/vuu-data-types").TableSchema>>>;
|
|
16
|
+
get services(): {
|
|
17
|
+
algoType: undefined;
|
|
18
|
+
basketTradingConstituent: undefined;
|
|
19
|
+
basketConstituent: undefined;
|
|
20
|
+
priceStrategyType: undefined;
|
|
21
|
+
basket: {
|
|
22
|
+
rpcName: string;
|
|
23
|
+
service: ServiceHandler;
|
|
24
|
+
}[];
|
|
25
|
+
basketTrading: {
|
|
26
|
+
rpcName: string;
|
|
27
|
+
service: ServiceHandler;
|
|
28
|
+
}[];
|
|
29
|
+
basketTradingConstituentJoin: {
|
|
30
|
+
rpcName: string;
|
|
31
|
+
service: ServiceHandler;
|
|
32
|
+
}[];
|
|
33
|
+
};
|
|
34
|
+
get menuServices(): Record<BasketsTableName, RpcMenuService[] | undefined> | undefined;
|
|
35
|
+
get tables(): Record<BasketsTableName, Table>;
|
|
36
|
+
get visualLinks(): {
|
|
37
|
+
algoType: undefined;
|
|
38
|
+
basket: undefined;
|
|
39
|
+
basketTrading: undefined;
|
|
40
|
+
basketTradingConstituent: undefined;
|
|
41
|
+
basketTradingConstituentJoin: undefined;
|
|
42
|
+
priceStrategyType: undefined;
|
|
43
|
+
basketConstituent: {
|
|
44
|
+
fromColumn: string;
|
|
45
|
+
toColumn: string;
|
|
46
|
+
toTable: string;
|
|
47
|
+
}[];
|
|
48
|
+
};
|
|
49
|
+
private createTradingBasket;
|
|
50
|
+
private createNewBasket;
|
|
51
|
+
private sendToMarket;
|
|
52
|
+
private takeOffMarket;
|
|
53
|
+
private addConstituent;
|
|
54
|
+
}
|
|
55
|
+
export declare const basketModule: BasketModule;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TableSchema } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import { VuuTable } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
export type BasketsTableName = "algoType" | "basket" | "basketConstituent" | "basketTrading" | "basketTradingConstituent" | "basketTradingConstituentJoin" | "priceStrategyType";
|
|
4
|
+
export declare const schemas: Readonly<Record<BasketsTableName, Readonly<TableSchema>>>;
|
|
5
|
+
export type BasketVuuTable = {
|
|
6
|
+
module: "BASKET";
|
|
7
|
+
table: BasketsTableName;
|
|
8
|
+
};
|
|
9
|
+
export declare const isBasketTable: (table: VuuTable) => table is BasketVuuTable;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type ask = number;
|
|
2
|
+
export type askSize = number;
|
|
3
|
+
export type bid = number;
|
|
4
|
+
export type bidSize = number;
|
|
5
|
+
export type close = number;
|
|
6
|
+
export type last = number;
|
|
7
|
+
export type open = number;
|
|
8
|
+
export type phase = "C";
|
|
9
|
+
export type ric = string;
|
|
10
|
+
export type scenario = "close";
|
|
11
|
+
export type PricesDataRow = [
|
|
12
|
+
ask,
|
|
13
|
+
askSize,
|
|
14
|
+
bid,
|
|
15
|
+
bidSize,
|
|
16
|
+
close,
|
|
17
|
+
last,
|
|
18
|
+
open,
|
|
19
|
+
phase,
|
|
20
|
+
ric,
|
|
21
|
+
scenario
|
|
22
|
+
];
|
|
23
|
+
declare const pricesTable: import("../..").Table;
|
|
24
|
+
export default pricesTable;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VuuModule } from "./VuuModule";
|
|
2
|
+
declare class ModuleContainer {
|
|
3
|
+
#private;
|
|
4
|
+
private constructor();
|
|
5
|
+
static get instance(): ModuleContainer;
|
|
6
|
+
register(module: VuuModule<any>): void;
|
|
7
|
+
get(name: string): VuuModule<string>;
|
|
8
|
+
get moduleNames(): MapIterator<string>;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: ModuleContainer;
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { DataSourceBase, DataSourceConfig, DataSourceRowWithBigint, DataSourceSubscribedMessage, DataSourceVisualLinkCreatedMessage, EditSessionMode, CopyOption, SessionDataSourceOverrides, SessionType, TableSchema } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import type { VuuMenu, VuuLink, LinkDescriptorWithLabel, VuuRpcMenuResponse, VuuCreateVisualLink, VuuRemoveVisualLink, VuuRpcServiceRequest, RpcResultSuccess, RpcResultError, VuuRpcMenuRequest } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
import { Table } from "../../Table";
|
|
4
|
+
import { TickingArrayDataSource } from "../../TickingArrayDataSource";
|
|
5
|
+
export interface IVuuModule<T extends string = string> {
|
|
6
|
+
createDataSource: (tableName: T, viewport?: string, config?: DataSourceConfig & {
|
|
7
|
+
session?: SessionDataSourceOverrides;
|
|
8
|
+
}) => DataSourceBase<DataSourceRowWithBigint>;
|
|
9
|
+
}
|
|
10
|
+
export type SessionTableMap = Record<string, Table>;
|
|
11
|
+
export type ServiceHandler = (rpcRequest: VuuRpcServiceRequest) => Promise<RpcResultSuccess | RpcResultError>;
|
|
12
|
+
export type MenuServiceHandler = (rpcRequest: VuuRpcMenuRequest) => Promise<VuuRpcMenuResponse>;
|
|
13
|
+
export type RpcService = {
|
|
14
|
+
rpcName: string;
|
|
15
|
+
service: ServiceHandler;
|
|
16
|
+
};
|
|
17
|
+
export type RpcMenuService = {
|
|
18
|
+
rpcName: string;
|
|
19
|
+
service: MenuServiceHandler;
|
|
20
|
+
};
|
|
21
|
+
export type VuuModuleOptions = {
|
|
22
|
+
/** Column written by session services (deleteRow, endEditSession) to report row-level status.
|
|
23
|
+
* Defaults to `"vuuMsg"` which matches the column added by `sessionTableSchema`. */
|
|
24
|
+
sessionTableMessageColumn?: string;
|
|
25
|
+
};
|
|
26
|
+
type Subscription = {
|
|
27
|
+
viewportId: string;
|
|
28
|
+
dataSource: DataSourceBase<DataSourceRowWithBigint>;
|
|
29
|
+
sessionTableName?: string;
|
|
30
|
+
sourceTableName?: string;
|
|
31
|
+
};
|
|
32
|
+
export declare abstract class VuuModule<T extends string = string> implements IVuuModule<T> {
|
|
33
|
+
#private;
|
|
34
|
+
constructor(name: string, { sessionTableMessageColumn }?: VuuModuleOptions);
|
|
35
|
+
protected abstract menus?: Record<T, VuuMenu | undefined> | undefined;
|
|
36
|
+
protected abstract schemas: Record<T, Readonly<TableSchema>>;
|
|
37
|
+
protected abstract tables: Record<T, Table>;
|
|
38
|
+
protected abstract menuServices?: Record<T, RpcMenuService[] | undefined> | undefined;
|
|
39
|
+
protected abstract services?: Record<T, RpcService[] | undefined> | undefined;
|
|
40
|
+
protected abstract visualLinks?: Record<T, VuuLink[] | undefined>;
|
|
41
|
+
getTableSchema(tableName: string): Record<T, Readonly<TableSchema>>[T];
|
|
42
|
+
getTableList(): string[];
|
|
43
|
+
protected handlePostSubscribeActivities: ({ clientViewportId, tableSchema, }: DataSourceSubscribedMessage) => void;
|
|
44
|
+
protected unregisterViewport: (viewportId: string) => void;
|
|
45
|
+
get name(): string;
|
|
46
|
+
getSubscriptionByViewport(viewportId: string): Subscription;
|
|
47
|
+
getSubscribedDataSource(vpId: string): DataSourceBase<DataSourceRowWithBigint>;
|
|
48
|
+
getLinks: (subscriptionMap: Map<string, Subscription[]>, vuuLinks: VuuLink[]) => LinkDescriptorWithLabel[];
|
|
49
|
+
visualLinkService: (message: VuuCreateVisualLink | VuuRemoveVisualLink) => Promise<DataSourceVisualLinkCreatedMessage | void>;
|
|
50
|
+
getVisualLinks: (tableName: string) => LinkDescriptorWithLabel[] | undefined;
|
|
51
|
+
createDataSource: (tableName: T, viewport?: string, config?: DataSourceConfig & {
|
|
52
|
+
session?: SessionDataSourceOverrides;
|
|
53
|
+
}) => DataSourceBase<DataSourceRowWithBigint>;
|
|
54
|
+
getServices(tableName: T): RpcService[];
|
|
55
|
+
getMenuServices(tableName: T): RpcMenuService[];
|
|
56
|
+
protected get sessionTableMap(): SessionTableMap;
|
|
57
|
+
protected getSessionTable(sessionTableName: string): Table;
|
|
58
|
+
protected getSessionTable(sessionTableName: string, throwIfNotFound: true): Table;
|
|
59
|
+
protected getSessionTable(sessionTableName: string, throwIfNotFound: false): Table | undefined;
|
|
60
|
+
protected deleteRow: ServiceHandler;
|
|
61
|
+
private deleteSelectedRows;
|
|
62
|
+
private undoRowChange;
|
|
63
|
+
private getColumnDescriptors;
|
|
64
|
+
private editCell;
|
|
65
|
+
private beginEditSessionMenuHandler;
|
|
66
|
+
/**
|
|
67
|
+
* Creates a standalone session table.
|
|
68
|
+
* The `copyOption` determines which rows are copied into the session table.
|
|
69
|
+
* Returns the session table reference so the caller can subscribe to it.
|
|
70
|
+
*/
|
|
71
|
+
private createSessionTableService;
|
|
72
|
+
private beginEditSession;
|
|
73
|
+
private addRow;
|
|
74
|
+
private endEditSession;
|
|
75
|
+
private applyBulkEdits;
|
|
76
|
+
protected createSessionTable(sourceTable: Table, sessionTableName: string, editSessionMode: EditSessionMode | CopyOption, dataSource: TickingArrayDataSource, sessionType?: SessionType): Table;
|
|
77
|
+
protected createSessionTableWithAllRows({ data, schema }: Table, _sessionTableName: string): Table;
|
|
78
|
+
protected createEmptySessionTable({ schema }: Table, sessionTableName: string, sessionType?: SessionType): Table;
|
|
79
|
+
protected createSessionTableFromSelectedRows({ data, map, schema }: Table, sessionTableName: string, dataSource: TickingArrayDataSource): Table;
|
|
80
|
+
}
|
|
81
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TableSchema } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import { Table } from "../../Table";
|
|
3
|
+
import { VuuRowDataItemType, VuuTable } from "@vuu-ui/vuu-protocol-types";
|
|
4
|
+
import { ColumnMap } from "@vuu-ui/vuu-utils";
|
|
5
|
+
import { UpdateGenerator } from "../../rowUpdates";
|
|
6
|
+
declare class TableContainer {
|
|
7
|
+
#private;
|
|
8
|
+
private constructor();
|
|
9
|
+
static get instance(): TableContainer;
|
|
10
|
+
createTable: (schema: TableSchema, data: Array<Array<VuuRowDataItemType | bigint>>, dataMap: ColumnMap, updateGenerator?: UpdateGenerator) => Table;
|
|
11
|
+
createJoinTable(joinTable: VuuTable, { table: t1 }: VuuTable, { table: t2 }: VuuTable, joinColumn: string): Table;
|
|
12
|
+
addTable(table: Table): void;
|
|
13
|
+
getTable<T = Table>(tableName: string): NonNullable<T>;
|
|
14
|
+
}
|
|
15
|
+
declare const _default: TableContainer;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function random(min: number, max: number): number;
|
|
2
|
+
export declare function randomPercentage(value: number): number;
|
|
3
|
+
export type PriceGenerator = (min: number, max: number) => number;
|
|
4
|
+
export declare const nextRandomDouble: PriceGenerator;
|
|
5
|
+
export declare const initBidAsk: (priceMaxDelta: number, nextRandomDouble: PriceGenerator) => number[];
|
|
6
|
+
export declare const generateNextBidAsk: (bid: number, ask: number, spreadMultipler: number, priceMaxDelta: number, nextRandomDouble: PriceGenerator) => number[];
|
|
7
|
+
export declare const withNanoMs: (ts: number, nanos?: number) => bigint;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./ArrayProxy";
|
|
2
|
+
export * from "./core/module/VuuModule";
|
|
3
|
+
export { default as tableContainer } from "./core/table/TableContainer";
|
|
4
|
+
export * from "./local-datasource-provider/LocalDatasourceProvider";
|
|
5
|
+
export * from "./makeSuggestions";
|
|
6
|
+
export * from "./schemas";
|
|
7
|
+
export * from "./simul";
|
|
8
|
+
export * from "./basket";
|
|
9
|
+
export { buildDataColumnMap, buildDataColumnMapFromSchema, Table, type TableEvents, } from "./Table";
|
|
10
|
+
export * from "./test";
|
|
11
|
+
export * from "./TickingArrayDataSource";
|
|
12
|
+
export * from "./vuu-row-generator";
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DataSourceRow } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
export declare const makeSuggestions: (data: DataSourceRow<bigint | VuuRowDataItemType>[], columnIndex: number, pattern?: string) => Promise<string[]>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VuuRange, VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
+
import { Table } from "./Table";
|
|
3
|
+
export type UpdateHandler = (updates: (RowUpdates | RowInsert | RowDelete)[]) => void;
|
|
4
|
+
export interface UpdateGenerator {
|
|
5
|
+
setTable: (table: Table) => void;
|
|
6
|
+
setRange: (range: VuuRange) => void;
|
|
7
|
+
}
|
|
8
|
+
export type UpdateType = "I" | "D" | "U";
|
|
9
|
+
type MAXIMUM_ALLOWED_BOUNDARY = 20;
|
|
10
|
+
type RepeatingTuple<Tuple extends Array<unknown>, Result extends Array<unknown> = [], Count extends ReadonlyArray<number> = []> = Count["length"] extends MAXIMUM_ALLOWED_BOUNDARY ? Result : Tuple extends [] ? [] : Result extends [] ? RepeatingTuple<Tuple, Tuple, [...Count, 1]> : RepeatingTuple<Tuple, Result | [...Result, ...Tuple], [...Count, 1]>;
|
|
11
|
+
type UpdatePairs = RepeatingTuple<[number, VuuRowDataItemType]>;
|
|
12
|
+
export type RowUpdates = ["U", number, ...UpdatePairs];
|
|
13
|
+
export type RowInsert = ["I", ...VuuRowDataItemType[]];
|
|
14
|
+
export type RowDelete = ["D", string];
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TableSchema } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import { type BasketsTableName } from "./basket/basket-schemas";
|
|
3
|
+
import { type SimulTableName } from "./simul/simul-schemas";
|
|
4
|
+
import { TestTableName } from "./test/TestModule";
|
|
5
|
+
export type VuuTableName = BasketsTableName | SimulTableName | TestTableName;
|
|
6
|
+
export declare const schemas: Record<VuuTableName, TableSchema>;
|
|
7
|
+
export declare const getAllSchemas: () => Record<VuuTableName, TableSchema>;
|
|
8
|
+
export declare const getSchema: (tableName: VuuTableName) => Readonly<TableSchema>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
+
import { Table } from "./Table";
|
|
3
|
+
import type { TableSchema } from "@vuu-ui/vuu-data-types";
|
|
4
|
+
export declare const sessionTableRow: (row: Array<bigint | VuuRowDataItemType>, schema: TableSchema) => (bigint | VuuRowDataItemType)[];
|
|
5
|
+
export declare const createSessionTableFromSelectedRows: (table: Table, selectedRowIds: string[]) => Table;
|
|
6
|
+
export declare const sessionTableSchema: (schema: TableSchema) => TableSchema;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { VuuLink, VuuMenu } from "@vuu-ui/vuu-protocol-types";
|
|
2
|
+
import { MenuServiceHandler, RpcMenuService, RpcService, ServiceHandler, VuuModule } from "../core/module/VuuModule";
|
|
3
|
+
import { Table } from "../Table";
|
|
4
|
+
import { type SimulTableName } from "./simul-schemas";
|
|
5
|
+
/**
|
|
6
|
+
* This is an example of how we might extend the built-in VuuModule to
|
|
7
|
+
* implement a module-specific service in such a way that it can invoke
|
|
8
|
+
* methods on the VuuModule.
|
|
9
|
+
*/
|
|
10
|
+
export declare class SimulModule extends VuuModule<SimulTableName> {
|
|
11
|
+
#private;
|
|
12
|
+
constructor();
|
|
13
|
+
get menus(): Record<SimulTableName, VuuMenu | undefined> | undefined;
|
|
14
|
+
get schemas(): Readonly<Record<SimulTableName, Readonly<import("@vuu-ui/vuu-data-types").TableSchema>>>;
|
|
15
|
+
get editServices(): undefined;
|
|
16
|
+
get menuServices(): Record<SimulTableName, RpcMenuService[] | undefined> | undefined;
|
|
17
|
+
get services(): Record<SimulTableName, RpcService[] | undefined> | undefined;
|
|
18
|
+
get tables(): Record<SimulTableName, Table>;
|
|
19
|
+
get visualLinks(): Record<SimulTableName, VuuLink[] | undefined>;
|
|
20
|
+
cancelOrder: MenuServiceHandler;
|
|
21
|
+
startOrders: ServiceHandler;
|
|
22
|
+
stopOrders: ServiceHandler;
|
|
23
|
+
}
|
|
24
|
+
export declare const simulModule: SimulModule;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const accounts: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const algos: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const currencies: string[];
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
type ask = number;
|
|
2
|
+
type askSize = number;
|
|
3
|
+
type bbg = string;
|
|
4
|
+
type bid = number;
|
|
5
|
+
type bidSize = number;
|
|
6
|
+
type close = number;
|
|
7
|
+
type currency = string;
|
|
8
|
+
type description = string;
|
|
9
|
+
type exchange = string;
|
|
10
|
+
type isin = string;
|
|
11
|
+
type last = number;
|
|
12
|
+
type lotSize = number;
|
|
13
|
+
type open = number;
|
|
14
|
+
type phase = string;
|
|
15
|
+
type ric = string;
|
|
16
|
+
type scenario = string;
|
|
17
|
+
type vuuCreatedTimestamp = number;
|
|
18
|
+
type vuuUpdatedTimestamp = number;
|
|
19
|
+
export type InstrumentPricesDataRow = [
|
|
20
|
+
ask,
|
|
21
|
+
askSize,
|
|
22
|
+
bbg,
|
|
23
|
+
bid,
|
|
24
|
+
bidSize,
|
|
25
|
+
close,
|
|
26
|
+
currency,
|
|
27
|
+
description,
|
|
28
|
+
exchange,
|
|
29
|
+
isin,
|
|
30
|
+
last,
|
|
31
|
+
lotSize,
|
|
32
|
+
open,
|
|
33
|
+
phase,
|
|
34
|
+
ric,
|
|
35
|
+
scenario,
|
|
36
|
+
vuuCreatedTimestamp,
|
|
37
|
+
vuuUpdatedTimestamp
|
|
38
|
+
];
|
|
39
|
+
export declare const InstrumentPricesColumnMap: {
|
|
40
|
+
ask: number;
|
|
41
|
+
askSize: number;
|
|
42
|
+
bbg: number;
|
|
43
|
+
bid: number;
|
|
44
|
+
bidSize: number;
|
|
45
|
+
close: number;
|
|
46
|
+
currency: number;
|
|
47
|
+
description: number;
|
|
48
|
+
exchange: number;
|
|
49
|
+
isin: number;
|
|
50
|
+
last: number;
|
|
51
|
+
lotSize: number;
|
|
52
|
+
open: number;
|
|
53
|
+
phase: number;
|
|
54
|
+
ric: number;
|
|
55
|
+
scenario: number;
|
|
56
|
+
vuuCreatedTimestamp: number;
|
|
57
|
+
vuuUpdatedTimestamp: number;
|
|
58
|
+
};
|
|
59
|
+
declare const instrumentPrices: InstrumentPricesDataRow[];
|
|
60
|
+
export { instrumentPrices };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const instrumentsExtendedTable: import("../..").Table;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type bbg = string;
|
|
2
|
+
export type currency = string;
|
|
3
|
+
export type ric = string;
|
|
4
|
+
export type description = string;
|
|
5
|
+
export type exchange = string;
|
|
6
|
+
export type price = string;
|
|
7
|
+
export type date = number;
|
|
8
|
+
export type InstrumentsDataRow = [
|
|
9
|
+
bbg,
|
|
10
|
+
currency,
|
|
11
|
+
description,
|
|
12
|
+
exchange,
|
|
13
|
+
string,
|
|
14
|
+
number,
|
|
15
|
+
ric,
|
|
16
|
+
date,
|
|
17
|
+
date,
|
|
18
|
+
string
|
|
19
|
+
];
|
|
20
|
+
export declare const InstrumentColumnMap: {
|
|
21
|
+
readonly bbg: 0;
|
|
22
|
+
readonly currency: 1;
|
|
23
|
+
readonly description: 2;
|
|
24
|
+
readonly exchange: 3;
|
|
25
|
+
readonly string: 4;
|
|
26
|
+
readonly number: 5;
|
|
27
|
+
readonly ric: 6;
|
|
28
|
+
readonly vuuCreatedTimestamp: 7;
|
|
29
|
+
readonly vuuUpdatedTimestamp: 8;
|
|
30
|
+
readonly vuuMsg: 9;
|
|
31
|
+
};
|
|
32
|
+
declare const instrumentsData: InstrumentsDataRow[];
|
|
33
|
+
export declare const getRic: (defaultRic: string) => string;
|
|
34
|
+
export declare const instrumentsTable: import("../..").Table;
|
|
35
|
+
export { instrumentsData };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const convertStringToBaseTenNumber: (value: string) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const alphabet: string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const alphanumeric: (string | number)[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const baseTenNumbers: number[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateCusipCheckCode: (cusip: string) => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateCusipWithoutCheckCode: () => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateCusip: () => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateRandomAlphanumeric: () => string | number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateRandomBaseTenNumber: () => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateRandomStringOfAlphanumericChars: () => string;
|
package/types/src/simul/reference-data/isin-generator/generate-random-string-of-base-ten-chars.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const generateRandomStringOfBaseTenChars: () => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isinGenerator: () => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isOdd: (value: number) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const lotsizes: number[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const orderStatus: string[];
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type status = string;
|
|
2
|
+
export type ccy = string;
|
|
3
|
+
export type created = number;
|
|
4
|
+
export type filledQuantity = number;
|
|
5
|
+
export type lastUpdate = number;
|
|
6
|
+
export type orderId = string;
|
|
7
|
+
export type quantity = number;
|
|
8
|
+
export type ric = string;
|
|
9
|
+
export type side = string;
|
|
10
|
+
export type trader = string;
|
|
11
|
+
export type OrdersDataRow = [
|
|
12
|
+
status,
|
|
13
|
+
ccy,
|
|
14
|
+
created,
|
|
15
|
+
filledQuantity,
|
|
16
|
+
lastUpdate,
|
|
17
|
+
orderId,
|
|
18
|
+
quantity,
|
|
19
|
+
ric,
|
|
20
|
+
side,
|
|
21
|
+
trader
|
|
22
|
+
];
|
|
23
|
+
export declare const OrderColumnMap: {
|
|
24
|
+
readonly ccy: 0;
|
|
25
|
+
readonly created: 1;
|
|
26
|
+
readonly filledQuantity: 2;
|
|
27
|
+
readonly lastUpdate: 3;
|
|
28
|
+
readonly orderId: 4;
|
|
29
|
+
readonly quantity: 5;
|
|
30
|
+
readonly ric: 6;
|
|
31
|
+
readonly side: 7;
|
|
32
|
+
readonly trader: 8;
|
|
33
|
+
};
|
|
34
|
+
declare const ordersData: OrdersDataRow[];
|
|
35
|
+
export declare const ordersTable: import("../..").Table;
|
|
36
|
+
export { ordersData };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const priceStrategies: string[];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type ask = number;
|
|
2
|
+
type askSize = number;
|
|
3
|
+
type bid = number;
|
|
4
|
+
type bidSize = number;
|
|
5
|
+
type close = number;
|
|
6
|
+
type last = number;
|
|
7
|
+
type open = number;
|
|
8
|
+
type phase = "C";
|
|
9
|
+
type ric = string;
|
|
10
|
+
type scenario = "close";
|
|
11
|
+
type lastUpdate = number;
|
|
12
|
+
type created = number;
|
|
13
|
+
type vuuMsg = string;
|
|
14
|
+
export type PricesDataRow = [
|
|
15
|
+
ask,
|
|
16
|
+
askSize,
|
|
17
|
+
bid,
|
|
18
|
+
bidSize,
|
|
19
|
+
close,
|
|
20
|
+
last,
|
|
21
|
+
open,
|
|
22
|
+
phase,
|
|
23
|
+
ric,
|
|
24
|
+
scenario,
|
|
25
|
+
lastUpdate,
|
|
26
|
+
created,
|
|
27
|
+
vuuMsg
|
|
28
|
+
];
|
|
29
|
+
declare const bid: number, bidSize: number, ask: number, askSize: number;
|
|
30
|
+
declare const lastUpdate: number;
|
|
31
|
+
declare const created: number;
|
|
32
|
+
declare const pricesData: Array<PricesDataRow>;
|
|
33
|
+
export declare const pricesTable: import("../..").Table;
|
|
34
|
+
export { pricesData };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const sides: string[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TableSchema } from "@vuu-ui/vuu-data-types";
|
|
2
|
+
import { VuuTable } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
export type SimulTableName = "instruments" | "instrumentsExtended" | "instrumentPrices" | "orders" | "childOrders" | "parentOrders" | "prices";
|
|
4
|
+
export declare const schemas: Readonly<Record<SimulTableName, Readonly<TableSchema>>>;
|
|
5
|
+
export type SimulVuuTable = {
|
|
6
|
+
module: "SIMUL";
|
|
7
|
+
table: SimulTableName;
|
|
8
|
+
};
|
|
9
|
+
export declare const isSimulTable: (table: VuuTable) => table is SimulVuuTable;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type RpcMenuService, VuuModule } from "../core/module/VuuModule";
|
|
2
|
+
import { type Table } from "../Table";
|
|
3
|
+
import type { TableSchema } from "@vuu-ui/vuu-data-types";
|
|
4
|
+
export type TestTableName = "TestDates" | "TwoHundredColumns" | "LinkParent" | "LinkChild" | "ChartTable" | "MaxScrollEndTable" | "TestEditEmpty" | "TestEdit";
|
|
5
|
+
declare class TestModule extends VuuModule<TestTableName> {
|
|
6
|
+
#private;
|
|
7
|
+
constructor();
|
|
8
|
+
get menus(): undefined;
|
|
9
|
+
get services(): undefined;
|
|
10
|
+
get menuServices(): Record<TestTableName, RpcMenuService[] | undefined> | undefined;
|
|
11
|
+
get schemas(): Record<TestTableName, TableSchema>;
|
|
12
|
+
get tables(): Record<TestTableName, Table>;
|
|
13
|
+
get visualLinks(): undefined;
|
|
14
|
+
}
|
|
15
|
+
export declare const testModule: TestModule;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./TestModule";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ColumnDescriptor } from "@vuu-ui/vuu-table-types";
|
|
2
|
+
import type { VuuRowDataItemType, VuuTable } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
import { UpdateGenerator } from "./rowUpdates";
|
|
4
|
+
type GenerateRowFunc = (index: number) => VuuRowDataItemType[];
|
|
5
|
+
export type RowGeneratorFactory = (columns: string[]) => GenerateRowFunc;
|
|
6
|
+
export type ColumnGeneratorFn = (columns?: number | string[], columnConfig?: {
|
|
7
|
+
[key: string]: Partial<ColumnDescriptor>;
|
|
8
|
+
}) => ColumnDescriptor[];
|
|
9
|
+
export declare const DefaultRowGenerator: RowGeneratorFactory;
|
|
10
|
+
export declare const DefaultColumnGenerator: ColumnGeneratorFn;
|
|
11
|
+
export declare const defaultGenerators: {
|
|
12
|
+
ColumnGenerator: ColumnGeneratorFn;
|
|
13
|
+
RowGenerator: RowGeneratorFactory;
|
|
14
|
+
};
|
|
15
|
+
export declare const getColumnAndRowGenerator: (table?: VuuTable) => [ColumnGeneratorFn, RowGeneratorFactory] | [ColumnGeneratorFn, RowGeneratorFactory, () => UpdateGenerator];
|
|
16
|
+
export declare const populateArray: (count: number, colGen: ColumnGeneratorFn, rowGen: RowGeneratorFactory, columns?: number | string[]) => VuuRowDataItemType[][];
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type UserAdminSnapshot, type UserAdminTableName } from "@heswell/user-admin/contracts";
|
|
2
|
+
import { InMemoryUserAdminStore } from "@heswell/user-admin/in-memory";
|
|
3
|
+
import type { TableSchema } from "@vuu-ui/vuu-data-types";
|
|
4
|
+
import { VuuModule, type RpcService } from "../core/module/VuuModule";
|
|
5
|
+
import { Table } from "../Table";
|
|
6
|
+
type UserAdminTables = Record<UserAdminTableName, Table>;
|
|
7
|
+
export declare class UserAdminModule extends VuuModule<UserAdminTableName> {
|
|
8
|
+
#private;
|
|
9
|
+
readonly store: InMemoryUserAdminStore;
|
|
10
|
+
constructor(snapshot?: UserAdminSnapshot);
|
|
11
|
+
get schemas(): Record<UserAdminTableName, Readonly<TableSchema>>;
|
|
12
|
+
get tables(): UserAdminTables;
|
|
13
|
+
get menus(): {
|
|
14
|
+
clients: undefined;
|
|
15
|
+
group_roles: undefined;
|
|
16
|
+
groups: undefined;
|
|
17
|
+
roles: undefined;
|
|
18
|
+
user_group_roles: undefined;
|
|
19
|
+
user_groups: undefined;
|
|
20
|
+
users: undefined;
|
|
21
|
+
};
|
|
22
|
+
get visualLinks(): undefined;
|
|
23
|
+
get menuServices(): undefined;
|
|
24
|
+
get services(): Record<UserAdminTableName, RpcService[]>;
|
|
25
|
+
reconcile(): Promise<void>;
|
|
26
|
+
protected createSessionTable(sourceTable: Table, sessionTableName: string, editSessionMode: import("@vuu-ui/vuu-data-types").EditSessionMode | import("@vuu-ui/vuu-data-types").CopyOption, dataSource: import("../TickingArrayDataSource").TickingArrayDataSource, sessionType?: import("@vuu-ui/vuu-data-types").SessionType): Table;
|
|
27
|
+
protected beforeSessionSave(sourceTable: Table, sessionTable: Table): Promise<void>;
|
|
28
|
+
protected afterSessionSave(sourceTable: Table, sessionTable: Table): Promise<void>;
|
|
29
|
+
private saveGroupsFromSession;
|
|
30
|
+
private saveGroupRoleAssignments;
|
|
31
|
+
private resolveGroupRoleAssignments;
|
|
32
|
+
private saveClientRolesFromSession;
|
|
33
|
+
private mutation;
|
|
34
|
+
private addUser;
|
|
35
|
+
private updateUser;
|
|
36
|
+
private deleteUser;
|
|
37
|
+
private addGroup;
|
|
38
|
+
private updateGroup;
|
|
39
|
+
private deleteGroup;
|
|
40
|
+
private addClient;
|
|
41
|
+
private updateClient;
|
|
42
|
+
private addRole;
|
|
43
|
+
private addClientRole;
|
|
44
|
+
private updateRole;
|
|
45
|
+
private assignGroupRole;
|
|
46
|
+
private removeGroupRole;
|
|
47
|
+
private assignUserToGroup;
|
|
48
|
+
private removeUserFromGroup;
|
|
49
|
+
private getUserModuleAccessOptions;
|
|
50
|
+
private setUserModuleAccess;
|
|
51
|
+
private assertUsernameIsUnique;
|
|
52
|
+
}
|
|
53
|
+
export declare const userAdminModule: UserAdminModule;
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { UserAdminSnapshot, UserAdminTableName } from "@heswell/user-admin/contracts";
|
|
2
|
+
import type { VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
|
|
3
|
+
import type { Table } from "../Table";
|
|
4
|
+
type Row = Array<bigint | VuuRowDataItemType>;
|
|
5
|
+
type Tables = Record<UserAdminTableName, Table>;
|
|
6
|
+
export declare const resolveDisplayName: (name: string, configuredDisplayName?: string) => string;
|
|
7
|
+
export declare const projectUserAdminSnapshot: (snapshot: UserAdminSnapshot, tables: Tables) => Record<UserAdminTableName, Row[]>;
|
|
8
|
+
export declare const reconcileUserAdminTables: (snapshot: UserAdminSnapshot, tables: Tables) => void;
|
|
9
|
+
export {};
|