@effect-dynamodb/schema 1.38.0 → 1.40.0

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 (85) hide show
  1. package/dist/Aggregate.d.ts +11 -4
  2. package/dist/Aggregate.d.ts.map +1 -1
  3. package/dist/Aggregate.js +21 -2
  4. package/dist/Aggregate.js.map +1 -1
  5. package/dist/DynamoModel.d.ts +13 -0
  6. package/dist/DynamoModel.d.ts.map +1 -1
  7. package/dist/DynamoModel.js.map +1 -1
  8. package/dist/DynamoSchema.d.ts +33 -17
  9. package/dist/DynamoSchema.d.ts.map +1 -1
  10. package/dist/DynamoSchema.js +19 -13
  11. package/dist/DynamoSchema.js.map +1 -1
  12. package/dist/Entity.d.ts +121 -18
  13. package/dist/Entity.d.ts.map +1 -1
  14. package/dist/Entity.js +238 -2
  15. package/dist/Entity.js.map +1 -1
  16. package/dist/Errors.d.ts +0 -27
  17. package/dist/Errors.d.ts.map +1 -1
  18. package/dist/Errors.js +0 -24
  19. package/dist/Errors.js.map +1 -1
  20. package/dist/KeyComposer.d.ts +368 -14
  21. package/dist/KeyComposer.d.ts.map +1 -1
  22. package/dist/KeyComposer.js +835 -87
  23. package/dist/KeyComposer.js.map +1 -1
  24. package/dist/index.d.ts +1 -1
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +1 -1
  27. package/dist/index.js.map +1 -1
  28. package/dist/internal/AggregateEdges.d.ts +3 -3
  29. package/dist/internal/AggregateSchemas.d.ts +181 -14
  30. package/dist/internal/AggregateSchemas.d.ts.map +1 -1
  31. package/dist/internal/AggregateSchemas.js +505 -45
  32. package/dist/internal/AggregateSchemas.js.map +1 -1
  33. package/dist/internal/AggregateTypes.d.ts +396 -36
  34. package/dist/internal/AggregateTypes.d.ts.map +1 -1
  35. package/dist/internal/CompositeCodec.d.ts +274 -6
  36. package/dist/internal/CompositeCodec.d.ts.map +1 -1
  37. package/dist/internal/CompositeCodec.js +829 -25
  38. package/dist/internal/CompositeCodec.js.map +1 -1
  39. package/dist/internal/EffectInstances.d.ts +81 -0
  40. package/dist/internal/EffectInstances.d.ts.map +1 -0
  41. package/dist/internal/EffectInstances.js +656 -0
  42. package/dist/internal/EffectInstances.js.map +1 -0
  43. package/dist/internal/EntitySchemas.d.ts +103 -27
  44. package/dist/internal/EntitySchemas.d.ts.map +1 -1
  45. package/dist/internal/EntitySchemas.js +778 -131
  46. package/dist/internal/EntitySchemas.js.map +1 -1
  47. package/dist/internal/EntityTypes.d.ts +67 -11
  48. package/dist/internal/EntityTypes.d.ts.map +1 -1
  49. package/dist/internal/FailingAsBefore.d.ts +25 -0
  50. package/dist/internal/FailingAsBefore.d.ts.map +1 -0
  51. package/dist/internal/FailingAsBefore.js +42 -0
  52. package/dist/internal/FailingAsBefore.js.map +1 -0
  53. package/dist/internal/InstanceReads.d.ts +33 -0
  54. package/dist/internal/InstanceReads.d.ts.map +1 -0
  55. package/dist/internal/InstanceReads.js +165 -0
  56. package/dist/internal/InstanceReads.js.map +1 -0
  57. package/dist/internal/KeyText136.d.ts +58 -131
  58. package/dist/internal/KeyText136.d.ts.map +1 -1
  59. package/dist/internal/KeyText136.js +154 -264
  60. package/dist/internal/KeyText136.js.map +1 -1
  61. package/dist/internal/NumericKey.d.ts +29 -2
  62. package/dist/internal/NumericKey.d.ts.map +1 -1
  63. package/dist/internal/NumericKey.js +64 -1
  64. package/dist/internal/NumericKey.js.map +1 -1
  65. package/dist/internal/PackedCodec.d.ts +8 -1
  66. package/dist/internal/PackedCodec.d.ts.map +1 -1
  67. package/dist/internal/PackedCodec.js +49 -13
  68. package/dist/internal/PackedCodec.js.map +1 -1
  69. package/dist/internal/SchemaAccessors.d.ts +160 -1
  70. package/dist/internal/SchemaAccessors.d.ts.map +1 -1
  71. package/dist/internal/SchemaAccessors.js +994 -1
  72. package/dist/internal/SchemaAccessors.js.map +1 -1
  73. package/dist/internal/Shards.d.ts +47 -0
  74. package/dist/internal/Shards.d.ts.map +1 -0
  75. package/dist/internal/Shards.js +60 -0
  76. package/dist/internal/Shards.js.map +1 -0
  77. package/dist/internal/SharedKeyAttribute.d.ts +102 -0
  78. package/dist/internal/SharedKeyAttribute.d.ts.map +1 -0
  79. package/dist/internal/SharedKeyAttribute.js +288 -0
  80. package/dist/internal/SharedKeyAttribute.js.map +1 -0
  81. package/dist/internal/SparseKey.d.ts +46 -0
  82. package/dist/internal/SparseKey.d.ts.map +1 -0
  83. package/dist/internal/SparseKey.js +69 -0
  84. package/dist/internal/SparseKey.js.map +1 -0
  85. package/package.json +2 -1
