@ai-matrx/records 0.72.14 → 0.72.23
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/CHANGELOG.md +54 -0
- package/dist/app-table/index.d.cts +3 -3
- package/dist/app-table/index.d.ts +3 -3
- package/dist/core/index.d.cts +5 -5
- package/dist/core/index.d.ts +5 -5
- package/dist/{declareTable-Br8pE4fr.d.cts → declareTable-CLvpMdgJ.d.cts} +2 -2
- package/dist/{declareTable-DM6z1tc-.d.ts → declareTable-DY3oN4rq.d.ts} +2 -2
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/memory/index.cjs +2681 -0
- package/dist/memory/index.cjs.map +1 -0
- package/dist/memory/index.d.cts +126 -0
- package/dist/memory/index.d.ts +126 -0
- package/dist/memory/index.js +2658 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/{ports-DKBvsoya.d.cts → ports-DKOk7AT2.d.cts} +1 -1
- package/dist/{ports-Bhu2Q3V0.d.ts → ports-Df3VghxK.d.ts} +1 -1
- package/dist/{table-kind-D6Lz7ebE.d.ts → table-kind-CD9B1vtx.d.ts} +1 -1
- package/dist/{table-kind-D6VOew74.d.cts → table-kind-e-g5kGXV.d.cts} +1 -1
- package/dist/templates/index.cjs +44 -17
- package/dist/templates/index.cjs.map +1 -1
- package/dist/templates/index.d.cts +18 -1176
- package/dist/templates/index.d.ts +18 -1176
- package/dist/templates/index.js +44 -17
- package/dist/templates/index.js.map +1 -1
- package/dist/{validate-QtFxMmJc.d.ts → types-Ba11aOEO.d.ts} +1 -42
- package/dist/{validate-DUSrx-9E.d.cts → types-BtEKp3ot.d.cts} +1 -42
- package/dist/types-DxVoKKpL.d.ts +1186 -0
- package/dist/types-dlj1-2t2.d.cts +1186 -0
- package/dist/use-cases/index.d.cts +3 -2
- package/dist/use-cases/index.d.ts +3 -2
- package/dist/validate-CMb7R_ke.d.cts +44 -0
- package/dist/validate-E-g4LAZ6.d.ts +44 -0
- package/package.json +13 -1
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { t as RecordsDataSource, R as RecordsConfig } from '../ports-DKOk7AT2.cjs';
|
|
2
|
+
import { T as TemplateSpec } from '../types-dlj1-2t2.cjs';
|
|
3
|
+
import { P as PgError } from '../field-CekLWOPw.cjs';
|
|
4
|
+
import '../types-BtEKp3ot.cjs';
|
|
5
|
+
|
|
6
|
+
type Json = Record<string, unknown>;
|
|
7
|
+
/** The ids the store's kernel tables carry everywhere (custom.table_kernel_id() and its siblings). */
|
|
8
|
+
declare const MEMORY_KERNEL: {
|
|
9
|
+
readonly table: "11111111-0000-4000-8000-000000000001";
|
|
10
|
+
readonly field: "11111111-0000-4000-8000-000000000002";
|
|
11
|
+
readonly person: "11111111-0000-4000-8000-000000000005";
|
|
12
|
+
readonly file: "11111111-0000-4000-8000-000000000006";
|
|
13
|
+
readonly rule: "11111111-0000-4000-8000-000000000003";
|
|
14
|
+
};
|
|
15
|
+
/** One stable uuid-shaped id per name (FNV-1a over the name, four lanes). */
|
|
16
|
+
declare function stableId(name: string): string;
|
|
17
|
+
interface MemoryField {
|
|
18
|
+
id: string;
|
|
19
|
+
table_id: string;
|
|
20
|
+
data: Json;
|
|
21
|
+
}
|
|
22
|
+
interface MemoryOption {
|
|
23
|
+
id: string;
|
|
24
|
+
key: string;
|
|
25
|
+
label: string;
|
|
26
|
+
color: string | null;
|
|
27
|
+
}
|
|
28
|
+
interface MemoryTable {
|
|
29
|
+
id: string;
|
|
30
|
+
token: string;
|
|
31
|
+
/** The Table's declaration as the table kernel holds it. */
|
|
32
|
+
document: Json;
|
|
33
|
+
fields: MemoryField[];
|
|
34
|
+
/** Field key → its choices, in order. */
|
|
35
|
+
options: Map<string, MemoryOption[]>;
|
|
36
|
+
/** Record id → its stored document (choice cells hold the option KEY, relations hold record ids). */
|
|
37
|
+
rows: Map<string, Json>;
|
|
38
|
+
/** Insertion order, which is the template's own row order. */
|
|
39
|
+
order: string[];
|
|
40
|
+
}
|
|
41
|
+
interface MemoryView {
|
|
42
|
+
view_id: string;
|
|
43
|
+
token: string;
|
|
44
|
+
table_id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
definition: Json;
|
|
47
|
+
filters: Json;
|
|
48
|
+
}
|
|
49
|
+
interface MemoryForm {
|
|
50
|
+
form_id: string;
|
|
51
|
+
token: string;
|
|
52
|
+
table_id: string;
|
|
53
|
+
title: string;
|
|
54
|
+
questions: Json[];
|
|
55
|
+
presentation: Json;
|
|
56
|
+
booking: Json | null;
|
|
57
|
+
}
|
|
58
|
+
interface MemoryDashboard {
|
|
59
|
+
dashboard_id: string;
|
|
60
|
+
token: string;
|
|
61
|
+
table_id: string;
|
|
62
|
+
name: string;
|
|
63
|
+
blocks: Json[];
|
|
64
|
+
}
|
|
65
|
+
interface MemoryWorld {
|
|
66
|
+
organization_id: string;
|
|
67
|
+
user_id: string;
|
|
68
|
+
/** The business's IANA zone. */
|
|
69
|
+
timezone: string;
|
|
70
|
+
today: string;
|
|
71
|
+
businessName: string;
|
|
72
|
+
tables: MemoryTable[];
|
|
73
|
+
tableById: Map<string, MemoryTable>;
|
|
74
|
+
views: MemoryView[];
|
|
75
|
+
forms: MemoryForm[];
|
|
76
|
+
dashboards: MemoryDashboard[];
|
|
77
|
+
/** Every record id → the table it belongs to. */
|
|
78
|
+
recordTable: Map<string, MemoryTable>;
|
|
79
|
+
/** Table id → the field key that is its pipeline stage. */
|
|
80
|
+
stageField: Map<string, string>;
|
|
81
|
+
}
|
|
82
|
+
interface TemplateWorldOptions {
|
|
83
|
+
/** "YYYY-MM-DD" the template's relative dates resolve against. Default: today (UTC). */
|
|
84
|
+
today?: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Walk the template's install plan into memory. Pure: the same spec and day give the same world.
|
|
88
|
+
*/
|
|
89
|
+
declare function templateWorld(spec: TemplateSpec, options?: TemplateWorldOptions): MemoryWorld;
|
|
90
|
+
|
|
91
|
+
/** What every write door answers in a preview. */
|
|
92
|
+
declare const PREVIEW_REFUSAL: PgError;
|
|
93
|
+
/** The memory store, as the seam every records-ui screen reads through. */
|
|
94
|
+
declare function memoryDataSource(world: MemoryWorld): RecordsDataSource & {
|
|
95
|
+
readonly world: MemoryWorld;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
interface TemplatePreview {
|
|
99
|
+
/** Mount this: `<RecordsMount config={preview.config}>` / `<RecordsProvider config={preview.config}>`. */
|
|
100
|
+
config: RecordsConfig;
|
|
101
|
+
world: MemoryWorld;
|
|
102
|
+
/** The template's tables in its own order: id (for `TablePage`), token, name. */
|
|
103
|
+
tables: Array<{
|
|
104
|
+
id: string;
|
|
105
|
+
token: string;
|
|
106
|
+
name: string;
|
|
107
|
+
rows: number;
|
|
108
|
+
}>;
|
|
109
|
+
forms: Array<{
|
|
110
|
+
id: string;
|
|
111
|
+
token: string;
|
|
112
|
+
title: string;
|
|
113
|
+
tableId: string;
|
|
114
|
+
booking: boolean;
|
|
115
|
+
}>;
|
|
116
|
+
dashboards: Array<{
|
|
117
|
+
id: string;
|
|
118
|
+
token: string;
|
|
119
|
+
name: string;
|
|
120
|
+
tableId: string;
|
|
121
|
+
}>;
|
|
122
|
+
}
|
|
123
|
+
/** A template, installed into memory and ready to mount. Pure for a given spec and day. */
|
|
124
|
+
declare function templatePreview(spec: TemplateSpec, options?: TemplateWorldOptions): TemplatePreview;
|
|
125
|
+
|
|
126
|
+
export { MEMORY_KERNEL, type MemoryDashboard, type MemoryField, type MemoryForm, type MemoryOption, type MemoryTable, type MemoryView, type MemoryWorld, PREVIEW_REFUSAL, type TemplatePreview, type TemplateWorldOptions, memoryDataSource, stableId, templatePreview, templateWorld };
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { t as RecordsDataSource, R as RecordsConfig } from '../ports-Df3VghxK.js';
|
|
2
|
+
import { T as TemplateSpec } from '../types-DxVoKKpL.js';
|
|
3
|
+
import { P as PgError } from '../field-CekLWOPw.js';
|
|
4
|
+
import '../types-Ba11aOEO.js';
|
|
5
|
+
|
|
6
|
+
type Json = Record<string, unknown>;
|
|
7
|
+
/** The ids the store's kernel tables carry everywhere (custom.table_kernel_id() and its siblings). */
|
|
8
|
+
declare const MEMORY_KERNEL: {
|
|
9
|
+
readonly table: "11111111-0000-4000-8000-000000000001";
|
|
10
|
+
readonly field: "11111111-0000-4000-8000-000000000002";
|
|
11
|
+
readonly person: "11111111-0000-4000-8000-000000000005";
|
|
12
|
+
readonly file: "11111111-0000-4000-8000-000000000006";
|
|
13
|
+
readonly rule: "11111111-0000-4000-8000-000000000003";
|
|
14
|
+
};
|
|
15
|
+
/** One stable uuid-shaped id per name (FNV-1a over the name, four lanes). */
|
|
16
|
+
declare function stableId(name: string): string;
|
|
17
|
+
interface MemoryField {
|
|
18
|
+
id: string;
|
|
19
|
+
table_id: string;
|
|
20
|
+
data: Json;
|
|
21
|
+
}
|
|
22
|
+
interface MemoryOption {
|
|
23
|
+
id: string;
|
|
24
|
+
key: string;
|
|
25
|
+
label: string;
|
|
26
|
+
color: string | null;
|
|
27
|
+
}
|
|
28
|
+
interface MemoryTable {
|
|
29
|
+
id: string;
|
|
30
|
+
token: string;
|
|
31
|
+
/** The Table's declaration as the table kernel holds it. */
|
|
32
|
+
document: Json;
|
|
33
|
+
fields: MemoryField[];
|
|
34
|
+
/** Field key → its choices, in order. */
|
|
35
|
+
options: Map<string, MemoryOption[]>;
|
|
36
|
+
/** Record id → its stored document (choice cells hold the option KEY, relations hold record ids). */
|
|
37
|
+
rows: Map<string, Json>;
|
|
38
|
+
/** Insertion order, which is the template's own row order. */
|
|
39
|
+
order: string[];
|
|
40
|
+
}
|
|
41
|
+
interface MemoryView {
|
|
42
|
+
view_id: string;
|
|
43
|
+
token: string;
|
|
44
|
+
table_id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
definition: Json;
|
|
47
|
+
filters: Json;
|
|
48
|
+
}
|
|
49
|
+
interface MemoryForm {
|
|
50
|
+
form_id: string;
|
|
51
|
+
token: string;
|
|
52
|
+
table_id: string;
|
|
53
|
+
title: string;
|
|
54
|
+
questions: Json[];
|
|
55
|
+
presentation: Json;
|
|
56
|
+
booking: Json | null;
|
|
57
|
+
}
|
|
58
|
+
interface MemoryDashboard {
|
|
59
|
+
dashboard_id: string;
|
|
60
|
+
token: string;
|
|
61
|
+
table_id: string;
|
|
62
|
+
name: string;
|
|
63
|
+
blocks: Json[];
|
|
64
|
+
}
|
|
65
|
+
interface MemoryWorld {
|
|
66
|
+
organization_id: string;
|
|
67
|
+
user_id: string;
|
|
68
|
+
/** The business's IANA zone. */
|
|
69
|
+
timezone: string;
|
|
70
|
+
today: string;
|
|
71
|
+
businessName: string;
|
|
72
|
+
tables: MemoryTable[];
|
|
73
|
+
tableById: Map<string, MemoryTable>;
|
|
74
|
+
views: MemoryView[];
|
|
75
|
+
forms: MemoryForm[];
|
|
76
|
+
dashboards: MemoryDashboard[];
|
|
77
|
+
/** Every record id → the table it belongs to. */
|
|
78
|
+
recordTable: Map<string, MemoryTable>;
|
|
79
|
+
/** Table id → the field key that is its pipeline stage. */
|
|
80
|
+
stageField: Map<string, string>;
|
|
81
|
+
}
|
|
82
|
+
interface TemplateWorldOptions {
|
|
83
|
+
/** "YYYY-MM-DD" the template's relative dates resolve against. Default: today (UTC). */
|
|
84
|
+
today?: string;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Walk the template's install plan into memory. Pure: the same spec and day give the same world.
|
|
88
|
+
*/
|
|
89
|
+
declare function templateWorld(spec: TemplateSpec, options?: TemplateWorldOptions): MemoryWorld;
|
|
90
|
+
|
|
91
|
+
/** What every write door answers in a preview. */
|
|
92
|
+
declare const PREVIEW_REFUSAL: PgError;
|
|
93
|
+
/** The memory store, as the seam every records-ui screen reads through. */
|
|
94
|
+
declare function memoryDataSource(world: MemoryWorld): RecordsDataSource & {
|
|
95
|
+
readonly world: MemoryWorld;
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
interface TemplatePreview {
|
|
99
|
+
/** Mount this: `<RecordsMount config={preview.config}>` / `<RecordsProvider config={preview.config}>`. */
|
|
100
|
+
config: RecordsConfig;
|
|
101
|
+
world: MemoryWorld;
|
|
102
|
+
/** The template's tables in its own order: id (for `TablePage`), token, name. */
|
|
103
|
+
tables: Array<{
|
|
104
|
+
id: string;
|
|
105
|
+
token: string;
|
|
106
|
+
name: string;
|
|
107
|
+
rows: number;
|
|
108
|
+
}>;
|
|
109
|
+
forms: Array<{
|
|
110
|
+
id: string;
|
|
111
|
+
token: string;
|
|
112
|
+
title: string;
|
|
113
|
+
tableId: string;
|
|
114
|
+
booking: boolean;
|
|
115
|
+
}>;
|
|
116
|
+
dashboards: Array<{
|
|
117
|
+
id: string;
|
|
118
|
+
token: string;
|
|
119
|
+
name: string;
|
|
120
|
+
tableId: string;
|
|
121
|
+
}>;
|
|
122
|
+
}
|
|
123
|
+
/** A template, installed into memory and ready to mount. Pure for a given spec and day. */
|
|
124
|
+
declare function templatePreview(spec: TemplateSpec, options?: TemplateWorldOptions): TemplatePreview;
|
|
125
|
+
|
|
126
|
+
export { MEMORY_KERNEL, type MemoryDashboard, type MemoryField, type MemoryForm, type MemoryOption, type MemoryTable, type MemoryView, type MemoryWorld, PREVIEW_REFUSAL, type TemplatePreview, type TemplateWorldOptions, memoryDataSource, stableId, templatePreview, templateWorld };
|