@b2bc-devkit/sheetorm 1.1.0 → 1.2.3

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 (150) hide show
  1. package/package.json +171 -86
  2. package/readme.md +57 -17
  3. package/dist/npm/SheetOrm.d.ts +0 -41
  4. package/dist/npm/SheetOrm.d.ts.map +0 -1
  5. package/dist/npm/SheetOrm.js +0 -41
  6. package/dist/npm/SheetOrm.js.map +0 -1
  7. package/dist/npm/core/Decorators.d.ts +0 -145
  8. package/dist/npm/core/Decorators.d.ts.map +0 -1
  9. package/dist/npm/core/Decorators.js +0 -226
  10. package/dist/npm/core/Decorators.js.map +0 -1
  11. package/dist/npm/core/Record.d.ts +0 -178
  12. package/dist/npm/core/Record.d.ts.map +0 -1
  13. package/dist/npm/core/Record.js +0 -313
  14. package/dist/npm/core/Record.js.map +0 -1
  15. package/dist/npm/core/RecordConstructor.d.ts +0 -20
  16. package/dist/npm/core/RecordConstructor.d.ts.map +0 -1
  17. package/dist/npm/core/RecordConstructor.js +0 -2
  18. package/dist/npm/core/RecordConstructor.js.map +0 -1
  19. package/dist/npm/core/RecordStatic.d.ts +0 -23
  20. package/dist/npm/core/RecordStatic.d.ts.map +0 -1
  21. package/dist/npm/core/RecordStatic.js +0 -2
  22. package/dist/npm/core/RecordStatic.js.map +0 -1
  23. package/dist/npm/core/Registry.d.ts +0 -101
  24. package/dist/npm/core/Registry.d.ts.map +0 -1
  25. package/dist/npm/core/Registry.js +0 -226
  26. package/dist/npm/core/Registry.js.map +0 -1
  27. package/dist/npm/core/SheetRepository.d.ts +0 -331
  28. package/dist/npm/core/SheetRepository.d.ts.map +0 -1
  29. package/dist/npm/core/SheetRepository.js +0 -1041
  30. package/dist/npm/core/SheetRepository.js.map +0 -1
  31. package/dist/npm/core/cache/MemoryCache.d.ts +0 -67
  32. package/dist/npm/core/cache/MemoryCache.d.ts.map +0 -1
  33. package/dist/npm/core/cache/MemoryCache.js +0 -112
  34. package/dist/npm/core/cache/MemoryCache.js.map +0 -1
  35. package/dist/npm/core/types/Entity.d.ts +0 -21
  36. package/dist/npm/core/types/Entity.d.ts.map +0 -1
  37. package/dist/npm/core/types/Entity.js +0 -2
  38. package/dist/npm/core/types/Entity.js.map +0 -1
  39. package/dist/npm/core/types/FieldDefinition.d.ts +0 -21
  40. package/dist/npm/core/types/FieldDefinition.d.ts.map +0 -1
  41. package/dist/npm/core/types/FieldDefinition.js +0 -2
  42. package/dist/npm/core/types/FieldDefinition.js.map +0 -1
  43. package/dist/npm/core/types/FieldType.d.ts +0 -12
  44. package/dist/npm/core/types/FieldType.d.ts.map +0 -1
  45. package/dist/npm/core/types/FieldType.js +0 -2
  46. package/dist/npm/core/types/FieldType.js.map +0 -1
  47. package/dist/npm/core/types/Filter.d.ts +0 -16
  48. package/dist/npm/core/types/Filter.d.ts.map +0 -1
  49. package/dist/npm/core/types/Filter.js +0 -2
  50. package/dist/npm/core/types/Filter.js.map +0 -1
  51. package/dist/npm/core/types/FilterOperator.d.ts +0 -16
  52. package/dist/npm/core/types/FilterOperator.d.ts.map +0 -1
  53. package/dist/npm/core/types/FilterOperator.js +0 -2
  54. package/dist/npm/core/types/FilterOperator.js.map +0 -1
  55. package/dist/npm/core/types/GroupResult.d.ts +0 -14
  56. package/dist/npm/core/types/GroupResult.d.ts.map +0 -1
  57. package/dist/npm/core/types/GroupResult.js +0 -2
  58. package/dist/npm/core/types/GroupResult.js.map +0 -1
  59. package/dist/npm/core/types/ICacheProvider.d.ts +0 -20
  60. package/dist/npm/core/types/ICacheProvider.d.ts.map +0 -1
  61. package/dist/npm/core/types/ICacheProvider.js +0 -2
  62. package/dist/npm/core/types/ICacheProvider.js.map +0 -1
  63. package/dist/npm/core/types/ISheetAdapter.d.ts +0 -53
  64. package/dist/npm/core/types/ISheetAdapter.d.ts.map +0 -1
  65. package/dist/npm/core/types/ISheetAdapter.js +0 -2
  66. package/dist/npm/core/types/ISheetAdapter.js.map +0 -1
  67. package/dist/npm/core/types/ISpreadsheetAdapter.d.ts +0 -41
  68. package/dist/npm/core/types/ISpreadsheetAdapter.d.ts.map +0 -1
  69. package/dist/npm/core/types/ISpreadsheetAdapter.js +0 -2
  70. package/dist/npm/core/types/ISpreadsheetAdapter.js.map +0 -1
  71. package/dist/npm/core/types/IndexDefinition.d.ts +0 -16
  72. package/dist/npm/core/types/IndexDefinition.d.ts.map +0 -1
  73. package/dist/npm/core/types/IndexDefinition.js +0 -2
  74. package/dist/npm/core/types/IndexDefinition.js.map +0 -1
  75. package/dist/npm/core/types/LifecycleHooks.d.ts +0 -32
  76. package/dist/npm/core/types/LifecycleHooks.d.ts.map +0 -1
  77. package/dist/npm/core/types/LifecycleHooks.js +0 -2
  78. package/dist/npm/core/types/LifecycleHooks.js.map +0 -1
  79. package/dist/npm/core/types/PaginatedResult.d.ts +0 -18
  80. package/dist/npm/core/types/PaginatedResult.d.ts.map +0 -1
  81. package/dist/npm/core/types/PaginatedResult.js +0 -2
  82. package/dist/npm/core/types/PaginatedResult.js.map +0 -1
  83. package/dist/npm/core/types/QueryOptions.d.ts +0 -21
  84. package/dist/npm/core/types/QueryOptions.d.ts.map +0 -1
  85. package/dist/npm/core/types/QueryOptions.js +0 -2
  86. package/dist/npm/core/types/QueryOptions.js.map +0 -1
  87. package/dist/npm/core/types/SortClause.d.ts +0 -10
  88. package/dist/npm/core/types/SortClause.d.ts.map +0 -1
  89. package/dist/npm/core/types/SortClause.js +0 -2
  90. package/dist/npm/core/types/SortClause.js.map +0 -1
  91. package/dist/npm/core/types/SystemColumns.d.ts +0 -16
  92. package/dist/npm/core/types/SystemColumns.d.ts.map +0 -1
  93. package/dist/npm/core/types/SystemColumns.js +0 -16
  94. package/dist/npm/core/types/SystemColumns.js.map +0 -1
  95. package/dist/npm/core/types/TableSchema.d.ts +0 -24
  96. package/dist/npm/core/types/TableSchema.d.ts.map +0 -1
  97. package/dist/npm/core/types/TableSchema.js +0 -2
  98. package/dist/npm/core/types/TableSchema.js.map +0 -1
  99. package/dist/npm/index/IndexMeta.d.ts +0 -16
  100. package/dist/npm/index/IndexMeta.d.ts.map +0 -1
  101. package/dist/npm/index/IndexMeta.js +0 -2
  102. package/dist/npm/index/IndexMeta.js.map +0 -1
  103. package/dist/npm/index/IndexStore.d.ts +0 -397
  104. package/dist/npm/index/IndexStore.d.ts.map +0 -1
  105. package/dist/npm/index/IndexStore.js +0 -1102
  106. package/dist/npm/index/IndexStore.js.map +0 -1
  107. package/dist/npm/index.d.ts +0 -115
  108. package/dist/npm/index.d.ts.map +0 -1
  109. package/dist/npm/index.js +0 -367
  110. package/dist/npm/index.js.map +0 -1
  111. package/dist/npm/query/Query.d.ts +0 -176
  112. package/dist/npm/query/Query.d.ts.map +0 -1
  113. package/dist/npm/query/Query.js +0 -270
  114. package/dist/npm/query/Query.js.map +0 -1
  115. package/dist/npm/query/QueryEngine.d.ts +0 -140
  116. package/dist/npm/query/QueryEngine.d.ts.map +0 -1
  117. package/dist/npm/query/QueryEngine.js +0 -453
  118. package/dist/npm/query/QueryEngine.js.map +0 -1
  119. package/dist/npm/storage/GoogleSheetAdapter.d.ts +0 -119
  120. package/dist/npm/storage/GoogleSheetAdapter.d.ts.map +0 -1
  121. package/dist/npm/storage/GoogleSheetAdapter.js +0 -238
  122. package/dist/npm/storage/GoogleSheetAdapter.js.map +0 -1
  123. package/dist/npm/storage/GoogleSpreadsheetAdapter.d.ts +0 -65
  124. package/dist/npm/storage/GoogleSpreadsheetAdapter.d.ts.map +0 -1
  125. package/dist/npm/storage/GoogleSpreadsheetAdapter.js +0 -119
  126. package/dist/npm/storage/GoogleSpreadsheetAdapter.js.map +0 -1
  127. package/dist/npm/testing/ParityCatalog.d.ts +0 -38
  128. package/dist/npm/testing/ParityCatalog.d.ts.map +0 -1
  129. package/dist/npm/testing/ParityCatalog.js +0 -404
  130. package/dist/npm/testing/ParityCatalog.js.map +0 -1
  131. package/dist/npm/testing/RuntimeBenchmark.d.ts +0 -37
  132. package/dist/npm/testing/RuntimeBenchmark.d.ts.map +0 -1
  133. package/dist/npm/testing/RuntimeBenchmark.js +0 -449
  134. package/dist/npm/testing/RuntimeBenchmark.js.map +0 -1
  135. package/dist/npm/testing/RuntimeParity.d.ts +0 -62
  136. package/dist/npm/testing/RuntimeParity.d.ts.map +0 -1
  137. package/dist/npm/testing/RuntimeParity.js +0 -4126
  138. package/dist/npm/testing/RuntimeParity.js.map +0 -1
  139. package/dist/npm/utils/Serialization.d.ts +0 -111
  140. package/dist/npm/utils/Serialization.d.ts.map +0 -1
  141. package/dist/npm/utils/Serialization.js +0 -281
  142. package/dist/npm/utils/Serialization.js.map +0 -1
  143. package/dist/npm/utils/SheetOrmLogger.d.ts +0 -31
  144. package/dist/npm/utils/SheetOrmLogger.d.ts.map +0 -1
  145. package/dist/npm/utils/SheetOrmLogger.js +0 -42
  146. package/dist/npm/utils/SheetOrmLogger.js.map +0 -1
  147. package/dist/npm/utils/Uuid.d.ts +0 -29
  148. package/dist/npm/utils/Uuid.d.ts.map +0 -1
  149. package/dist/npm/utils/Uuid.js +0 -86
  150. package/dist/npm/utils/Uuid.js.map +0 -1
