harperdb 4.6.5 → 4.7.0-alpha.1

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 (45) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +1 -1
  3. package/bin/harperdb.js +89 -78
  4. package/bin/lite.js +85 -74
  5. package/components/requestRestart.d.ts +3 -0
  6. package/components/status/ComponentStatus.d.ts +61 -0
  7. package/components/status/ComponentStatusRegistry.d.ts +80 -0
  8. package/components/status/api.d.ts +104 -0
  9. package/components/status/crossThread.d.ts +62 -0
  10. package/components/status/errors.d.ts +68 -0
  11. package/components/status/index.d.ts +35 -0
  12. package/components/status/internal.d.ts +40 -0
  13. package/components/status/registry.d.ts +10 -0
  14. package/components/status/types.d.ts +75 -0
  15. package/json/systemSchema.json +66 -7
  16. package/launchServiceScripts/launchNatsIngestService.js +85 -74
  17. package/launchServiceScripts/launchNatsReplyService.js +85 -74
  18. package/launchServiceScripts/launchUpdateNodes4-0-0.js +85 -74
  19. package/npm-shrinkwrap.json +118 -75
  20. package/package.json +5 -5
  21. package/resources/RequestTarget.d.ts +1 -1
  22. package/resources/Resource.d.ts +3 -3
  23. package/resources/ResourceInterface.d.ts +33 -10
  24. package/resources/Resources.d.ts +1 -0
  25. package/resources/Table.d.ts +3 -3
  26. package/resources/analytics/hostnames.d.ts +3 -3
  27. package/resources/analytics/write.d.ts +2 -0
  28. package/resources/auditStore.d.ts +2 -0
  29. package/resources/databases.d.ts +3 -3
  30. package/resources/usageLicensing.d.ts +29 -0
  31. package/security/certificateVerification.d.ts +80 -0
  32. package/security/pkijs-ed25519-patch.d.ts +14 -0
  33. package/server/jobs/jobProcess.js +85 -74
  34. package/server/replication/knownNodes.d.ts +13 -1
  35. package/server/replication/replicationConnection.d.ts +11 -2
  36. package/server/status/index.d.ts +14 -5
  37. package/server/threads/threadServer.js +85 -74
  38. package/studio/build-local/asset-manifest.json +2 -2
  39. package/studio/build-local/index.html +1 -1
  40. package/studio/build-local/static/js/main.ee040ffb.js +2 -0
  41. package/utility/hdbTerms.d.ts +8 -0
  42. package/utility/scripts/restartHdb.js +85 -74
  43. package/validation/usageLicensing.d.ts +36 -0
  44. package/studio/build-local/static/js/main.14ef684d.js +0 -2
  45. /package/studio/build-local/static/js/{main.14ef684d.js.LICENSE.txt → main.ee040ffb.js.LICENSE.txt} +0 -0
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "harperdb",
3
- "version": "4.6.5",
3
+ "version": "4.7.0-alpha.1",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "harperdb",
9
- "version": "4.6.5",
9
+ "version": "4.7.0-alpha.1",
10
10
  "hasInstallScript": true,
11
11
  "license": "SEE LICENSE IN LICENSE",
12
12
  "dependencies": {
@@ -34,6 +34,7 @@
34
34
  "cli-progress": "3.12.0",
35
35
  "clone": "2.1.2",
36
36
  "dotenv": "^16.4.7",
37
+ "easy-ocsp": "1.2.2",
37
38
  "fast-glob": "3.3.3",
38
39
  "fastify": "~4.29.0",
39
40
  "fastify-plugin": "~4.5.1",
@@ -74,8 +75,7 @@
74
75
  "properties-reader": "2.3.0",
75
76
  "recursive-iterator": "3.3.0",
76
77
  "semver": "7.7.2",
77
- "send": "^1.1.0",
78
- "serve-static": "^2.2.0",
78
+ "send": "^1.2.0",
79
79
  "ses": "1.13.0",
80
80
  "stream-chain": "2.2.5",
81
81
  "stream-json": "1.9.1",
@@ -1458,9 +1458,9 @@
1458
1458
  }
1459
1459
  },
1460
1460
  "node_modules/@jridgewell/gen-mapping": {
1461
- "version": "0.3.12",
1462
- "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.12.tgz",
1463
- "integrity": "sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==",
1461
+ "version": "0.3.13",
1462
+ "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz",
1463
+ "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==",
1464
1464
  "license": "MIT",
1465
1465
  "dependencies": {
1466
1466
  "@jridgewell/sourcemap-codec": "^1.5.0",
@@ -1477,15 +1477,15 @@
1477
1477
  }
1478
1478
  },
