@ai-matrx/records 0.98.6 → 0.98.8

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog — @ai-matrx/records
2
2
 
3
+ ## 0.98.8
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/records/v0.98.7..npm/records/v0.98.8 -- apps/shared/records`).
7
+ No source changes intended and no consumer action required.
8
+
9
+ ## 0.98.7
10
+
11
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
12
+ `git diff npm/records/v0.98.6..npm/records/v0.98.7 -- apps/shared/records`).
13
+ No source changes intended and no consumer action required.
14
+
3
15
  ## 0.98.6
4
16
 
5
17
  Automatic changed-only republish (docs/metadata drift since the last tag — see
@@ -103,6 +103,7 @@ __export(core_exports, {
103
103
  STORE_DOORS: () => STORE_DOORS,
104
104
  STORE_KNOBS: () => STORE_KNOBS,
105
105
  STORE_REFUSAL_CODES: () => STORE_REFUSAL_CODES,
106
+ STORE_SCHEMA: () => STORE_SCHEMA,
106
107
  SYSTEM_WRITER_WORDS: () => SYSTEM_WRITER_WORDS,
107
108
  TABLE_DISPLAYS: () => TABLE_DISPLAYS,
108
109
  TABLE_KIND_PREFIX: () => TABLE_KIND_PREFIX,
@@ -296,6 +297,7 @@ __export(core_exports, {
296
297
  stableFilterKey: () => stableFilterKey,
297
298
  staleWriteDetail: () => staleWriteDetail,
298
299
  statusGroupOf: () => statusGroupOf,
300
+ storeDoors: () => storeDoors,
299
301
  supabaseDataSource: () => supabaseDataSource,
300
302
  tableIdOf: () => tableIdOf,
301
303
  tableJsonSchema: () => tableJsonSchema,
@@ -11059,6 +11061,58 @@ function blockLandedInStore(outcomes, block) {
11059
11061
  return false;
11060
11062
  }
11061
11063
 
11064
+ // src/core/storeDoors.ts
11065
+ var STORE_SCHEMA = "custom";
11066
+ function storeDoors(client) {
11067
+ const source = supabaseDataSource(client ?? {});
11068
+ const call = (fn, args = {}) => source.rpc(fn, args, { schema: STORE_SCHEMA });
11069
+ const typed = (fn, args) => call(fn, args);
11070
+ return {
11071
+ rpc: call,
11072
+ async whereIdOpens(id) {
11073
+ const raw = await call("where_id_opens", { p_id: id });
11074
+ const e = raw.error;
11075
+ return {
11076
+ data: raw.data ?? null,
11077
+ error: e ? { code: typeof e.code === "string" ? e.code : null, message: typeof e.message === "string" ? e.message : "The record store refused." } : null
11078
+ };
11079
+ },
11080
+ tableKernelId: () => typed("table_kernel_id", {}),
11081
+ readRecordsByIds: (organizationId, tableId, ids) => typed("read_records_by_ids", { p_organization_id: organizationId, p_table_id: tableId, p_record_ids: ids }),
11082
+ readRecordsPage: (args) => typed("read_records_page", args),
11083
+ recordTable: (organizationId, recordId) => typed("record_table", { p_organization_id: organizationId, p_record_id: recordId }),
11084
+ applicableFields: (organizationId, tableId) => typed("applicable_fields", { p_organization_id: organizationId, p_table_id: tableId }),
11085
+ fieldDeclare: (organizationId, tableId, spec) => typed("field_declare", { p_organization_id: organizationId, p_table_id: tableId, p_spec: spec }),
11086
+ recordUpdate: (organizationId, recordId, patch) => typed("record_update", { p_organization_id: organizationId, p_record_id: recordId, p_patch: patch }),
11087
+ entityReferenceWords: (organizationId, refs) => typed("entity_reference_words", { p_organization_id: organizationId, p_refs: refs.map((r) => ({ token: r.token, id: r.id })) }),
11088
+ templates: (filter) => typed("templates", { p_filter: filter }),
11089
+ templateFromTables: ({ organizationId, tableIds, includeRows, rowsPerTable }) => typed("template_from_tables", {
11090
+ p_organization_id: organizationId,
11091
+ p_table_ids: tableIds,
11092
+ p_include_rows: includeRows,
11093
+ p_rows_per_table: rowsPerTable
11094
+ }),
11095
+ templateDeclare: (scope, spec) => typed("template_declare", { p_scope: scope, p_spec: spec }),
11096
+ templateKeep: (templateId) => typed("template_keep", { p_template_id: templateId }),
11097
+ templateArchive: (templateId, restore) => typed("template_archive", restore === void 0 ? { p_template_id: templateId } : { p_template_id: templateId, p_restore: restore }),
11098
+ templateInstallClaim: ({ organizationId, installId, kind, label, sourceId, leaseSeconds }) => typed("template_install_claim", {
11099
+ p_organization_id: organizationId,
11100
+ p_install_id: installId,
11101
+ p_kind: kind,
11102
+ p_label: label,
11103
+ ...sourceId ? { p_source_id: sourceId } : {},
11104
+ p_lease_seconds: leaseSeconds
11105
+ }),
11106
+ templateInstallNote: ({ organizationId, installId, kind, id, label }) => typed("template_install_note", {
11107
+ p_organization_id: organizationId,
11108
+ p_install_id: installId,
11109
+ p_kind: kind,
11110
+ p_id: id,
11111
+ p_label: label
11112
+ })
11113
+ };
11114
+ }
11115
+
11062
11116
  // src/core/validation.ts
11063
11117
  var import_uuid7 = require("@ai-matrx/kit/uuid");
11064
11118
  var DEFAULT_VALUE_MAX_BYTES = 1e5;