@ai-matrx/records 0.97.4 → 0.97.6

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 (48) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{client-C6_v0Jnq.d.ts → client-B1PjSTav.d.ts} +1 -1
  3. package/dist/{client-BSe721CI.d.cts → client-ijtYioVl.d.cts} +1 -1
  4. package/dist/core/index.cjs +53 -1
  5. package/dist/core/index.cjs.map +1 -1
  6. package/dist/core/index.d.cts +3 -3
  7. package/dist/core/index.d.ts +3 -3
  8. package/dist/core/index.js +53 -1
  9. package/dist/core/index.js.map +1 -1
  10. package/dist/data/index.cjs +53 -1
  11. package/dist/data/index.cjs.map +1 -1
  12. package/dist/data/index.d.cts +2 -2
  13. package/dist/data/index.d.ts +2 -2
  14. package/dist/data/index.js +53 -1
  15. package/dist/data/index.js.map +1 -1
  16. package/dist/{declareTable-B6ps9KX8.d.cts → declareTable-BE423RBb.d.cts} +1 -1
  17. package/dist/{declareTable-C_ZguQb4.d.ts → declareTable-W3aD-9fQ.d.ts} +1 -1
  18. package/dist/{doors-DEvCdeYB.d.cts → doors-Bopr9YVf.d.cts} +52 -5
  19. package/dist/{doors-DnHM_tkC.d.ts → doors-DfHUqP7j.d.ts} +52 -5
  20. package/dist/questions/index.d.cts +2 -2
  21. package/dist/questions/index.d.ts +2 -2
  22. package/dist/react/index.cjs +53 -1
  23. package/dist/react/index.cjs.map +1 -1
  24. package/dist/react/index.d.cts +32 -4
  25. package/dist/react/index.d.ts +32 -4
  26. package/dist/react/index.js +53 -1
  27. package/dist/react/index.js.map +1 -1
  28. package/dist/scopes/index.cjs +53 -1
  29. package/dist/scopes/index.cjs.map +1 -1
  30. package/dist/scopes/index.d.cts +2 -2
  31. package/dist/scopes/index.d.ts +2 -2
  32. package/dist/scopes/index.js +53 -1
  33. package/dist/scopes/index.js.map +1 -1
  34. package/dist/setup/index.cjs +53 -1
  35. package/dist/setup/index.cjs.map +1 -1
  36. package/dist/setup/index.d.cts +2 -2
  37. package/dist/setup/index.d.ts +2 -2
  38. package/dist/setup/index.js +53 -1
  39. package/dist/setup/index.js.map +1 -1
  40. package/dist/typed-table/index.cjs +53 -1
  41. package/dist/typed-table/index.cjs.map +1 -1
  42. package/dist/typed-table/index.d.cts +3 -3
  43. package/dist/typed-table/index.d.ts +3 -3
  44. package/dist/typed-table/index.js +53 -1
  45. package/dist/typed-table/index.js.map +1 -1
  46. package/dist/views/index.d.cts +2 -2
  47. package/dist/views/index.d.ts +2 -2
  48. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
1
  import { RealtimeManager } from '@ai-matrx/realtime';
2
- import { R as RecordsClient } from '../client-BSe721CI.cjs';
2
+ import { R as RecordsClient } from '../client-ijtYioVl.cjs';
3
3
  import { C as CreateEntityDataPortOptions, E as EntityDataPort } from '../port-DrDY9rfs.cjs';
4
4
  import { R as RecordOrganizationPort, O as ObjectOrganizationAnswer } from '../objectOrganization-DBwPkUBC.cjs';
5
5
  import { a as RecordsConfig, b as RowAgentPort, c as RecordsErrorSink, d as RecordsDataSource, e as RecordsChangeSink, f as RowAgentTarget } from '../ports-DBxW-a61.cjs';
@@ -10,7 +10,7 @@ import '../field-CSNfZsJ3.cjs';
10
10
  import '../subscription-D5IcSqMw.cjs';
11
11
  import '../rule-DE3biaSw.cjs';
12
12
  import '../relation-C5H3GUUP.cjs';
13
- import '../doors-DEvCdeYB.cjs';
13
+ import '../doors-Bopr9YVf.cjs';
14
14
  import '../portal-ByiRZGqc.cjs';
15
15
  import '../types-SOXLHL0A.cjs';
16
16
 
@@ -1,5 +1,5 @@
1
1
  import { RealtimeManager } from '@ai-matrx/realtime';