1479
1479
  "node_modules/@jridgewell/sourcemap-codec": {
1480
- "version": "1.5.4",
1481
- "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.4.tgz",
1482
- "integrity": "sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==",
1480
+ "version": "1.5.5",
1481
+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
1482
+ "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
1483
1483
  "license": "MIT"
1484
1484
  },
1485
1485
  "node_modules/@jridgewell/trace-mapping": {
1486
- "version": "0.3.29",
1487
- "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.29.tgz",
1488
- "integrity": "sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==",
1486
+ "version": "0.3.30",
1487
+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.30.tgz",
1488
+ "integrity": "sha512-GQ7Nw5G2lTu/BtHTKfXhKHok2WGetd4XYcVKGx00SjAk8GMwgJM3zr6zORiPGuOE+/vkc90KtTosSSvaCjKb2Q==",
1489
1489
  "license": "MIT",
1490
1490
  "dependencies": {
1491
1491
  "@jridgewell/resolve-uri": "^3.1.0",
@@ -1670,6 +1670,18 @@
1670
1670
  "win32"
1671
1671
  ]
1672
1672
  },
1673
+ "node_modules/@noble/hashes": {
1674
+ "version": "1.8.0",
1675
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz",
1676
+ "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==",
1677
+ "license": "MIT",
1678
+ "engines": {
1679
+ "node": "^14.21.3 || >=16"
1680
+ },
1681
+ "funding": {
1682
+ "url": "https://paulmillr.com/funding/"
1683
+ }
1684
+ },
1673
1685
  "node_modules/@nodelib/fs.scandir": {
1674
1686
  "version": "2.1.5",
1675
1687
  "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@@ -3034,9 +3046,9 @@
3034
3046
  "license": "MIT"
3035
3047
  },
3036
3048
  "node_modules/@types/node": {
3037
- "version": "24.2.0",
3038
- "resolved": "https://registry.npmjs.org/@types/node/-/node-24.2.0.tgz",
3039
- "integrity": "sha512-3xyG3pMCq3oYCNg7/ZP+E1ooTaGB4cG8JWRsqqOYQdbWNY4zbaV0Ennrd7stjiJEFZCaybcIgpTjJWHRfBSIDw==",
3049
+ "version": "24.2.1",
3050
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-24.2.1.tgz",
3051
+ "integrity": "sha512-DRh5K+ka5eJic8CjH7td8QpYEV6Zo10gfRkjHCO3weqZHWDtAaSTFtl4+VMqOJ4N5jcuhZ9/l+yy8rVgw7BQeQ==",
3040
3052
  "license": "MIT",
3041
3053
  "dependencies": {
3042
3054
  "undici-types": "~7.10.0"
@@ -3266,6 +3278,20 @@
3266
3278
  "node": ">=0.10.0"
3267
3279
  }
3268
3280
  },
3281
+ "node_modules/asn1js": {
3282
+ "version": "3.0.6",
3283
+ "resolved": "https://registry.npmjs.org/asn1js/-/asn1js-3.0.6.tgz",
3284
+ "integrity": "sha512-UOCGPYbl0tv8+006qks/dTgV9ajs97X2p0FAbyS2iyCRrmLSRolDaHdp+v/CLgnzHc3fVB+CwYiUmei7ndFcgA==",
3285
+ "license": "BSD-3-Clause",
3286
+ "dependencies": {
3287
+ "pvtsutils": "^1.3.6",
3288
+ "pvutils": "^1.1.3",
3289
+ "tslib": "^2.8.1"
3290
+ },
3291
+ "engines": {
3292
+ "node": ">=12.0.0"
3293
+ }
3294
+ },
3269
3295
  "node_modules/ast-types": {
3270
3296
  "version": "0.13.4",
3271
3297
  "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz",
@@ -3316,16 +3342,16 @@
3316
3342
  "license": "MIT"
3317
3343
  },
3318
3344
  "node_modules/bare-events": {
3319
- "version": "2.6.0",
3320
- "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.6.0.tgz",
3321
- "integrity": "sha512-EKZ5BTXYExaNqi3I3f9RtEsaI/xBSGjE0XZCZilPzFAV/goswFHuPd9jEZlPIZ/iNZJwDSao9qRiScySz7MbQg==",
3345
+ "version": "2.6.1",
3346
+ "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.6.1.tgz",
3347
+ "integrity": "sha512-AuTJkq9XmE6Vk0FJVNq5QxETrSA/vKHarWVBG5l/JbdCL1prJemiyJqUS0jrlXO0MftuPq4m3YVYhoNc5+aE/g==",
3322
3348
  "license": "Apache-2.0",
3323
3349
  "optional": true
3324
3350
  },