@@ -1,266 +1,121 @@
1
1
  /**
2
- * KeyText136 — the key text effect-dynamodb 1.36 composed (#171).
2
+ * KeyText136 — the key texts rows can be stored under, for `rekey` (#171, #183).
3
3
  *
4
- * 1.37 composes some key text differently, so a row 1.36 wrote with such a
5
- * value sits under a key 1.37 does not compose:
4
+ * Every operation composes one key text, the one the schema's `escapeKeys` setting chooses, and
5
+ * reads and writes nothing else. A row stored under another text isn't found by any read until
6
+ * `db.tables.<Table>.rekey()` moves it. This module is what `rekey` recognises such a row by. The
7
+ * key texts differ in:
6
8
  *
7
- * - **Numbers** (`serializeValue`): 1.36 zero-padded `String(n)` to 16
8
- * characters (a bigint to 38), which kept non-negative integers below 1e16
9
- * in order and nothing else; 1.37 encodes every number in numeric order
10
- * (`NumericKey.ts`). The text of a non-negative integer below 1e16 (1e38 for
11
- * a bigint) is unchanged.
12
- * - **Sort key values** holding a code point U+0000–U+0025 — a control
13
- * character, space, `!`, `"`, `#`, `$` or `%` — are escaped in 1.37
14
- * (`KeyComposer.sortKeyText`) and were not in 1.36. Partition keys, unique
15
- * sentinels and the structural parts of a key are not escaped.
16
- * - **Time-series event keys** carried the orderBy attribute's ENCODED value
17
- * (a `NumberFromString` `"10"` as the string `10`); 1.37 composes its key
18
- * form (`0000000000000010`).
9
+ * - **Numbers.** Up to 1.36, and with `escapeKeys` off, `String(n)` zero-padded to 16 characters
10
+ * (a bigint to 38), which keeps non-negative integers below 1e16 in order and nothing else.
11
+ * 1.37.0, 1.38.0 and `escapeKeys: true` encode every number in numeric order (`NumericKey.ts`). The
12
+ * text of a non-negative integer below 1e16 (1e38 for a bigint) is the same.
13
+ * - **Strings.** With `escapeKeys: true` a key value holding a code point U+0000–U+0025 is escaped
14
+ * (`KeyComposer.escapeKeyText`) in every key. 1.37.0 and 1.38.0 escaped sort keys only. Off, and up to 1.36,
15
+ * none. The structural parts of a key are never escaped.
16
+ * - **Time-series event keys.** Up to 1.36, and off, they hold the orderBy attribute's ENCODED
17
+ * value (a `NumberFromString` `"10"` as the string `10`), and with numeric text its key form
18
+ * (`0000000000000010`): `KeyComposer.eventOrderByValue`.
19
19
  *
20
- * Everything else — the key layout, casing, the history, sentinel, aggregate
21
- * and EventStore key shapes — is unchanged, so these functions compose 1.36's
22
- * bytes through the same `DynamoSchema` composers, fed 1.36's serialization.
23
- * Z-order sort keys are new in 1.37 and have no 1.36 form: `composeAllKeys`
24
- * leaves a Z-order index out.
20
+ * So there are four places a row can be, {@link forms}: each a pair of schemas whose composers give
21
+ * its partition and sort key text. `test/KeyText136.test.ts` checks the composers against golden
22
+ * vectors the published 1.36.0 packages composed.
25
23
  *
26
- * Every function takes the same key-form record its `KeyComposer` counterpart
27
- * does. `test/KeyText136.test.ts` checks them against golden vectors the
28
- * published 1.36.0 packages composed.
29
- *
30
- * The 1.37.x operations read and move rows still under their 1.36 keys while
31
- * the fallback is {@link enabled}; the fallback and this module go in the next
32
- * major release. Not part of the public API.
24
+ * Not part of the public API.
33
25
  */
