@ai-matrx/records 0.99.14 → 0.99.16

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/{client-BhrN1XK2.d.cts → client-D8vzRl-L.d.cts} +2 -83
  3. package/dist/{client-BTUMagai.d.ts → client-DuoWeGcM.d.ts} +2 -83
  4. package/dist/core/index.cjs +6 -6
  5. package/dist/core/index.cjs.map +1 -1
  6. package/dist/core/index.d.cts +4 -3
  7. package/dist/core/index.d.ts +4 -3
  8. package/dist/core/index.js +6 -6
  9. package/dist/core/index.js.map +1 -1
  10. package/dist/data/index.cjs +6 -6
  11. package/dist/data/index.cjs.map +1 -1
  12. package/dist/data/index.d.cts +2 -1
  13. package/dist/data/index.d.ts +2 -1
  14. package/dist/data/index.js +6 -6
  15. package/dist/data/index.js.map +1 -1
  16. package/dist/{declareTable-D8Mq6wNq.d.ts → declareTable-DO8U62Pf.d.ts} +1 -1
  17. package/dist/{declareTable-BU3IURyS.d.cts → declareTable-T0LWvfIO.d.cts} +1 -1
  18. package/dist/index.d.cts +3 -2
  19. package/dist/index.d.ts +3 -2
  20. package/dist/questions/index.d.cts +2 -1
  21. package/dist/questions/index.d.ts +2 -1
  22. package/dist/react/index.cjs +20 -20
  23. package/dist/react/index.cjs.map +1 -1
  24. package/dist/react/index.js +18 -18
  25. package/dist/react/index.js.map +1 -1
  26. package/dist/scopes/index.cjs +2 -2
  27. package/dist/scopes/index.cjs.map +1 -1
  28. package/dist/scopes/index.js +2 -2
  29. package/dist/scopes/index.js.map +1 -1
  30. package/dist/setup/index.cjs +8 -8
  31. package/dist/setup/index.cjs.map +1 -1
  32. package/dist/setup/index.d.cts +2 -1
  33. package/dist/setup/index.d.ts +2 -1
  34. package/dist/setup/index.js +8 -8
  35. package/dist/setup/index.js.map +1 -1
  36. package/dist/table-kind/index.cjs +421 -0
  37. package/dist/table-kind/index.cjs.map +1 -0
  38. package/dist/table-kind/index.d.cts +83 -0
  39. package/dist/table-kind/index.d.ts +83 -0
  40. package/dist/table-kind/index.js +400 -0
  41. package/dist/table-kind/index.js.map +1 -0
  42. package/dist/typed-table/index.cjs +3 -3
  43. package/dist/typed-table/index.cjs.map +1 -1
  44. package/dist/typed-table/index.d.cts +3 -2
  45. package/dist/typed-table/index.d.ts +3 -2
  46. package/dist/typed-table/index.js +3 -3
  47. package/dist/typed-table/index.js.map +1 -1
  48. package/dist/views/index.d.cts +2 -1
  49. package/dist/views/index.d.ts +2 -1
  50. package/package.json +12 -2
@@ -1,5 +1,5 @@
1
1
  import { RealtimeManager } from '@ai-matrx/realtime';
2
- import { R as RecordsClient } from '../client-BhrN1XK2.cjs';
2
+ import { R as RecordsClient } from '../client-D8vzRl-L.cjs';
3
3
  import { C as CreateEntityDataPortOptions, E as EntityDataPort } from '../port-VHk95pB1.cjs';
4
4
  import { R as RecordOrganizationPort, O as ObjectOrganizationAnswer } from '../objectOrganization-61jOlh2H.cjs';
5
5
  import { a as RecordsConfig, b as RowAgentPort, c as RecordsErrorSink, d as RecordsDataSource, e as RecordsChangeSink, f as RowAgentTarget } from '../ports-D2_BQmR-.cjs';
@@ -11,6 +11,7 @@ import '../relation-B6JqOI0b.cjs';
11
11
  import '../field-Cw0kIDaG.cjs';
12
12
  import '../doors-BW2oHt5K.cjs';
13
13
  import '../portal-CYg30IWl.cjs';
14
+ import '../table-kind/index.cjs';
14
15
  import '../types-BRMqDFGE.cjs';
15
16
 
16
17
  /** A signed-in database identity: the client every door and live change rides, and who it is. */
@@ -1,5 +1,5 @@
1
1
  import { RealtimeManager } from '@ai-matrx/realtime';
2
- import { R as RecordsClient } from '../client-BTUMagai.js';
2
+ import { R as RecordsClient } from '../client-DuoWeGcM.js';
3
3
  import { C as CreateEntityDataPortOptions, E as EntityDataPort } from '../port-BurGLCot.js';
4
4
  import { R as RecordOrganizationPort, O as ObjectOrganizationAnswer } from '../objectOrganization-tPXgAo39.js';
5
5
  import { a as RecordsConfig, b as RowAgentPort, c as RecordsErrorSink, d as RecordsDataSource, e as RecordsChangeSink, f as RowAgentTarget } from '../ports-DopjYwYG.js';
@@ -11,6 +11,7 @@ import '../relation-BhUQJAOi.js';
11
11
  import '../field-0bRLy9ZN.js';
12
12
  import '../doors-CiCqbOu_.js';