3325
3351
  "node_modules/bare-fs": {
3326
- "version": "4.1.6",
3327
- "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.1.6.tgz",
3328
- "integrity": "sha512-25RsLF33BqooOEFNdMcEhMpJy8EoR88zSMrnOQOaM3USnOK2VmaJ1uaQEwPA6AQjrv1lXChScosN6CzbwbO9OQ==",
3352
+ "version": "4.2.0",
3353
+ "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.2.0.tgz",
3354
+ "integrity": "sha512-oRfrw7gwwBVAWx9S5zPMo2iiOjxyiZE12DmblmMQREgcogbNO0AFaZ+QBxxkEXiPspcpvO/Qtqn8LabUx4uYXg==",
3329
3355
  "license": "Apache-2.0",
3330
3356
  "optional": true,
3331
3357
  "dependencies": {
@@ -3448,9 +3474,9 @@
3448
3474
  }
3449
3475
  },
3450
3476
  "node_modules/bl": {
3451
- "version": "6.1.1",
3452
- "resolved": "https://registry.npmjs.org/bl/-/bl-6.1.1.tgz",
3453
- "integrity": "sha512-yYc8UIHrd1ZTLgNBIE7JjMzUPZH+dec3q7nWkrSHEbtvkQ3h6WKC63W9K5jthcL5EXFyMuWYq+2pq5WMSIgFHw==",
3477
+ "version": "6.1.2",
3478
+ "resolved": "https://registry.npmjs.org/bl/-/bl-6.1.2.tgz",
3479
+ "integrity": "sha512-6J3oG82fpJ71WF4l0W6XslkwAPMr+Zcp+AmdxJ0L8LsXNzFeO8GYesV2J9AzGArBjrsb2xR50Ocbn/CL1B44TA==",
3454
3480
  "license": "MIT",
3455
3481
  "dependencies": {
3456
3482
  "@types/readable-stream": "^4.0.0",
@@ -3527,9 +3553,9 @@
3527
3553
  "license": "MIT"
3528
3554
  },
3529
3555
  "node_modules/bowser": {
3530
- "version": "2.11.0",
3531
- "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.11.0.tgz",
3532
- "integrity": "sha512-AlcaJBi/pqqJBIQ8U9Mcpc9i8Aqxn88Skv5d+xBX006BY5u8N3mGLHa5Lgppa7L/HfwgwLgZ6NYs+Ag6uUmJRA==",
3556
+ "version": "2.12.0",
3557
+ "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.12.0.tgz",
3558
+ "integrity": "sha512-HcOcTudTeEWgbHh0Y1Tyb6fdeR71m4b/QACf0D4KswGTsNeIJQmg38mRENZPAYPZvGFN3fk3604XbQEPdxXdKg==",
3533
3559
  "license": "MIT"
3534
3560
  },
3535
3561
  "node_modules/brace-expansion": {
@@ -3598,6 +3624,15 @@
3598
3624
  "node": ">=6.14.2"
3599
3625
  }
3600
3626
  },
3627
+ "node_modules/bytestreamjs": {
3628
+ "version": "2.0.1",
3629
+ "resolved": "https://registry.npmjs.org/bytestreamjs/-/bytestreamjs-2.0.1.tgz",
3630
+ "integrity": "sha512-U1Z/ob71V/bXfVABvNr/Kumf5VyeQRBEm6Txb0PQ6S7V5GpBM3w4Cbqz/xPDicR5tN0uvDifng8C+5qECeGwyQ==",
3631
+ "license": "BSD-3-Clause",
3632
+ "engines": {
3633
+ "node": ">=6.0.0"
3634
+ }
3635
+ },
3601
3636
  "node_modules/call-bind": {
3602
3637
  "version": "1.0.8",
3603
3638
  "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.8.tgz",
@@ -4147,6 +4182,19 @@
4147
4182
  "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
4148
4183
  "license": "MIT"
4149
4184
  },
