@ai-matrx/records 0.58.11 → 0.58.12

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 CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog — @ai-matrx/records
2
2
 
3
+ ## 0.58.12 (2026-09-25)
4
+
5
+ ### Lane DECLARE-ENTITY-REF (2026-09-25)
6
+
7
+ * **Every column word reaches the door as `type`.** `declareTable` / `addFields` / `fieldDeclarationFor`
8
+ mapped `text` / `long_text` / `number` synonyms to `plain` and sent EVERY other word as
9
+ `parity_type` — but `custom._field_document_for` accepts `parity_type` only for the fourteen parity
10
+ types, while its `type` arm resolves them all. So eight words were refused ("There is no field type
11
+ called …"): `entity_reference`, `relation`, `signature`, `autonumber`, `created_time`,
12
+ `modified_time`, `list`, `boolean`. The word is now sent as `type`, unmapped (multiline text still
13
+ becomes `long_text`), and `NewFieldSpec.allowedTypes` carries an entity reference's kinds as
14
+ `allowed_types`. Guard: `every-declarable-word-reaches-the-door-as-its-word.test.ts` holds the
15
+ door's rule against every word it resolves. Proven live: a table with an
16
+ `entity_reference → ai_model` column declared as admin, a record written with
17
+ `{token: "ai_model", id}`, one `platform.associations` row answered.
18
+ **Consumer action:** a caller that put `allowed_types` in `config` may keep it (the door reads both)
19
+ or move it to `allowedTypes`; nothing else changes.
20
+
3
21
  ## 0.58.11 (2026-09-25 — published by PUBLISH-SWEEP-6)
4
22
 
5
23
  0.58.10 was tagged but never reached npm: its publish gate (`real-doors.test.ts`, "no signed-out caller
@@ -8559,7 +8559,8 @@ function fieldDeclarationFor(field) {
8559
8559
  ...field.options ? { options: field.options } : {},
8560
8560
  ...field.relationTarget ? { relation_target: field.relationTarget } : {},
8561
8561
  ...field.unit ? { unit: field.unit } : {},
8562
- ...field.kind ? { kind: field.kind } : {}
8562
+ ...field.kind ? { kind: field.kind } : {},
8563
+ ...field.allowedTypes ? { allowed_types: field.allowedTypes } : {}
8563
8564
  };
8564
8565
  }
8565
8566
  async function declareTable(client, spec) {
@@ -8626,25 +8627,12 @@ async function addFields(client, tableId, fields) {
8626
8627
  }
8627
8628
  return { ok: true, data: tableId };
8628
8629
  }
8629
- var PLAIN_WORDS = {
8630
- text: "text",
8631
- string: "text",
8632
- long_text: "long_text",
8633
- longtext: "long_text",
8634
- paragraph: "long_text",
8635
- number: "number",
8636
- range: "number",
8637
- integer: "number",
8638
- decimal: "number",
8639
- float: "number"
8640
- };
8641
8630
  function declaredType(field) {
8642
8631
  const word = (field.type ?? "text").toLowerCase();
8643
- const plain = PLAIN_WORDS[word];
8644
- if (plain) {
8645
- return { plain: plain === "text" && field.config?.["multiline"] === true ? "long_text" : plain };
8632
+ if ((word === "text" || word === "string") && field.config?.["multiline"] === true) {
8633
+ return { type: "long_text" };
8646
8634
  }
8647
- return { parity_type: word };
8635
+ return { type: word };
8648
8636
  }
8649
8637
 
8650
8638
  // src/core/supabase.ts