@ai-matrx/records 0.87.17 → 0.87.18

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,13 +1,25 @@
1
1
  # Changelog — @ai-matrx/records
2
2
 
3
+ ## 0.87.18
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/records/v0.87.17..npm/records/v0.87.18 -- apps/shared/records`).
7
+ No source changes intended and no consumer action required.
8
+
3
9
  ## 0.87.17
4
10
 
5
11
  Automatic changed-only republish (docs/metadata drift since the last tag — see
6
12
  `git diff npm/records/v0.87.16..npm/records/v0.87.17 -- apps/shared/records`).
7
13
  No source changes intended and no consumer action required.
8
14
 
15
+ ## 0.87.16
16
+
17
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
18
+ `git diff npm/records/v0.87.15..npm/records/v0.87.16 -- apps/shared/records`).
19
+ No source changes intended and no consumer action required.
20
+
9
21
  ## 0.87.15
10
- ### lane AO: a blank format-checked field is no value (0.87.14)
22
+ ### lane AO: a blank format-checked field is no value
11
23
 
12
24
  From the final live test of the Applet builder (v0.4.3018, 2026-10-08): Brand form, only the name filled,
13
25
  Save → `record_write` 400 / 23514 "Contact Email is not written the way this field expects". The table data
@@ -126,6 +126,7 @@ __export(core_exports, {
126
126
  asRecordsDataSource: () => asRecordsDataSource,
127
127
  asWriteConflict: () => asWriteConflict,
128
128
  atLeast: () => atLeast,
129
+ autonumberJoin: () => autonumberJoin,
129
130
  autonumberPrefixOf: () => autonumberPrefixOf,
130
131
  autonumberSearchOf: () => autonumberSearchOf,
131
132
  autonumberWords: () => autonumberWords,
@@ -1471,7 +1472,10 @@ function autonumberPrefixOf(field) {
1471
1472
  function autonumberWords(field, value) {
1472
1473
  const n = typeof value === "number" ? value : typeof value === "string" && /^\d+$/.test(value.trim()) ? Number(value) : NaN;
1473
1474
  if (!Number.isFinite(n)) return null;
1474
- return `${autonumberPrefixOf(field)}${Math.trunc(n)}`;
1475
+ return `${autonumberJoin(autonumberPrefixOf(field))}${Math.trunc(n)}`;
1476
+ }
1477
+ function autonumberJoin(prefix) {
1478
+ return prefix === "" || /[-_#.:/\s]$/.test(prefix) ? prefix : `${prefix}-`;
1475
1479
  }
1476
1480
  function autonumberSearchOf(fields, words) {
1477
1481
  const text2 = words.trim();
@@ -7093,7 +7097,12 @@ function createRecordsClient(given) {
7093
7097
  );
7094
7098
  let total = Number(answer?.total ?? 0);
7095
7099
  let locked = 0;
7096
- const plainPage = (!filter || Object.keys(filter).length === 0) && (!search || search.trim() === "") && (!sort || sort.length === 0) && view_id == null;
7100
+ const unfiltered = (!filter || Object.keys(filter).length === 0) && (!search || search.trim() === "") && view_id == null;
7101
+ const plainPage = unfiltered && (!sort || sort.length === 0);
7102
+ const lockedOffPage = Number(answer?.locked ?? 0);
7103
+ if (!plainPage && unfiltered && Number.isFinite(lockedOffPage) && lockedOffPage > 0) {
7104
+ locked = Math.max(lockedOnPage, lockedOffPage);
7105
+ }
7097
7106
  if (plainPage) {
7098
7107
  const counted = await client.recordAggregate({ table_id, measures: [{ op: "count" }] });
7099
7108
  if (!counted.ok) return err(counted.error);
@@ -7103,7 +7112,7 @@ function createRecordsClient(given) {
7103
7112
  }
7104
7113
  locked = openable <= total ? Math.max(lockedOnPage, total - openable) : lockedOnPage;
7105
7114
  total = openable;
7106
- } else if (lockedOnPage > 0) {
7115
+ } else if (lockedOnPage > 0 && locked === 0) {
7107
7116
  locked = lockedOnPage;
7108
7117
  total = Math.max(rows2.length, total - lockedOnPage);
7109
7118
  }