34
- import { DateTime } from "effect";
35
26
  import * as DynamoSchema from "../DynamoSchema.js";
36
- import { applyCasing, composeClusteredSortKey, composeCollectionKey, composeIsolatedSortKey, composeKey, KEY_DELIMITER, } from "../DynamoSchema.js";
37
- import { effectiveCasing, isZOrderHalf } from "../KeyComposer.js";
38
- /** Whether operations read and move rows under their 1.36 keys (`DynamoSchema.make`'s `legacyKeys`). */
39
- export const enabled = (schema) => schema.legacyKeys !== false;
40
- /** `%`: the highest code point 1.37 escapes in sort key text, and the first of every escape. */
41
- const ESCAPE = 0x25;
42
- /**
43
- * Does sort key value text `text` hold a code point 1.37 escapes (U+0000–
44
- * U+0025)? Then its key text differs from 1.36's — and holds an escape, which
45
- * 1.36's text of another value can spell: `foo%20bar` is `foo bar`'s key now.
46
- */
47
- export const holdsEscaped = (text) => {
48
- for (let i = 0; i < text.length; i++) {
49
- if (text.charCodeAt(i) <= ESCAPE)
50
- return true;
51
- }
52
- return false;
53
- };
54
- /**
55
- * The first character of `text` below `%` (U+0000–U+0024), if any. Escaped
56
- * text never holds one, nor does any text whose casing is escaped text, so a
57
- * stored value holding it is not the 1.36 spelling of an escape.
58
- */
59
- export const firstBelowEscape = (text) => {
60
- for (let i = 0; i < text.length; i++) {
61
- if (text.charCodeAt(i) < ESCAPE)
62
- return text[i];
63
- }
64
- return undefined;
65
- };
27
+ import { composePk, composeSk, keyValueText, unescapeKeyText, } from "../KeyComposer.js";
28
+ import { decodeBigInt, decodeNumber } from "./NumericKey.js";
29
+ /** The schema composing the key text 1.36 composed: what `escapeKeys` off composes. */
30
+ export const schema136 = (schema) => ({
31
+ ...DynamoSchema.make({
32
+ name: schema.name,
33
+ version: schema.version,
34
+ casing: schema.casing,
35
+ escapeKeys: false,
36
+ }),
37
+ text136: true,
38
+ });
66
39
  /**
67
- * 1.36's composite value text: a number zero-padded to 16 characters, a bigint
68
- * to 38 — `String(n)` padded, so `-3` is `00000000000000-3` and `2.5` is
69
- * `00000000000002.5` — a boolean as `true` / `false`, a date as its ISO
70
- * string. Never throws: 1.36 composed `NaN` as `0000000000000NaN`.
40
+ * The schema whose partition key text is what 1.37.0 and 1.38.0 stored: its numbers in numeric order, its
41
+ * strings unescaped.
71
42
  */