4185
+ "node_modules/easy-ocsp": {
4186
+ "version": "1.2.2",
4187
+ "resolved": "https://registry.npmjs.org/easy-ocsp/-/easy-ocsp-1.2.2.tgz",
4188
+ "integrity": "sha512-AUKL5mPJYWSE3ucelHkkgwOMk/WVuJP9PkfDKe0OzQwN1d1NAmHdfNgf3++RjrVpj4EuJGtYEY/oFVcSYZRIgQ==",
4189
+ "license": "MIT",
4190
+ "dependencies": {
4191
+ "asn1js": "^3.0.5",
4192
+ "pkijs": "^3.2.4"
4193
+ },
4194
+ "engines": {
4195
+ "node": ">=18"
4196
+ }
4197
+ },
4150
4198
  "node_modules/ecdsa-sig-formatter": {
4151
4199
  "version": "1.0.11",
4152
4200
  "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
@@ -5217,24 +5265,14 @@
5217
5265
  }
5218
5266
  },
5219
5267
  "node_modules/ip-address": {
5220
- "version": "9.0.5",
5221
- "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz",
5222
- "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==",
5268
+ "version": "10.0.1",
5269
+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.0.1.tgz",
5270
+ "integrity": "sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==",
5223
5271
  "license": "MIT",
5224
- "dependencies": {
5225
- "jsbn": "1.1.0",
5226
- "sprintf-js": "^1.1.3"
5227
- },
5228
5272
  "engines": {
5229
5273
  "node": ">= 12"
5230
5274
  }
5231
5275
  },
5232
- "node_modules/ip-address/node_modules/sprintf-js": {
5233
- "version": "1.1.3",
5234
- "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz",
5235
- "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==",
5236
- "license": "BSD-3-Clause"
5237
- },
5238
5276
  "node_modules/ipaddr.js": {
5239
5277
  "version": "1.9.1",
5240
5278
  "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
@@ -5511,12 +5549,6 @@
5511
5549
  "js-yaml": "bin/js-yaml.js"
5512
5550
  }
5513
5551
  },
5514
- "node_modules/jsbn": {
5515
- "version": "1.1.0",
5516
- "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz",
5517
- "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==",
5518
- "license": "MIT"
5519
- },
5520
5552
  "node_modules/jsesc": {
5521
5553
  "version": "2.5.2",
5522
5554
  "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
@@ -6580,15 +6612,6 @@
6580
6612
  "node": ">=0.10.0"
6581
6613
  }
6582
6614
  },
6583
- "node_modules/parseurl": {
6584
- "version": "1.3.3",
6585
- "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
6586
- "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
6587
- "license": "MIT",
6588
- "engines": {
6589
- "node": ">= 0.8"
6590
- }
6591
- },
6592
6615
  "node_modules/passport": {
6593
6616
  "version": "0.7.0",
6594
6617
  "resolved": "https://registry.npmjs.org/passport/-/passport-0.7.0.tgz",
@@ -6807,6 +6830,23 @@
6807
6830
  "integrity": "sha512-n9wh8tvBe5sFmsqlg+XQhaQLumwpqoAUruLwjCopgTmUBjJ/fjtBsJzKleCaIGBOMXYEhp1YfKl4d7rJ5ZKJGA==",
6808
6831
  "license": "MIT"
6809
6832
  },
6833
+ "node_modules/pkijs": {
6834
+ "version": "3.2.5",
6835
+ "resolved": "https://registry.npmjs.org/pkijs/-/pkijs-3.2.5.tgz",
6836
+ "integrity": "sha512-WX0la7n7CbnguuaIQoT4Fc0IJckPDOUldzOwlZ0nwpOcySS+Six/tXBdc0RX17J5o1To0SAr3xDJjDLsOfDFQA==",
6837
+ "license": "BSD-3-Clause",
6838
+ "dependencies": {
6839
+ "@noble/hashes": "^1.4.0",
6840
+ "asn1js": "^3.0.5",
6841
+ "bytestreamjs": "^2.0.0",
6842
+ "pvtsutils": "^1.3.2",
6843
+ "pvutils": "^1.1.3",
6844
+ "tslib": "^2.6.3"
6845
+ },
6846
+ "engines": {
6847
+ "node": ">=12.0.0"
6848
+ }
6849
+ },
6810
6850
  "node_modules/pm2": {
6811
6851
  "version": "5.4.1",
6812
6852
  "resolved": "https://registry.npmjs.org/pm2/-/pm2-5.4.1.tgz",
@@ -7197,6 +7237,24 @@
7197
7237
  "node": ">= 6"
7198
7238
  }
7199
7239
  },
