@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
@@ -12,9 +12,9 @@ export { D as DEFAULT_PORTAL_ARCHIVE_FILTER, F as FormLookOptions, l as PORTAL_A
12
12
  export { A as AggregateBucket, g as AggregateCompare, q as AggregateCompareKind, r as AggregateCompareWindows, s as AggregateDelta, b as AggregateFilter, t as AggregateGroupValue, c as AggregateMeasure, a as AggregateOperation, j as AggregateRow, u as AggregateWindow, f as DashboardBlock, D as DashboardBlockKind, v as DashboardBlockResult, h as DashboardRunResult, e as DashboardSummary, w as DashboardTarget, x as DashboardTargetBase, y as DashboardTargetOp, z as DashboardTargetResult, B as DashboardTotals, m as DigestPreview, M as MySubscription, Q as QuietHours, R as RecordFilter, p as RowTemplateRow, C as SavedViewColorBy, E as SavedViewDefinition, F as SavedViewLayout, n as SavedViewRow, o as SavedViewSpecIn, d as StoreFilter, i as StuckRow, k as Subscription, G as SubscriptionBlock, S as SubscriptionCadence, l as SubscriptionSpec, H as callersTimeZone, I as hasQuietHours, J as isRuleFilter, K as liftWithheld, L as measureKey, N as stableFilterKey, O as withCallersClock } from '../subscription-D5IcSqMw.cjs';
13
13
  export { g as EntityRef, E as EntityRefWithWords, h as EntityReferenceKind, i as REVERSE_LINKS_PAGE_MAX, j as REVERSE_LINKS_RECORDS_PER_CALL, k as Relation, l as RelationCarries, R as RelationCoordinate, b as RelationIcons, m as RelationProperties, n as RelationTarget, a as RelationWordsManyArgs, c as ReverseColumn, o as ReverseLink, e as ReverseLinks, f as ReverseLinksFieldsArgs, d as ReverseLinksManyArgs, S as SourceArchived, p as entityReferenceKinds, q as entityReferenceSearch, r as entityReferenceWords, s as entityRefsOf, t as entityRefsToWrite, u as isReverseField, v as sourceArchivedOf } from '../relation-C5H3GUUP.cjs';
14
14
  export { a as ObjectKind, O as ObjectOrganizationAnswer, R as RecordOrganizationPort, W as WHERE_ID_OPENS_DOOR, r as readObjectOrganizationAnswer, b as resolveObjectOrganization, w as whereIdOpensPort } from '../objectOrganization-DBwPkUBC.cjs';
15
- export { A as A_PERSONS_REFUSAL, a as AsOf, D as DEFAULT_PAGE_SIZE, P as PromotedPredicate, Q as QueryPlan, b as RecordQuery, R as RecordsClient, T as TableFact, c as TableLiveLocation, d as asWriteConflict, e as createRecordsClient, i as intersectIds, f as isAPersonsRefusal, p as planQuery, w as withTableFacts } from '../client-BSe721CI.cjs';
16
- export { D as DEFAULT_FIELDS, a as DeclareResult, E as EnsureResult, N as NewFieldSpec, b as NewTableSpec, c as addFields, d as declareTable, e as ensureTable, f as fieldDeclarationFor, t as tokenFor } from '../declareTable-B6ps9KX8.cjs';
17
- import '../doors-DEvCdeYB.cjs';
15
+ export { A as A_PERSONS_REFUSAL, a as AsOf, D as DEFAULT_PAGE_SIZE, P as PromotedPredicate, Q as QueryPlan, b as RecordQuery, R as RecordsClient, T as TableFact, c as TableLiveLocation, d as asWriteConflict, e as createRecordsClient, i as intersectIds, f as isAPersonsRefusal, p as planQuery, w as withTableFacts } from '../client-ijtYioVl.cjs';
16
+ export { D as DEFAULT_FIELDS, a as DeclareResult, E as EnsureResult, N as NewFieldSpec, b as NewTableSpec, c as addFields, d as declareTable, e as ensureTable, f as fieldDeclarationFor, t as tokenFor } from '../declareTable-BE423RBb.cjs';
17
+ import '../doors-Bopr9YVf.cjs';
18
18
 
19
19
  declare function doorExists(name: string): boolean;
20
20
  /**
@@ -12,9 +12,9 @@ export { D as DEFAULT_PORTAL_ARCHIVE_FILTER, F as FormLookOptions, l as PORTAL_A
12
12
  export { A as AggregateBucket, g as AggregateCompare, q as AggregateCompareKind, r as AggregateCompareWindows, s as AggregateDelta, b as AggregateFilter, t as AggregateGroupValue, c as AggregateMeasure, a as AggregateOperation, j as AggregateRow, u as AggregateWindow, f as DashboardBlock, D as DashboardBlockKind, v as DashboardBlockResult, h as DashboardRunResult, e as DashboardSummary, w as DashboardTarget, x as DashboardTargetBase, y as DashboardTargetOp, z as DashboardTargetResult, B as DashboardTotals, m as DigestPreview, M as MySubscription, Q as QuietHours, R as RecordFilter, p as RowTemplateRow, C as SavedViewColorBy, E as SavedViewDefinition, F as SavedViewLayout, n as SavedViewRow, o as SavedViewSpecIn, d as StoreFilter, i as StuckRow, k as Subscription, G as SubscriptionBlock, S as SubscriptionCadence, l as SubscriptionSpec, H as callersTimeZone, I as hasQuietHours, J as isRuleFilter, K as liftWithheld, L as measureKey, N as stableFilterKey, O as withCallersClock } from '../subscription-Cu6aMX6f.js';
13
13
  export { g as EntityRef, E as EntityRefWithWords, h as EntityReferenceKind, i as REVERSE_LINKS_PAGE_MAX, j as REVERSE_LINKS_RECORDS_PER_CALL, k as Relation, l as RelationCarries, R as RelationCoordinate, b as RelationIcons, m as RelationProperties, n as RelationTarget, a as RelationWordsManyArgs, c as ReverseColumn, o as ReverseLink, e as ReverseLinks, f as ReverseLinksFieldsArgs, d as ReverseLinksManyArgs, S as SourceArchived, p as entityReferenceKinds, q as entityReferenceSearch, r as entityReferenceWords, s as entityRefsOf, t as entityRefsToWrite, u as isReverseField, v as sourceArchivedOf } from '../relation-yYaW32bf.js';
14
14
  export { a as ObjectKind, O as ObjectOrganizationAnswer, R as RecordOrganizationPort, W as WHERE_ID_OPENS_DOOR, r as readObjectOrganizationAnswer, b as resolveObjectOrganization, w as whereIdOpensPort } from '../objectOrganization-e1VgfCsX.js';
15
- export { A as A_PERSONS_REFUSAL, a as AsOf, D as DEFAULT_PAGE_SIZE, P as PromotedPredicate, Q as QueryPlan, b as RecordQuery, R as RecordsClient, T as TableFact, c as TableLiveLocation, d as asWriteConflict, e as createRecordsClient, i as intersectIds, f as isAPersonsRefusal, p as planQuery, w as withTableFacts } from '../client-C6_v0Jnq.js';
16
- export { D as DEFAULT_FIELDS, a as DeclareResult, E as EnsureResult, N as NewFieldSpec, b as NewTableSpec, c as addFields, d as declareTable, e as ensureTable, f as fieldDeclarationFor, t as tokenFor } from '../declareTable-C_ZguQb4.js';
17
- import '../doors-DnHM_tkC.js';
15
+ export { A as A_PERSONS_REFUSAL, a as AsOf, D as DEFAULT_PAGE_SIZE, P as PromotedPredicate, Q as QueryPlan, b as RecordQuery, R as RecordsClient, T as TableFact, c as TableLiveLocation, d as asWriteConflict, e as createRecordsClient, i as intersectIds, f as isAPersonsRefusal, p as planQuery, w as withTableFacts } from '../client-B1PjSTav.js';
16
+ export { D as DEFAULT_FIELDS, a as DeclareResult, E as EnsureResult, N as NewFieldSpec, b as NewTableSpec, c as addFields, d as declareTable, e as ensureTable, f as fieldDeclarationFor, t as tokenFor } from '../declareTable-W3aD-9fQ.js';
17
+ import '../doors-DfHUqP7j.js';
18
18
 
19
19
  declare function doorExists(name: string): boolean;
20
20
  /**
@@ -5209,6 +5209,9 @@ function onTableStructureChanged(listener) {
5209
5209
  return () => tableListeners.delete(listener);
5210
5210
  }
5211
5211
 
5212
+ // src/scopes/types.ts
5213
+ var SYSTEM_CONTEXT_TYPE_ID = "__system__";
5214
+
5212
5215
  // src/scopes/codec.ts
5213
5216
  var str = (v, fallback = "") => typeof v === "string" ? v : fallback;
5214
5217
  var strOrNull = (v) => typeof v === "string" ? v : null;
@@ -5380,6 +5383,51 @@ var SENSITIVITY_TO_DOOR = {
5380
5383
  confidential: "restricted",
5381
5384
  restricted: "privileged"
5382
5385
  };
5386
+ var SENSITIVITY_FROM_DOOR = {
5387
+ public: "public",
5388
+ internal: "internal",
5389
+ restricted: "confidential",
5390
+ privileged: "restricted"
5391
+ };
5392
+ function systemContextFieldFromStore(row, index) {
5393
+ const key = str(row.key);
5394
+ const kind = str(row.value_type, "string");
5395
+ return {
5396
+ id: str(row.id),
5397
+ scope_type_id: SYSTEM_CONTEXT_TYPE_ID,
5398
+ organization_id: "",
5399
+ key,
5400
+ label: str(row.display_name, key),
5401
+ description: str(row.description),
5402
+ kind: KINDS.has(kind) ? kind : "string",
5403
+ type: "system",
5404
+ multi: kind === "array",
5405
+ format: null,
5406
+ config: {},
5407
+ relation_target: null,
5408
+ sort: typeof row.sort_order === "number" ? row.sort_order : index,
5409
+ context_policy: "include",
5410
+ // The system table keeps the old sensitivity words (`restricted`/`privileged`), like the write doors.
5411
+ sensitivity: SENSITIVITY_FROM_DOOR[str(row.sensitivity)] ?? "public",
5412
+ source: "system",
5413
+ status: "active",
5414
+ status_note: null,
5415
+ category: null,
5416
+ tags: [],
5417
+ max_items: 0,
5418
+ custom_component: null,
5419
+ reference_source: null,
5420
+ allowed_scope_type_ids: null,
5421
+ allowed_reference_types: null,
5422
+ review_interval_days: null,
5423
+ depends_on: [],
5424
+ version: 0,
5425
+ created_by: null,
5426
+ created_at: "",
5427
+ updated_at: "",
5428
+ item_class: strOrNull(row.item_class)
5429
+ };
5430
+ }
5383
5431
  var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
5384
5432
  function referencesOf(row) {
5385
5433
  const v = row.value;
@@ -5714,7 +5762,11 @@ function createScopeDoors(call) {
5714
5762
  },
5715
5763
  async systemItems() {
5716
5764
  const res = await call("context_system_items", {}, "scopes.systemItems");
5717
- return res.ok ? { ok: true, data: res.data ?? [] } : res;
5765
+ return res.ok ? { ok: true, data: (res.data ?? []).map(systemContextFieldFromStore) } : res;
5766
+ },
5767
+ async tableTemplates(organizationId) {
5768
+ const res = await call("table_templates", { p_org_id: organizationId }, "scopes.tableTemplates");
5769
+ return res.ok ? { ok: true, data: Array.isArray(res.data) ? res.data : [] } : res;
5718
5770
  },
5719
5771
  async templates() {
5720
5772
  const res = await call("context_templates", {}, "scopes.templates");