@ai-matrx/records 0.87.32 → 0.92.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.
- package/CHANGELOG.md +92 -0
- package/README.md +115 -0
- package/dist/{client-E0VQ0NPO.d.ts → client-DE9Mq6YX.d.cts} +8 -5
- package/dist/{client-C3ZZNfGH.d.cts → client-vJAb7g9r.d.ts} +8 -5
- package/dist/core/index.cjs +25 -7
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +23 -12
- package/dist/core/index.d.ts +23 -12
- package/dist/core/index.js +25 -7
- package/dist/core/index.js.map +1 -1
- package/dist/data/index.cjs +19 -7
- package/dist/data/index.cjs.map +1 -1
- package/dist/data/index.d.cts +12 -142
- package/dist/data/index.d.ts +12 -142
- package/dist/data/index.js +19 -7
- package/dist/data/index.js.map +1 -1
- package/dist/{declareTable-BK3zufr7.d.cts → declareTable-Btg5bql1.d.cts} +4 -4
- package/dist/{declareTable-B12XybRp.d.ts → declareTable-JKt2q34d.d.ts} +4 -4
- package/dist/entity/index.cjs +984 -0
- package/dist/entity/index.cjs.map +1 -0
- package/dist/entity/index.d.cts +36 -0
- package/dist/entity/index.d.ts +36 -0
- package/dist/entity/index.js +964 -0
- package/dist/entity/index.js.map +1 -0
- package/dist/entity/react.cjs +1024 -0
- package/dist/entity/react.cjs.map +1 -0
- package/dist/entity/react.d.cts +511 -0
- package/dist/entity/react.d.ts +511 -0
- package/dist/entity/react.js +1015 -0
- package/dist/entity/react.js.map +1 -0
- package/dist/{field-BanTVGK2.d.cts → field-BJBnTyJ0.d.cts} +1 -1
- package/dist/{field-BPABOJ2Y.d.ts → field-Ti5iAxFr.d.ts} +1 -1
- package/dist/forms/index.cjs +984 -0
- package/dist/forms/index.cjs.map +1 -0
- package/dist/forms/index.d.cts +333 -0
- package/dist/forms/index.d.ts +333 -0
- package/dist/forms/index.js +961 -0
- package/dist/forms/index.js.map +1 -0
- package/dist/index.cjs +10 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -8
- package/dist/index.d.ts +11 -8
- package/dist/index.js +10 -1
- package/dist/index.js.map +1 -1
- package/dist/memory/index.d.cts +7 -6
- package/dist/memory/index.d.ts +7 -6
- package/dist/port-CPVBfDxS.d.cts +301 -0
- package/dist/port-D2i2o7Lg.d.ts +301 -0
- package/dist/portal-Db4CYyHe.d.ts +331 -0
- package/dist/portal-DfeY2Boy.d.cts +331 -0
- package/dist/{ports-TMWX-t9l.d.ts → ports-BWtxAnXh.d.ts} +2 -2
- package/dist/{ports-D8-iuY1P.d.cts → ports-DSU2RsR6.d.cts} +2 -2
- package/dist/react/index.cjs +55 -523
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +14 -1
- package/dist/react/index.d.ts +14 -1
- package/dist/react/index.js +52 -527
- package/dist/react/index.js.map +1 -1
- package/dist/realtime/index.d.cts +2 -2
- package/dist/realtime/index.d.ts +2 -2
- package/dist/{record-DpB2QgAZ.d.cts → record-BQi92d4-.d.cts} +7 -1
- package/dist/{record-DpB2QgAZ.d.ts → record-BQi92d4-.d.ts} +7 -1
- package/dist/relation-DMwkmzgN.d.cts +230 -0
- package/dist/relation-DlcqV_W5.d.ts +230 -0
- package/dist/rule-B8kR0l01.d.ts +250 -0
- package/dist/rule-BMViCLmW.d.cts +250 -0
- package/dist/search/index.cjs +283 -0
- package/dist/search/index.cjs.map +1 -0
- package/dist/search/index.d.cts +44 -0
- package/dist/search/index.d.ts +44 -0
- package/dist/search/index.js +260 -0
- package/dist/search/index.js.map +1 -0
- package/dist/setup/index.cjs +6854 -0
- package/dist/setup/index.cjs.map +1 -0
- package/dist/setup/index.d.cts +87 -0
- package/dist/setup/index.d.ts +87 -0
- package/dist/setup/index.js +6829 -0
- package/dist/setup/index.js.map +1 -0
- package/dist/{subscription-D7KQBHXN.d.ts → subscription-5CLN3Jug.d.ts} +3 -249
- package/dist/{subscription-BD9DnJxX.d.cts → subscription-D-VEzvyy.d.cts} +3 -249
- package/dist/{table-kind-BZu8mtND.d.cts → table-kind-CVp43g6h.d.ts} +3 -558
- package/dist/{table-kind-xKxTHtrV.d.ts → table-kind-Cm6PXkWx.d.cts} +3 -558
- package/dist/templates/index.d.cts +10 -9
- package/dist/templates/index.d.ts +10 -9
- package/dist/typed-table/index.cjs +19 -7
- package/dist/typed-table/index.cjs.map +1 -1
- package/dist/typed-table/index.d.cts +10 -7
- package/dist/typed-table/index.d.ts +10 -7
- package/dist/typed-table/index.js +19 -7
- package/dist/typed-table/index.js.map +1 -1
- package/dist/{types-CLP5H4Wk.d.cts → types-9Q5SHRDJ.d.cts} +2 -2
- package/dist/{types-DmPkWQic.d.ts → types-CfYy-vdV.d.ts} +2 -2
- package/dist/{types-C2uspRtf.d.cts → types-Cs2MyE3u.d.cts} +2 -2
- package/dist/{types-Dv61jStB.d.ts → types-DF-dxB_l.d.ts} +2 -2
- package/dist/types-DTEGaxso.d.cts +139 -0
- package/dist/types-Dji5SpFS.d.ts +139 -0
- package/dist/use-cases/index.d.cts +5 -5
- package/dist/use-cases/index.d.ts +5 -5
- package/dist/{validate-CWVToe1T.d.ts → validate-BydKd-Le.d.ts} +1 -1
- package/dist/{validate-DEB_mn4Y.d.cts → validate-CqJakTKk.d.cts} +1 -1
- package/dist/versions/index.cjs +375 -0
- package/dist/versions/index.cjs.map +1 -0
- package/dist/versions/index.d.cts +160 -0
- package/dist/versions/index.d.ts +160 -0
- package/dist/versions/index.js +353 -0
- package/dist/versions/index.js.map +1 -0
- package/package.json +62 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AggregateOperation, a as AggregateFilter, D as DashboardBlockKind, b as AggregateMeasure, c as AggregateBucket, S as SubscriptionCadence } from './subscription-
|
|
2
|
-
import { U as UseCase, a as UseCaseTable, b as UseCaseField, c as UseCaseRow, d as UseCaseForm, e as UseCaseFormField, f as UseCaseNotificationTrigger, N as NotificationChannel, g as UseCaseProvenance } from './types-
|
|
1
|
+
import { A as AggregateOperation, a as AggregateFilter, D as DashboardBlockKind, b as AggregateMeasure, c as AggregateBucket, S as SubscriptionCadence } from './subscription-D-VEzvyy.cjs';
|
|
2
|
+
import { U as UseCase, a as UseCaseTable, b as UseCaseField, c as UseCaseRow, d as UseCaseForm, e as UseCaseFormField, f as UseCaseNotificationTrigger, N as NotificationChannel, g as UseCaseProvenance } from './types-Cs2MyE3u.cjs';
|
|
3
3
|
|
|
4
4
|
declare const TABLE_KERNEL_ID = "11111111-0000-4000-8000-000000000001";
|
|
5
5
|
type ConfidentialLevel = "viewer" | "commenter" | "editor";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AggregateOperation, a as AggregateFilter, D as DashboardBlockKind, b as AggregateMeasure, c as AggregateBucket, S as SubscriptionCadence } from './subscription-
|
|
2
|
-
import { U as UseCase, a as UseCaseTable, b as UseCaseField, c as UseCaseRow, d as UseCaseForm, e as UseCaseFormField, f as UseCaseNotificationTrigger, N as NotificationChannel, g as UseCaseProvenance } from './types-
|
|
1
|
+
import { A as AggregateOperation, a as AggregateFilter, D as DashboardBlockKind, b as AggregateMeasure, c as AggregateBucket, S as SubscriptionCadence } from './subscription-5CLN3Jug.js';
|
|
2
|
+
import { U as UseCase, a as UseCaseTable, b as UseCaseField, c as UseCaseRow, d as UseCaseForm, e as UseCaseFormField, f as UseCaseNotificationTrigger, N as NotificationChannel, g as UseCaseProvenance } from './types-DF-dxB_l.js';
|
|
3
3
|
|
|
4
4
|
declare const TABLE_KERNEL_ID = "11111111-0000-4000-8000-000000000001";
|
|
5
5
|
type ConfidentialLevel = "viewer" | "commenter" | "editor";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { F as FieldTypeWord, a as FieldRule } from './field-
|
|
1
|
+
import { g as TableType, h as TableDisplay, S as StorageMode, F as FieldSource, C as ComputeOn, i as FieldSensitivity, j as ContextPolicy, b as RelationFlavor, d as RelationCardinality, O as OnDelete } from './record-BQi92d4-.cjs';
|
|
2
|
+
import { F as FieldTypeWord, a as FieldRule } from './field-BJBnTyJ0.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Who the data belongs to. A test organization is created under this name — the
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { F as FieldTypeWord, a as FieldRule } from './field-
|
|
1
|
+
import { g as TableType, h as TableDisplay, S as StorageMode, F as FieldSource, C as ComputeOn, i as FieldSensitivity, j as ContextPolicy, b as RelationFlavor, d as RelationCardinality, O as OnDelete } from './record-BQi92d4-.js';
|
|
2
|
+
import { F as FieldTypeWord, a as FieldRule } from './field-Ti5iAxFr.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Who the data belongs to. A test organization is created under this name — the
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { E as EntityRefWithWords } from './relation-DMwkmzgN.cjs';
|
|
2
|
+
import { U as Uuid, R as RecordsResult } from './record-BQi92d4-.cjs';
|
|
3
|
+
|
|
4
|
+
/** §0. A link to any thing: `{token, id, label}`. A custom row's token is `record`. Every link reads as `EntityRef[]`. */
|
|
5
|
+
type EntityRef = EntityRefWithWords;
|
|
6
|
+
/** The token a custom table's row carries (platform.entity_types maps `record` → `custom.record`). */
|
|
7
|
+
declare const CUSTOM_ROW_TOKEN = "record";
|
|
8
|
+
/** §0. One column, read live — never from a generated file. */
|
|
9
|
+
interface Column {
|
|
10
|
+
/** The store's stable field key — never derived from the label. No platform key starts with "_". */
|
|
11
|
+
key: string;
|
|
12
|
+
label: string;
|
|
13
|
+
/** The store's word for what the value is: text, number, date, datetime, boolean, list, relation, formula, … */
|
|
14
|
+
type: string;
|
|
15
|
+
origin: "platform" | "custom";
|
|
16
|
+
required: boolean;
|
|
17
|
+
/** For a choice column: the words a person picks from (what a cell reads as and a write takes). */
|
|
18
|
+
choices?: string[];
|
|
19
|
+
/** For a link column: what it may point at (a custom table's id, or entity tokens). */
|
|
20
|
+
linksTo?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* For a link column: the alias, in the SAME port, that serves the table it points at — so a form can list
|
|
23
|
+
* the linked rows to pick from. Absent when no source of this Applet serves that table.
|
|
24
|
+
*/
|
|
25
|
+
linksToSource?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The store's own answer to "does this column hold more than one value" (`custom.field.multi`). A choice
|
|
28
|
+
* column's type is `list` whether it takes one word or many — only this tells them apart (Status, one
|
|
29
|
+
* value, drew as four switches and the store refused the list it sent: social planner, 2026-10-08).
|
|
30
|
+
*/
|
|
31
|
+
multi?: boolean;
|
|
32
|
+
/** The column a row is named by (the table's `title_field`) — what a link to the row reads as. */
|
|
33
|
+
title?: boolean;
|
|
34
|
+
readOnly: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** §0. One row, keyed by `Column.key`. Underscore keys are the runtime's own. */
|
|
37
|
+
interface Row {
|
|
38
|
+
_id: Uuid;
|
|
39
|
+
_version: number;
|
|
40
|
+
_organization_id: Uuid;
|
|
41
|
+
/** On a platform row only: the organization's custom fields (a real column may be named `custom`). */
|
|
42
|
+
_custom?: Record<string, unknown>;
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
}
|
|
45
|
+
/** §0. What a write carries, keyed by `Column.key`; `_custom` on platform sources. */
|
|
46
|
+
type Values = Record<string, unknown> & {
|
|
47
|
+
_custom?: Record<string, unknown>;
|
|
48
|
+
};
|
|
49
|
+
type WhereOp = "eq" | "neq" | "lt" | "lte" | "gt" | "gte" | "contains" | "in" | "empty";
|
|
50
|
+
interface WhereClause {
|
|
51
|
+
column: string;
|
|
52
|
+
op: WhereOp;
|
|
53
|
+
value?: unknown;
|
|
54
|
+
}
|
|
55
|
+
type Lane = "all" | "mine" | "team" | "orgs" | "shared" | "public" | "system";
|
|
56
|
+
/** §4. A question of one source. Every clause must hold. */
|
|
57
|
+
interface Query {
|
|
58
|
+
where?: WhereClause[];
|
|
59
|
+
search?: string;
|
|
60
|
+
sort?: {
|
|
61
|
+
column: string;
|
|
62
|
+
direction?: "asc" | "desc";
|
|
63
|
+
}[];
|
|
64
|
+
pageSize?: number;
|
|
65
|
+
/** Default: the type's "Shown to by default" knob. A custom table has one lane: what row security shows. */
|
|
66
|
+
lane?: Lane;
|
|
67
|
+
/** A filter, never a lock. Default "all". */
|
|
68
|
+
org?: Uuid | "all";
|
|
69
|
+
}
|
|
70
|
+
/** §4. One page; `cursor` is null on the last one. */
|
|
71
|
+
interface Page {
|
|
72
|
+
rows: Row[];
|
|
73
|
+
total: number | null;
|
|
74
|
+
cursor: string | null;
|
|
75
|
+
}
|
|
76
|
+
interface DataSource {
|
|
77
|
+
alias: string;
|
|
78
|
+
label: string;
|
|
79
|
+
kind: "table" | "entity";
|
|
80
|
+
canCreate: boolean;
|
|
81
|
+
canUpdate: boolean;
|
|
82
|
+
}
|
|
83
|
+
/** The one event stream a source has: these ids moved — re-read only them. `null`: cannot tell which. */
|
|
84
|
+
interface RowsEvent {
|
|
85
|
+
ids: Uuid[] | null;
|
|
86
|
+
/** The table's columns moved (one added, retired or changed): re-read `columns()` too. */
|
|
87
|
+
shape?: true;
|
|
88
|
+
}
|
|
89
|
+
type DataPortEventName = `rows:${string}`;
|
|
90
|
+
/** §4. The host's data port, scoped to ONE mounted Applet's aliases. Every call answers, never throws. */
|
|
91
|
+
interface DataPort {
|
|
92
|
+
sources(): Promise<RecordsResult<DataSource[]>>;
|
|
93
|
+
columns(alias: string): Promise<RecordsResult<Column[]>>;
|
|
94
|
+
list(alias: string, q: Query, cursor?: string): Promise<RecordsResult<Page>>;
|
|
95
|
+
get(alias: string, id: Uuid): Promise<RecordsResult<Row | null>>;
|
|
96
|
+
create(alias: string, values: Values): Promise<RecordsResult<Row>>;
|
|
97
|
+
update(alias: string, id: Uuid, patch: Values, baseVersion: number): Promise<RecordsResult<Row>>;
|
|
98
|
+
archive(alias: string, id: Uuid): Promise<RecordsResult<void>>;
|
|
99
|
+
restore(alias: string, id: Uuid): Promise<RecordsResult<void>>;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The frame's side of the §1 event stream `rows:<alias>` (the AppletHost's `host.events`). The listener
|
|
103
|
+
* stays in the frame; only the event payload `{ids, shape?}` crosses the channel.
|
|
104
|
+
*/
|
|
105
|
+
interface DataEvents {
|
|
106
|
+
on(event: DataPortEventName, listener: (event: RowsEvent) => void): () => void;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The HOST's DataPort (contracts amendment 2.2): the port plus the producer of its event streams.
|
|
110
|
+
* `subscribe` never crosses the frame/host channel — the AppletHost turns it into `rows:<alias>`.
|
|
111
|
+
*/
|
|
112
|
+
interface HostDataPort extends DataPort {
|
|
113
|
+
subscribe(event: DataPortEventName, listener: (event: RowsEvent) => void): () => void;
|
|
114
|
+
}
|
|
115
|
+
/** An alias as the Applet record declares it: one table plus its organization (an entity token is phase B). */
|
|
116
|
+
interface TableAlias {
|
|
117
|
+
kind: "table";
|
|
118
|
+
tableId: Uuid;
|
|
119
|
+
organizationId: Uuid;
|
|
120
|
+
/** Shown in `sources()`; the table's own name when left out. */
|
|
121
|
+
label?: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* An alias bound to one PLATFORM entity type (contacts, projects, tasks…), served by `@ai-matrx/entity-data`'s port.
|
|
125
|
+
* `organizationId` is an assumed organization FILTER for its lists, never a lock; writes carry the active organization.
|
|
126
|
+
*/
|
|
127
|
+
interface EntityAlias {
|
|
128
|
+
kind: "entity";
|
|
129
|
+
/** The type's token in `platform.entity_types` (`party`, `project`, `task`, …). */
|
|
130
|
+
token: string;
|
|
131
|
+
organizationId?: Uuid;
|
|
132
|
+
label?: string;
|
|
133
|
+
}
|
|
134
|
+
/** Every alias an Applet record can declare. A host routes each kind to the port that serves it. */
|
|
135
|
+
type AnyAlias = TableAlias | EntityAlias;
|
|
136
|
+
/** What the table port takes (it serves `table` aliases only). */
|
|
137
|
+
type AliasBinding = TableAlias;
|
|
138
|
+
|
|
139
|
+
export { type AliasBinding as A, type Column as C, type DataEvents as D, type EntityAlias as E, type HostDataPort as H, type Lane as L, type Page as P, type Query as Q, type Row as R, type TableAlias as T, type Values as V, type WhereClause as W, type AnyAlias as a, CUSTOM_ROW_TOKEN as b, type DataPort as c, type DataPortEventName as d, type DataSource as e, type EntityRef as f, type RowsEvent as g, type WhereOp as h };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { E as EntityRefWithWords } from './relation-DlcqV_W5.js';
|
|
2
|
+
import { U as Uuid, R as RecordsResult } from './record-BQi92d4-.js';
|
|
3
|
+
|
|
4
|
+
/** §0. A link to any thing: `{token, id, label}`. A custom row's token is `record`. Every link reads as `EntityRef[]`. */
|
|
5
|
+
type EntityRef = EntityRefWithWords;
|
|
6
|
+
/** The token a custom table's row carries (platform.entity_types maps `record` → `custom.record`). */
|
|
7
|
+
declare const CUSTOM_ROW_TOKEN = "record";
|
|
8
|
+
/** §0. One column, read live — never from a generated file. */
|
|
9
|
+
interface Column {
|
|
10
|
+
/** The store's stable field key — never derived from the label. No platform key starts with "_". */
|
|
11
|
+
key: string;
|
|
12
|
+
label: string;
|
|
13
|
+
/** The store's word for what the value is: text, number, date, datetime, boolean, list, relation, formula, … */
|
|
14
|
+
type: string;
|
|
15
|
+
origin: "platform" | "custom";
|
|
16
|
+
required: boolean;
|
|
17
|
+
/** For a choice column: the words a person picks from (what a cell reads as and a write takes). */
|
|
18
|
+
choices?: string[];
|
|
19
|
+
/** For a link column: what it may point at (a custom table's id, or entity tokens). */
|
|
20
|
+
linksTo?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* For a link column: the alias, in the SAME port, that serves the table it points at — so a form can list
|
|
23
|
+
* the linked rows to pick from. Absent when no source of this Applet serves that table.
|
|
24
|
+
*/
|
|
25
|
+
linksToSource?: string;
|
|
26
|
+
/**
|
|
27
|
+
* The store's own answer to "does this column hold more than one value" (`custom.field.multi`). A choice
|
|
28
|
+
* column's type is `list` whether it takes one word or many — only this tells them apart (Status, one
|
|
29
|
+
* value, drew as four switches and the store refused the list it sent: social planner, 2026-10-08).
|
|
30
|
+
*/
|
|
31
|
+
multi?: boolean;
|
|
32
|
+
/** The column a row is named by (the table's `title_field`) — what a link to the row reads as. */
|
|
33
|
+
title?: boolean;
|
|
34
|
+
readOnly: boolean;
|
|
35
|
+
}
|
|
36
|
+
/** §0. One row, keyed by `Column.key`. Underscore keys are the runtime's own. */
|
|
37
|
+
interface Row {
|
|
38
|
+
_id: Uuid;
|
|
39
|
+
_version: number;
|
|
40
|
+
_organization_id: Uuid;
|
|
41
|
+
/** On a platform row only: the organization's custom fields (a real column may be named `custom`). */
|
|
42
|
+
_custom?: Record<string, unknown>;
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
}
|
|
45
|
+
/** §0. What a write carries, keyed by `Column.key`; `_custom` on platform sources. */
|
|
46
|
+
type Values = Record<string, unknown> & {
|
|
47
|
+
_custom?: Record<string, unknown>;
|
|
48
|
+
};
|
|
49
|
+
type WhereOp = "eq" | "neq" | "lt" | "lte" | "gt" | "gte" | "contains" | "in" | "empty";
|
|
50
|
+
interface WhereClause {
|
|
51
|
+
column: string;
|
|
52
|
+
op: WhereOp;
|
|
53
|
+
value?: unknown;
|
|
54
|
+
}
|
|
55
|
+
type Lane = "all" | "mine" | "team" | "orgs" | "shared" | "public" | "system";
|
|
56
|
+
/** §4. A question of one source. Every clause must hold. */
|
|
57
|
+
interface Query {
|
|
58
|
+
where?: WhereClause[];
|
|
59
|
+
search?: string;
|
|
60
|
+
sort?: {
|
|
61
|
+
column: string;
|
|
62
|
+
direction?: "asc" | "desc";
|
|
63
|
+
}[];
|
|
64
|
+
pageSize?: number;
|
|
65
|
+
/** Default: the type's "Shown to by default" knob. A custom table has one lane: what row security shows. */
|
|
66
|
+
lane?: Lane;
|
|
67
|
+
/** A filter, never a lock. Default "all". */
|
|
68
|
+
org?: Uuid | "all";
|
|
69
|
+
}
|
|
70
|
+
/** §4. One page; `cursor` is null on the last one. */
|
|
71
|
+
interface Page {
|
|
72
|
+
rows: Row[];
|
|
73
|
+
total: number | null;
|
|
74
|
+
cursor: string | null;
|
|
75
|
+
}
|
|
76
|
+
interface DataSource {
|
|
77
|
+
alias: string;
|
|
78
|
+
label: string;
|
|
79
|
+
kind: "table" | "entity";
|
|
80
|
+
canCreate: boolean;
|
|
81
|
+
canUpdate: boolean;
|
|
82
|
+
}
|
|
83
|
+
/** The one event stream a source has: these ids moved — re-read only them. `null`: cannot tell which. */
|
|
84
|
+
interface RowsEvent {
|
|
85
|
+
ids: Uuid[] | null;
|
|
86
|
+
/** The table's columns moved (one added, retired or changed): re-read `columns()` too. */
|
|
87
|
+
shape?: true;
|
|
88
|
+
}
|
|
89
|
+
type DataPortEventName = `rows:${string}`;
|
|
90
|
+
/** §4. The host's data port, scoped to ONE mounted Applet's aliases. Every call answers, never throws. */
|
|
91
|
+
interface DataPort {
|
|
92
|
+
sources(): Promise<RecordsResult<DataSource[]>>;
|
|
93
|
+
columns(alias: string): Promise<RecordsResult<Column[]>>;
|
|
94
|
+
list(alias: string, q: Query, cursor?: string): Promise<RecordsResult<Page>>;
|
|
95
|
+
get(alias: string, id: Uuid): Promise<RecordsResult<Row | null>>;
|
|
96
|
+
create(alias: string, values: Values): Promise<RecordsResult<Row>>;
|
|
97
|
+
update(alias: string, id: Uuid, patch: Values, baseVersion: number): Promise<RecordsResult<Row>>;
|
|
98
|
+
archive(alias: string, id: Uuid): Promise<RecordsResult<void>>;
|
|
99
|
+
restore(alias: string, id: Uuid): Promise<RecordsResult<void>>;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The frame's side of the §1 event stream `rows:<alias>` (the AppletHost's `host.events`). The listener
|
|
103
|
+
* stays in the frame; only the event payload `{ids, shape?}` crosses the channel.
|
|
104
|
+
*/
|
|
105
|
+
interface DataEvents {
|
|
106
|
+
on(event: DataPortEventName, listener: (event: RowsEvent) => void): () => void;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The HOST's DataPort (contracts amendment 2.2): the port plus the producer of its event streams.
|
|
110
|
+
* `subscribe` never crosses the frame/host channel — the AppletHost turns it into `rows:<alias>`.
|
|
111
|
+
*/
|
|
112
|
+
interface HostDataPort extends DataPort {
|
|
113
|
+
subscribe(event: DataPortEventName, listener: (event: RowsEvent) => void): () => void;
|
|
114
|
+
}
|
|
115
|
+
/** An alias as the Applet record declares it: one table plus its organization (an entity token is phase B). */
|
|
116
|
+
interface TableAlias {
|
|
117
|
+
kind: "table";
|
|
118
|
+
tableId: Uuid;
|
|
119
|
+
organizationId: Uuid;
|
|
120
|
+
/** Shown in `sources()`; the table's own name when left out. */
|
|
121
|
+
label?: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* An alias bound to one PLATFORM entity type (contacts, projects, tasks…), served by `@ai-matrx/entity-data`'s port.
|
|
125
|
+
* `organizationId` is an assumed organization FILTER for its lists, never a lock; writes carry the active organization.
|
|
126
|
+
*/
|
|
127
|
+
interface EntityAlias {
|
|
128
|
+
kind: "entity";
|
|
129
|
+
/** The type's token in `platform.entity_types` (`party`, `project`, `task`, …). */
|
|
130
|
+
token: string;
|
|
131
|
+
organizationId?: Uuid;
|
|
132
|
+
label?: string;
|
|
133
|
+
}
|
|
134
|
+
/** Every alias an Applet record can declare. A host routes each kind to the port that serves it. */
|
|
135
|
+
type AnyAlias = TableAlias | EntityAlias;
|
|
136
|
+
/** What the table port takes (it serves `table` aliases only). */
|
|
137
|
+
type AliasBinding = TableAlias;
|
|
138
|
+
|
|
139
|
+
export { type AliasBinding as A, type Column as C, type DataEvents as D, type EntityAlias as E, type HostDataPort as H, type Lane as L, type Page as P, type Query as Q, type Row as R, type TableAlias as T, type Values as V, type WhereClause as W, type AnyAlias as a, CUSTOM_ROW_TOKEN as b, type DataPort as c, type DataPortEventName as d, type DataSource as e, type EntityRef as f, type RowsEvent as g, type WhereOp as h };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { U as UseCase, h as UseCaseSummary } from '../types-
|
|
2
|
-
export { B as BusinessIdentity, F as FormAudience, N as NotificationChannel, P as PostalAddress, i as UseCaseDashboardQuestion, j as UseCaseDocumentTemplate, b as UseCaseField, d as UseCaseForm, e as UseCaseFormField, k as UseCaseMergeField, l as UseCaseNotificationRule, f as UseCaseNotificationTrigger, m as UseCasePipeline, n as UseCasePipelineStage, g as UseCaseProvenance, o as UseCaseRelationship, c as UseCaseRow, a as UseCaseTable } from '../types-
|
|
3
|
-
export { M as MIN_ROWS_IN_PRIMARY_TABLE, R as RESOLVABLE_FIELD_TYPE_WORDS, U as UseCaseProblem, a as UseCaseVerdict, b as assertUseCase, v as validateUseCase } from '../validate-
|
|
4
|
-
import '../record-
|
|
5
|
-
import '../field-
|
|
1
|
+
import { U as UseCase, h as UseCaseSummary } from '../types-Cs2MyE3u.cjs';
|
|
2
|
+
export { B as BusinessIdentity, F as FormAudience, N as NotificationChannel, P as PostalAddress, i as UseCaseDashboardQuestion, j as UseCaseDocumentTemplate, b as UseCaseField, d as UseCaseForm, e as UseCaseFormField, k as UseCaseMergeField, l as UseCaseNotificationRule, f as UseCaseNotificationTrigger, m as UseCasePipeline, n as UseCasePipelineStage, g as UseCaseProvenance, o as UseCaseRelationship, c as UseCaseRow, a as UseCaseTable } from '../types-Cs2MyE3u.cjs';
|
|
3
|
+
export { M as MIN_ROWS_IN_PRIMARY_TABLE, R as RESOLVABLE_FIELD_TYPE_WORDS, U as UseCaseProblem, a as UseCaseVerdict, b as assertUseCase, v as validateUseCase } from '../validate-CqJakTKk.cjs';
|
|
4
|
+
import '../record-BQi92d4-.cjs';
|
|
5
|
+
import '../field-BJBnTyJ0.cjs';
|
|
6
6
|
|
|
7
7
|
/** One banned pattern, with the reason and what to do instead. */
|
|
8
8
|
interface PlaceholderPattern {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { U as UseCase, h as UseCaseSummary } from '../types-
|
|
2
|
-
export { B as BusinessIdentity, F as FormAudience, N as NotificationChannel, P as PostalAddress, i as UseCaseDashboardQuestion, j as UseCaseDocumentTemplate, b as UseCaseField, d as UseCaseForm, e as UseCaseFormField, k as UseCaseMergeField, l as UseCaseNotificationRule, f as UseCaseNotificationTrigger, m as UseCasePipeline, n as UseCasePipelineStage, g as UseCaseProvenance, o as UseCaseRelationship, c as UseCaseRow, a as UseCaseTable } from '../types-
|
|
3
|
-
export { M as MIN_ROWS_IN_PRIMARY_TABLE, R as RESOLVABLE_FIELD_TYPE_WORDS, U as UseCaseProblem, a as UseCaseVerdict, b as assertUseCase, v as validateUseCase } from '../validate-
|
|
4
|
-
import '../record-
|
|
5
|
-
import '../field-
|
|
1
|
+
import { U as UseCase, h as UseCaseSummary } from '../types-DF-dxB_l.js';
|
|
2
|
+
export { B as BusinessIdentity, F as FormAudience, N as NotificationChannel, P as PostalAddress, i as UseCaseDashboardQuestion, j as UseCaseDocumentTemplate, b as UseCaseField, d as UseCaseForm, e as UseCaseFormField, k as UseCaseMergeField, l as UseCaseNotificationRule, f as UseCaseNotificationTrigger, m as UseCasePipeline, n as UseCasePipelineStage, g as UseCaseProvenance, o as UseCaseRelationship, c as UseCaseRow, a as UseCaseTable } from '../types-DF-dxB_l.js';
|
|
3
|
+
export { M as MIN_ROWS_IN_PRIMARY_TABLE, R as RESOLVABLE_FIELD_TYPE_WORDS, U as UseCaseProblem, a as UseCaseVerdict, b as assertUseCase, v as validateUseCase } from '../validate-BydKd-Le.js';
|
|
4
|
+
import '../record-BQi92d4-.js';
|
|
5
|
+
import '../field-Ti5iAxFr.js';
|
|
6
6
|
|
|
7
7
|
/** One banned pattern, with the reason and what to do instead. */
|
|
8
8
|
interface PlaceholderPattern {
|