72
- export const serializeValue = (value) => {
73
- if (typeof value === "string")
74
- return value;
75
- if (typeof value === "number")
76
- return String(value).padStart(16, "0");
77
- if (typeof value === "bigint")
78
- return String(value).padStart(38, "0");
79
- if (typeof value === "boolean")
80
- return value ? "true" : "false";
81
- if (typeof value === "object" && value !== null && DateTime.isDateTime(value)) {
82
- return DateTime.formatIso(value);
83
- }
84
- if (value instanceof Date)
85
- return value.toISOString();
86
- return String(value);
87
- };
88
- /** `KeyComposer.extractComposites` with 1.36's {@link serializeValue}. */
89
- export const extractComposites = (composite, record) => composite.map((attr) => {
90
- const value = record[attr];
91
- if (value === undefined || value === null) {
92
- throw new Error(`Missing composite attribute "${attr}" in record`);
93
- }
94
- return serializeValue(value);
43
+ export const schema137 = (schema) => ({
44
+ ...DynamoSchema.make({
45
+ name: schema.name,
46
+ version: schema.version,
47
+ casing: schema.casing,
48
+ escapeKeys: false,
49
+ }),
50
+ numericKeyText: true,
95
51
  });
96
- /** {@link extractComposites}, or `undefined` when a composite is missing. */
97
- export const tryExtractComposites = (composite, record) => composite.every((attr) => record[attr] !== undefined && record[attr] !== null)
98
- ? extractComposites(composite, record)
99
- : undefined;
100
- /** 1.36's partition key of `index` (`KeyComposer.composePk`). */
101
- export const composePk = (schema, entityType, index, record) => {
102
- const composites = extractComposites(index.pk.composite, record);
103
- const names = [...index.pk.composite];
104
- const collection = index.collection;
105
- if (collection !== undefined) {
106
- const collectionName = Array.isArray(collection) ? collection[0] : collection;
107
- return composeCollectionKey(schema, collectionName, composites, { casing: index.casing, names });
108
- }
109
- return composeKey(schema, entityType, composites, { casing: index.casing, names });
110
- };
111
- /** The sort key text 1.36 composed from `composites` (unescaped values). */
112
- const sortKeyOf = (schema, entityType, entityVersion, index, composites, names) => {
113
- const collection = index.collection;
114
- if (collection !== undefined) {
115
- if ((index.type ?? "isolated") === "clustered") {
116
- return composeClusteredSortKey(schema, collection, entityType, entityVersion, composites, {
117
- casing: index.casing,
118
- names,
119
- });
120
- }
121
- return composeIsolatedSortKey(schema, entityType, entityVersion, composites, {
122
- casing: index.casing,
123
- names,
124
- });
125
- }
126
- return composeKey(schema, entityType, composites, { casing: index.casing, names });
127
- };
128
- /** 1.36's sort key of a string-keyed `index` (`KeyComposer.composeSk`), values unescaped. */
129
- export const composeSk = (schema, entityType, entityVersion, index, record) => sortKeyOf(schema, entityType, entityVersion, index, extractComposites(index.sk.composite, record), index.sk.composite);
130
- /** Both 1.36 keys of a string-keyed `index`. */
131
- export const composeIndexKeys = (schema, entityType, entityVersion, index, record) => ({
132
- [index.pk.field]: composePk(schema, entityType, index, record),
133
- [index.sk.field]: composeSk(schema, entityType, entityVersion, index, record),
52
+ /** The schema composing the key text of `escapeKeys: true`. */
53
+ export const schemaEscaped = (schema) => DynamoSchema.make({
54
+ name: schema.name,
55
+ version: schema.version,
56
+ casing: schema.casing,
57
+ escapeKeys: true,
134
58
  });
135
- /** {@link composeIndexKeys}, or `undefined` when a composite is missing (a sparse index). */
136
- export const tryComposeIndexKeys = (schema, entityType, entityVersion, index, record) => {
137
- const present = (composite) => composite.every((attr) => record[attr] !== undefined && record[attr] !== null);
138
- if (!present(index.pk.composite) || !present(index.sk.composite))
139
- return undefined;
140
- return composeIndexKeys(schema, entityType, entityVersion, index, record);
141
- };
142
- /**
143
- * Every index's 1.36 keys (`KeyComposer.composeAllKeys`): the primary index's
144
- * always, a GSI's when all its composites are present. A Z-order index is new
145
- * in 1.37, so it has none.
146
- */
147
- export const composeAllKeys = (schema, entityType, entityVersion, indexes, record) => {
148
- const result = {};
149
- for (const [indexName, index] of Object.entries(indexes)) {
150
- if (isZOrderHalf(index.sk))
151
- continue;
152
- if (indexName === "primary") {
153
- Object.assign(result, composeIndexKeys(schema, entityType, entityVersion, index, record));
154
- }
155
- else {
156
- const keys = tryComposeIndexKeys(schema, entityType, entityVersion, index, record);
157
- if (keys !== undefined)
158
- Object.assign(result, keys);
159
- }
160
- }
161
- return result;
162
- };
163
59
  /**
164
- * 1.36's sort key prefix from the leading sort key composites present in
165
- * `record` (`KeyComposer.composeSortKeyPrefix`).
60
+ * Every place a row can be stored, whatever the setting is now, the current one among them:
61
+ * up to 1.36 and off; 1.37.0 and 1.38.0; on.
166
62
  */
167
- export const composeSortKeyPrefix = (schema, entityType, entityVersion, index, record) => {
168
- const names = [];
169
- for (const attr of index.sk.composite) {
170
- if (record[attr] === undefined || record[attr] === null)
171
- break;
172
- names.push(attr);
173
- }
174
- return sortKeyOf(schema, entityType, entityVersion, index, extractComposites(names, record), names);
175
- };
176
- /**
177
- * 1.36's `begins_with` operand: {@link composeSortKeyPrefix}, with the key
178
- * delimiter appended while composites remain unsupplied.
179
- */
180
- export const composeSortKeyBeginsWith = (schema, entityType, entityVersion, index, record) => {
181
- const prefix = composeSortKeyPrefix(schema, entityType, entityVersion, index, record);
182
- const supplied = index.sk.composite.findIndex((attr) => record[attr] === undefined || record[attr] === null);
183
- return supplied === -1 ? prefix : `${prefix}${KEY_DELIMITER}`;
184
- };
185
- /** How many leading sort key composites `record` holds. */
186
- const leadingSupplied = (index, record) => {
187
- const i = index.sk.composite.findIndex((attr) => record[attr] === undefined || record[attr] === null);
188
- return i === -1 ? index.sk.composite.length : i;
189
- };
190
- /**
191
- * The condition that selects, under 1.36's key text, the rows a query
192
- * accessor's pins select (`KeyComposer.composeSortKeyCondition`): `eq` on the
193
- * complete key, else `beginsWith` on the prefix and the delimiter.
194
- */
195
- export const composeSortKeyCondition = (schema, entityType, entityVersion, index, record) => {
196
- const prefix = composeSortKeyPrefix(schema, entityType, entityVersion, index, record);
197
- return leadingSupplied(index, record) === index.sk.composite.length
198
- ? { eq: prefix }
199
- : { beginsWith: `${prefix}${KEY_DELIMITER}` };
200
- };
201
- /**
202
- * The condition that selects, under 1.36's key text, the rows an `eq` or
203
- * `beginsWith` bound on sort key composite `field` selects, every composite
204
- * before it pinned in `pinned` (`composeRangeUnder` in `DynamoClient.ts`):
205
- * `eq` on the last composite is its key, on any other the value's subtree (the
206
- * delimiter appended); a `beginsWith` is a prefix of the value's text, or `eq`
207
- * for a number, which has no text prefix.
208
- */
209
- export const composeBoundCondition = (schema, entityType, entityVersion, index, pinned, field, bound) => {
210
- const casing = effectiveCasing(schema, index);
211
- const prefix = composeSortKeyBeginsWith(schema, entityType, entityVersion, index, pinned);
212
- const segment = (value) => `${prefix}${applyCasing(field, casing)}_${applyCasing(serializeValue(value), casing)}`;
213
- if ("beginsWith" in bound) {
214
- const operand = bound.beginsWith;
215
- if (typeof operand !== "number" && typeof operand !== "bigint") {
216
- return { beginsWith: segment(operand) };
217
- }
218
- }
219
- const value = "eq" in bound ? bound.eq : bound.beginsWith;
220
- const last = index.sk.composite.indexOf(field) === index.sk.composite.length - 1;
221
- return last ? { eq: segment(value) } : { beginsWith: `${segment(value)}${KEY_DELIMITER}` };
63
+ export const forms = (schema) => {
64
+ const off = schema136(schema);
65
+ const on = schemaEscaped(schema);
66
+ return [
67
+ { pk: off, sk: off },
68
+ { pk: schema137(schema), sk: on },
69
+ { pk: on, sk: on },
70
+ ];
222
71
  };
223
72
  /**
224
- * 1.36's time-series event sort key: `currentSk` (the current item's 1.36 sort
225
- * key), the cased `e` infix and the orderBy attribute's ENCODED value — not
226
- * its key form — through 1.36's {@link serializeValue}, cased.
73
+ * The row 1.37.0 and 1.38.0 stored on an entity with an index half in a table key attribute (inverted): each half
74
+ * was overwritten with the index's, so its partition key attribute holds the sort half's text
75
+ * (escaped), and its sort key attribute the partition half's (not).
227
76
  */
228
- export const composeEventSk = (currentSk, encodedOrderBy, casing = "lowercase") => `${currentSk}#${applyCasing("e", casing)}#${applyCasing(serializeValue(encodedOrderBy), casing)}`;
229
- /** 1.36's unique-constraint sentinel key over the constraint's field values, in order. */
230
- export const composeUniqueKey = (schema, entityType, constraintName, values) => DynamoSchema.composeUniqueKey(schema, entityType, constraintName, values.map(serializeValue));
231
- /** 1.36's vector index partition value, or `undefined` when a composite is missing. */
232
- export const tryComposeVectorPartition = (schema, entityType, index, record) => {
233
- const composites = tryExtractComposites(index.partition, record);
234
- if (composites === undefined)
235
- return undefined;
236
- return composeKey(schema, entityType, composites, {
237
- casing: index.casing,
238
- names: [...index.partition],
239
- });
240
- };
77
+ export const invertedForm137 = (schema) => ({
78
+ pk: schemaEscaped(schema),
79
+ sk: schema137(schema),
80
+ });
241
81
  /**
242
- * The 1.36 primary key of the item at `record` when the fallback is
243
- * {@link enabled} and its text differs from `current` — the key 1.37
244
- * composes — else `undefined`: the item can only be at `current`.
82
+ * A row holding no values (a projection's row tombstone or outbox item) says which text its key is
83
+ * by its `__edd_kt__` attribute: none, off's (1.36's), whose text every setting reads the same when
84
+ * nothing in it changes; 1, that of 1.37.0 and 1.38.0; 2, the text of `escapeKeys: true`.
245
85
  */
246
- export const changedPrimaryKey = (schema, entityType, entityVersion, primary, record, current) => {
247
- if (!enabled(schema))
86
+ export const formOfMark = (schema, mark) => {
87
+ const off = schema136(schema);
88
+ const on = schemaEscaped(schema);
89
+ if (mark === "1")
90
+ return { pk: schema137(schema), sk: on };
91
+ if (mark === "2")
92
+ return { pk: on, sk: on };
93
+ return { pk: off, sk: off };
94
+ };
95
+ /** The `__edd_kt__` of a row holding no values, keyed for `record` under `schema` ({@link formOfMark}). */
96
+ export const markOf = (schema, entityType, entityVersion, index, record) => {
97
+ if (schema.escapeKeys !== true)
248
98
  return undefined;
249
- const keys = composeIndexKeys(schema, entityType, entityVersion, primary, record);
250
- return keys[primary.pk.field] === current[primary.pk.field] &&
251
- keys[primary.sk.field] === current[primary.sk.field]
99
+ const off = schema136(schema);
100
+ const now = composeAt({ pk: schema, sk: schema }, entityType, entityVersion, index, record);
101
+ const then = composeAt({ pk: off, sk: off }, entityType, entityVersion, index, record);
102
+ return now[index.pk.field] === then[index.pk.field] &&
103
+ now[index.sk.field] === then[index.sk.field]
252
104
  ? undefined
253
- : keys;
105
+ : 2;
254
106
  };
255
107
  /**
256
- * A composite's 1.36 text back as the key-form value it was composed from:
257
- * a number or bigint without the zeros {@link serializeValue} padded it with,
258
- * a boolean from `true` / `false` in any casing, anything else as the (cased)
259
- * text. `undefined` when the text is no bigint or boolean; text that is no
260
- * number reads as `NaN`, which composes only `NaN`'s text.
108
+ * A composite's text under `under` back as the key-form value it was composed from: a number or
109
+ * bigint from its padded or numeric key text, a boolean from `true` / `false` in any casing,
110
+ * anything else as the (cased) text, unescaped where `under` escapes. `undefined` when the text is
111
+ * no bigint or boolean; text that is no number reads as `NaN`, which composes only `NaN`'s text.
261
112
  */
262
- const valueOf136 = (text, kind) => {
113
+ const valueOf = (under, rawText, kind) => {
114
+ const text = under.escapeKeys === true ? unescapeKeyText(rawText) : rawText;
263
115
  if (kind === "number" || kind === "bigint") {
116
+ if (under.escapeKeys === true || under.numericKeyText === true) {
117
+ return kind === "number" ? decodeNumber(text) : decodeBigInt(text);
118
+ }
264
119
  const digits = text.replace(/^0+/, "");
265
120
  const unpadded = digits === "" ? "0" : digits.startsWith(".") ? `0${digits}` : digits;
266
121
  // Casing may have changed `Infinity`'s letters, which `Number` reads in one spelling.
@@ -283,25 +138,51 @@ const valueOf136 = (text, kind) => {
283
138
  const MAX_READINGS = 8;
284
139
  /** Placeholder `i` in a key template: no casing changes it, and no prefix or label holds it. */
285
140
  const placeholder = (i) => `\u0000${i}\u0000`;
141
+ /** The partition and sort key of `index` under `form`. Throws when a composite is missing. */
142
+ export const composeAt = (form, entityType, entityVersion, index, record) => ({
143
+ [index.pk.field]: composePk(form.pk, entityType, index, record),
144
+ [index.sk.field]: composeSk(form.sk, entityType, entityVersion, index, record),
145
+ });
286
146
  /**
287
- * The key-form values 1.36 composed `stored` — a primary key `index` stores
288
- * rows under — from, read back from its text, for a row that holds no values
289
- * of its own (a projection's row tombstone or outbox item, which carry only
290
- * the key they were written for). Each composite's text is what lies between
291
- * the key's fixed parts (the prefix, labels and delimiters {@link
292
- * composeIndexKeys} writes around it), turned back into a value by `kindOf`
293
- * ({@link valueOf136}); a reading counts only when {@link composeIndexKeys}
294
- * composes exactly `stored` from it. `undefined` unless exactly one reading
295
- * does: none, when `stored` is not 1.36 text of any values (1.37 text of a
296
- * changed number, say), and more than one when a string value holds the
297
- * delimiter and the next composite's label.
147
+ * The key-form values `form` composed `stored` — a primary key `index` stores rows under — from,
148
+ * read back from its text, for a row that holds no values of its own (a projection's row
149
+ * tombstone or outbox item, which carry only the key they were written for). Each composite's
150
+ * text is what lies between the key's fixed parts (the prefix, labels and delimiters {@link
151
+ * composeAt} writes around it), turned back into a value by `kindOf` ({@link valueOf}); a reading
152
+ * counts only when {@link composeAt} composes exactly `stored` from it. `undefined` unless exactly
153
+ * one reading does: none, when `stored` is not `form`'s text of any values, and more than one when
154
+ * a string value holds the delimiter and the next composite's label. Given several kinds, a
155
+ * composite takes the first whose value composes its own text again: a field that stored both
156
+ * numeric kinds is read one composite at a time, never by trying each combination.
298
157
  *
299
- * A string comes back cased, which composes the same key text, in 1.36 and
300
- * 1.37 alike, as the value it was cased from.
158
+ * A string comes back cased, which composes the same key text as the value it was cased from.
301
159
  */
302
- export const readIndexKeys = (schema, entityType, entityVersion, index, stored, kindOf) => {
160
+ export const readIndexKeys = (form, entityType, entityVersion, index, stored, kindOf) => {
303
161
  const attrs = [...new Set([...index.pk.composite, ...index.sk.composite])];
304
- const template = composeIndexKeys(schema, entityType, entityVersion, index, Object.fromEntries(attrs.map((attr, i) => [attr, placeholder(i)])));
162
+ /**
163
+ * A composite's text as the first of its kinds whose value composes that text again, each
164
+ * judged by itself; the first kind's value when none does, which the whole key then refuses.
165
+ */
166
+ const slotValue = (under, text, attr) => {
167
+ const kinds = kindOf(attr);
168
+ if (!Array.isArray(kinds))
169
+ return valueOf(under, text, kinds);
170
+ const values = kinds.map((kind) => valueOf(under, text, kind));
171
+ const exact = values.find((value) => {
172
+ if (value === undefined)
173
+ return false;
174
+ try {
175
+ return keyValueText(under, value, index.casing ?? under.casing) === text;
176
+ }
177
+ catch {
178
+ return false;
179
+ }
180
+ });
181
+ return exact ?? values[0];
182
+ };
183
+ // The fixed parts are the same under every form, and off leaves a placeholder as it is.
184
+ const off = schema136(form.pk);
185
+ const template = composeAt({ pk: off, sk: off }, entityType, entityVersion, index, Object.fromEntries(attrs.map((attr, i) => [attr, placeholder(i)])));
305
186
  /** Every way `text` splits into `template`'s parts: each composite's text, by attribute. */
306
187
  const readings = (text, layout) => {
307
188
  // Fixed text and slot numbers alternate: `placeholder` brackets each number.
@@ -338,18 +219,27 @@ export const readIndexKeys = (schema, entityType, entityVersion, index, stored,
338
219
  for (const fromSk of readings(sk, template[index.sk.field])) {
339
220
  const record = {};
340
221
  let consistent = true;
341
- for (const [slot, text] of [...fromPk, ...fromSk]) {
342
- const attr = attrs[slot];
343
- const value = valueOf136(text, kindOf(attr));
344
- if (value === undefined || (attr in record && record[attr] !== value))
345
- consistent = false;
346
- record[attr] = value;
347
- }
222
+ const read = (halves, under) => {
223
+ for (const [slot, text] of halves) {
224
+ const attr = attrs[slot];
225
+ const value = slotValue(under, text, attr);
226
+ if (value === undefined || (attr in record && record[attr] !== value))
227
+ consistent = false;
228
+ record[attr] = value;
229
+ }
230
+ };
231
+ read(fromPk, form.pk);
232
+ read(fromSk, form.sk);
348
233
  if (!consistent)
349
234
  continue;
350
- const keys = composeIndexKeys(schema, entityType, entityVersion, index, record);
351
- if (keys[index.pk.field] === pk && keys[index.sk.field] === sk)
352
- fits.push(record);
235
+ try {
236
+ const keys = composeAt(form, entityType, entityVersion, index, record);
237
+ if (keys[index.pk.field] === pk && keys[index.sk.field] === sk)
238
+ fits.push(record);
239
+ }
240
+ catch {
241
+ // `NaN` read from no number: not this form's text.
242
+ }
353
243
  }
354
244
  }
355
245
  return fits.length === 1 ? fits[0] : undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"KeyText136.js","sourceRoot":"","sources":["../../src/internal/KeyText136.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AACjC,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAA;AAClD,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,oBAAoB,EACpB,sBAAsB,EACtB,UAAU,EACV,aAAa,GACd,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,e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12 +46,16 @@ declare const KeyValueError_base: new <A extends Record<string, any> = {}>(args:
46
46
  /**
47
47
  * A value key composition can't place in sort order: `NaN`, or a bigint of
48
48
  * more than 1,000 digits. Thrown synchronously by `serializeValue`; the write
49
- * paths turn it into a `ValidationError`.
49
+ * paths turn it into a `ValidationError`. A composite's number its declared
50
+ * kind can't hold exactly is refused as one too (`CompositeCodec.refuseInexact`).
50
51
  */
51
52
  export declare class KeyValueError extends KeyValueError_base<{
52
53
  readonly value: unknown;
53
54
  readonly reason: string;
54
- /** Human-readable description, prefixed with `EDD-9096`. */
55
+ /**
56
+ * Human-readable description, prefixed with its code: `EDD-9096`, or `EDD-9050`
57
+ * for a number its composite's kind can't hold exactly.
58
+ */
55
59
  readonly message: string;
56
60
  }> {
57
61
  }
@@ -60,6 +64,29 @@ export declare class KeyValueError extends KeyValueError_base<{
60
64
  * this package (a consumer's and `effect-dynamodb`'s) still agree.
61
65
  */
62
66
  export declare const isKeyValueError: (u: unknown) => u is KeyValueError;
67
+ declare const StoredNaNTypeId: unique symbol;
68
+ /**
69
+ * The `NaN` of a number its field stores as a string, in key form. `Schema.NumberFromString`
70
+ * stores `"NaN"`, so a row can hold it: with `escapeKeys` off it composes the text 1.36 gave it
71
+ * (`0000000000000NaN`), as up to 1.39.0, where such a row was written, read, updated and deleted.
72
+ * A `number`'s own `NaN` has no stored form, so no row holds it and it has no key text under
73
+ * either setting. Only the field can tell the two apart, so the composite key form
74
+ * (`CompositeCodec`) hands the first on as this value and the composers compose it by the
75
+ * schema's setting. It is `NaN` to arithmetic and comparison.
76
+ */
77
+ export declare const STORED_NAN: {
78
+ readonly [StoredNaNTypeId]: true;
79
+ };
80
+ /** Is `u` {@link STORED_NAN}? By its id, so two copies of this package still agree. */
81
+ export declare const isStoredNaN: (u: unknown) => boolean;
82
+ /**
83
+ * The `number` {@link encodeNumber} composed `text` from, for `rekey`, which reads a value back out
84
+ * of a row holding only its key. `NaN` when `text` is no such text; a caller checks by composing
85
+ * the value again.
86
+ */
87
+ export declare const decodeNumber: (text: string) => number;
88
+ /** The `bigint` {@link encodeBigInt} composed `text` from; `undefined` when it is no such text. */
89
+ export declare const decodeBigInt: (text: string) => bigint | undefined;
63
90
  /** The key text of a `number`. Throws {@link KeyValueError} (`[EDD-9096]`) for `NaN`. */
64
91
  export declare const encodeNumber: (n: number) => string;
65
92
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"NumericKey.d.ts","sourceRoot":"","sources":["../../src/internal/NumericKey.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;;;;AAIH;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,mBAAkC;IACnE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAC;CAAG;AAEL;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,GAAG,OAAO,KAAG,CAAC,IAAI,aACV,CAAA;AAuDxC,yFAAyF;AACzF,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,KAAG,MAQxC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,YAAY,GAAI,GAAG,MAAM,KAAG,MAQxC,CAAA"}
1
+ {"version":3,"file":"NumericKey.d.ts","sourceRoot":"","sources":["../../src/internal/NumericKey.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;;;;AAIH;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,mBAAkC;IACnE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAC;CAAG;AAEL;;;GAGG;AACH,eAAO,MAAM,eAAe,GAA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