{"version":3,"sources":["../../src/table-kind.ts","../../src/table-kind-mapping.json"],"sourcesContent":["// src/table-kind.ts — A TABLE IS A KIND (KINDS-GLUE wave 3 §1–2).\n//\n// `table:<uuid>` names \"a record of that Table\". It is never a registry row: its schema is\n// derived, when asked for, from the Table's live Fields as the store's door\n// `custom.table_kind_facts` (N1) answers them — `TableKindFacts` is that door's JSON verbatim.\n//\n// ONE MAPPING, THREE OUTPUTS, TWO LANGUAGES. `table-kind-mapping.json` beside this file is the\n// one data file (aidream copies it verbatim into matrx-graph). From it:\n//   - stored   — the JSON Schema a value is validated against (mirrors custom.validate_values and\n//                custom._undeclared_key_guard: closed only on a `fields` Table, platform keys allowed;\n//                uses the door's column_source / platform_keys / per-Field field_kind when present,\n//                else derives them);\n//   - authored — a plain object every provider binds (no allOf / if / patternProperties);\n//   - render   — the content-ir KindSchema the web draws with, never stricter than the store.\n// Each is Fields-only here (`tableJsonSchema`, `tableRenderSchema`); the control keys are wave 2's\n// one function (`withControlKeys` / `withControlKeyFields` in @ai-matrx/content-ir), applied by\n// the caller. The Python twin is `matrx_graph.table_kinds`; both write byte-identical JSON for\n// the golden fixture (guard 3 (a), `__tests__/table-kind-round-trip.test.ts`).\n\nimport { isLowercaseUuidShape } from \"@ai-matrx/kit/uuid\";\nimport MAPPING from \"./table-kind-mapping.json\";\n\nexport const TABLE_KIND_PREFIX = \"table:\";\nconst KIND_KEY = \"__kind\";\n\ntype Json = Record<string, unknown>;\n\n/** `custom.table_kind_facts(p_table_id)` verbatim (N1). */\nexport interface TableKindFacts {\n  organization_id: string;\n  table_id: string;\n  name: string | null;\n  title_field: string | null;\n  agent_writable: boolean;\n  purpose: string | null;\n  version: number | null;\n  type_field: string | null;\n  stamp: string | null;\n  /** Every live Field document (typed ones included), plus `id` and `version`, in `sort` order. */\n  fields: Array<Record<string, unknown>>;\n  /** `{<list field key>: [{key, label, id, retired, position}]}`, retired included, live first. */\n  choices: Record<string, Array<{ key?: string | null; label?: string | null; id?: string | null; retired?: boolean; position?: number | null }>>;\n  /** `custom.table_column_source` (`fields` / `free_form` / `code`) once the door carries it; absent, the mapping's default. */\n  column_source?: string | null;\n  /** `custom.record_platform_keys()` once the door carries it; absent, the mapping's keys. */\n  platform_keys?: string[] | null;\n}\n\n/** The content-ir `KindSchema` shape, structurally (this package does not depend on content-ir). */\nexport interface TableRenderSchema {\n  kind: string;\n  fields: Record<string, Record<string, unknown>>;\n}\n\nexport type TableSchemaMode = \"stored\" | \"authored\";\n\ntype KindSpec = {\n  shape: \"string\" | \"number\" | \"boolean\" | \"datetime\" | \"choice\" | \"relation\" | \"entity_reference\" | \"address\" | \"computed\";\n  value?: Json;\n  authored?: boolean;\n  unit?: boolean;\n  hint?: string;\n  rating?: boolean;\n};\n\ntype Mapping = {\n  kernels: { file: string; person: string };\n  system_kinds: string[];\n  by_behaviour: Record<string, string>;\n  choice_enum_limit: number;\n  rating_max: number;\n  address_parts: string[];\n  address_part_max: number;\n  column_source_default: string;\n  platform_keys: Record<string, Json>;\n  stored_patterns: { record_id: string; datetime: string };\n  kinds: Record<string, KindSpec>;\n  render: Record<string, { one: Json; many: Json }>;\n};\n\nconst M = MAPPING as unknown as Mapping;\n\n/** The one mapping (records' own file; the Python copy is generated from it). */\nexport function tableKindMapping(): Readonly<Mapping> {\n  return M;\n}\n\nexport function isTableKind(slug: unknown): slug is `table:${string}` {\n  return typeof slug === \"string\" && slug.startsWith(TABLE_KIND_PREFIX) && isLowercaseUuidShape(slug.slice(TABLE_KIND_PREFIX.length));\n}\n\nexport function tableKindSlug(tableId: string): `table:${string}` {\n  const slug = `${TABLE_KIND_PREFIX}${String(tableId).trim().toLowerCase()}`;\n  if (!isTableKind(slug)) throw new Error(`${JSON.stringify(tableId)} is not a table id`);\n  return slug;\n}\n\nexport function tableIdOf(slug: string): string {\n  if (!isTableKind(slug)) throw new Error(`${JSON.stringify(slug)} is not a table kind`);\n  return slug.slice(TABLE_KIND_PREFIX.length);\n}\n\n// ── field kinds ─────────────────────────────────────────────────────────────────────────\n\nfunction clone<T>(value: T): T {\n  return JSON.parse(JSON.stringify(value)) as T;\n}\n\nfunction truthy(value: unknown): boolean {\n  return value === true || value === \"true\";\n}\n\nfunction configOf(d: Json): Json {\n  const cfg = d.config;\n  return cfg && typeof cfg === \"object\" && !Array.isArray(cfg) ? (cfg as Json) : {};\n}\n\n/** Twin of `custom.parity_type` — the first answer wins. */\nfunction parityType(d: Json): string | null {\n  const t = d.type;\n  const fmt = d.format;\n  const cfg = configOf(d);\n  if (t === \"boolean\") return \"checkbox\";\n  if (t === \"list\") return truthy(d.multi) ? \"multi_select\" : \"select\";\n  if (t === \"relation\" && d.relation_target === M.kernels.file) return \"attachment\";\n  if (t === \"relation\" && d.relation_target === M.kernels.person) return \"member\";\n  if (t === \"formula\" && \"pick\" in cfg) return \"lookup\";\n  if (t === \"formula\" && \"agg\" in cfg) return \"rollup\";\n  if (t === \"formula\" && \"expr\" in cfg) return \"formula\";\n  if (t === \"text\" && (fmt === \"url\" || fmt === \"email\" || fmt === \"phone\")) return fmt;\n  if (t === \"range\" && fmt === \"percent\") return \"percent\";\n  if (t === \"range\" && d.unit && fmt === \"currency\") return \"currency\";\n  if (t === \"range\" && (cfg.kind === \"date\" || cfg.kind === \"datetime\")) return \"datetime\";\n  return null;\n}\n\n/** Twin of `custom.field_kind_of`: the field kind a stored Field document declares. */\nexport function fieldKindOf(d: Record<string, unknown>): string | null {\n  const t = d.type;\n  const fmt = d.format;\n  const cfg = configOf(d);\n  if (t === \"range\" && (fmt === \"rating\" || fmt === \"duration\")) return fmt;\n  if (t === \"text\" && (fmt === \"address\" || fmt === \"barcode\" || fmt === \"rich_text\" || fmt === \"signature\")) return fmt;\n  if (t === \"list\" && fmt === \"status\") return \"status\";\n  if (t === \"formula\" && fmt === \"count\" && cfg.agg === \"count\") return \"count\";\n  if (t === \"formula\" && typeof cfg.system === \"string\" && M.system_kinds.includes(cfg.system)) return cfg.system;\n  if (t === \"relation\" && Array.isArray(cfg.allowed_types)) return \"entity_reference\";\n  const parity = parityType(d);\n  if (parity !== null) return parity;\n  if (t === \"text\") return fmt === \"long\" || truthy(cfg.multiline) ? \"long_text\" : \"text\";\n  if (t === \"range\") return \"number\";\n  if (t === \"relation\") return \"relation\";\n  return null;\n}\n\n/**\n * The store's own `field_kind` when the facts carry it (`custom.field_kind_of` per Field, asked\n * of the door); otherwise this twin's derivation of the same answer.\n */\nfunction fieldKind(d: Json): string | null {\n  if (\"field_kind\" in d) return typeof d.field_kind === \"string\" ? d.field_kind : null;\n  return fieldKindOf(d);\n}\n\nfunction kindSpec(d: Json): KindSpec {\n  const kind = fieldKind(d) ?? M.by_behaviour[String(d.type)] ?? \"formula\";\n  return M.kinds[kind] ?? M.kinds.formula!;\n}\n\n// ── per Field ───────────────────────────────────────────────────────────────────────────\n\nfunction unconditionalRules(d: Json): Json[] {\n  const rules = Array.isArray(d.rules) ? (d.rules as unknown[]) : [];\n  return rules.filter(\n    (r): r is Json =>\n      !!r &&\n      typeof r === \"object\" &&\n      !Array.isArray(r) &&\n      !(Array.isArray((r as Json).applies_to_types) && ((r as Json).applies_to_types as unknown[]).length > 0) &&\n      !(typeof (r as Json).applies_to_types === \"string\" && (r as Json).applies_to_types !== \"\"),\n  );\n}\n\n/** A rule's number, as Python's twin writes it (6.0 is 6). */\nfunction numberOf(value: unknown): number | null {\n  if (typeof value === \"boolean\") return null;\n  if (typeof value === \"number\" && Number.isFinite(value)) return value;\n  if (typeof value === \"string\" && /^-?[0-9]+(\\.[0-9]+)?$/.test(value)) return Number(value);\n  return null;\n}\n\nfunction choiceTokens(facts: TableKindFacts, key: string): string[] {\n  const tokens: string[] = [];\n  for (const choice of facts.choices?.[key] ?? []) {\n    for (const token of [choice.key, choice.label, choice.id]) {\n      if (typeof token === \"string\" && token && !tokens.includes(token)) tokens.push(token);\n    }\n  }\n  return tokens;\n}\n\nfunction liveChoiceKeys(facts: TableKindFacts, key: string): string[] {\n  const keys: string[] = [];\n  for (const choice of facts.choices?.[key] ?? []) {\n    const k = choice.key;\n    if (!choice.retired && typeof k === \"string\" && k && !keys.includes(k)) keys.push(k);\n  }\n  return keys;\n}\n\nfunction item(facts: TableKindFacts, d: Json, mode: TableSchemaMode): Json {\n  const spec = kindSpec(d);\n  const shape = spec.shape;\n  const cfg = configOf(d);\n  const key = String(d.key);\n  if (shape === \"string\" || shape === \"number\" || shape === \"boolean\") {\n    const out = clone(spec.value ?? {});\n    for (const rule of unconditionalRules(d)) {\n      const kind = rule.kind;\n      const value = numberOf(rule.value);\n      if (shape === \"number\" && kind === \"min\" && value !== null) out.minimum = value;\n      else if (shape === \"number\" && kind === \"max\" && value !== null) out.maximum = value;\n      else if (shape === \"string\" && kind === \"length\" && value !== null) out.maxLength = Math.trunc(value);\n    }\n    if (spec.rating && !(\"maximum\" in out)) out.maximum = M.rating_max;\n    if (spec.unit && d.unit && mode === \"stored\") out[\"x-matrx-unit\"] = d.unit;\n    return out;\n  }\n  if (shape === \"datetime\") {\n    // The store casts a string to timestamptz; the pattern refuses what no cast can read.\n    if (mode === \"stored\") return { type: [\"number\", \"string\"], pattern: M.stored_patterns.datetime };\n    return { type: \"string\", format: cfg.kind === \"date\" ? \"date\" : \"date-time\" };\n  }\n  if (shape === \"choice\") {\n    if (truthy(cfg.allow_other)) return { type: \"string\" };\n    if (mode === \"stored\") return { type: \"string\", enum: choiceTokens(facts, key) };\n    const live = liveChoiceKeys(facts, key);\n    if (live.length === 0 || live.length > M.choice_enum_limit) return { type: \"string\" };\n    return { type: \"string\", enum: live };\n  }\n  if (shape === \"relation\") {\n    // custom.validate_values refuses a value that is not an id by this very regex.\n    if (mode === \"stored\") return { type: \"string\", format: \"uuid\", pattern: M.stored_patterns.record_id };\n    return { type: \"string\", format: \"uuid\" };\n  }\n  if (shape === \"entity_reference\") {\n    const allowed = (Array.isArray(cfg.allowed_types) ? (cfg.allowed_types as unknown[]) : []).filter(\n      (t): t is string => typeof t === \"string\",\n    );\n    const id: Json = { type: \"string\", format: \"uuid\" };\n    if (mode === \"stored\") id.pattern = M.stored_patterns.record_id;\n    const out: Json = {\n      type: \"object\",\n      properties: { token: { type: \"string\", enum: allowed }, id },\n      required: [\"token\", \"id\"],\n    };\n    if (mode === \"authored\") out.additionalProperties = false;\n    return out;\n  }\n  if (shape === \"address\") {\n    const part: Json =\n      mode === \"authored\"\n        ? { type: \"string\", maxLength: M.address_part_max }\n        : { type: [\"string\", \"null\"], maxLength: M.address_part_max };\n    const out: Json = {\n      type: \"object\",\n      properties: Object.fromEntries(M.address_parts.map((p) => [p, { ...part }])),\n      additionalProperties: false,\n    };\n    if (mode === \"stored\") out.minProperties = 1;\n    return out;\n  }\n  return { readOnly: true };\n}\n\nfunction isTyped(d: Json): boolean {\n  return Array.isArray(d.applies_to_types) && (d.applies_to_types as unknown[]).length > 0;\n}\n\nfunction storedValue(facts: TableKindFacts, d: Json): Json {\n  const shape = kindSpec(d).shape;\n  if (shape === \"computed\") return { readOnly: true };\n  const one = item(facts, d, \"stored\");\n  const required = truthy(d.required) && !isTyped(d);\n  let value: Json;\n  if (shape === \"relation\" || shape === \"entity_reference\") {\n    const many: Json = { type: \"array\", items: one };\n    const ceiling = numberOf(d.relation_max);\n    if (ceiling !== null) many.maxItems = Math.trunc(ceiling);\n    if (required) many.minItems = 1;\n    value = { anyOf: [one, many] };\n  } else if (truthy(d.multi)) {\n    value = { type: \"array\", items: one };\n    if (required) value.minItems = 1;\n  } else {\n    value = one;\n  }\n  return required ? value : { anyOf: [value, { type: \"null\" }] };\n}\n\nfunction authoredValue(facts: TableKindFacts, d: Json, typeLabels: string[]): Json {\n  const spec = kindSpec(d);\n  const shape = spec.shape;\n  const one = item(facts, d, \"authored\");\n  let value: Json;\n  if (shape === \"relation\" || shape === \"entity_reference\") {\n    value = { type: \"array\", items: one };\n    const ceiling = numberOf(d.relation_max);\n    if (ceiling !== null) value.maxItems = Math.trunc(ceiling);\n  } else if (truthy(d.multi)) {\n    value = { type: \"array\", items: one };\n  } else {\n    value = one;\n  }\n  const extras: string[] = [];\n  if (spec.unit && d.unit) extras.push(`Amount in ${String(d.unit)}.`);\n  if (spec.hint) extras.push(spec.hint);\n  if (typeLabels.length > 0) extras.push(`Only for ${typeLabels.join(\", \")} records.`);\n  const label = String(d.label || d.key);\n  value.description = extras.length > 0 ? `${label}. ${extras.join(\" \")}` : label;\n  return value;\n}\n\nfunction isAuthored(d: Json): boolean {\n  const spec = kindSpec(d);\n  return spec.shape !== \"computed\" && spec.authored !== false;\n}\n\nfunction typeChoice(facts: TableKindFacts, word: string) {\n  for (const choice of facts.choices?.[facts.type_field ?? \"\"] ?? []) {\n    if (word === choice.key || word === choice.label || word === choice.id) return choice;\n  }\n  return null;\n}\n\nfunction typeSynonyms(facts: TableKindFacts, word: string): [string, string[]] {\n  const choice = typeChoice(facts, word);\n  if (!choice) return [word, [word]];\n  const out: string[] = [];\n  for (const token of [choice.key, choice.label, choice.id]) {\n    if (typeof token === \"string\" && token && !out.includes(token)) out.push(token);\n  }\n  return [String(choice.key || word), out];\n}\n\nfunction typeLabels(facts: TableKindFacts, d: Json): string[] {\n  const labels: string[] = [];\n  for (const word of (d.applies_to_types as unknown[]) ?? []) {\n    const choice = typeChoice(facts, String(word));\n    const label = choice ? String(choice.label || choice.key) : String(word);\n    if (!labels.includes(label)) labels.push(label);\n  }\n  return labels;\n}\n\nfunction liveFields(facts: TableKindFacts): Json[] {\n  return (facts.fields ?? []).filter((d): d is Json => !!d && typeof d === \"object\" && !!(d as Json).key);\n}\n\n// ── whole schemas ───────────────────────────────────────────────────────────────────────\n\n/** The Fields-only JSON Schema of a record of this Table (no control keys). */\nexport function tableJsonSchema(facts: TableKindFacts, mode: TableSchemaMode): Json {\n  const slug = tableKindSlug(String(facts.table_id));\n  const fields = liveFields(facts);\n  const properties: Json = { [KIND_KEY]: { const: slug } };\n  const required: string[] = [KIND_KEY];\n\n  if (mode === \"stored\") {\n    const branches = new Map<string, { if: Json; then: { required: string[]; properties: Json } }>();\n    for (const d of fields) {\n      const key = String(d.key);\n      properties[key] = storedValue(facts, d);\n      const computed = kindSpec(d).shape === \"computed\";\n      if (!truthy(d.required) || computed) continue;\n      if (!isTyped(d)) {\n        required.push(key);\n        continue;\n      }\n      if (!facts.type_field) continue;\n      for (const word of d.applies_to_types as unknown[]) {\n        const [typeKey, synonyms] = typeSynonyms(facts, String(word));\n        let branch = branches.get(typeKey);\n        if (!branch) {\n          branch = {\n            if: { properties: { [facts.type_field]: { enum: synonyms } }, required: [facts.type_field] },\n            then: { required: [], properties: {} },\n          };\n          branches.set(typeKey, branch);\n        }\n        if (!branch.then.required.includes(key)) {\n          branch.then.required.push(key);\n          branch.then.properties[key] = { not: { type: \"null\" } };\n        }\n      }\n    }\n    const platformKeys = Array.isArray(facts.platform_keys) ? facts.platform_keys : Object.keys(M.platform_keys);\n    for (const name of platformKeys) {\n      // A key the platform writes into every record (custom.record_platform_keys()); a Field of\n      // the same name is the column and keeps its own shape.\n      if (typeof name === \"string\" && !(name in properties)) properties[name] = clone(M.platform_keys[name] ?? {});\n    }\n    const schema: Json = {\n      type: \"object\",\n      properties,\n      patternProperties: { \"^_\": {} },\n      required,\n    };\n    // custom._undeclared_key_guard judges only a `fields` Table: a free_form (document) or code\n    // Table keeps any key, so its schema stays open (custom.table_column_source).\n    if ((facts.column_source || M.column_source_default) === \"fields\") schema.additionalProperties = false;\n    if (branches.size > 0) schema.allOf = [...branches.values()];\n    return schema;\n  }\n\n  for (const d of fields) {\n    if (!isAuthored(d)) continue;\n    const key = String(d.key);\n    const typed = isTyped(d);\n    properties[key] = authoredValue(facts, d, typed ? typeLabels(facts, d) : []);\n    if (truthy(d.required) && !typed) required.push(key);\n  }\n  return { type: \"object\", properties, required, additionalProperties: false };\n}\n\n/**\n * The Fields-only content-ir `KindSchema` the web draws a record of this Table with: every Field\n * nullable and optional, choices open to every word the store accepts (keys, labels, ids,\n * retired included). Wrap it with `withControlKeyFields` from @ai-matrx/content-ir — table kinds\n * never pass through `kindSchemaFromJsonSchema`.\n */\nexport function tableRenderSchema(facts: TableKindFacts): TableRenderSchema {\n  const slug = tableKindSlug(String(facts.table_id));\n  const out: Record<string, Record<string, unknown>> = {};\n  for (const d of liveFields(facts)) {\n    const key = String(d.key);\n    const shape = kindSpec(d).shape;\n    const multi = truthy(d.multi);\n    let field: Json;\n    if (shape === \"choice\") {\n      field = { type: multi ? \"string[]\" : \"enum\", values: choiceTokens(facts, key) };\n      if (truthy(configOf(d).allow_other)) field.open = true;\n    } else {\n      field = clone(M.render[shape]![multi ? \"many\" : \"one\"]);\n    }\n    field.nullable = true;\n    out[key] = field;\n  }\n  return { kind: slug, fields: out };\n}\n","{\n  \"about\": \"THE ONE MAPPING from a store Field to a kind's three schemas (KINDS-GLUE wave 3 §2). 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.\",\n  \"version\": 2,\n  \"kernels\": {\n    \"file\": \"11111111-0000-4000-8000-000000000006\",\n    \"person\": \"11111111-0000-4000-8000-000000000005\"\n  },\n  \"system_kinds\": [\"created_by\", \"modified_by\", \"autonumber\", \"created_time\", \"modified_time\"],\n  \"by_behaviour\": {\n    \"text\": \"text\",\n    \"range\": \"number\",\n    \"list\": \"select\",\n    \"relation\": \"relation\",\n    \"boolean\": \"checkbox\",\n    \"formula\": \"formula\"\n  },\n  \"choice_enum_limit\": 100,\n  \"rating_max\": 5,\n  \"address_parts\": [\"street\", \"city\", \"region\", \"postal_code\", \"country\"],\n  \"address_part_max\": 200,\n  \"column_source_default\": \"fields\",\n  \"platform_keys\": {\n    \"parent_id\": { \"type\": [\"string\", \"null\"], \"pattern\": \"^(?:\\\\{[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7}\\\\}|[0-9a-fA-F]{4}(?:-?[0-9a-fA-F]{4}){7})$\" },\n    \"icon\": { \"type\": [\"string\", \"null\"] }\n  },\n  \"stored_patterns\": {\n    \"record_id\": \"^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$\",\n    \"datetime\": \"[0-9][^0-9]+[0-9]|[0-9]{5}|^\\\\s*(?:[Nn][Oo][Ww]|[Tt][Oo][Dd][Aa][Yy]|[Tt][Oo][Mm][Oo][Rr][Rr][Oo][Ww]|[Yy][Ee][Ss][Tt][Ee][Rr][Dd][Aa][Yy]|[Ee][Pp][Oo][Cc][Hh])(?![A-Za-z])\"\n  },\n  \"kinds\": {\n    \"text\": { \"shape\": \"string\", \"value\": { \"type\": \"string\" } },\n    \"long_text\": { \"shape\": \"string\", \"value\": { \"type\": \"string\" } },\n    \"email\": { \"shape\": \"string\", \"value\": { \"type\": \"string\", \"format\": \"email\" } },\n    \"phone\": { \"shape\": \"string\", \"value\": { \"type\": \"string\" } },\n    \"url\": { \"shape\": \"string\", \"value\": { \"type\": \"string\" } },\n    \"barcode\": { \"shape\": \"string\", \"value\": { \"type\": \"string\", \"maxLength\": 256 } },\n    \"rich_text\": { \"shape\": \"string\", \"value\": { \"type\": \"string\" }, \"hint\": \"Markdown, no HTML.\" },\n    \"signature\": { \"shape\": \"string\", \"value\": { \"type\": \"string\", \"readOnly\": true }, \"authored\": false },\n    \"number\": { \"shape\": \"number\", \"value\": { \"type\": \"number\" } },\n    \"currency\": { \"shape\": \"number\", \"value\": { \"type\": \"number\" }, \"unit\": true },\n    \"percent\": { \"shape\": \"number\", \"value\": { \"type\": \"number\" }, \"hint\": \"A whole percent: 6 means 6%.\" },\n    \"rating\": { \"shape\": \"number\", \"value\": { \"type\": \"integer\", \"minimum\": 0 }, \"rating\": true },\n    \"duration\": { \"shape\": \"number\", \"value\": { \"type\": \"number\", \"minimum\": 0 }, \"hint\": \"A length of time in seconds.\" },\n    \"datetime\": { \"shape\": \"datetime\" },\n    \"checkbox\": { \"shape\": \"boolean\", \"value\": { \"type\": \"boolean\" } },\n    \"select\": { \"shape\": \"choice\" },\n    \"multi_select\": { \"shape\": \"choice\" },\n    \"status\": { \"shape\": \"choice\" },\n    \"relation\": { \"shape\": \"relation\" },\n    \"member\": { \"shape\": \"relation\" },\n    \"attachment\": { \"shape\": \"relation\", \"authored\": false },\n    \"entity_reference\": { \"shape\": \"entity_reference\" },\n    \"address\": { \"shape\": \"address\" },\n    \"formula\": { \"shape\": \"computed\" },\n    \"lookup\": { \"shape\": \"computed\" },\n    \"rollup\": { \"shape\": \"computed\" },\n    \"count\": { \"shape\": \"computed\" },\n    \"created_by\": { \"shape\": \"computed\" },\n    \"modified_by\": { \"shape\": \"computed\" },\n    \"autonumber\": { \"shape\": \"computed\" },\n    \"created_time\": { \"shape\": \"computed\" },\n    \"modified_time\": { \"shape\": \"computed\" }\n  },\n  \"render\": {\n    \"string\": { \"one\": { \"type\": \"string\" }, \"many\": { \"type\": \"string[]\" } },\n    \"number\": { \"one\": { \"type\": \"number\" }, \"many\": { \"type\": \"number[]\" } },\n    \"boolean\": { \"one\": { \"type\": \"boolean\" }, \"many\": { \"type\": \"boolean[]\" } },\n    \"datetime\": { \"one\": { \"type\": \"union\", \"scalars\": [\"string\", \"number\"] }, \"many\": { \"type\": \"json\" } },\n    \"relation\": { \"one\": { \"type\": \"json\" }, \"many\": { \"type\": \"json\" } },\n    \"entity_reference\": { \"one\": { \"type\": \"json\" }, \"many\": { \"type\": \"json\" } },\n    \"address\": { \"one\": { \"type\": \"json\" }, \"many\": { \"type\": \"json\" } },\n    \"computed\": { \"one\": { \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