13
13
  import '../portal-6E1E9651.js';
14
+ import '../table-kind/index.js';
14
15
  import '../types-B1xhDHsk.js';
15
16
 
16
17
  /** A signed-in database identity: the client every door and live change rides, and who it is. */
@@ -427,6 +427,7 @@ var defaultOpLedger = ledgerOver(globalSlot2("ai-matrx.records.op-ledger", () =>
427
427
  var SYSTEM_CONTEXT_TYPE_ID = "__system__";
428
428
 
429
429
  // src/scopes/codec.ts
430
+ import { isUuidShape as isUuidShape2 } from "@ai-matrx/kit/uuid";
430
431
  var str = (v, fallback = "") => typeof v === "string" ? v : fallback;
431
432
  var strOrNull = (v) => typeof v === "string" ? v : null;
432
433
  var num = (v, fallback = 0) => {
@@ -642,7 +643,6 @@ function systemContextFieldFromStore(row, index) {
642
643
  item_class: strOrNull(row.item_class)
643
644
  };
644
645
  }
645
- var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
646
646
  function referencesOf(row) {
647
647
  const v = row.value;
648
648
  const list = Array.isArray(v) ? v : v == null ? [] : [v];
@@ -652,7 +652,7 @@ function referencesOf(row) {
652
652
  const out = [];
653
653
  for (const el of list) {
654
654
  let ref = null;
655
- if (typeof el === "string" && UUID.test(el)) ref = { id: el, type: toFile ? "file" : "scope" };
655
+ if (typeof el === "string" && isUuidShape2(el)) ref = { id: el, type: toFile ? "file" : "scope" };
656
656
  else if (el && typeof el === "object" && typeof el.id === "string") {
657
657
  const token = String(el.token ?? "");
658
658
  const own = el.label;
@@ -1139,7 +1139,7 @@ function createScopeDoors(call) {
1139
1139
  }
1140
1140
 
1141
1141
  // src/choice.ts
1142
- import { isUuidShape as isUuidShape2 } from "@ai-matrx/kit/uuid";
1142
+ import { isUuidShape as isUuidShape3 } from "@ai-matrx/kit/uuid";
1143
1143
  var CHOICE_NUDGES = ["ask", "always_add", "never_add"];
1144
1144
  function asChoiceNudge(value) {
1145
1145
  return typeof value === "string" && CHOICE_NUDGES.includes(value) ? value : "ask";
@@ -7086,7 +7086,7 @@ function opHeader(opId) {
7086
7086
  }
7087
7087
 
7088
7088
  // src/entity/port/port.ts
7089
- import { isUuidShape as isUuidShape3 } from "@ai-matrx/kit/uuid";
7089
+ import { isUuidShape as isUuidShape4 } from "@ai-matrx/kit/uuid";
7090
7090
 
7091
7091
  // src/entity/core/realtime.ts
7092
7092
  import {
@@ -7415,7 +7415,7 @@ function createEntityDataPort(options) {
7415
7415
  async get(alias, id) {
7416
7416
  const binding = bindingOf(alias);
7417
7417
  if (!binding) return noSuchAlias(alias);
7418
- if (!isUuidShape3(id)) return refusal("invalid_argument", `"${String(id)}" is not a row id.`);
7418
+ if (!isUuidShape4(id)) return refusal("invalid_argument", `"${String(id)}" is not a row id.`);
7419
7419
  return getCoalesced(alias, binding.token, id);
7420
7420
  },
7421
7421
  async create(alias, values) {
@@ -7435,20 +7435,20 @@ function createEntityDataPort(options) {
7435
7435
  async update(alias, id, patch, baseVersion) {
7436
7436
  const binding = bindingOf(alias);
7437
7437
  if (!binding) return noSuchAlias(alias);
7438
- if (!isUuidShape3(id)) return refusal("invalid_argument", `"${String(id)}" is not a row id.`);
7438
+ if (!isUuidShape4(id)) return refusal("invalid_argument", `"${String(id)}" is not a row id.`);
7439
7439
  const answer = await client.update({ token: binding.token, id, baseVersion, patch: toWireValues(patch), opId: ledger.mint() });
7440
7440
  return readBack(alias, answer, "The change");
7441
7441
  },
7442
7442
  async archive(alias, id) {
7443
7443
  const binding = bindingOf(alias);
7444
7444
  if (!binding) return noSuchAlias(alias);
7445
- if (!isUuidShape3(id)) return refusal("invalid_argument", `"${String(id)}" is not a row id.`);
7445
+ if (!isUuidShape4(id)) return refusal("invalid_argument", `"${String(id)}" is not a row id.`);
7446
7446
  return done(await client.archive({ token: binding.token, ids: [id], opId: ledger.mint() }));
7447
7447
  },
7448
7448
  async restore(alias, id) {
7449
7449
  const binding = bindingOf(alias);
7450
7450
  if (!binding) return noSuchAlias(alias);
7451
- if (!isUuidShape3(id)) return refusal("invalid_argument", `"${String(id)}" is not a row id.`);
7451
+ if (!isUuidShape4(id)) return refusal("invalid_argument", `"${String(id)}" is not a row id.`);
7452
7452
  return done(await client.unarchive({ token: binding.token, ids: [id], opId: ledger.mint() }));
7453
7453
  },
7454
7454
  subscribe(event, listener) {