2
- import { R as RecordsClient } from '../client-C6_v0Jnq.js';
2
+ import { R as RecordsClient } from '../client-B1PjSTav.js';
3
3
  import { C as CreateEntityDataPortOptions, E as EntityDataPort } from '../port-Dm99a1bL.js';
4
4
  import { R as RecordOrganizationPort, O as ObjectOrganizationAnswer } from '../objectOrganization-e1VgfCsX.js';
5
5
  import { a as RecordsConfig, b as RowAgentPort, c as RecordsErrorSink, d as RecordsDataSource, e as RecordsChangeSink, f as RowAgentTarget } from '../ports-DCX-WDVh.js';
@@ -10,7 +10,7 @@ import '../field-Do135FdJ.js';
10
10
  import '../subscription-Cu6aMX6f.js';
11
11
  import '../rule-Bn3E-ZLl.js';
12
12
  import '../relation-yYaW32bf.js';
13
- import '../doors-DnHM_tkC.js';
13
+ import '../doors-DfHUqP7j.js';
14
14
  import '../portal-B_H6TEj2.js';
15
15
  import '../types-CX2kXEX_.js';
16
16
 
@@ -418,6 +418,9 @@ function createOpLedger() {
418
418
  }
419
419
  var defaultOpLedger = ledgerOver(globalSlot2("ai-matrx.records.op-ledger", () => /* @__PURE__ */ new Map()));
420
420
 
421
+ // src/scopes/types.ts
422
+ var SYSTEM_CONTEXT_TYPE_ID = "__system__";
423
+
421
424
  // src/scopes/codec.ts
422
425
  var str = (v, fallback = "") => typeof v === "string" ? v : fallback;
423
426
  var strOrNull = (v) => typeof v === "string" ? v : null;
@@ -589,6 +592,51 @@ var SENSITIVITY_TO_DOOR = {
589
592
  confidential: "restricted",
590
593
  restricted: "privileged"
591
594
  };
595
+ var SENSITIVITY_FROM_DOOR = {
596
+ public: "public",
597
+ internal: "internal",
598
+ restricted: "confidential",
599
+ privileged: "restricted"
600
+ };
601
+ function systemContextFieldFromStore(row, index) {
602
+ const key = str(row.key);
603
+ const kind = str(row.value_type, "string");
604
+ return {
605
+ id: str(row.id),
606
+ scope_type_id: SYSTEM_CONTEXT_TYPE_ID,
607
+ organization_id: "",
608
+ key,
609
+ label: str(row.display_name, key),
610
+ description: str(row.description),
611
+ kind: KINDS.has(kind) ? kind : "string",
612
+ type: "system",
613
+ multi: kind === "array",
614
+ format: null,
615
+ config: {},
616
+ relation_target: null,
617
+ sort: typeof row.sort_order === "number" ? row.sort_order : index,
618
+ context_policy: "include",
619
+ // The system table keeps the old sensitivity words (`restricted`/`privileged`), like the write doors.
620
+ sensitivity: SENSITIVITY_FROM_DOOR[str(row.sensitivity)] ?? "public",
621
+ source: "system",
622
+ status: "active",
623
+ status_note: null,
624
+ category: null,
625
+ tags: [],
626
+ max_items: 0,
627
+ custom_component: null,
628
+ reference_source: null,
629
+ allowed_scope_type_ids: null,
630
+ allowed_reference_types: null,
631
+ review_interval_days: null,
632
+ depends_on: [],
633
+ version: 0,
634
+ created_by: null,
635
+ created_at: "",
636
+ updated_at: "",
637
+ item_class: strOrNull(row.item_class)
638
+ };
639
+ }
592
640
  var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
593
641
  function referencesOf(row) {
594
642
  const v = row.value;
@@ -923,7 +971,11 @@ function createScopeDoors(call) {
923
971
  },
924
972
  async systemItems() {
925
973
  const res = await call("context_system_items", {}, "scopes.systemItems");
926
- return res.ok ? { ok: true, data: res.data ?? [] } : res;
974
+ return res.ok ? { ok: true, data: (res.data ?? []).map(systemContextFieldFromStore) } : res;
975
+ },
976
+ async tableTemplates(organizationId) {
977
+ const res = await call("table_templates", { p_org_id: organizationId }, "scopes.tableTemplates");
978
+ return res.ok ? { ok: true, data: Array.isArray(res.data) ? res.data : [] } : res;
927
979
  },
928
980
  async templates() {
929
981
  const res = await call("context_templates", {}, "scopes.templates");