@ai-matrx/records 0.58.114 → 0.58.115

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.
@@ -39104,6 +39104,9 @@ var DOORS = {
39104
39104
  fieldDeclare: "field_declare",
39105
39105
  fieldUpdate: "field_update",
39106
39106
  fieldRetire: "field_retire",
39107
+ // THE UNDO OF field_retire (lane STORE-RESTORE-DOORS): the set that went together comes back
39108
+ // whole, the Table declares the columns again, and the values never left the records.
39109
+ fieldRestore: "field_restore",
39107
39110
  // CUSTOM FIELDS ON A STANDARD BUSINESS TABLE. Every door above is keyed by a
39108
39111
  // custom Table's uuid, and a standard table has no Table record - so until
39109
39112
  // 2026-09-20 `custom.applicable_fields(org, 'party', null)` answered `22P02
@@ -40568,6 +40571,28 @@ function createRecordsClient(config) {
40568
40571
  "fieldRetire"
40569
40572
  );
40570
40573
  },
40574
+ async fieldRestore({ field_id }) {
40575
+ return callDoor(
40576
+ DOORS.fieldRestore,
40577
+ { p_organization_id: org, p_field_id: field_id },
40578
+ "fieldRestore"
40579
+ );
40580
+ },
40581
+ async fieldsRetired({ table_id }) {
40582
+ const kernel = await callDoor(DOORS.fieldKernelId, {}, "fieldsRetired.kernel");
40583
+ if (!kernel.ok) return err(kernel.error);
40584
+ const PAGE = 200;
40585
+ const found = [];
40586
+ for (let page = 0; page < 25; page += 1) {
40587
+ const answered = await this.listArchived({ table_id: kernel.data, lane: "org", limit: PAGE, offset: page * PAGE });
40588
+ if (!answered.ok) return err(answered.error);
40589
+ for (const row of answered.data.rows) {
40590
+ if (String(row.document["entity_definition_id"] ?? "") === table_id) found.push(row);
40591
+ }
40592
+ if (answered.data.rows.length < PAGE) break;
40593
+ }
40594
+ return ok(found);
40595
+ },
40571
40596
  async relationWords({ field_id, value }) {
40572
40597
  return callDoor(
40573
40598
  DOORS.relationWords,
@@ -42968,6 +42993,11 @@ function useFieldMutation() {
42968
42993
  if (gone) announce(null);
42969
42994
  return gone;
42970
42995
  },
42996
+ restore: async (args) => {
42997
+ const back = await run(() => client.fieldRestore({ field_id: args.field_id }), false);
42998
+ if (back) announce(null);
42999
+ return back;
43000
+ },
42971
43001
  saving,
42972
43002
  error,
42973
43003
  clearError: () => setError(null)