@vuu-ui/vuu-data-test 4.0.0-alpha.1 → 4.0.0-alpha.3

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.
@@ -1,13 +1,13 @@
1
- import { TableSchema } from "@vuu-ui/vuu-data-types";
1
+ import type { TableSchema } from "@vuu-ui/vuu-data-types";
2
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";
3
+ import type { VuuRowDataItemType, VuuTable } from "@vuu-ui/vuu-protocol-types";
4
+ import type { ColumnMap } from "@vuu-ui/vuu-utils";
5
+ import type { UpdateGenerator } from "../../rowUpdates";
6
6
  declare class TableContainer {
7
7
  #private;
8
8
  private constructor();
9
9
  static get instance(): TableContainer;
10
- createTable: (schema: TableSchema, data: Array<Array<VuuRowDataItemType | bigint>>, dataMap: ColumnMap, updateGenerator?: UpdateGenerator) => Table;
10
+ createTable: (schema: TableSchema, data?: Array<Array<VuuRowDataItemType | bigint>>, dataMap?: ColumnMap, updateGenerator?: UpdateGenerator) => Table;
11
11
  createJoinTable(joinTable: VuuTable, { table: t1 }: VuuTable, { table: t2 }: VuuTable, joinColumn: string): Table;
12
12
  addTable(table: Table): void;
13
13
  getTable<T = Table>(tableName: string): NonNullable<T>;
package/types/index.d.ts CHANGED
@@ -1,11 +1,14 @@
1
1
  export * from "./ArrayProxy";
2
2
  export * from "./core/module/VuuModule";
3
+ export { ensureVuuModule } from "./core/module/ModuleContainer";
3
4
  export { default as tableContainer } from "./core/table/TableContainer";
4
5
  export * from "./local-datasource-provider/LocalDatasourceProvider";
5
6
  export * from "./makeSuggestions";
6
7
  export * from "./schemas";
7
8
  export * from "./simul";
8
9
  export * from "./basket";
10
+ export * from "./module-admin";
11
+ export * from "./user-admin";
9
12
  export { buildDataColumnMap, buildDataColumnMapFromSchema, Table, type TableEvents, } from "./Table";
10
13
  export * from "./test";
11
14
  export * from "./TickingArrayDataSource";
@@ -0,0 +1,23 @@
1
+ import type { TableSchema } from "@vuu-ui/vuu-data-types";
2
+ import { VuuModule } from "../core/module/VuuModule";
3
+ import { type Table } from "../Table";
4
+ import { type ModuleAdminTableName } from "./module-admin-schemas";
5
+ import { type ModuleAdminSnapshot } from "./snapshot-projection";
6
+ type ModuleAdminTables = Record<ModuleAdminTableName, Table>;
7
+ export declare const MODULE_ADMIN_INITIAL_SNAPSHOT: ModuleAdminSnapshot;
8
+ export declare class ModuleAdminModule extends VuuModule<ModuleAdminTableName> {
9
+ #private;
10
+ constructor(snapshot?: ModuleAdminSnapshot);
11
+ get menus(): {
12
+ modulePermissions: undefined;
13
+ modules: undefined;
14
+ };
15
+ protected get includeDefaultServices(): boolean;
16
+ get menuServices(): undefined;
17
+ get schemas(): Record<ModuleAdminTableName, Readonly<TableSchema>>;
18
+ get services(): undefined;
19
+ get tables(): ModuleAdminTables;
20
+ get visualLinks(): undefined;
21
+ }
22
+ export declare const moduleAdminModule: ModuleAdminModule;
23
+ 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 { ModuleAccessRole, 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,14 @@
1
+ import { type ModuleAccessRole, type ModuleDefinition } 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
+ moduleAccessRoles: readonly ModuleAccessRole[];
9
+ modules: readonly ModuleDefinition[];
10
+ timestamp: number;
11
+ };
12
+ export declare const projectModuleAdminSnapshot: (snapshot: ModuleAdminSnapshot, tables: Tables) => Record<ModuleAdminTableName, Row[]>;
13
+ export declare const reconcileModuleAdminTables: (snapshot: ModuleAdminSnapshot, tables: Tables) => void;
14
+ export {};
@@ -1,8 +1,10 @@
1
- import { TableSchema } from "@vuu-ui/vuu-data-types";
1
+ import type { TableSchema } from "@vuu-ui/vuu-data-types";
2
2
  import { type BasketsTableName } from "./basket/basket-schemas";
3
3
  import { type SimulTableName } from "./simul/simul-schemas";
4
- import { TestTableName } from "./test/TestModule";
5
- export type VuuTableName = BasketsTableName | SimulTableName | TestTableName;
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;
6
8
  export declare const schemas: Record<VuuTableName, TableSchema>;
7
9
  export declare const getAllSchemas: () => Record<VuuTableName, TableSchema>;
8
10
  export declare const getSchema: (tableName: VuuTableName) => Readonly<TableSchema>;
@@ -0,0 +1,50 @@
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): Promise<void>;
29
+ private mutation;
30
+ private addUser;
31
+ private updateUser;
32
+ private deleteUser;
33
+ private addGroup;
34
+ private updateGroup;
35
+ private deleteGroup;
36
+ private addClient;
37
+ private updateClient;
38
+ private addRole;
39
+ private addClientRole;
40
+ private updateRole;
41
+ private assignGroupRole;
42
+ private removeGroupRole;
43
+ private assignUserToGroup;
44
+ private removeUserFromGroup;
45
+ private getUserModuleAccessOptions;
46
+ private setUserModuleAccess;
47
+ private assertUsernameIsUnique;
48
+ }
49
+ export declare const userAdminModule: UserAdminModule;
50
+ 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;
@@ -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 {};