7240
+ "node_modules/pvtsutils": {
7241
+ "version": "1.3.6",
7242
+ "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.3.6.tgz",
7243
+ "integrity": "sha512-PLgQXQ6H2FWCaeRak8vvk1GW462lMxB5s3Jm673N82zI4vqtVUPuZdffdZbPDFRoU8kAhItWFtPCWiPpp4/EDg==",
7244
+ "license": "MIT",
7245
+ "dependencies": {
7246
+ "tslib": "^2.8.1"
7247
+ }
7248
+ },
7249
+ "node_modules/pvutils": {
7250
+ "version": "1.1.3",
7251
+ "resolved": "https://registry.npmjs.org/pvutils/-/pvutils-1.1.3.tgz",
7252
+ "integrity": "sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==",
7253
+ "license": "MIT",
7254
+ "engines": {
7255
+ "node": ">=6.0.0"
7256
+ }
7257
+ },
7200
7258
  "node_modules/queue-microtask": {
7201
7259
  "version": "1.2.3",
7202
7260
  "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
@@ -7624,21 +7682,6 @@
7624
7682
  "node": ">= 18"
7625
7683
  }
7626
7684
  },
7627
- "node_modules/serve-static": {
7628
- "version": "2.2.0",
7629
- "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz",
7630
- "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==",
7631
- "license": "MIT",
7632
- "dependencies": {
7633
- "encodeurl": "^2.0.0",
7634
- "escape-html": "^1.0.3",
7635
- "parseurl": "^1.3.3",
7636
- "send": "^1.2.0"
7637
- },
7638
- "engines": {
7639
- "node": ">= 18"
7640
- }
7641
- },
7642
7685
  "node_modules/ses": {
7643
7686
  "version": "1.13.0",
7644
7687
  "resolved": "https://registry.npmjs.org/ses/-/ses-1.13.0.tgz",
@@ -7743,12 +7786,12 @@
7743
7786
  }
7744
7787
  },
