@heswell/vuu-data-engine-local 0.0.0-stage → 1.0.0

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 (81) hide show
  1. package/README.md +102 -2
  2. package/index.js +9440 -0
  3. package/package.json +37 -4
  4. package/src/ArrayProxy.d.ts +8 -0
  5. package/src/EngineDataSource.d.ts +109 -0
  6. package/src/ModuleDataSource.d.ts +41 -0
  7. package/src/RowKeys.d.ts +17 -0
  8. package/src/RuntimeVisualLink.d.ts +16 -0
  9. package/src/Table.d.ts +46 -0
  10. package/src/UpdateGenerator.d.ts +18 -0
  11. package/src/basket/BasketModule.d.ts +55 -0
  12. package/src/basket/basket-schemas.d.ts +9 -0
  13. package/src/basket/index.d.ts +2 -0
  14. package/src/basket/reference-data/constituents.d.ts +3 -0
  15. package/src/basket/reference-data/ftse100.d.ts +2 -0
  16. package/src/basket/reference-data/hsi.d.ts +2 -0
  17. package/src/basket/reference-data/nasdaq100.d.ts +2 -0
  18. package/src/basket/reference-data/prices.d.ts +24 -0
  19. package/src/basket/reference-data/sp500.d.ts +2 -0
  20. package/src/core/filter/PermissionFilter.d.ts +41 -0
  21. package/src/core/module/ModuleContainer.d.ts +15 -0
  22. package/src/core/module/VuuModule.d.ts +103 -0
  23. package/src/core/table/TableContainer.d.ts +21 -0
  24. package/src/core/user/CurrentUser.d.ts +14 -0
  25. package/src/data-utils.d.ts +7 -0
  26. package/src/default-column-definitions.d.ts +2 -0
  27. package/src/index.d.ts +19 -0
  28. package/src/local-datasource-provider/LocalDatasourceProvider.d.ts +18 -0
  29. package/src/makeSuggestions.d.ts +3 -0
  30. package/src/module-admin/ModuleAdminModule.d.ts +32 -0
  31. package/src/module-admin/index.d.ts +4 -0
  32. package/src/module-admin/module-admin-schemas.d.ts +4 -0
  33. package/src/module-admin/snapshot-projection.d.ts +13 -0
  34. package/src/notifications/NotificationModule.d.ts +39 -0
  35. package/src/notifications/NotificationsSchema.d.ts +20 -0
  36. package/src/notifications/index.d.ts +6 -0
  37. package/src/notifications/simulated/DismissNotificationRpcHandler.d.ts +8 -0
  38. package/src/notifications/simulated/SimulatedNotificationsModule.d.ts +2 -0
  39. package/src/notifications/simulated/SimulatedNotificationsProvider.d.ts +21 -0
  40. package/src/notifications/simulated/notificationsModule.d.ts +5 -0
  41. package/src/rowUpdates.d.ts +15 -0
  42. package/src/schemas.d.ts +10 -0
  43. package/src/session-table-utils.d.ts +6 -0
  44. package/src/simul/SimulModule.d.ts +24 -0
  45. package/src/simul/index.d.ts +2 -0
  46. package/src/simul/reference-data/accounts.d.ts +1 -0
  47. package/src/simul/reference-data/algos.d.ts +1 -0
  48. package/src/simul/reference-data/currencies.d.ts +1 -0
  49. package/src/simul/reference-data/index.d.ts +5 -0
  50. package/src/simul/reference-data/instrument-prices.d.ts +60 -0
  51. package/src/simul/reference-data/instruments-extended.d.ts +1 -0
  52. package/src/simul/reference-data/instruments.d.ts +35 -0
  53. package/src/simul/reference-data/isin-generator/convert-string-to-base-ten-number.d.ts +1 -0
  54. package/src/simul/reference-data/isin-generator/fixtures/alphabet.d.ts +1 -0
  55. package/src/simul/reference-data/isin-generator/fixtures/alphanumeric-values.d.ts +1 -0
  56. package/src/simul/reference-data/isin-generator/fixtures/base-ten-numbers.d.ts +1 -0
  57. package/src/simul/reference-data/isin-generator/generate-cusip-check-code.d.ts +1 -0
  58. package/src/simul/reference-data/isin-generator/generate-cusip-without-check-code.d.ts +1 -0
  59. package/src/simul/reference-data/isin-generator/generate-cusip.d.ts +1 -0
  60. package/src/simul/reference-data/isin-generator/generate-random-alphanumeric.d.ts +1 -0
  61. package/src/simul/reference-data/isin-generator/generate-random-base-ten-number.d.ts +1 -0
  62. package/src/simul/reference-data/isin-generator/generate-random-string-of-alphanumeric-chars.d.ts +1 -0
  63. package/src/simul/reference-data/isin-generator/generate-random-string-of-base-ten-chars.d.ts +1 -0
  64. package/src/simul/reference-data/isin-generator/index.d.ts +1 -0
  65. package/src/simul/reference-data/isin-generator/is-odd.d.ts +1 -0
  66. package/src/simul/reference-data/locations.d.ts +4 -0
  67. package/src/simul/reference-data/lotsizes.d.ts +1 -0
  68. package/src/simul/reference-data/orderStatus.d.ts +1 -0
  69. package/src/simul/reference-data/orders.d.ts +36 -0
  70. package/src/simul/reference-data/parent-child-orders.d.ts +4 -0
  71. package/src/simul/reference-data/priceStrategies.d.ts +1 -0
  72. package/src/simul/reference-data/prices.d.ts +34 -0
  73. package/src/simul/reference-data/sides.d.ts +1 -0
  74. package/src/simul/simul-schemas.d.ts +9 -0
  75. package/src/test/TestModule.d.ts +16 -0
  76. package/src/test/index.d.ts +1 -0
  77. package/src/user-admin/UserAdminModule.d.ts +54 -0
  78. package/src/user-admin/index.d.ts +3 -0
  79. package/src/user-admin/initialSnapshot.d.ts +2 -0
  80. package/src/user-admin/snapshot-projection.d.ts +9 -0
  81. package/src/vuu-row-generator.d.ts +17 -0
