@oino-ts/nosql 1.0.6 → 1.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oino-ts/nosql",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "OINO TS library package for publishing NoSQL storage as a REST API.",
5
5
  "author": "Matias Kiviniemi (pragmatta)",
6
6
  "license": "MPL-2.0",
@@ -19,13 +19,13 @@
19
19
  "module": "./dist/esm/index.js",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "dependencies": {
22
- "@oino-ts/common": "1.0.6",
22
+ "@oino-ts/common": "1.0.7",
23
23
  "oino-ts": "file:.."
24
24
  },
25
25
  "devDependencies": {
26
- "@oino-ts/types": "1.0.6",
26
+ "@oino-ts/types": "1.0.7",
27
27
  "@types/bun": "^1.1.14",
28
- "@types/node": "^21.0.60",
28
+ "@types/node": "^21.0.70",
29
29
  "typescript": "~5.9.0"
30
30
  },
31
31
  "files": [
@@ -298,6 +298,41 @@ export async function OINOTestNoSql(storageParams: OINONoSqlStorageParams, testP
298
298
  expect(json).toContain(testParams.updateVerifyValue)
299
299
  }, 30_000)
300
300
 
301
+ // Large property value: a single string property exceeds the per-property limit
302
+ // of NoSQL backends (e.g. Azure Table Storage caps a string property at 32K chars),
303
+ // so the backend must transparently split/store and reassemble it on read.
304
+ await test(target_name + target_storage + target_group + " update with large property", async () => {
305
+ // Build a >32000 char value with a non-repeating-per-chunk pattern so that any
306
+ // truncation, reordering or chunk-boundary corruption is detectable.
307
+ let large_value = ""
308
+ let chunk = 0
309
+ while (large_value.length <= 32_000) {
310
+ large_value += "[chunk" + chunk + ":" + "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".repeat(8) + "]"
311
+ chunk++
312
+ }
313
+ expect(large_value.length).toBeGreaterThan(32_000)
314
+
315
+ const large_props = { ...testParams.updateProperties, LargeNote: large_value }
316
+ const large_put_request = new OINOApiRequest({
317
+ url: base_url,
318
+ method: "PUT",
319
+ rowId: testParams.testRowId,
320
+ body: JSON.stringify({ properties: large_props }),
321
+ headers: { "content-type": "application/json" }
322
+ })
323
+ const result: OINOApiResult = await api.doApiRequest(large_put_request)
324
+ expect(result.success).toBe(true)
325
+
326
+ // Read back and verify the large value round-trips exactly.
327
+ const verify_request = new OINOApiRequest({ url: base_url, method: "GET", rowId: testParams.testRowId })
328
+ const verify_result: OINOApiResult = await api.doApiRequest(verify_request)
329
+ expect(verify_result.success).toBe(true)
330
+ const json = await verify_result.data!.writeString(OINOContentType.json)
331
+ const parsed = JSON.parse(json) as Array<{ properties: string }>
332
+ const props = JSON.parse(parsed[0].properties) as Record<string, unknown>
333
+ expect(props.LargeNote).toBe(large_value)
334
+ }, 30_000)
335
+
301
336
  // ── BATCH UPDATE ──────────────────────────────────────────────────────
302
337
  // NoSQL backends reject duplicate keys within a single batch, so use
303
338
  // 3 *distinct* row IDs (derived from testRowId with -b1/-b2/-b3 suffixes)