7745
7788
  "node_modules/socks": {
7746
- "version": "2.8.6",
7747
- "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.6.tgz",
7748
- "integrity": "sha512-pe4Y2yzru68lXCb38aAqRf5gvN8YdjP1lok5o0J7BOHljkyCGKVz7H3vpVIXKD27rj2giOJ7DwVyk/GWrPHDWA==",
7789
+ "version": "2.8.7",
7790
+ "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz",
7791
+ "integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==",
7749
7792
  "license": "MIT",
7750
7793
  "dependencies": {
7751
- "ip-address": "^9.0.5",
7794
+ "ip-address": "^10.0.1",
7752
7795
  "smart-buffer": "^4.2.0"
7753
7796
  },
7754
7797
  "engines": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harperdb",
3
- "version": "4.6.5",
3
+ "version": "4.7.0-alpha.1",
4
4
  "description": "HarperDB is a distributed database, caching service, streaming broker, and application development platform focused on performance and ease of use.",
5
5
  "keywords": [
6
6
  "database",
@@ -25,8 +25,8 @@
25
25
  ],
26
26
  "main": "harperdb.js",
27
27
  "bin": {
28
- "harperdb": "./bin/harperdb.js",
29
- "harper": "./bin/harperdb.js"
28
+ "harperdb": "bin/harperdb.js",
29
+ "harper": "bin/harperdb.js"
30
30
  },
31
31
  "engines": {
32
32
  "minimum-node": "16.0.0",
@@ -68,6 +68,7 @@
68
68
  "cli-progress": "3.12.0",
69
69
  "clone": "2.1.2",
70
70
  "dotenv": "^16.4.7",
71
+ "easy-ocsp": "1.2.2",
71
72
  "fast-glob": "3.3.3",
72
73
  "fastify": "~4.29.0",
73
74
  "fastify-plugin": "~4.5.1",
@@ -108,8 +109,7 @@
108
109
  "properties-reader": "2.3.0",
109
110
  "recursive-iterator": "3.3.0",
110
111
  "semver": "7.7.2",
111
- "send": "^1.1.0",
112
- "serve-static": "^2.2.0",
112
+ "send": "^1.2.0",
113
113
  "ses": "1.13.0",
114
114
  "stream-chain": "2.2.5",
115
115
  "stream-json": "1.9.1",
@@ -1,4 +1,4 @@
1
- import { Conditions, Id, Select, Sort } from './ResourceInterface';
1
+ import { Conditions, Id, Select, Sort } from './ResourceInterface.ts';
2
2
  export declare class RequestTarget extends URLSearchParams {
3
3
  #private;
4
4
  pathname: string;
@@ -1,4 +1,4 @@
1
- import type { ResourceInterface, SubscriptionRequest, Id, Context, Query } from './ResourceInterface.ts';
1
+ import type { ResourceInterface, SubscriptionRequest, Id, Context, Query, SourceContext } from './ResourceInterface.ts';
2
2
  import { Transaction } from './DatabaseTransaction.ts';
3
3
  import { IterableEventQueue } from './IterableEventQueue.ts';
4
4
  import { AsyncLocalStorage } from 'async_hooks';
@@ -113,7 +113,7 @@ export declare class Resource implements ResourceInterface {
113
113
  * @param options
114
114
  * @returns
115
115
  */
116
- static getResource(id: Id, request: Context, options?: any): Resource | Promise<Resource>;
116
+ static getResource(id: Id, request: Context | SourceContext, options?: any): Resource | Promise<Resource>;
117
117
  /**
118
118
  * This is called by protocols that wish to make a subscription for real-time notification/updates.
119
119
  * This default implementation simply provides a streaming iterator that does not deliver any notifications
@@ -140,7 +140,7 @@ export declare class Resource implements ResourceInterface {
140
140
  * Get the context for this resource
141
141
  * @returns context object with information about the current transaction, user, and more
142
142
  */
143
- getContext(): Context;
143
+ getContext(): Context | SourceContext;
144
144
  }
145
145
  export declare function snakeCase(camelCase: string): string;
146
146
  /**
@@ -1,8 +1,9 @@
1
1
  import { DatabaseTransaction } from './DatabaseTransaction.ts';
2
2
  import { OperationFunctionName } from '../server/serverHelpers/serverUtilities.ts';
3
- import { RequestTarget } from './RequestTarget';
3
+ import { RequestTarget } from './RequestTarget.ts';
4
+ import { Entry } from './RecordEncoder.ts';
4
5
  export interface ResourceInterface<Key = any, Record = any> {
5
- get?(id: Id): Promise<UpdatableRecord<Record>>;
6
+ get?(id: Id): Promise<Record>;
6
7
  get?(query: RequestTargetOrId): Promise<AsyncIterable<Record>>;
7
8
  put?(target: RequestTargetOrId, record: any): void;
8
9
  post?(target: RequestTargetOrId, record: any): void;
@@ -21,25 +22,25 @@ export interface User {
21
22
  username: string;
22
23
  }
23
24
  export interface Context {
24
- /** The user making the request */
25
+ /** The user making the request */
25
26
  user?: User;
26
- /** The database transaction object */
27
+ /** The database transaction object */
27
28
  transaction?: DatabaseTransaction;
28
- /** If the operation that will be performed with this context should check user authorization */
29
+ /** If the operation that will be performed with this context should check user authorization */
29
30
  authorize?: number;
30
- /** The last modification time of any data that has been accessed with this context */
31
+ /** The last modification time of any data that has been accessed with this context */
31
32
  lastModified?: number;
32
33
  /** The time at which a saved record should expire */
33
34
  expiresAt?: number;
34
- /** Indicates that caching should not be applied */
35
+ /** Indicates that caching should not be applied */
35
36
  noCache?: boolean;
36
- /** Indicates that values from the source data should be stored as a cached value */
37
+ /** Indicates that values from the source data should be stored as a cached value */
37
38
  noCacheStore?: boolean;
38
39
  /** Only return values from the table, and don't use data from the source */
39
40
  onlyIfCached?: boolean;
40
41
  /** Allows data from a caching table to be used if there is an error retrieving data from the source */
41
42
  staleIfError?: boolean;
42
- /** Indicates any cached data must be revalidated */
43
+ /** Indicates any cached data must be revalidated */
43
44
  mustRevalidate?: boolean;
44
45
  /** An array of nodes to replicate to */
45
46
  replicateTo?: string[];
@@ -52,6 +53,28 @@ export interface Context {
52
53
  resourceCache?: Map<Id, any>;
53
54
  _freezeRecords?: boolean;
54
55
  }
56
+ export interface SourceContext<TRequestContext = Context> {
57
+ /** The original request context passed from the caching layer */
58
+ requestContext: TRequestContext;
59
+ /** The existing record, from the existing entry (if any) */
60
+ replacingRecord?: any;
61
+ /** The existing database entry (if any) */
62
+ replacingEntry?: Entry;
63
+ /** The version/timestamp of the existing record */
64
+ replacingVersion?: number;
65
+ /** Indicates that values from the source data should NOT be stored as a cached value */
66
+ noCacheStore?: boolean;
67
+ /** Reference to the source Resource instance */
68
+ source?: ResourceInterface;
69
+ /** Shared resource cache from parent context for visibility of modifications */
70
+ resourceCache?: Map<Id, any>;
71
+ /** Database transaction for the context */
72
+ transaction?: DatabaseTransaction;
73
+ /** The time at which the cached entry should expire (ms since epoch) */
74
+ expiresAt?: number;
75
+ /** The last modification time of any data accessed with this context */
76
+ lastModified?: number;
77
+ }
55
78
  export type Operator = 'and' | 'or';
56
79
  type SearchType = 'equals' | 'contains' | 'starts_with' | 'ends_with' | 'greater_than' | 'greater_than_equal' | 'less_than' | 'less_than_equal' | 'between';
57
80
  export interface DirectCondition {
@@ -94,7 +117,7 @@ export interface SubscriptionRequest {
94
117
  export type Query = RequestTarget;
95
118
  export type RequestTargetOrId = RequestTarget | Id;
96
119
  export type Id = number | string | (number | string | null)[] | null;
97
- type UpdatableRecord<T> = T;
120
+ export type UpdatableRecord<T> = T;
98
121
  interface Subscription {
99
122
  }
100
123
  export {};
@@ -12,6 +12,7 @@ interface ResourceEntry {
12
12
  export declare class Resources extends Map<string, ResourceEntry> {
13
13
  isWorker: boolean;
14
14
  loginPath?: (request: any) => string;
15
+ allTypes: Map<any, any>;
15
16
  set(path: any, resource: any, exportTypes?: {
16
17
  [key: string]: boolean;
17
18
  }, force?: boolean): void;
@@ -203,7 +203,7 @@ export declare function makeTable(options: any): {
203
203
  get isCollection(): boolean;
204
204
  connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
205
205
  getId(): Id;
206
- getContext(): Context;
206
+ getContext(): Context | import("./ResourceInterface.ts").SourceContext;
207
207
  };
208
208
  name: any;
209
209
  primaryStore: any;
@@ -412,7 +412,7 @@ export declare function makeTable(options: any): {
412
412
  get isCollection(): boolean;
413
413
  connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
414
414
  getId(): Id;
415
- getContext(): Context;
415
+ getContext(): Context | import("./ResourceInterface.ts").SourceContext;
416
416
  }> | {
417
417
  #record: any;
418
418
  #changes: any;
@@ -574,7 +574,7 @@ export declare function makeTable(options: any): {
574
574
  get isCollection(): boolean;
575
575
  connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
576
576
  getId(): Id;
577
- getContext(): Context;
577
+ getContext(): Context | import("./ResourceInterface.ts").SourceContext;
578
578
  };
579
579
  _updateResource(resource: any, entry: any): void;
580
580
  getNewId(): any;
@@ -110,7 +110,7 @@ export declare function getAnalyticsHostnameTable(): {
110
110
  get isCollection(): boolean;
111
111
  connect(incomingMessages: import("../IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
112
112
  getId(): import("../ResourceInterface.js").Id;
113
- getContext(): import("../ResourceInterface.js").Context;
113
+ getContext(): import("../ResourceInterface.js").Context | import("../ResourceInterface.js").SourceContext;
114
114
  };
115
115
  name: any;
116
116
  primaryStore: any;
@@ -250,7 +250,7 @@ export declare function getAnalyticsHostnameTable(): {
250
250
  get isCollection(): boolean;
251
251
  connect(incomingMessages: import("../IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
252
252
  getId(): import("../ResourceInterface.js").Id;
253
- getContext(): import("../ResourceInterface.js").Context;
253
+ getContext(): import("../ResourceInterface.js").Context | import("../ResourceInterface.js").SourceContext;
254
254
  }> | {
255
255
  #record: any;
256
256
  #changes: any;
@@ -361,7 +361,7 @@ export declare function getAnalyticsHostnameTable(): {
361
361
  get isCollection(): boolean;
362
362
  connect(incomingMessages: import("../IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
363
363
  getId(): import("../ResourceInterface.js").Id;
364
- getContext(): import("../ResourceInterface.js").Context;
364
+ getContext(): import("../ResourceInterface.js").Context | import("../ResourceInterface.js").SourceContext;
365
365
  };
366
366
  _updateResource(resource: any, entry: any): void;
367
367
  getNewId(): any;
@@ -23,6 +23,7 @@ export declare function setAnalyticsEnabled(enabled: boolean): void;
23
23
  */
24
24
  export declare function recordAction(value: Value, metric: string, path?: string, method?: string, type?: string): void;
25
25
  export declare function recordActionBinary(value: any, metric: any, path?: any, method?: any, type?: any): void;
26
+ export declare const analyticsDelay = 1000;
26
27
  export declare function addAnalyticsListener(callback: any): void;
27
28
  export declare function recordHostname(): Promise<void>;
28
29
  export interface Metric {
@@ -47,6 +48,7 @@ export declare function calculateCPUUtilization(resourceUsage: ResourceUsage, pe
47
48
  * new values for this time period.
48
49
  */
49
50
  export declare function diffResourceUsage(lastResourceUsage: ResourceUsage, resourceUsage: ResourceUsage): ResourceUsage;
51
+ export declare function onAnalyticsAggregate(callback: any): void;
50
52
  export {};
51
53
  /**
52
54
  * This section contains a possible/experimental approach to bucketing values as they come instead of pushing all into an array and sorting.
@@ -53,6 +53,7 @@ export declare function readAuditEntry(buffer: Uint8Array, start?: number, end?:
53
53
  previousLocalTime: any;
54
54
  readonly user: import("ordered-binary").Key;
55
55
  readonly encoded: Uint8Array<ArrayBufferLike>;
56
+ readonly size: number;
56
57
  getValue(store: any, fullRecord?: any, auditTime?: any): any;
57
58
  getBinaryValue(): Uint8Array<ArrayBufferLike>;
58
59
  extendedType: any;
@@ -70,6 +71,7 @@ export declare function readAuditEntry(buffer: Uint8Array, start?: number, end?:
70
71
  previousLocalTime?: undefined;
71
72
  readonly user?: undefined;
72
73
  readonly encoded?: undefined;
74
+ readonly size?: undefined;
73
75
  getValue?: undefined;
74
76
  getBinaryValue?: undefined;
75
77
  extendedType?: undefined;
@@ -187,7 +187,7 @@ export declare function table(tableDefinition: TableDefinition): {
187
187
  get isCollection(): boolean;
188
188
  connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
189
189
  getId(): import("./ResourceInterface.js").Id;
190
- getContext(): import("./ResourceInterface.js").Context;
190
+ getContext(): import("./ResourceInterface.js").Context | import("./ResourceInterface.js").SourceContext;
191
191
  };
192
192
  name: any;
193
193
  primaryStore: any;
@@ -327,7 +327,7 @@ export declare function table(tableDefinition: TableDefinition): {
327
327
  get isCollection(): boolean;
328
328
  connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
329
329
  getId(): import("./ResourceInterface.js").Id;
330
- getContext(): import("./ResourceInterface.js").Context;
330
+ getContext(): import("./ResourceInterface.js").Context | import("./ResourceInterface.js").SourceContext;
331
331
  }> | {
332
332
  #record: any;
333
333
  #changes: any;
@@ -438,7 +438,7 @@ export declare function table(tableDefinition: TableDefinition): {
438
438
  get isCollection(): boolean;
439
439
  connect(incomingMessages: import("./IterableEventQueue.js").IterableEventQueue, query?: {}): AsyncIterable<any>;
440
440
  getId(): import("./ResourceInterface.js").Id;
441
- getContext(): import("./ResourceInterface.js").Context;
441
+ getContext(): import("./ResourceInterface.js").Context | import("./ResourceInterface.js").SourceContext;
442
442
  };
443
443
  _updateResource(resource: any, entry: any): void;
444
444
  getNewId(): any;
@@ -0,0 +1,29 @@
1
+ interface InstallLicenseRequest {
2
+ operation: 'install_usage_license';
3
+ license: string;
4
+ }
5
+ export declare function installUsageLicenseOp(req: InstallLicenseRequest): Promise<string>;
6
+ interface UsageLicenseRecord {
7
+ id: string;
8
+ expiration: number;
9
+ reads: number;
10
+ readBytes: number;
11
+ writes: number;
12
+ writeBytes: number;
13
+ realTimeMessages: number;
14
+ realTimeBytes: number;
15
+ cpuTime: number;
16
+ usedReads: number;
17
+ usedReadBytes: number;
18
+ usedWrites: number;
19
+ usedWriteBytes: number;
20
+ usedRealTimeMessages: number;
21
+ usedRealTimeBytes: number;
22
+ usedCpuTime: number;
23
+ addTo: (field: string, value: number) => void;
24
+ }
25
+ interface GetUsageLicensesReq {
26
+ operation: 'get_usage_licenses';
27
+ }
28
+ export declare function getUsageLicensesOp(req: GetUsageLicensesReq): Promise<UsageLicenseRecord[]>;
29
+ export {};