@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.
@@ -2150,10 +2150,11 @@ interface NewFieldSpec {
2150
2150
  key: string;
2151
2151
  label: string;
2152
2152
  /**
2153
- * The word for what this column holds. One of the thirteen parity types, one
2154
- * of the five behaviours, or a plain synonym (`text`, `long_text`, `number`)
2155
- * — `custom._field_document_for` resolves all three and refuses a word that
2156
- * means nothing, by name, with the list.
2153
+ * The word for what this column holds — any word `custom._field_document_for`
2154
+ * resolves for `type` (a parity type, a behaviour, a plain synonym, or a kind
2155
+ * such as `signature`, `relation`, `entity_reference`, `autonumber`). It is
2156
+ * sent to the door as `type`, unmapped; a word that means nothing is refused
2157
+ * by name, with the list.
2157
2158
  */
2158
2159
  type: FieldTypeWord;
2159
2160
  sort?: number;
@@ -2167,6 +2168,12 @@ interface NewFieldSpec {
2167
2168
  /** A currency column's symbol; a date column's day-or-day-and-time. */
2168
2169
  unit?: string;
2169
2170
  kind?: "date" | "datetime";
2171
+ /**
2172
+ * An `entity_reference` column's kinds: the platform entity tokens it may point
2173
+ * at (`ai_model`, `note`, `web_site` …; `custom.entity_reference_kinds()` lists
2174
+ * them). The store refuses an entity reference that names none.
2175
+ */
2176
+ allowedTypes?: string[];
2170
2177
  }
2171
2178
  interface NewTableSpec {
2172
2179
  name: string;
@@ -2150,10 +2150,11 @@ interface NewFieldSpec {
2150
2150
  key: string;
2151
2151
  label: string;
2152
2152
  /**
2153
- * The word for what this column holds. One of the thirteen parity types, one
2154
- * of the five behaviours, or a plain synonym (`text`, `long_text`, `number`)
2155
- * — `custom._field_document_for` resolves all three and refuses a word that
2156
- * means nothing, by name, with the list.
2153
+ * The word for what this column holds — any word `custom._field_document_for`
2154
+ * resolves for `type` (a parity type, a behaviour, a plain synonym, or a kind
2155
+ * such as `signature`, `relation`, `entity_reference`, `autonumber`). It is
2156
+ * sent to the door as `type`, unmapped; a word that means nothing is refused
2157
+ * by name, with the list.
2157
2158
  */
2158
2159
  type: FieldTypeWord;
2159
2160
  sort?: number;
@@ -2167,6 +2168,12 @@ interface NewFieldSpec {
2167
2168
  /** A currency column's symbol; a date column's day-or-day-and-time. */
2168
2169
  unit?: string;
2169
2170
  kind?: "date" | "datetime";
2171
+ /**
2172
+ * An `entity_reference` column's kinds: the platform entity tokens it may point
2173
+ * at (`ai_model`, `note`, `web_site` …; `custom.entity_reference_kinds()` lists
2174
+ * them). The store refuses an entity reference that names none.
2175
+ */
2176
+ allowedTypes?: string[];
2170
2177
  }
2171
2178
  interface NewTableSpec {
2172
2179
  name: string;
@@ -8373,7 +8373,8 @@ function fieldDeclarationFor(field) {
8373
8373
  ...field.options ? { options: field.options } : {},
8374
8374
  ...field.relationTarget ? { relation_target: field.relationTarget } : {},
8375
8375
  ...field.unit ? { unit: field.unit } : {},
8376
- ...field.kind ? { kind: field.kind } : {}
8376
+ ...field.kind ? { kind: field.kind } : {},
8377
+ ...field.allowedTypes ? { allowed_types: field.allowedTypes } : {}
8377
8378
  };
8378
8379
  }
8379
8380
  async function declareTable(client, spec) {
@@ -8440,25 +8441,12 @@ async function addFields(client, tableId, fields) {
8440
8441
  }
8441
8442
  return { ok: true, data: tableId };
8442
8443
  }
8443
- var PLAIN_WORDS = {
8444
- text: "text",
8445
- string: "text",
8446
- long_text: "long_text",
8447
- longtext: "long_text",
8448
- paragraph: "long_text",
8449
- number: "number",
8450
- range: "number",
8451
- integer: "number",
8452
- decimal: "number",
8453
- float: "number"
8454
- };
8455
8444
  function declaredType(field) {
8456
8445
  const word = (field.type ?? "text").toLowerCase();
8457
- const plain = PLAIN_WORDS[word];
8458
- if (plain) {
8459
- return { plain: plain === "text" && field.config?.["multiline"] === true ? "long_text" : plain };
8446
+ if ((word === "text" || word === "string") && field.config?.["multiline"] === true) {
8447
+ return { type: "long_text" };
8460
8448
  }
8461
- return { parity_type: word };
8449
+ return { type: word };
8462
8450
  }
8463
8451
 
8464
8452
  // src/core/supabase.ts