package/src/index.d.ts ADDED
@@ -0,0 +1,19 @@
1
+ export * from "./ArrayProxy";
2
+ export * from "./core/filter/PermissionFilter";
3
+ export * from "./core/module/VuuModule";
4
+ export { ensureVuuModule } from "./core/module/ModuleContainer";
5
+ export * from "./core/user/CurrentUser";
6
+ export { default as tableContainer } from "./core/table/TableContainer";
7
+ export * from "./local-datasource-provider/LocalDatasourceProvider";
8
+ export * from "./makeSuggestions";
9
+ export * from "./notifications";
10
+ export * from "./schemas";
11
+ export * from "./simul";
12
+ export * from "./basket";
13
+ export * from "./module-admin";
14
+ export * from "./user-admin";
15
+ export { buildDataColumnMap, buildDataColumnMapFromSchema, Table, type TableEvents, } from "./Table";
16
+ export * from "./test";
17
+ export * from "./EngineDataSource";
18
+ export * from "./ModuleDataSource";
19
+ export * from "./vuu-row-generator";
@@ -0,0 +1,18 @@
1
+ import { type LocalVuuServer } from "@vuu-ui/core";
2
+ import type { ReactNode } from "react";
3
+ import type { VuuModule } from "../core/module/VuuModule";
4
+ /** Data context covering every VuuModule registered in the browser. */
5
+ export declare const LocalDataSourceProvider: ({ children }: {
6
+ children: ReactNode;
7
+ }) => import("react").JSX.Element;
8
+ export interface LocalVuuServerOptions {
9
+ /** Matches the `vuu.connectionId` of the modules this server serves. */
10
+ connectionId: string;
11
+ modules: VuuModule<any>[];
12
+ }
13
+ /**
14
+ * Simulates a Vuu server in the browser, publishing the tables of the given
15
+ * modules. Pass the result to a local-mode `AuthenticationProvider` as one of
16
+ * its `localServers`.
17
+ */
18
+ export declare const createLocalVuuServer: ({ connectionId, modules, }: LocalVuuServerOptions) => LocalVuuServer;
@@ -0,0 +1,3 @@
1
+ import type { DataSourceRow } from "@vuu-ui/vuu-data-types";
2
+ import type { 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,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,39 @@
1
+ import type { TableSchema } from "@vuu-ui/vuu-data-types";
2
+ import { type RpcService, VuuModule } from "../core/module/VuuModule";
3
+ import type { PermissionFunction } from "../core/filter/PermissionFilter";
4
+ import { type Table } from "../Table";
5
+ import { type ColumnDefinition } from "./NotificationsSchema";
6
+ export type NotificationsTableName = "notifications";
7
+ /**
8
+ * Source of notifications. Started when the first dataSource is
9
+ * created for the notifications table, or explicitly via module.start().
10
+ */
11
+ export interface NotificationsProvider {
12
+ start: () => void;
13
+ stop: () => void;
14
+ }
15
+ export type NotificationsProviderFactory = (table: Table) => NotificationsProvider;
16
+ export type NotificationsServiceFactory = (table: Table, module: NotificationModule) => RpcService[];
17
+ /**
18
+ * A generic Notifications module, exposing a single 'notifications' table.
19
+ * The source of notifications (provider), the rows visible to each user
20
+ * (permissionFunction) and any rpc services (serviceFactory) are supplied
21
+ * by the consumer. Any additional columns are appended to the generic
22
+ * notification columns (see NotificationsSchema).
23
+ */
24
+ export declare class NotificationModule extends VuuModule<NotificationsTableName> {
25
+ #private;
26
+ static readonly NAME = "NOTIFICATIONS";
27
+ static readonly TABLE_NAME: "notifications";
28
+ constructor(providerFactory: NotificationsProviderFactory, permissionFunction: PermissionFunction, serviceFactory: NotificationsServiceFactory, ...additionalColumns: ColumnDefinition[]);
29
+ protected beforeCreateDataSource(): void;
30
+ get isRunning(): boolean;
31
+ start(): void;
32
+ stop(): void;
33
+ get menus(): undefined;
34
+ get menuServices(): undefined;
35
+ get schemas(): Record<"notifications", TableSchema>;
36
+ get services(): Record<"notifications", RpcService[]>;
37
+ get tables(): Record<"notifications", Table>;
38
+ get visualLinks(): undefined;
39
+ }
@@ -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,2 @@
1
+ import { NotificationModule } from "../NotificationModule";
2
+ export declare const SimulatedNotificationsModule: () => 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,5 @@
1
+ /**
2
+ * Simulated notifications. The provider starts generating notifications
3
+ * when the first dataSource is created for the notifications table.
4
+ */
5
+ export declare const notificationsModule: import("..").NotificationModule;
@@ -0,0 +1,15 @@
1
+ import type { VuuRange, VuuRowDataItemType } from "@vuu-ui/vuu-protocol-types";
2
+ import type { 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,10 @@
1
+ import type { 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 { type TestTableName } from "./test/TestModule";
5
+ import { type UserAdminTableName } from "@heswell/user-admin/contracts";
6
+ import { type ModuleAdminTableName } from "./module-admin";
7
+ export type VuuTableName = BasketsTableName | SimulTableName | TestTableName | UserAdminTableName | ModuleAdminTableName;
8
+ export declare const schemas: Record<VuuTableName, TableSchema>;
9
+ export declare const getAllSchemas: () => Record<VuuTableName, TableSchema>;
10
+ 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 type { VuuLink, VuuMenu } from "@vuu-ui/vuu-protocol-types";
2
+ import { type MenuServiceHandler, type RpcMenuService, type RpcService, type ServiceHandler, VuuModule } from "../core/module/VuuModule";
3
+ import type { 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,2 @@
1
+ export { type SimulTableName, isSimulTable, schemas as simulSchemas, } from "./simul-schemas";
2
+ export { simulModule } from "./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,5 @@
1
+ export * from "./currencies";
2
+ export * from "./instruments";
3
+ export * from "./instrument-prices";
4
+ export * from "./prices";
5
+ export * from "./locations";
@@ -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;
@@ -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,4 @@
1
+ export declare const locations: {
2
+ [key: string]: string[];
3
+ };
4
+ export declare const suffixes: string[];
@@ -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,4 @@
1
+ export declare const parentOrdersTable: import("../..").Table;
2
+ export declare const childOrdersTable: import("../..").Table;
3
+ export declare function startGeneratingNewOrders(): void;
4
+ export declare function stopGeneratingNewOrders(): void;
@@ -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 type { TableSchema } from "@vuu-ui/vuu-data-types";
2
+ import type { 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,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("../ModuleDataSource").ModuleDataSource, 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,3 @@
1
+ export { UserAdminModule, userAdminModule, } from "./UserAdminModule";
2
+ export { USER_ADMIN_INITIAL_SNAPSHOT } from "./initialSnapshot";
3
+ export { projectUserAdminSnapshot, reconcileUserAdminTables, } from "./snapshot-projection";
@@ -0,0 +1,2 @@
1
+ import type { UserAdminSnapshot } from "@heswell/user-admin";
2
+ export declare const USER_ADMIN_INITIAL_SNAPSHOT: UserAdminSnapshot;