@ai-matrx/records 0.77.2 → 0.78.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 +15 -0
- package/dist/app-table/index.cjs +94 -5
- package/dist/app-table/index.cjs.map +1 -1
- package/dist/app-table/index.d.cts +7 -7
- package/dist/app-table/index.d.ts +7 -7
- package/dist/app-table/index.js +94 -5
- package/dist/app-table/index.js.map +1 -1
- package/dist/{client-DZ3UcU4_.d.cts → client-BExNR0TK.d.cts} +5 -5
- package/dist/{client-ZIxyAOdh.d.ts → client-Byn_UthM.d.ts} +5 -5
- package/dist/core/index.cjs +98 -7
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +11 -11
- package/dist/core/index.d.ts +11 -11
- package/dist/core/index.js +98 -7
- package/dist/core/index.js.map +1 -1
- package/dist/data/index.cjs +90 -1
- package/dist/data/index.cjs.map +1 -1
- package/dist/data/index.d.cts +6 -6
- package/dist/data/index.d.ts +6 -6
- package/dist/data/index.js +90 -1
- package/dist/data/index.js.map +1 -1
- package/dist/{declareTable-BYZdFrt5.d.cts → declareTable-CgrEusy8.d.cts} +4 -4
- package/dist/{declareTable-DGSJMqGx.d.ts → declareTable-DWOh53eK.d.ts} +4 -4
- package/dist/{field-D7I9yck6.d.ts → field-B2bvpqcE.d.ts} +1 -1
- package/dist/{field-BTW7h7Wh.d.cts → field-t9aefszx.d.cts} +1 -1
- package/dist/index.cjs +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/memory/index.cjs +6 -1
- package/dist/memory/index.cjs.map +1 -1
- package/dist/memory/index.d.cts +6 -6
- package/dist/memory/index.d.ts +6 -6
- package/dist/memory/index.js +6 -1
- package/dist/memory/index.js.map +1 -1
- package/dist/{ports-CaYEF1dG.d.ts → ports-Ch4Ym0tj.d.ts} +7 -1
- package/dist/{ports-PpvsH1cQ.d.cts → ports-Cjl-IjFa.d.cts} +7 -1
- package/dist/react/index.cjs +98 -7
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +16 -0
- package/dist/react/index.d.ts +16 -0
- package/dist/react/index.js +98 -7
- 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-B7iwye2k.d.cts → record-Ba1F1CNS.d.cts} +10 -0
- package/dist/{record-B7iwye2k.d.ts → record-Ba1F1CNS.d.ts} +10 -0
- package/dist/{subscription-BWaRPLyo.d.ts → subscription-CccP6N93.d.ts} +1 -1
- package/dist/{subscription-Br30ZwIt.d.cts → subscription-DGCrwwSR.d.cts} +1 -1
- package/dist/{table-kind-Da21ZLdJ.d.ts → table-kind-BMWi8G37.d.ts} +3 -3
- package/dist/{table-kind-HAQ6WNxZ.d.cts → table-kind-BoelIMjr.d.cts} +3 -3
- package/dist/templates/index.cjs +6 -2
- package/dist/templates/index.cjs.map +1 -1
- package/dist/templates/index.d.cts +9 -9
- package/dist/templates/index.d.ts +9 -9
- package/dist/templates/index.js +6 -2
- package/dist/templates/index.js.map +1 -1
- package/dist/{types-DrJLOqVi.d.ts → types-CiHdoATO.d.ts} +2 -2
- package/dist/{types-DWZ5_3by.d.ts → types-CtyMwJvy.d.ts} +2 -2
- package/dist/{types-DYoWzHwJ.d.cts → types-D-Mhiodh.d.cts} +2 -2
- package/dist/{types-LvxsZ6Zv.d.cts → types-euaQwxnB.d.cts} +2 -2
- package/dist/use-cases/index.cjs.map +1 -1
- package/dist/use-cases/index.d.cts +5 -5
- package/dist/use-cases/index.d.ts +5 -5
- package/dist/use-cases/index.js.map +1 -1
- package/dist/{validate-j0WQoC3C.d.ts → validate-B-p3YPgA.d.ts} +1 -1
- package/dist/{validate-CRdXE73G.d.cts → validate-COvMcv8z.d.cts} +1 -1
- package/package.json +4 -4
package/dist/react/index.d.cts
CHANGED
|
@@ -1504,6 +1504,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
1504
1504
|
readonly args: "p_organization_id uuid DEFAULT NULL::uuid";
|
|
1505
1505
|
readonly returns: "TABLE(kind text, organization_id uuid, organization_name text, item_id uuid, table_id uuid, table_name text, item_row jsonb)";
|
|
1506
1506
|
readonly security: "definer";
|
|
1507
|
+
}, {
|
|
1508
|
+
readonly name: "data_home_slim";
|
|
1509
|
+
readonly args: "p_organization_id uuid DEFAULT NULL::uuid, p_search text DEFAULT NULL::text, p_include_app_tables boolean DEFAULT false";
|
|
1510
|
+
readonly returns: "jsonb";
|
|
1511
|
+
readonly security: "invoker";
|
|
1507
1512
|
}, {
|
|
1508
1513
|
readonly name: "data_home_tables";
|
|
1509
1514
|
readonly args: "p_organization_id uuid DEFAULT NULL::uuid";
|
|
@@ -4404,6 +4409,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
4404
4409
|
readonly args: "p_table_id uuid, p_to_organization_id uuid, p_expected_version integer DEFAULT NULL::integer";
|
|
4405
4410
|
readonly returns: "jsonb";
|
|
4406
4411
|
readonly security: "definer";
|
|
4412
|
+
}, {
|
|
4413
|
+
readonly name: "table_page_bundle";
|
|
4414
|
+
readonly args: "p_organization_id uuid, p_table_id uuid, p_view_id uuid DEFAULT NULL::uuid";
|
|
4415
|
+
readonly returns: "jsonb";
|
|
4416
|
+
readonly security: "invoker";
|
|
4407
4417
|
}, {
|
|
4408
4418
|
readonly name: "table_placement";
|
|
4409
4419
|
readonly args: "p_organization_id uuid, p_table_id uuid, p_data jsonb, p_is_kernel boolean DEFAULT false";
|
|
@@ -11199,6 +11209,12 @@ interface RecordsDataSource {
|
|
|
11199
11209
|
data: unknown;
|
|
11200
11210
|
error: PgError | null;
|
|
11201
11211
|
}>;
|
|
11212
|
+
/**
|
|
11213
|
+
* OPTIONAL. True for the real supabase adapters: the client may open a table page with ONE
|
|
11214
|
+
* `custom.table_page_bundle` call instead of a dozen shape doors one after another (PAGE-BUNDLE).
|
|
11215
|
+
* Leave it off for a test or replay source that does not model the bundle door.
|
|
11216
|
+
*/
|
|
11217
|
+
opensInOneCall?: boolean;
|
|
11202
11218
|
/** Reads of `custom.*` go through the schema-qualified builder, never a bare `from`. */
|
|
11203
11219
|
schema(name: string): {
|
|
11204
11220
|
from(table: string): RecordsTableQuery;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1504,6 +1504,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
1504
1504
|
readonly args: "p_organization_id uuid DEFAULT NULL::uuid";
|
|
1505
1505
|
readonly returns: "TABLE(kind text, organization_id uuid, organization_name text, item_id uuid, table_id uuid, table_name text, item_row jsonb)";
|
|
1506
1506
|
readonly security: "definer";
|
|
1507
|
+
}, {
|
|
1508
|
+
readonly name: "data_home_slim";
|
|
1509
|
+
readonly args: "p_organization_id uuid DEFAULT NULL::uuid, p_search text DEFAULT NULL::text, p_include_app_tables boolean DEFAULT false";
|
|
1510
|
+
readonly returns: "jsonb";
|
|
1511
|
+
readonly security: "invoker";
|
|
1507
1512
|
}, {
|
|
1508
1513
|
readonly name: "data_home_tables";
|
|
1509
1514
|
readonly args: "p_organization_id uuid DEFAULT NULL::uuid";
|
|
@@ -4404,6 +4409,11 @@ declare const STORE_DOORS: readonly [{
|
|
|
4404
4409
|
readonly args: "p_table_id uuid, p_to_organization_id uuid, p_expected_version integer DEFAULT NULL::integer";
|
|
4405
4410
|
readonly returns: "jsonb";
|
|
4406
4411
|
readonly security: "definer";
|
|
4412
|
+
}, {
|
|
4413
|
+
readonly name: "table_page_bundle";
|
|
4414
|
+
readonly args: "p_organization_id uuid, p_table_id uuid, p_view_id uuid DEFAULT NULL::uuid";
|
|
4415
|
+
readonly returns: "jsonb";
|
|
4416
|
+
readonly security: "invoker";
|
|
4407
4417
|
}, {
|
|
4408
4418
|
readonly name: "table_placement";
|
|
4409
4419
|
readonly args: "p_organization_id uuid, p_table_id uuid, p_data jsonb, p_is_kernel boolean DEFAULT false";
|
|
@@ -11199,6 +11209,12 @@ interface RecordsDataSource {
|
|
|
11199
11209
|
data: unknown;
|
|
11200
11210
|
error: PgError | null;
|
|
11201
11211
|
}>;
|
|
11212
|
+
/**
|
|
11213
|
+
* OPTIONAL. True for the real supabase adapters: the client may open a table page with ONE
|
|
11214
|
+
* `custom.table_page_bundle` call instead of a dozen shape doors one after another (PAGE-BUNDLE).
|
|
11215
|
+
* Leave it off for a test or replay source that does not model the bundle door.
|
|
11216
|
+
*/
|
|
11217
|
+
opensInOneCall?: boolean;
|
|
11202
11218
|
/** Reads of `custom.*` go through the schema-qualified builder, never a bare `from`. */
|
|
11203
11219
|
schema(name: string): {
|
|
11204
11220
|
from(table: string): RecordsTableQuery;
|
package/dist/react/index.js
CHANGED
|
@@ -1217,6 +1217,7 @@ var STORE_DOORS = [
|
|
|
1217
1217
|
{ name: "data_home", args: "p_organization_id uuid DEFAULT NULL::uuid, p_search text DEFAULT NULL::text, p_include_app_tables boolean DEFAULT false", returns: "jsonb", security: "definer" },
|
|
1218
1218
|
{ name: "data_home_changed_by", args: "p_asks jsonb", returns: "TABLE(organization_id uuid, id uuid, at timestamp with time zone, who text)", security: "definer" },
|
|
1219
1219
|
{ name: "data_home_items", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "TABLE(kind text, organization_id uuid, organization_name text, item_id uuid, table_id uuid, table_name text, item_row jsonb)", security: "definer" },
|
|
1220
|
+
{ name: "data_home_slim", args: "p_organization_id uuid DEFAULT NULL::uuid, p_search text DEFAULT NULL::text, p_include_app_tables boolean DEFAULT false", returns: "jsonb", security: "invoker" },
|
|
1220
1221
|
{ name: "data_home_tables", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "TABLE(table_id uuid, table_name text, organization_id uuid, organization_name text, member boolean, visibility text, updated_at timestamp with time zone, mine boolean, shared_with_me boolean, kept_by_the_app boolean, kind text, team boolean, system boolean, created_by uuid)", security: "definer" },
|
|
1221
1222
|
{ name: "data_home_tables", args: "p_organization_id uuid, p_include_app_tables boolean", returns: "TABLE(table_id uuid, table_name text, organization_id uuid, organization_name text, member boolean, visibility text, updated_at timestamp with time zone, mine boolean, shared_with_me boolean, kept_by_the_app boolean, kind text, team boolean, system boolean, created_by uuid)", security: "invoker" },
|
|
1222
1223
|
{ name: "declared_conversation", args: "", returns: "uuid", security: "invoker" },
|
|
@@ -1797,6 +1798,7 @@ var STORE_DOORS = [
|
|
|
1797
1798
|
{ name: "table_list_everywhere", args: "p_organization_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "definer" },
|
|
1798
1799
|
{ name: "table_list_everywhere", args: "p_organization_id uuid, p_include_app_tables boolean", returns: "jsonb", security: "invoker" },
|
|
1799
1800
|
{ name: "table_move", args: "p_table_id uuid, p_to_organization_id uuid, p_expected_version integer DEFAULT NULL::integer", returns: "jsonb", security: "definer" },
|
|
1801
|
+
{ name: "table_page_bundle", args: "p_organization_id uuid, p_table_id uuid, p_view_id uuid DEFAULT NULL::uuid", returns: "jsonb", security: "invoker" },
|
|
1800
1802
|
{ name: "table_placement", args: "p_organization_id uuid, p_table_id uuid, p_data jsonb, p_is_kernel boolean DEFAULT false", returns: "jsonb", security: "invoker" },
|
|
1801
1803
|
{ name: "table_record_ceiling", args: "", returns: "integer", security: "invoker" },
|
|
1802
1804
|
{ name: "table_record_ceiling", args: "p_organization_id uuid", returns: "integer", security: "invoker" },
|
|
@@ -3861,6 +3863,8 @@ function supabaseDataSource(client) {
|
|
|
3861
3863
|
const supabase = client;
|
|
3862
3864
|
const hasSchema = typeof supabase.schema === "function";
|
|
3863
3865
|
const bound = {
|
|
3866
|
+
// PAGE-BUNDLE: the real adapter opens a table page with one `custom.table_page_bundle` call.
|
|
3867
|
+
opensInOneCall: true,
|
|
3864
3868
|
rpc(fn, args, options) {
|
|
3865
3869
|
if (!hasSchema) {
|
|
3866
3870
|
return Promise.resolve(
|
|
@@ -4007,6 +4011,12 @@ function intersectIds(sets) {
|
|
|
4007
4011
|
|
|
4008
4012
|
// src/core/client.ts
|
|
4009
4013
|
var DEFAULT_SCHEMA = "custom";
|
|
4014
|
+
function canonicalArgs(value) {
|
|
4015
|
+
return JSON.stringify(
|
|
4016
|
+
value,
|
|
4017
|
+
(_key, held) => held && typeof held === "object" && !Array.isArray(held) ? Object.fromEntries(Object.keys(held).sort().map((k) => [k, held[k]])) : held
|
|
4018
|
+
);
|
|
4019
|
+
}
|
|
4010
4020
|
var A_PERSONS_REFUSAL = /* @__PURE__ */ new Set([
|
|
4011
4021
|
"refused_by_rule",
|
|
4012
4022
|
"stale_write",
|
|
@@ -4035,7 +4045,83 @@ function createRecordsClient(given) {
|
|
|
4035
4045
|
const schema = config.schema ?? DEFAULT_SCHEMA;
|
|
4036
4046
|
const org = config.organizationId;
|
|
4037
4047
|
const scream = sink(config);
|
|
4048
|
+
const BUNDLE_TTL_MS = 1e4;
|
|
4049
|
+
const BUNDLE_OPENERS = /* @__PURE__ */ new Set(["applicable_fields", "views", "view_look_read", "table_decorations", "row_actions", "reverse_columns", "record_change_actions", "grid_layout", "io_imports"]);
|
|
4050
|
+
const bundleParts = /* @__PURE__ */ new Map();
|
|
4051
|
+
const bundleFlights = /* @__PURE__ */ new Map();
|
|
4052
|
+
const bundleAsked = /* @__PURE__ */ new Map();
|
|
4053
|
+
let bundleKernel = null;
|
|
4054
|
+
const bundleKey = (door, args) => `${door}|${canonicalArgs(args)}`;
|
|
4055
|
+
function bundleTableOf(door, args) {
|
|
4056
|
+
const t = args["p_table_id"];
|
|
4057
|
+
if (door === "read_records_by_ids") {
|
|
4058
|
+
const ids = args["p_record_ids"];
|
|
4059
|
+
return typeof t === "string" && t === bundleKernel && Array.isArray(ids) && ids.length === 1 && typeof ids[0] === "string" ? ids[0] : null;
|
|
4060
|
+
}
|
|
4061
|
+
if (door === "my_levels") {
|
|
4062
|
+
const ids = args["p_ids"];
|
|
4063
|
+
return args["p_type"] === "record" && Array.isArray(ids) && ids.length === 1 && typeof ids[0] === "string" ? ids[0] : null;
|
|
4064
|
+
}
|
|
4065
|
+
return typeof t === "string" ? t : null;
|
|
4066
|
+
}
|
|
4067
|
+
async function fillBundle(tableId, viewId) {
|
|
4068
|
+
try {
|
|
4069
|
+
const response = await config.dataSource.rpc(
|
|
4070
|
+
"table_page_bundle",
|
|
4071
|
+
{ p_organization_id: org, p_table_id: tableId, p_view_id: typeof viewId === "string" ? viewId : null },
|
|
4072
|
+
{ schema }
|
|
4073
|
+
);
|
|
4074
|
+
const answer = response.data;
|
|
4075
|
+
if (response.error || !answer || !Array.isArray(answer.parts)) return;
|
|
4076
|
+
const now = Date.now();
|
|
4077
|
+
for (const part of answer.parts) {
|
|
4078
|
+
if (part.error !== void 0 || part.data === void 0) continue;
|
|
4079
|
+
if (part.door === "table_kernel_id" && typeof part.data === "string") bundleKernel = part.data;
|
|
4080
|
+
bundleParts.set(bundleKey(part.door, part.args), { data: part.data, at: now });
|
|
4081
|
+
}
|
|
4082
|
+
} catch {
|
|
4083
|
+
}
|
|
4084
|
+
}
|
|
4085
|
+
async function fromBundle(door, args) {
|
|
4086
|
+
if (!config.dataSource.opensInOneCall || !doorReady(config, "table_page_bundle")) return null;
|
|
4087
|
+
const tableId = bundleTableOf(door, args);
|
|
4088
|
+
if (tableId) {
|
|
4089
|
+
const asked = bundleAsked.get(tableId);
|
|
4090
|
+
const fresh = asked !== void 0 && Date.now() - asked < BUNDLE_TTL_MS;
|
|
4091
|
+
if (!fresh && BUNDLE_OPENERS.has(door)) {
|
|
4092
|
+
bundleAsked.set(tableId, Date.now());
|
|
4093
|
+
const flight2 = fillBundle(tableId, door === "grid_layout" ? args["p_view_id"] : null).finally(() => bundleFlights.delete(tableId));
|
|
4094
|
+
bundleFlights.set(tableId, flight2);
|
|
4095
|
+
}
|
|
4096
|
+
const flight = bundleFlights.get(tableId);
|
|
4097
|
+
if (flight) await flight;
|
|
4098
|
+
} else if (door === "table_kernel_id") {
|
|
4099
|
+
if (bundleKernel === null) {
|
|
4100
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
4101
|
+
await Promise.all([...bundleFlights.values()]);
|
|
4102
|
+
}
|
|
4103
|
+
return bundleKernel === null ? null : { data: bundleKernel };
|
|
4104
|
+
} else {
|
|
4105
|
+
return null;
|
|
4106
|
+
}
|
|
4107
|
+
const key = bundleKey(door, args);
|
|
4108
|
+
const held = bundleParts.get(key);
|
|
4109
|
+
if (!held) return null;
|
|
4110
|
+
bundleParts.delete(key);
|
|
4111
|
+
return Date.now() - held.at < BUNDLE_TTL_MS ? { data: held.data } : null;
|
|
4112
|
+
}
|
|
4113
|
+
function bundleDrop(tableId) {
|
|
4114
|
+
if (tableId === null) {
|
|
4115
|
+
bundleParts.clear();
|
|
4116
|
+
bundleAsked.clear();
|
|
4117
|
+
return;
|
|
4118
|
+
}
|
|
4119
|
+
bundleAsked.delete(tableId);
|
|
4120
|
+
for (const key of [...bundleParts.keys()]) if (key.includes(tableId)) bundleParts.delete(key);
|
|
4121
|
+
}
|
|
4038
4122
|
async function callDoor(door, args, where) {
|
|
4123
|
+
const bundled = await fromBundle(door, args);
|
|
4124
|
+
if (bundled) return ok(bundled.data);
|
|
4039
4125
|
if (!doorReady(config, door)) {
|
|
4040
4126
|
const refusal3 = doorAbsent(door);
|
|
4041
4127
|
scream({ code: refusal3.code, message: refusal3.message, ...refusal3.hint ? { hint: refusal3.hint } : {}, where });
|
|
@@ -4050,7 +4136,10 @@ function createRecordsClient(given) {
|
|
|
4050
4136
|
return ok(response.data);
|
|
4051
4137
|
}
|
|
4052
4138
|
function structureMoved(tableId, result) {
|
|
4053
|
-
if (result.ok)
|
|
4139
|
+
if (result.ok) {
|
|
4140
|
+
bundleDrop(tableId);
|
|
4141
|
+
announceTableStructureChanged(tableId);
|
|
4142
|
+
}
|
|
4054
4143
|
return result;
|
|
4055
4144
|
}
|
|
4056
4145
|
async function owedDoor(door, args, where) {
|
|
@@ -10557,6 +10646,7 @@ function useStoreTable(table, options = {}) {
|
|
|
10557
10646
|
}
|
|
10558
10647
|
|
|
10559
10648
|
// src/app-table/graduate.ts
|
|
10649
|
+
import { isUuidShape as isUuidShape5 } from "@ai-matrx/kit/uuid";
|
|
10560
10650
|
var TO_CUSTOM_FIELDS = "custom_fields";
|
|
10561
10651
|
var TO_ASSOCIATION = "association";
|
|
10562
10652
|
var GRADUATION_BASE_COLUMNS = [
|
|
@@ -10616,10 +10706,9 @@ function graduationProblems(fields, graduation) {
|
|
|
10616
10706
|
}
|
|
10617
10707
|
return problems;
|
|
10618
10708
|
}
|
|
10619
|
-
var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
10620
10709
|
function idsOf(value) {
|
|
10621
10710
|
const list = Array.isArray(value) ? value : value === null || value === void 0 ? [] : [value];
|
|
10622
|
-
return list.filter((v) => typeof v === "string" &&
|
|
10711
|
+
return list.filter((v) => typeof v === "string" && isUuidShape5(v));
|
|
10623
10712
|
}
|
|
10624
10713
|
function graduatedRow(fields, graduation, snapshot) {
|
|
10625
10714
|
const row = {
|
|
@@ -11083,7 +11172,7 @@ function allowsOtherValues(field2) {
|
|
|
11083
11172
|
}
|
|
11084
11173
|
|
|
11085
11174
|
// src/retype.ts
|
|
11086
|
-
import { isUuidShape as
|
|
11175
|
+
import { isUuidShape as isUuidShape6 } from "@ai-matrx/kit/uuid";
|
|
11087
11176
|
var TRUE_WORDS2 = /* @__PURE__ */ new Set(["true", "t", "yes", "y", "1", "on", "x", "\u2713", "\u2714"]);
|
|
11088
11177
|
var FALSE_WORDS2 = /* @__PURE__ */ new Set(["false", "f", "no", "n", "0", "off", "\u2610"]);
|
|
11089
11178
|
function valueConverts(to, value) {
|
|
@@ -11104,7 +11193,7 @@ function valueConverts(to, value) {
|
|
|
11104
11193
|
return text2.trim() !== "" && /^[+-]?(\d+\.?\d*|\.\d+)(e[+-]?\d+)?$/i.test(text2.trim());
|
|
11105
11194
|
case "list":
|
|
11106
11195
|
case "relation":
|
|
11107
|
-
return typeof value === "string" &&
|
|
11196
|
+
return typeof value === "string" && isUuidShape6(text2);
|
|
11108
11197
|
default:
|
|
11109
11198
|
return false;
|
|
11110
11199
|
}
|
|
@@ -11555,6 +11644,9 @@ function scopeChip(scope) {
|
|
|
11555
11644
|
return scope.title ? `About: ${scope.title}` : "About: this record";
|
|
11556
11645
|
}
|
|
11557
11646
|
|
|
11647
|
+
// src/table-kind.ts
|
|
11648
|
+
import { isLowercaseUuidShape } from "@ai-matrx/kit/uuid";
|
|
11649
|
+
|
|
11558
11650
|
// src/table-kind-mapping.json
|
|
11559
11651
|
var table_kind_mapping_default = {
|
|
11560
11652
|
about: "THE ONE MAPPING from a store Field to a kind's three schemas (KINDS-GLUE wave 3 \xA72). Hand-written here; aidream copies it verbatim to packages/matrx-graph/matrx_graph/table_kind_mapping.json (scripts/generate_table_kind_mapping.py --check). Both languages derive from this file only: @ai-matrx/records src/table-kind.ts and matrx_graph.table_kinds. Keys of `kinds` are the store's field kinds (custom.field_kinds() plus the formula `system` kinds custom.field_kind_of answers). Stored mode only: `column_source_default` is custom.table_column_source's answer when the facts carry none (silence means the doctrine: Field rows are the columns); `platform_keys` mirrors custom.record_platform_keys() with each key's shape (parent_id: custom.containment_parent's uuid cast; icon: the record's own @ai-matrx/icons name, a string or null); `stored_patterns` mirror custom.validate_values' relation id regex and, for dates, refuse a string the timestamptz cast can never read (no digits, not a special word) while never refusing one it can.",
|
|
@@ -11633,14 +11725,13 @@ var table_kind_mapping_default = {
|
|
|
11633
11725
|
|
|
11634
11726
|
// src/table-kind.ts
|
|
11635
11727
|
var TABLE_KIND_PREFIX = "table:";
|
|
11636
|
-
var UUID2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
11637
11728
|
var KIND_KEY = "__kind";
|
|
11638
11729
|
var M = table_kind_mapping_default;
|
|
11639
11730
|
function tableKindMapping() {
|
|
11640
11731
|
return M;
|
|
11641
11732
|
}
|
|
11642
11733
|
function isTableKind(slug) {
|
|
11643
|
-
return typeof slug === "string" && slug.startsWith(TABLE_KIND_PREFIX) &&
|
|
11734
|
+
return typeof slug === "string" && slug.startsWith(TABLE_KIND_PREFIX) && isLowercaseUuidShape(slug.slice(TABLE_KIND_PREFIX.length));
|
|
11644
11735
|
}
|
|
11645
11736
|
function tableKindSlug(tableId) {
|
|
11646
11737
|
const slug = `${TABLE_KIND_PREFIX}${String(tableId).trim().toLowerCase()}`;
|