@@ -1,404 +0,0 @@
1
- /**
2
- * @module ParityCatalog
3
- *
4
- * Canonical catalog of every Jest test case that must also have a
5
- * corresponding runtime handler in {@link RuntimeParity}.
6
- *
7
- * The catalog is the single source of truth for parity validation:
8
- * - `SUITES` lists each test file and its test names.
9
- * - `CASE_IDS` is a flat array of composite IDs (`"file::testName"`).
10
- * - `toCaseId()` builds a composite ID from file + test name.
11
- *
12
- * Both Jest tests (via `parity-validator.test.ts`) and GAS runtime
13
- * tests (via `RuntimeParity.validate()`) cross-check against this
14
- * catalog to detect drift.
15
- */
16
- const PARITY_SUITES = [
17
- {
18
- file: "cache.test.ts",
19
- tests: [
20
- "stores and retrieves values",
21
- "returns null for missing keys",
22
- "has() returns true for existing keys",
23
- "delete() removes a key",
24
- "clear() removes all keys",
25
- "expires entries after TTL",
26
- "has() returns false after TTL expiry",
27
- "allows per-key TTL override",
28
- "stores complex objects",
29
- "constructor throws for NaN TTL",
30
- "constructor throws for negative TTL",
31
- "set() throws for NaN per-key TTL",
32
- "TTL of 0 expires immediately",
33
- "set() throws for negative per-key TTL",
34
- "set() throws for Infinity per-key TTL",
35
- "constructor with TTL of 0 expires entries immediately",
36
- ],
37
- },
38
- {
39
- file: "index-store.test.ts",
40
- tests: [
41
- "creates a combined index sheet",
42
- "adds and looks up entries",
43
- "enforces unique index",
44
- "allows same entity to re-index with same value (unique)",
45
- "removes entries when value is cleared in update",
46
- "removes all entries for an entity",
47
- "updates entries when value changes",
48
- "supports independent lookups per indexed field",
49
- "drops a combined index",
50
- "cancelIndexBatch() discards buffered entries",
51
- "removeMultipleFromCombined() bulk-removes entries",
52
- "removeMultipleFromCombined() no-op for empty array",
53
- "existsCombined() checks for index sheet",
54
- "getIndexedFields() returns registered fields",
55
- "searchCombined (n-gram) > finds exact token match",
56
- "searchCombined (n-gram) > finds partial match via trigrams",
57
- "searchCombined (n-gram) > is case insensitive",
58
- "searchCombined (n-gram) > handles multi-token query (intersection)",
59
- "searchCombined (n-gram) > returns empty for no match",
60
- "searchCombined (n-gram) > respects limit parameter",
61
- "searchCombined (n-gram) > finds match through normalized separators",
62
- "searchCombined (n-gram) > invalidates search cache after flushIndexBatch",
63
- "searchCombined (n-gram) > invalidates search index cache on data change",
64
- "searchCombined (n-gram) > returns empty for empty query",
65
- "searchCombined (n-gram) > finds substring within a token via trigrams",
66
- "normalizeForSearch > lowercases and trims",
67
- "normalizeForSearch > normalizes dashes to spaces",
68
- "normalizeForSearch > collapses whitespace",
69
- "normalizeForSearch > returns empty for null-ish input",
70
- "ngrams > generates trigrams",
71
- "ngrams > returns empty for short input",
72
- "ngrams > strips whitespace before generating",
73
- "searchCombined (n-gram) > returns empty array for limit=0",
74
- "searchCombined (n-gram) > finds match for query shorter than trigram size",
75
- "lookupCombined returns empty for non-existent index table",
76
- "updateInCombined throws unique violation when value conflicts with another entity",
77
- "addAllFieldsToCombined detects unique violation in pending batch entries",
78
- "operates correctly without cache provider",
79
- "removeMultipleFromCombined is no-op for non-existent entity IDs",
80
- "updateInCombined creates entry when field goes from empty to populated",
81
- "normalizeForSearch > normalizes em-dashes and underscores to spaces",
82
- "lookupCombined deduplicates entityIds when same entity indexed twice",
83
- "searchCombined deduplicates entityIds from repeated index entries",
84
- "clearAllCaches() allows the search cache to be rebuilt",
85
- ],
86
- },
87
- {
88
- file: "query.test.ts",
89
- tests: [
90
- "filters with where()",
91
- "chains multiple where() as AND",
92
- "sorts results",
93
- "limits results",
94
- "applies offset",
95
- "limit() throws for negative number",
96
- "limit() throws for NaN",
97
- "offset() throws for negative number",
98
- "offset() throws for Infinity",
99
- "first() returns the first match",
100
- "first() returns null when no match",
101
- "first() respects offset",
102
- "count() returns matching count",
103
- "select() returns paginated result",
104
- "select() applies orderBy before pagination",
105
- "groupBy() groups results",
106
- "build() returns query options",
107
- "build() includes offset when set alone",
108
- "returns entities matching either condition",
109
- "applies AND within each OR group",
110
- "chains multiple or() calls",
111
- "works with orderBy",
112
- "works with limit and offset",
113
- "first() returns first OR match",
114
- "count() counts OR matches",
115
- "select() paginates OR results",
116
- "groupBy() groups OR results",
117
- "build() returns whereGroups for OR queries",
118
- "build() returns where (not whereGroups) for AND-only queries",
119
- "or() without preceding where() still filters correctly",
120
- "or().and() without preceding where() chains correctly",
121
- "execute() with limit(0) returns an empty array",
122
- "first() with limit(0) returns null",
123
- "build() with limit(0) includes limit 0",
124
- "build() with no filters returns all undefined options",
125
- "first() returns null when offset exceeds result count",
126
- "groupBy() respects orderBy before grouping",
127
- "execute() with orderBy and offset combined returns correct slice",
128
- "execute() returns items from offset when no limit is set",
129
- "limit() and offset() floor fractional values",
130
- "Query.from() without resolver throws descriptive error",
131
- ],
132
- },
133
- {
134
- file: "query-engine.test.ts",
135
- tests: [
136
- "filters with = operator",
137
- "filters with != operator",
138
- "filters with > operator",
139
- "filters with < operator",
140
- "filters with >= and <= operators",
141
- "filters with contains operator",
142
- "contains is case-insensitive for uppercase query",
143
- "filters with startsWith operator",
144
- "filters with in operator",
145
- "filters with search operator (substring match)",
146
- "applies multiple filters as AND",
147
- "returns all when no filters",
148
- "sorts ascending by number",
149
- "returns original array reference when no sort clauses",
150
- "sorts descending by number",
151
- "sorts by string",
152
- "sorts by multiple fields",
153
- "does not mutate original array",
154
- "returns first page",
155
- "returns last page",
156
- "returns empty if offset exceeds total",
157
- "groups by field",
158
- "groups by boolean",
159
- "combines filter + sort + pagination",
160
- "applies only sort and limit when no filters are provided",
161
- "returns all entities for empty options",
162
- "matches entities passing any group",
163
- "applies AND within each group",
164
- "returns all entities for empty groups",
165
- "empty group within OR groups matches nothing",
166
- "uses OR groups when whereGroups is provided",
167
- "prefers whereGroups over where",
168
- "contains with non-string value matches nothing",
169
- "startsWith with non-string value matches nothing",
170
- "search with non-string value matches nothing",
171
- "negative offset is clamped to 0",
172
- "negative limit defaults to full length",
173
- "NaN offset defaults to 0",
174
- "returns no matches for an unrecognized operator",
175
- "returns false when field type differs from value type (number vs string)",
176
- "compares strings when both field and value are strings",
177
- "filters by nested dot-path field",
178
- "filters by nested slash-path field",
179
- "sorts by nested field",
180
- "returns undefined for missing nested segment",
181
- "uses Set for arrays with more than 8 elements",
182
- "returns empty items when limit is 0",
183
- "places null values before non-null in ascending order",
184
- "places null values last in descending sort",
185
- "groups entities including those with undefined keys",
186
- "sortEntities returns empty array for empty input",
187
- "groupEntities returns empty array for empty input",
188
- "filterEntities with empty entity list returns empty",
189
- "paginateEntities with Infinity limit defaults to full length",
190
- "sortEntities treats both-null values as equal",
191
- "in operator with non-array value returns empty result",
192
- "in operator with >8 elements uses Set-based path",
193
- "contains operator with non-string entity value returns false",
194
- "executeQuery applies offset without limit correctly",
195
- "normalizes non-finite offset and limit in executeQuery",
196
- ],
197
- },
198
- {
199
- file: "serialization.test.ts",
200
- tests: [
201
- "serializes string",
202
- "serializes number",
203
- "serializes boolean",
204
- "serializes json",
205
- "serializes date",
206
- "serializes date type with non-Date string value",
207
- "serializes reference",
208
- "deserializes string",
209
- "applies defaultValue when empty",
210
- "deserializes number",
211
- "deserializes boolean",
212
- "deserializes date from ISO string",
213
- "deserializes reference type as string",
214
- "deserializes json",
215
- "deserializes json type with non-string value returns it as-is",
216
- "prepends system columns",
217
- "round-trips an entity",
218
- "round-trips an entity with explicit fieldMap",
219
- "handles missing optional fields",
220
- "round-trips json string values",
221
- "deserializes native Date objects in date fields to ISO strings",
222
- "deserializes date from numeric cell value as string",
223
- "serializes Infinity as empty for number type",
224
- "serializes Infinity string as empty for number type",
225
- "serializes invalid Date as empty for date type",
226
- "auto-infers number type when fieldDef.type is undefined",
227
- "auto-infers boolean type when fieldDef.type is undefined",
228
- "auto-infers object as JSON when fieldDef.type is undefined",
229
- "auto-infers valid Date to ISO string when fieldDef.type is undefined",
230
- "auto-infers string type as String() when fieldDef.type is undefined",
231
- "deserializes Infinity as null for number type",
232
- "deserializes Infinity string as null for number type",
233
- "deserializes invalid Date object as null for date type",
234
- "returns raw value when fieldDef.type is undefined",
235
- "auto-infers invalid Date as empty string when fieldDef.type is undefined",
236
- "serializes NaN as empty for number type",
237
- "deserializes boolean from number 0 and 1",
238
- "deserializes boolean string false as false",
239
- "deserializes yes as true and numeric-string zero as false for boolean type",
240
- "deserializes boolean string one as true",
241
- "serializes boolean from string yes/no",
242
- "serializes unrecognized field type as string",
243
- "deserializes unrecognized field type as raw value",
244
- "rowToEntity handles row shorter than headers",
245
- "entityToRow uses raw value for column without field definition",
246
- "rowToEntity keeps raw value for column without field definition",
247
- "rowToEntity converts Date objects in system columns to ISO strings",
248
- ],
249
- },
250
- {
251
- file: "uuid.test.ts",
252
- tests: [
253
- "returns a string of UUID v4 format",
254
- "generates unique values",
255
- "falls back to Math.random when crypto is unavailable",
256
- "uses GAS Utilities.getUuid when available",
257
- "uses crypto.getRandomValues when available",
258
- ],
259
- },
260
- {
261
- file: "record.test.ts",
262
- tests: [
263
- "creates a new entity with auto-generated ID",
264
- "auto-creates the table on first save",
265
- "updates an existing entity",
266
- "returns this for chaining",
267
- "persists update via findById round-trip",
268
- "throws on missing required field",
269
- "sets a field value and returns this",
270
- "supports chaining set calls",
271
- "get() retrieves a field value",
272
- "deletes a saved entity",
273
- "returns false for unsaved entity",
274
- "returns a plain object with all fields",
275
- "creates instance with data via static create()",
276
- "finds a saved entity by ID",
277
- "returns null for non-existent ID",
278
- "returns all entities",
279
- "returns entities matching query",
280
- "returns first matching entity",
281
- "returns null when no match",
282
- "returns a Query and chains",
283
- "returns a Query",
284
- "counts all entities",
285
- "counts with filter",
286
- "deletes matching entities",
287
- "returns paginated results",
288
- "groups entities by field",
289
- "creates separate tables for each class",
290
- "works with class reference (typed)",
291
- "works with string name",
292
- "works with table name string",
293
- "supports full fluent chain",
294
- "throws for unknown class name",
295
- "create → query → update → delete cycle",
296
- "works with Query.from() end-to-end",
297
- "count() with whereGroups counts only matching entities",
298
- "deleteAll() with whereGroups deletes only matching entities",
299
- "select() with whereGroups paginates only matching entities",
300
- "groupBy() with whereGroups groups only matching entities",
301
- "invalidates cache when saveAll() fails mid-operation",
302
- "does not persist earlier updates when a later saveAll entry fails",
303
- "invalidates cache and re-throws on mid-batch failure",
304
- "batch is no longer active after commitBatch error",
305
- "clears class maps on re-configure",
306
- "clears entity cache and allows re-read from sheet",
307
- "falls back to sheet scan when cache entry is null",
308
- "skips rows with empty __id",
309
- "persists both new and updated entities in a single batch",
310
- "returns an entity when called with no filter",
311
- "deletes all entities and returns the count",
312
- "does not overwrite an existing entity when a gap row is present",
313
- "findById returns correct entity after gap row",
314
- "assigns correct row indices so delete targets the right entity",
315
- "discards buffered operations without writing",
316
- "beginBatch \u2192 save \u2192 delete \u2192 commitBatch applies all operations",
317
- "count() during batch returns sheet state, not buffered state",
318
- "returns correct entity without re-reading sheet data",
319
- "delete() returns false on unsaved record (no __id)",
320
- "toJSON() returns undefined __id for unsaved entity",
321
- "saveAll() with empty array returns empty array",
322
- "deleteAll() returns zero when no entities match filter",
323
- "save() includes null fields but excludes undefined fields",
324
- "Query.from(Class) auto-registers class without prior save",
325
- "deleteAll uses individual deletes for 2 entities and bulk for 3",
326
- "bulk deleteAll removes gap rows from sheet as expected",
327
- "indexed search with additional where filter narrows results",
328
- "Field defaultValue fills missing property on save",
329
- "Field() without options still registers and persists the field",
330
- "Field type date stores Date as ISO string in sheet round-trip",
331
- "resetDecoratorCaches() keeps @Field metadata effective",
332
- "Field({ required: true }) enforces required validation",
333
- "returns the shared IndexStore instance",
334
- "batch save updates existing entity when committed",
335
- "throws when indexed model has no indexTableName",
336
- "getClassByName resolves class by table name fallback",
337
- "protects sheet on first save when isProtected returns true",
338
- "does not protect sheet when isProtected returns false",
339
- "does not re-protect sheet on subsequent saves",
340
- "protects sheet with empty editors list",
341
- ],
342
- },
343
- {
344
- file: "sheet-repository.test.ts",
345
- tests: [
346
- "onValidate rejects save when validation errors returned",
347
- "beforeSave mutates entity payload",
348
- "afterSave receives saved entity and isNew flag",
349
- "beforeDelete returning false blocks deletion",
350
- "beforeDelete veto on deleteAll returns zero and preserves data",
351
- "beforeDelete veto on deleteAll can preserve selected entities",
352
- "beforeDelete partial veto works for deleteAll small-batch path",
353
- "afterDelete is called with deleted entity ID",
354
- "afterDelete is called for each entity removed by deleteAll",
355
- "afterDelete is called for each entity removed by deleteAll small-batch path",
356
- "getSheet throws when sheet does not exist",
357
- "loadAllEntities throws during active saveAll entity batch",
358
- "findById returns a detached copy from cache",
359
- "query() returns detached copies from cache-backed reads",
360
- "save() in batch mode with explicit __id sets __createdAt for new entity",
361
- "commitBatch persists queued save with explicit __id for new entity",
362
- "two queued saves with same explicit __id produce one updated entity after commit",
363
- "two queued saves with same explicit __id trigger afterSave as create then update",
364
- "commitBatch() is a no-op when no batch is active",
365
- "rollbackBatch() is a no-op when no batch is active",
366
- "rollbackBatch discards queued operations and does not trigger save/delete hooks",
367
- "beginBatch() resets the buffer when batch is already active",
368
- "queued save applies beforeSave and triggers afterSave on commit",
369
- "queued update applies beforeSave and triggers afterSave with isNew=false",
370
- "queued update by __id without __createdAt updates existing entity and preserves createdAt",
371
- "deleteAll() in batch mode queues deletes for deferred execution",
372
- "deleteAll(options) in batch mode queues only matching deletes",
373
- "delete() in batch mode with non-existent ID is a deferred no-op after commit",
374
- "afterDelete is called for queued delete when batch is committed",
375
- "afterDelete is not called for missing queued delete on commit",
376
- "missing delete in batch does not block valid queued operations",
377
- "delete() outside batch returns false for non-existent ID",
378
- "delete() falls back to full scan when cached row index is stale",
379
- "deleteAll(options) in batch mode returns zero when nothing matches",
380
- "beforeDelete veto is respected when queued deleteAll is committed",
381
- ],
382
- },
383
- ];
384
- /** Build a composite parity case ID from a test file name and test name. */
385
- function toParityCaseId(file, testName) {
386
- return `${file}::${testName}`;
387
- }
388
- /** Pre-computed flat array of all case IDs across all suites. */
389
- const PARITY_CASE_IDS = PARITY_SUITES.flatMap((suite) => suite.tests.map((testName) => toParityCaseId(suite.file, testName)));
390
- /**
391
- * Public API for accessing the parity test catalog.
392
- *
393
- * Used by `parity-validator.test.ts` (Jest) and `RuntimeParity.validate()` (GAS)
394
- * to ensure that both environments define the same set of test cases.
395
- */
396
- export class ParityCatalog {
397
- }
398
- /** All suite definitions with test names. */
399
- ParityCatalog.SUITES = PARITY_SUITES;
400
- /** Flat array of composite case IDs. */
401
- ParityCatalog.CASE_IDS = PARITY_CASE_IDS;
402
- /** Utility to build a composite case ID. */
403
- ParityCatalog.toCaseId = toParityCaseId;
404
- //# sourceMappingURL=ParityCatalog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ParityCatalog.js","sourceRoot":"","sources":["../../../src/testing/ParityCatalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,MAAM,aAAa,GAAkB;IACnC;QACE,IAAI,EAAE,eAAe;QACrB,KAAK,EAAE;YACL,6BAA6B;YAC7B,+BAA+B;YAC/B,sCAAsC;YACtC,wBAAwB;YACxB,0BAA0B;YAC1B,2BAA2B;YAC3B,sCAAs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F;YACjF,6DAA6D;YAC7D,iEAAiE;YACjE,0EAA0E;YAC1E,2FAA2F;YAC3F,iEAAiE;YACjE,+DAA+D;YAC/D,8EAA8E;YAC9E,iEAAiE;YACjE,+DAA+D;YAC/D,gEAAgE;YAChE,0DAA0D;YAC1D,iEAAiE;YACjE,oEAAoE;YACpE,mEAAmE;SACpE;KACF;CACF,CAAC;AAEF,4EAA4E;AAC5E,SAAS,cAAc,CAAC,IAAY,EAAE,QAAgB;IACpD,OAAO,GAAG,IAAI,KAAK,QAAQ,EAAE,CAAC;AAChC,CAAC;AAED,iEAAiE;AACjE,MAAM,eAAe,GAAa,aAAa,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAChE,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CACpE,CAAC;AAEF;;;;;GAKG;AACH,MAAM,OAAO,aAAa;;AACxB,6CAA6C;AAC7B,oBAAM,GAAG,aAAa,CAAC;AACvC,wCAAwC;AACxB,sBAAQ,GAAG,eAAe,CAAC;AAC3C,4CAA4C;AACrC,sBAAQ,GAAG,cAAc,CAAC"}
@@ -1,37 +0,0 @@
1
- /**
2
- * @module RuntimeBenchmark
3
- *
4
- * Runtime performance benchmark for SheetORM in Google Apps Script.
5
- *
6
- * Mirrors `tests/benchmark.test.ts` but runs against real Google Sheets API.
7
- * Measures CRUD operations, query performance, and compares @Indexed
8
- * n-gram search with full-scan "contains" queries.
9
- *
10
- * **GAS entry point**: `runBenchmark()` — full benchmark for Cars + Workers
11
- * (default 1000 records each).
12
- *
13
- * **Comparison phases**:
14
- * 1. CRUD + query benchmark for `Car` class (all fields @Indexed).
15
- * 2. CRUD + query benchmark for `Worker` class (no @Indexed fields).
16
- * 3. Search comparison: @Indexed "search" (n-gram) vs full-scan "contains".
17
- *
18
- * Results are logged to the GAS execution log and returned as a JSON report.
19
- */
20
- /**
21
- * Main benchmark entry point — invoked from GAS menu.
22
- *
23
- * Runs two model benchmarks (Cars with @Indexed, Workers without),
24
- * then a search comparison (n-gram vs full-scan), and returns a
25
- * JSON report string with all timing data.
26
- */
27
- declare function runBenchmark(): string;
28
- /**
29
- * Exported wrapper class for the benchmark runner.
30
- * `RuntimeBenchmark.run()` delegates to the module-level `runBenchmark()`.
31
- */
32
- export declare class RuntimeBenchmark {
33
- /** Execute the full benchmark suite. */
34
- static run: typeof runBenchmark;
35
- }
36
- export {};
37
- //# sourceMappingURL=RuntimeBenchmark.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RuntimeBenchmark.d.ts","sourceRoot":"","sources":["../../../src/testing/RuntimeBenchmark.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA4TH;;;;;;GAMG;AACH,iBAAS,YAAY,IAAI,MAAM,CAiM9B;AAED;;;GAGG;AACH,qBAAa,gBAAgB;IAC3B,wCAAwC;IACxC,MAAM,CAAC,GAAG,sBAAgB;CAC3B"}