@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,6 +1,6 @@
1
1
  import { C as Column, Q as Query, A as AliasBinding, H as HostDataPort } from '../types-SOXLHL0A.cjs';
2
2
  export { a as AnyAlias, b as CUSTOM_ROW_TOKEN, D as DataEvents, c as DataPort, d as DataPortEventName, e as DataSource, E as EntityAlias, f as EntityRef, L as Lane, P as Page, R as Row, g as RowsEvent, T as TableAlias, V as Values, W as WhereClause, h as WhereOp } from '../types-SOXLHL0A.cjs';
3
- import { R as RecordsClient } from '../client-BSe721CI.cjs';
3
+ import { R as RecordsClient } from '../client-ijtYioVl.cjs';
4
4
  import { F as Field } from '../field-CSNfZsJ3.cjs';
5
5
  import { U as Uuid, R as RecordsResult, r as RecordPageSort, q as ReadRow } from '../record-fC6s1Xc8.cjs';
6
6
  import { R as RuleExpression } from '../rule-DE3biaSw.cjs';
@@ -8,7 +8,7 @@ import '../relation-C5H3GUUP.cjs';
8
8
  import '../ports-DBxW-a61.cjs';
9
9
  import '../table-kind-CzaNpjv1.cjs';
10
10
  import '../subscription-D5IcSqMw.cjs';
11
- import '../doors-DEvCdeYB.cjs';
11
+ import '../doors-Bopr9YVf.cjs';
12
12
  import '../portal-ByiRZGqc.cjs';
13
13
 
14
14
  interface TableShape {
@@ -1,6 +1,6 @@
1
1
  import { C as Column, Q as Query, A as AliasBinding, H as HostDataPort } from '../types-CX2kXEX_.js';
2
2
  export { a as AnyAlias, b as CUSTOM_ROW_TOKEN, D as DataEvents, c as DataPort, d as DataPortEventName, e as DataSource, E as EntityAlias, f as EntityRef, L as Lane, P as Page, R as Row, g as RowsEvent, T as TableAlias, V as Values, W as WhereClause, h as WhereOp } from '../types-CX2kXEX_.js';
3
- import { R as RecordsClient } from '../client-C6_v0Jnq.js';
3
+ import { R as RecordsClient } from '../client-B1PjSTav.js';
4
4
  import { F as Field } from '../field-Do135FdJ.js';
5
5
  import { U as Uuid, R as RecordsResult, r as RecordPageSort, q as ReadRow } from '../record-fC6s1Xc8.js';
6
6
  import { R as RuleExpression } from '../rule-Bn3E-ZLl.js';
@@ -8,7 +8,7 @@ import '../relation-yYaW32bf.js';
8
8
  import '../ports-DCX-WDVh.js';
9
9
  import '../table-kind-DT5EYraJ.js';
10
10
  import '../subscription-Cu6aMX6f.js';
11
- import '../doors-DnHM_tkC.js';
11
+ import '../doors-DfHUqP7j.js';
12
12
  import '../portal-B_H6TEj2.js';
13
13
 
14
14
  interface TableShape {
@@ -622,6 +622,9 @@ function ledgerOver(ours) {
622
622
  }
623
623
  var defaultOpLedger = ledgerOver(globalSlot2("ai-matrx.records.op-ledger", () => /* @__PURE__ */ new Map()));
624
624
 
625
+ // src/scopes/types.ts
626
+ var SYSTEM_CONTEXT_TYPE_ID = "__system__";
627
+
625
628
  // src/scopes/codec.ts
626
629
  var str = (v, fallback = "") => typeof v === "string" ? v : fallback;
627
630
  var strOrNull = (v) => typeof v === "string" ? v : null;
@@ -793,6 +796,51 @@ var SENSITIVITY_TO_DOOR = {
793
796
  confidential: "restricted",
794
797
  restricted: "privileged"
795
798
  };
799
+ var SENSITIVITY_FROM_DOOR = {
800
+ public: "public",
801
+ internal: "internal",
802
+ restricted: "confidential",
803
+ privileged: "restricted"
804
+ };
805
+ function systemContextFieldFromStore(row, index) {
806
+ const key = str(row.key);
807
+ const kind = str(row.value_type, "string");
808
+ return {
809
+ id: str(row.id),
810
+ scope_type_id: SYSTEM_CONTEXT_TYPE_ID,
811
+ organization_id: "",
812
+ key,
813
+ label: str(row.display_name, key),
814
+ description: str(row.description),
815
+ kind: KINDS.has(kind) ? kind : "string",
816
+ type: "system",
817
+ multi: kind === "array",
818
+ format: null,
819
+ config: {},
820
+ relation_target: null,
821
+ sort: typeof row.sort_order === "number" ? row.sort_order : index,
822
+ context_policy: "include",
823
+ // The system table keeps the old sensitivity words (`restricted`/`privileged`), like the write doors.
824
+ sensitivity: SENSITIVITY_FROM_DOOR[str(row.sensitivity)] ?? "public",
825
+ source: "system",
826
+ status: "active",
827
+ status_note: null,
828
+ category: null,
829
+ tags: [],
830
+ max_items: 0,
831
+ custom_component: null,
832
+ reference_source: null,
833
+ allowed_scope_type_ids: null,
834
+ allowed_reference_types: null,
835
+ review_interval_days: null,
836
+ depends_on: [],
837
+ version: 0,
838
+ created_by: null,
839
+ created_at: "",
840
+ updated_at: "",
841
+ item_class: strOrNull(row.item_class)
842
+ };
843
+ }
796
844
  var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
797
845
  function referencesOf(row) {
798
846
  const v = row.value;
@@ -1127,7 +1175,11 @@ function createScopeDoors(call) {
1127
1175
  },
1128
1176
  async systemItems() {
1129
1177
  const res = await call("context_system_items", {}, "scopes.systemItems");
1130
- return res.ok ? { ok: true, data: res.data ?? [] } : res;
1178
+ return res.ok ? { ok: true, data: (res.data ?? []).map(systemContextFieldFromStore) } : res;
1179
+ },
1180
+ async tableTemplates(organizationId) {
1181
+ const res = await call("table_templates", { p_org_id: organizationId }, "scopes.tableTemplates");
1182
+ return res.ok ? { ok: true, data: Array.isArray(res.data) ? res.data : [] } : res;
1131
1183
  },
1132
1184
  async templates() {
1133
1185
  const res = await call("context_templates", {}, "scopes.templates");