@ai-matrx/records 0.76.13 → 0.76.15

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,17 @@
1
1
  # Changelog — @ai-matrx/records
2
2
 
3
+ ## 0.76.15
4
+
5
+ - `parseCsv` / `importCsv` read through THE one reader, kit `parseDelimited` (AP-2; was a hand-rolled char loop). Needs kit 0.31.0.
6
+
7
+ **Consumer action:** none.
8
+
9
+ ## 0.76.14
10
+
11
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
12
+ `git diff npm/records/v0.76.13..npm/records/v0.76.14 -- apps/shared/records`).
13
+ No source changes intended and no consumer action required.
14
+
3
15
  ## 0.76.13
4
16
 
5
17
  - `exportCsv` writes through THE one writer, `@ai-matrx/kit/delimited` (AP-2): formula-looking text gets a leading `'` (OWASP CSV injection); it had no formula guard before. Same header row, quoting and order.
@@ -4688,7 +4688,7 @@ function scopeChip(scope) {
4688
4688
 
4689
4689
  // src/table-kind-mapping.json
4690
4690
  var table_kind_mapping_default = {
4691
- 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); `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.",
4691
+ 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.",
4692
4692
  version: 2,
4693
4693
  kernels: {
4694
4694
  file: "11111111-0000-4000-8000-000000000006",
@@ -4709,7 +4709,8 @@ var table_kind_mapping_default = {
4709
4709
  address_part_max: 200,
4710
4710
  column_source_default: "fields",
4711
4711
  platform_keys: {
4712
- 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})$" }
4712
+ 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})$" },
4713
+ icon: { type: ["string", "null"] }
4713
4714
  },
4714
4715
  stored_patterns: {
4715
4716
  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}$",
@@ -9907,38 +9908,7 @@ async function exportXlsx(fields, rows2, sheetLabel = "Records") {
9907
9908
  return writeWorkbookBytes({ sheets: [{ name, rows: toAoa(fields, rows2) }] });
9908
9909
  }
9909
9910
  function parseCsv(text2) {
9910
- const rows2 = [];
9911
- let row = [];
9912
- let cell = "";
9913
- let quoted = false;
9914
- for (let i = 0; i < text2.length; i += 1) {
9915
- const ch = text2[i];
9916
- if (quoted) {
9917
- if (ch === '"') {
9918
- if (text2[i + 1] === '"') {
9919
- cell += '"';
9920
- i += 1;
9921
- } else quoted = false;
9922
- } else cell += ch;
9923
- continue;
9924
- }
9925
- if (ch === '"') quoted = true;
9926
- else if (ch === ",") {
9927
- row.push(cell);
9928
- cell = "";
9929
- } else if (ch === "\n" || ch === "\r") {
9930
- if (ch === "\r" && text2[i + 1] === "\n") i += 1;
9931
- row.push(cell);
9932
- rows2.push(row);
9933
- row = [];
9934
- cell = "";
9935
- } else cell += ch;
9936
- }
9937
- if (cell.length > 0 || row.length > 0) {
9938
- row.push(cell);
9939
- rows2.push(row);
9940
- }
9941
- return rows2;
9911
+ return (0, import_delimited.parseDelimited)(text2, { delimiter: ",", skipEmptyLines: true }).data;
9942
9912
  }
9943
9913
  function importCsv(text2) {
9944
9914
  return fromMatrix(parseCsv(text2));