@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.
- package/CHANGELOG.md +6 -0
- package/dist/core/index.cjs +25 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +16 -0
- package/dist/core/index.d.ts +16 -0
- package/dist/core/index.js +25 -0
- package/dist/core/index.js.map +1 -1
- package/dist/react/index.cjs +30 -0
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +19 -0
- package/dist/react/index.d.ts +19 -0
- package/dist/react/index.js +30 -0
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.d.cts
CHANGED
|
@@ -11298,6 +11298,21 @@ interface RecordsClient {
|
|
|
11298
11298
|
fieldRetire(args: {
|
|
11299
11299
|
field_id: Uuid;
|
|
11300
11300
|
}): Promise<RecordsResult<boolean>>;
|
|
11301
|
+
/**
|
|
11302
|
+
* Bring a removed column back (`custom.field_restore`): the set that was retired with it, the
|
|
11303
|
+
* Table's declaration of those columns, and the links they made. The values never left.
|
|
11304
|
+
*/
|
|
11305
|
+
fieldRestore(args: {
|
|
11306
|
+
field_id: Uuid;
|
|
11307
|
+
}): Promise<RecordsResult<boolean>>;
|
|
11308
|
+
/**
|
|
11309
|
+
* THE COLUMNS THIS TABLE HAD AND NO LONGER HAS (grids review 3): its retired Field records,
|
|
11310
|
+
* newest first, through the same archived door the Table archive uses — addressed at the Field
|
|
11311
|
+
* kernel (every Field is a record in it) and paged until the door answers short.
|
|
11312
|
+
*/
|
|
11313
|
+
fieldsRetired(args: {
|
|
11314
|
+
table_id: Uuid;
|
|
11315
|
+
}): Promise<RecordsResult<ArchivedRow[]>>;
|
|
11301
11316
|
/** What the registry says about a token, and whether it can hold a value at all. */
|
|
11302
11317
|
entityTable(args: {
|
|
11303
11318
|
token: string;
|
|
@@ -13118,6 +13133,10 @@ interface UseFieldMutation {
|
|
|
13118
13133
|
retire: (args: {
|
|
13119
13134
|
field_id: Uuid;
|
|
13120
13135
|
}) => Promise<boolean>;
|
|
13136
|
+
/** Bring a removed column back, with its values. */
|
|
13137
|
+
restore: (args: {
|
|
13138
|
+
field_id: Uuid;
|
|
13139
|
+
}) => Promise<boolean>;
|
|
13121
13140
|
saving: boolean;
|
|
13122
13141
|
error: RecordsError | null;
|
|
13123
13142
|
clearError: () => void;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -11298,6 +11298,21 @@ interface RecordsClient {
|
|
|
11298
11298
|
fieldRetire(args: {
|
|
11299
11299
|
field_id: Uuid;
|
|
11300
11300
|
}): Promise<RecordsResult<boolean>>;
|
|
11301
|
+
/**
|
|
11302
|
+
* Bring a removed column back (`custom.field_restore`): the set that was retired with it, the
|
|
11303
|
+
* Table's declaration of those columns, and the links they made. The values never left.
|
|
11304
|
+
*/
|
|
11305
|
+
fieldRestore(args: {
|
|
11306
|
+
field_id: Uuid;
|
|
11307
|
+
}): Promise<RecordsResult<boolean>>;
|
|
11308
|
+
/**
|
|
11309
|
+
* THE COLUMNS THIS TABLE HAD AND NO LONGER HAS (grids review 3): its retired Field records,
|
|
11310
|
+
* newest first, through the same archived door the Table archive uses — addressed at the Field
|
|
11311
|
+
* kernel (every Field is a record in it) and paged until the door answers short.
|
|
11312
|
+
*/
|
|
11313
|
+
fieldsRetired(args: {
|
|
11314
|
+
table_id: Uuid;
|
|
11315
|
+
}): Promise<RecordsResult<ArchivedRow[]>>;
|
|
11301
11316
|
/** What the registry says about a token, and whether it can hold a value at all. */
|
|
11302
11317
|
entityTable(args: {
|
|
11303
11318
|
token: string;
|
|
@@ -13118,6 +13133,10 @@ interface UseFieldMutation {
|
|
|
13118
13133
|
retire: (args: {
|
|
13119
13134
|
field_id: Uuid;
|
|
13120
13135
|
}) => Promise<boolean>;
|
|
13136
|
+
/** Bring a removed column back, with its values. */
|
|
13137
|
+
restore: (args: {
|
|
13138
|
+
field_id: Uuid;
|
|
13139
|
+
}) => Promise<boolean>;
|
|
13121
13140
|
saving: boolean;
|
|
13122
13141
|
error: RecordsError | null;
|
|
13123
13142
|
clearError: () => void;
|
package/dist/react/index.js
CHANGED
|
@@ -38924,6 +38924,9 @@ var DOORS = {
|
|
|
38924
38924
|
fieldDeclare: "field_declare",
|
|
38925
38925
|
fieldUpdate: "field_update",
|
|
38926
38926
|
fieldRetire: "field_retire",
|
|
38927
|
+
// THE UNDO OF field_retire (lane STORE-RESTORE-DOORS): the set that went together comes back
|
|
38928
|
+
// whole, the Table declares the columns again, and the values never left the records.
|
|
38929
|
+
fieldRestore: "field_restore",
|
|
38927
38930
|
// CUSTOM FIELDS ON A STANDARD BUSINESS TABLE. Every door above is keyed by a
|
|
38928
38931
|
// custom Table's uuid, and a standard table has no Table record - so until
|
|
38929
38932
|
// 2026-09-20 `custom.applicable_fields(org, 'party', null)` answered `22P02
|
|
@@ -40388,6 +40391,28 @@ function createRecordsClient(config) {
|
|
|
40388
40391
|
"fieldRetire"
|
|
40389
40392
|
);
|
|
40390
40393
|
},
|
|
40394
|
+
async fieldRestore({ field_id }) {
|
|
40395
|
+
return callDoor(
|
|
40396
|
+
DOORS.fieldRestore,
|
|
40397
|
+
{ p_organization_id: org, p_field_id: field_id },
|
|
40398
|
+
"fieldRestore"
|
|
40399
|
+
);
|
|
40400
|
+
},
|
|
40401
|
+
async fieldsRetired({ table_id }) {
|
|
40402
|
+
const kernel = await callDoor(DOORS.fieldKernelId, {}, "fieldsRetired.kernel");
|
|
40403
|
+
if (!kernel.ok) return err(kernel.error);
|
|
40404
|
+
const PAGE = 200;
|
|
40405
|
+
const found = [];
|
|
40406
|
+
for (let page = 0; page < 25; page += 1) {
|
|
40407
|
+
const answered = await this.listArchived({ table_id: kernel.data, lane: "org", limit: PAGE, offset: page * PAGE });
|
|
40408
|
+
if (!answered.ok) return err(answered.error);
|
|
40409
|
+
for (const row of answered.data.rows) {
|
|
40410
|
+
if (String(row.document["entity_definition_id"] ?? "") === table_id) found.push(row);
|
|
40411
|
+
}
|
|
40412
|
+
if (answered.data.rows.length < PAGE) break;
|
|
40413
|
+
}
|
|
40414
|
+
return ok(found);
|
|
40415
|
+
},
|
|
40391
40416
|
async relationWords({ field_id, value }) {
|
|
40392
40417
|
return callDoor(
|
|
40393
40418
|
DOORS.relationWords,
|
|
@@ -42788,6 +42813,11 @@ function useFieldMutation() {
|
|
|
42788
42813
|
if (gone) announce(null);
|
|
42789
42814
|
return gone;
|
|
42790
42815
|
},
|
|
42816
|
+
restore: async (args) => {
|
|
42817
|
+
const back = await run(() => client.fieldRestore({ field_id: args.field_id }), false);
|
|
42818
|
+
if (back) announce(null);
|
|
42819
|
+
return back;
|
|
42820
|
+
},
|
|
42791
42821
|
saving,
|
|
42792
42822
|
error,
|
|
42793
42823
|
clearError: () => setError(null)
|