@ai-matrx/records 0.97.5 → 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 +6 -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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog — @ai-matrx/records
2
2
 
3
+ ## 0.97.6
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/records/v0.97.5..npm/records/v0.97.6 -- apps/shared/records`).
7
+ No source changes intended and no consumer action required.
8
+
3
9
  ## 0.97.5
4
10
 
5
11
  Automatic changed-only republish (docs/metadata drift since the last tag — see
@@ -2,7 +2,7 @@ import { C as ChoiceNudge, T as TableArchiveProgress, a as TableRestoreProgress,
2
2
  import { d as StoreFilter, e as DashboardSummary, f as DashboardBlock, R as RecordFilter, g as AggregateCompare, A as AggregateBucket, h as DashboardRunResult, i as StuckRow, c as AggregateMeasure, j as AggregateRow, k as Subscription, M as MySubscription, l as SubscriptionSpec, m as DigestPreview, n as SavedViewRow, o as SavedViewSpecIn, p as RowTemplateRow } from './subscription-Cu6aMX6f.js';
3
3
  import { R as RelationCoordinate, a as RelationWordsManyArgs, b as RelationIcons, c as ReverseColumn, d as ReverseLinksManyArgs, e as ReverseLinks, f as ReverseLinksFieldsArgs, S as SourceArchived } from './relation-yYaW32bf.js';
4
4
  import { F as Field, c as FieldPatch, N as NewFieldDeclaration, R as RelationNamesAnswer, d as FieldDuplicated, e as FieldProposal, T as TableProposal, B as ButtonPressed } from './field-Do135FdJ.js';
5
- import { q as ScopeDoors } from './doors-DnHM_tkC.js';
5
+ import { r as ScopeDoors } from './doors-DfHUqP7j.js';
6
6
  import { F as FormSummary, B as BookingSummary, a as BookingAvailability, b as BookingDeclared, c as FormRoute, d as FormResults } from './rule-Bn3E-ZLl.js';
7
7
  import { F as FormLookOptions, P as PortalSummary, a as PortalArchiveFilter, b as PortalArchiveAnswer, c as PortalTableRef, d as PortalCard, e as PortalConfigInput, f as PortalFormSpec, g as PortalFormAnswer, h as PortalInvitation, i as PortalRevocation, j as PortalPreviewRow } from './portal-B_H6TEj2.js';
8
8
  import { a as RecordsConfig, M as MyLevel } from './ports-DCX-WDVh.js';
@@ -2,7 +2,7 @@ import { C as ChoiceNudge, T as TableArchiveProgress, a as TableRestoreProgress,
2
2
  import { d as StoreFilter, e as DashboardSummary, f as DashboardBlock, R as RecordFilter, g as AggregateCompare, A as AggregateBucket, h as DashboardRunResult, i as StuckRow, c as AggregateMeasure, j as AggregateRow, k as Subscription, M as MySubscription, l as SubscriptionSpec, m as DigestPreview, n as SavedViewRow, o as SavedViewSpecIn, p as RowTemplateRow } from './subscription-D5IcSqMw.cjs';
3
3
  import { R as RelationCoordinate, a as RelationWordsManyArgs, b as RelationIcons, c as ReverseColumn, d as ReverseLinksManyArgs, e as ReverseLinks, f as ReverseLinksFieldsArgs, S as SourceArchived } from './relation-C5H3GUUP.cjs';
4
4
  import { F as Field, c as FieldPatch, N as NewFieldDeclaration, R as RelationNamesAnswer, d as FieldDuplicated, e as FieldProposal, T as TableProposal, B as ButtonPressed } from './field-CSNfZsJ3.cjs';
5
- import { q as ScopeDoors } from './doors-DEvCdeYB.cjs';
5
+ import { r as ScopeDoors } from './doors-Bopr9YVf.cjs';
6
6
  import { F as FormSummary, B as BookingSummary, a as BookingAvailability, b as BookingDeclared, c as FormRoute, d as FormResults } from './rule-DE3biaSw.cjs';
7
7
  import { F as FormLookOptions, P as PortalSummary, a as PortalArchiveFilter, b as PortalArchiveAnswer, c as PortalTableRef, d as PortalCard, e as PortalConfigInput, f as PortalFormSpec, g as PortalFormAnswer, h as PortalInvitation, i as PortalRevocation, j as PortalPreviewRow } from './portal-ByiRZGqc.cjs';
8
8
  import { a as RecordsConfig, M as MyLevel } from './ports-DBxW-a61.cjs';
@@ -5535,6 +5535,9 @@ function onTableStructureChanged(listener) {
5535
5535
  return () => tableListeners.delete(listener);
5536
5536
  }
5537
5537
 
5538
+ // src/scopes/types.ts
5539
+ var SYSTEM_CONTEXT_TYPE_ID = "__system__";
5540
+
5538
5541
  // src/scopes/codec.ts
5539
5542
  var str = (v, fallback = "") => typeof v === "string" ? v : fallback;
5540
5543
  var strOrNull = (v) => typeof v === "string" ? v : null;
@@ -5706,6 +5709,51 @@ var SENSITIVITY_TO_DOOR = {
5706
5709
  confidential: "restricted",
5707
5710
  restricted: "privileged"
5708
5711
  };
5712
+ var SENSITIVITY_FROM_DOOR = {
5713
+ public: "public",
5714
+ internal: "internal",
5715
+ restricted: "confidential",
5716
+ privileged: "restricted"
5717
+ };
5718
+ function systemContextFieldFromStore(row, index) {
5719
+ const key = str(row.key);
5720
+ const kind = str(row.value_type, "string");
5721
+ return {
5722
+ id: str(row.id),
5723
+ scope_type_id: SYSTEM_CONTEXT_TYPE_ID,
5724
+ organization_id: "",
5725
+ key,
5726
+ label: str(row.display_name, key),
5727
+ description: str(row.description),
5728
+ kind: KINDS.has(kind) ? kind : "string",
5729
+ type: "system",
5730
+ multi: kind === "array",
5731
+ format: null,
5732
+ config: {},
5733
+ relation_target: null,
5734
+ sort: typeof row.sort_order === "number" ? row.sort_order : index,
5735
+ context_policy: "include",
5736
+ // The system table keeps the old sensitivity words (`restricted`/`privileged`), like the write doors.
5737
+ sensitivity: SENSITIVITY_FROM_DOOR[str(row.sensitivity)] ?? "public",
5738
+ source: "system",
5739
+ status: "active",
5740
+ status_note: null,
5741
+ category: null,
5742
+ tags: [],
5743
+ max_items: 0,
5744
+ custom_component: null,
5745
+ reference_source: null,
5746
+ allowed_scope_type_ids: null,
5747
+ allowed_reference_types: null,
5748
+ review_interval_days: null,
5749
+ depends_on: [],
5750
+ version: 0,
5751
+ created_by: null,
5752
+ created_at: "",
5753
+ updated_at: "",
5754
+ item_class: strOrNull(row.item_class)
5755
+ };
5756
+ }
5709
5757
  var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
5710
5758
  function referencesOf(row) {
5711
5759
  const v = row.value;
@@ -6040,7 +6088,11 @@ function createScopeDoors(call) {
6040
6088
  },
6041
6089
  async systemItems() {
6042
6090
  const res = await call("context_system_items", {}, "scopes.systemItems");
6043
- return res.ok ? { ok: true, data: res.data ?? [] } : res;
6091
+ return res.ok ? { ok: true, data: (res.data ?? []).map(systemContextFieldFromStore) } : res;
6092
+ },
6093
+ async tableTemplates(organizationId) {
6094
+ const res = await call("table_templates", { p_org_id: organizationId }, "scopes.tableTemplates");
6095
+ return res.ok ? { ok: true, data: Array.isArray(res.data) ? res.data : [] } : res;
6044
6096
  },
6045
6097
  async templates() {
6046
6098
  const res = await call("context_templates", {}, "scopes.templates");