harperdb 4.5.0-alpha.2 → 4.5.0-alpha.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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "harperdb",
3
- "version": "4.5.0-alpha.2",
3
+ "version": "4.5.0-alpha.3",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "harperdb",
9
- "version": "4.5.0-alpha.2",
9
+ "version": "4.5.0-alpha.3",
10
10
  "hasInstallScript": true,
11
11
  "license": "SEE LICENSE IN LICENSE",
12
12
  "dependencies": {
@@ -46,7 +46,7 @@
46
46
  "json2csv": "5.0.7",
47
47
  "jsonata": "1.8.7",
48
48
  "jsonwebtoken": "9.0.2",
49
- "lmdb": "3.2.5",
49
+ "lmdb": "3.2.6",
50
50
  "lodash": "4.17.21",
51
51
  "mathjs": "11.12.0",
52
52
  "minimist": "1.2.8",
@@ -1061,13 +1061,13 @@
1061
1061
  }
1062
1062
  },
1063
1063
  "node_modules/@babel/generator": {
1064
- "version": "7.26.5",
1065
- "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.5.tgz",
1066
- "integrity": "sha512-2caSP6fN9I7HOe6nqhtft7V4g7/V/gfDsC3Ag4W7kEzzvRGKqiv0pu0HogPiZ3KaVSoNDhUws6IJjDjpfmYIXw==",
1064
+ "version": "7.26.8",
1065
+ "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.26.8.tgz",
1066
+ "integrity": "sha512-ef383X5++iZHWAXX0SXQR6ZyQhw/0KtTkrTz61WXRhFM6dhpHulO/RJz79L8S6ugZHJkOOkUrUdxgdF2YiPFnA==",
1067
1067
  "license": "MIT",
1068
1068
  "dependencies": {
1069
- "@babel/parser": "^7.26.5",
1070
- "@babel/types": "^7.26.5",
1069
+ "@babel/parser": "^7.26.8",
1070
+ "@babel/types": "^7.26.8",
1071
1071
  "@jridgewell/gen-mapping": "^0.3.5",
1072
1072
  "@jridgewell/trace-mapping": "^0.3.25",
1073
1073
  "jsesc": "^3.0.2"
@@ -1107,12 +1107,12 @@
1107
1107
  }
1108
1108
  },
1109
1109
  "node_modules/@babel/parser": {
1110
- "version": "7.26.7",
1111
- "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.7.tgz",
1112
- "integrity": "sha512-kEvgGGgEjRUutvdVvZhbn/BxVt+5VSpwXz1j3WYXQbXDo8KzFOPNG2GQbdAiNq8g6wn1yKk7C/qrke03a84V+w==",
1110
+ "version": "7.26.8",
1111
+ "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.8.tgz",
1112
+ "integrity": "sha512-TZIQ25pkSoaKEYYaHbbxkfL36GNsQ6iFiBbeuzAkLnXayKR1yP1zFe+NxuZWWsUyvt8icPU9CCq0sgWGXR1GEw==",
1113
1113
  "license": "MIT",
1114
1114
  "dependencies": {
1115
- "@babel/types": "^7.26.7"
1115
+ "@babel/types": "^7.26.8"
1116
1116
  },
1117
1117
  "bin": {
1118
1118
  "parser": "bin/babel-parser.js"
@@ -1134,30 +1134,30 @@
1134
1134
  }
1135
1135
  },
1136
1136
  "node_modules/@babel/template": {
1137
- "version": "7.25.9",
1138
- "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.25.9.tgz",
1139
- "integrity": "sha512-9DGttpmPvIxBb/2uwpVo3dqJ+O6RooAFOS+lB+xDqoE2PVCE8nfoHMdZLpfCQRLwvohzXISPZcgxt80xLfsuwg==",
1137
+ "version": "7.26.8",
1138
+ "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.8.tgz",
1139
+ "integrity": "sha512-iNKaX3ZebKIsCvJ+0jd6embf+Aulaa3vNBqZ41kM7iTWjx5qzWKXGHiJUW3+nTpQ18SG11hdF8OAzKrpXkb96Q==",
1140
1140
  "license": "MIT",
1141
1141
  "dependencies": {
1142
- "@babel/code-frame": "^7.25.9",
1143
- "@babel/parser": "^7.25.9",
1144
- "@babel/types": "^7.25.9"
1142
+ "@babel/code-frame": "^7.26.2",
1143
+ "@babel/parser": "^7.26.8",
1144
+ "@babel/types": "^7.26.8"
1145
1145
  },
1146
1146
  "engines": {
1147
1147
  "node": ">=6.9.0"
1148
1148
  }
1149
1149
  },
1150
1150
  "node_modules/@babel/traverse": {
1151
- "version": "7.26.7",
1152
- "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.7.tgz",
1153
- "integrity": "sha512-1x1sgeyRLC3r5fQOM0/xtQKsYjyxmFjaOrLJNtZ81inNjyJHGIolTULPiSc/2qe1/qfpFLisLQYFnnZl7QoedA==",
1151
+ "version": "7.26.8",
1152
+ "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.26.8.tgz",
1153
+ "integrity": "sha512-nic9tRkjYH0oB2dzr/JoGIm+4Q6SuYeLEiIiZDwBscRMYFJ+tMAz98fuel9ZnbXViA2I0HVSSRRK8DW5fjXStA==",
1154
1154
  "license": "MIT",
1155
1155
  "dependencies": {
1156
1156
  "@babel/code-frame": "^7.26.2",
1157
- "@babel/generator": "^7.26.5",
1158
- "@babel/parser": "^7.26.7",
1159
- "@babel/template": "^7.25.9",
1160
- "@babel/types": "^7.26.7",
1157
+ "@babel/generator": "^7.26.8",
1158
+ "@babel/parser": "^7.26.8",
1159
+ "@babel/template": "^7.26.8",
1160
+ "@babel/types": "^7.26.8",
1161
1161
  "debug": "^4.3.1",
1162
1162
  "globals": "^11.1.0"
1163
1163
  },
@@ -1166,9 +1166,9 @@
1166
1166
  }
1167
1167
  },
1168
1168
  "node_modules/@babel/types": {
1169
- "version": "7.26.7",
1170
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.7.tgz",
1171
- "integrity": "sha512-t8kDRGrKXyp6+tjUh7hw2RLyclsW4TRoRvRHtSyAX9Bb5ldlFh+90YAYY6awRXrlB4G5G2izNeGySpATlFzmOg==",
1169
+ "version": "7.26.8",
1170
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.8.tgz",
1171
+ "integrity": "sha512-eUuWapzEGWFEpHFxgEaBG8e3n6S8L3MSu0oda755rOfabWPnh0Our1AozNFVUxGFIhbKgd1ksprsoDGMinTOTA==",
1172
1172
  "license": "MIT",
1173
1173
  "dependencies": {
1174
1174
  "@babel/helper-string-parser": "^7.25.9",
@@ -1556,9 +1556,9 @@
1556
1556
  }
1557
1557
  },
1558
1558
  "node_modules/@lmdb/lmdb-darwin-arm64": {
1559
- "version": "3.2.5",
1560
- "resolved": "https://registry.npmjs.org/@lmdb/lmdb-darwin-arm64/-/lmdb-darwin-arm64-3.2.5.tgz",
1561
- "integrity": "sha512-LR1bXR8Ligyk6+4wmpOS1siViDOfuxKMwl9KYwv7ROHyCpuHY+etVZ+F+0erk3Ucr8T6q+ccm+c/iZf3cCbbTQ==",
1559
+ "version": "3.2.6",
1560
+ "resolved": "https://registry.npmjs.org/@lmdb/lmdb-darwin-arm64/-/lmdb-darwin-arm64-3.2.6.tgz",
1561
+ "integrity": "sha512-yF/ih9EJJZc72psFQbwnn8mExIWfTnzWJg+N02hnpXtDPETYLmQswIMBn7+V88lfCaFrMozJsUvcEQIkEPU0Gg==",
1562
1562
  "cpu": [
1563
1563
  "arm64"
1564
1564
  ],
@@ -1569,9 +1569,9 @@
1569
1569
  ]
1570
1570
  },
1571
1571
  "node_modules/@lmdb/lmdb-darwin-x64": {
1572
- "version": "3.2.5",
1573
- "resolved": "https://registry.npmjs.org/@lmdb/lmdb-darwin-x64/-/lmdb-darwin-x64-3.2.5.tgz",
1574
- "integrity": "sha512-BGS9r0ttPwElq1aXJ+Y18DQT25WosZQQWZ4/vKE7bMfh4DrR0rMGLBOp8y9L/Ym8Y7rqmL8mvINkKg0+i+1N5w==",
1572
+ "version": "3.2.6",
1573
+ "resolved": "https://registry.npmjs.org/@lmdb/lmdb-darwin-x64/-/lmdb-darwin-x64-3.2.6.tgz",
1574
+ "integrity": "sha512-5BbCumsFLbCi586Bb1lTWQFkekdQUw8/t8cy++Uq251cl3hbDIGEwD9HAwh8H6IS2F6QA9KdKmO136LmipRNkg==",
1575
1575
  "cpu": [
1576
1576
  "x64"
1577
1577
  ],
@@ -1582,9 +1582,9 @@
1582
1582
  ]
1583
1583
  },
1584
1584
  "node_modules/@lmdb/lmdb-linux-arm": {
1585
- "version": "3.2.5",
1586
- "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-arm/-/lmdb-linux-arm-3.2.5.tgz",
1587
- "integrity": "sha512-V7AQQJtPrmViZQhmh7PhC/SQKkJC0xXwMcG1jdkcifCoUhacu3SyTWIoyVuloMWo8fHZsoYVBQfumzDW4XL1vg==",
1585
+ "version": "3.2.6",
1586
+ "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-arm/-/lmdb-linux-arm-3.2.6.tgz",
1587
+ "integrity": "sha512-+6XgLpMb7HBoWxXj+bLbiiB4s0mRRcDPElnRS3LpWRzdYSe+gFk5MT/4RrVNqd2MESUDmb53NUXw1+BP69bjiQ==",
1588
1588
  "cpu": [
1589
1589
  "arm"
1590
1590
  ],
@@ -1595,9 +1595,9 @@
1595
1595
  ]
1596
1596
  },
1597
1597
  "node_modules/@lmdb/lmdb-linux-arm64": {
1598
- "version": "3.2.5",
1599
- "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-arm64/-/lmdb-linux-arm64-3.2.5.tgz",
1600
- "integrity": "sha512-TC7RLSQV4f/0VoymcxOBt5ooypKXSnn4uiYrJJRoyrhGaNQmo8MFro8/X8f7vKfMXZ18KfzJmH6/GwJszoI7yg==",
1598
+ "version": "3.2.6",
1599
+ "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-arm64/-/lmdb-linux-arm64-3.2.6.tgz",
1600
+ "integrity": "sha512-l5VmJamJ3nyMmeD1ANBQCQqy7do1ESaJQfKPSm2IG9/ADZryptTyCj8N6QaYgIWewqNUrcbdMkJajRQAt5Qjfg==",
1601
1601
  "cpu": [
1602
1602
  "arm64"
1603
1603
  ],
@@ -1608,9 +1608,9 @@
1608
1608
  ]
1609
1609
  },
1610
1610
  "node_modules/@lmdb/lmdb-linux-x64": {
1611
- "version": "3.2.5",
1612
- "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-x64/-/lmdb-linux-x64-3.2.5.tgz",
1613
- "integrity": "sha512-e0jNcz+2i5wxINH58h4UhjO/H5USomicZVzPK7YJpRLbzsTIFpXIsvr+YmygFKyM3vvgPURlUJgln2uNMN4fHA==",
1611
+ "version": "3.2.6",
1612
+ "resolved": "https://registry.npmjs.org/@lmdb/lmdb-linux-x64/-/lmdb-linux-x64-3.2.6.tgz",
1613
+ "integrity": "sha512-nDYT8qN9si5+onHYYaI4DiauDMx24OAiuZAUsEqrDy+ja/3EbpXPX/VAkMV8AEaQhy3xc4dRC+KcYIvOFefJ4Q==",
1614
1614
  "cpu": [
1615
1615
  "x64"
1616
1616
  ],
@@ -1621,9 +1621,9 @@
1621
1621
  ]
1622
1622
  },
1623
1623
  "node_modules/@lmdb/lmdb-win32-x64": {
1624
- "version": "3.2.5",
1625
- "resolved": "https://registry.npmjs.org/@lmdb/lmdb-win32-x64/-/lmdb-win32-x64-3.2.5.tgz",
1626
- "integrity": "sha512-VtKaMEwqL68b7CCPSvRvl434dbt6bwFsel33NYqd9gppxkezFzNALTp3TJfoOXwapW0qjo1QXa4SkN+yNNYghg==",
1624
+ "version": "3.2.6",
1625
+ "resolved": "https://registry.npmjs.org/@lmdb/lmdb-win32-x64/-/lmdb-win32-x64-3.2.6.tgz",
1626
+ "integrity": "sha512-XlqVtILonQnG+9fH2N3Aytria7P/1fwDgDhl29rde96uH2sLB8CHORIf2PfuLVzFQJ7Uqp8py9AYwr3ZUCFfWg==",
1627
1627
  "cpu": [
1628
1628
  "x64"
1629
1629
  ],
@@ -5549,9 +5549,9 @@
5549
5549
  }
5550
5550
  },
5551
5551
  "node_modules/lmdb": {
5552
- "version": "3.2.5",
5553
- "resolved": "https://registry.npmjs.org/lmdb/-/lmdb-3.2.5.tgz",
5554
- "integrity": "sha512-KIyB6PcHzmUv8aSIbN6JVS5Tyc16puIvPI43X8GT2i57BXeY+OPGsJHIdPrggX6FZsZPY1UxkJBtipYCKN/cAg==",
5552
+ "version": "3.2.6",
5553
+ "resolved": "https://registry.npmjs.org/lmdb/-/lmdb-3.2.6.tgz",
5554
+ "integrity": "sha512-SuHqzPl7mYStna8WRotY8XX/EUZBjjv3QyKIByeCLFfC9uXT/OIHByEcA07PzbMfQAM0KYJtLgtpMRlIe5dErQ==",
5555
5555
  "hasInstallScript": true,
5556
5556
  "license": "MIT",
5557
5557
  "dependencies": {
@@ -5565,12 +5565,12 @@
5565
5565
  "download-lmdb-prebuilds": "bin/download-prebuilds.js"
5566
5566
  },
5567
5567
  "optionalDependencies": {
5568
- "@lmdb/lmdb-darwin-arm64": "3.2.5",
5569
- "@lmdb/lmdb-darwin-x64": "3.2.5",
5570
- "@lmdb/lmdb-linux-arm": "3.2.5",
5571
- "@lmdb/lmdb-linux-arm64": "3.2.5",
5572
- "@lmdb/lmdb-linux-x64": "3.2.5",
5573
- "@lmdb/lmdb-win32-x64": "3.2.5"
5568
+ "@lmdb/lmdb-darwin-arm64": "3.2.6",
5569
+ "@lmdb/lmdb-darwin-x64": "3.2.6",
5570
+ "@lmdb/lmdb-linux-arm": "3.2.6",
5571
+ "@lmdb/lmdb-linux-arm64": "3.2.6",
5572
+ "@lmdb/lmdb-linux-x64": "3.2.6",
5573
+ "@lmdb/lmdb-win32-x64": "3.2.6"
5574
5574
  }
5575
5575
  },
5576
5576
  "node_modules/lmdb/node_modules/node-addon-api": {
@@ -7548,9 +7548,9 @@
7548
7548
  }
7549
7549
  },
7550
7550
  "node_modules/socks": {
7551
- "version": "2.8.3",
7552
- "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz",
7553
- "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==",
7551
+ "version": "2.8.4",
7552
+ "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.4.tgz",
7553
+ "integrity": "sha512-D3YaD0aRxR3mEcqnidIs7ReYJFVzWdd6fXJYUM8ixcQcJRGTka/b3saV0KflYhyVJXKhb947GndU35SxYNResQ==",
7554
7554
  "license": "MIT",
7555
7555
  "dependencies": {
7556
7556
  "ip-address": "^9.0.5",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "harperdb",
3
- "version": "4.5.0-alpha.2",
3
+ "version": "4.5.0-alpha.3",
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",
@@ -79,7 +79,7 @@
79
79
  "json2csv": "5.0.7",
80
80
  "jsonata": "1.8.7",
81
81
  "jsonwebtoken": "9.0.2",
82
- "lmdb": "3.2.5",
82
+ "lmdb": "3.2.6",
83
83
  "lodash": "4.17.21",
84
84
  "mathjs": "11.12.0",
85
85
  "minimist": "1.2.8",
@@ -48,12 +48,12 @@ export interface Table {
48
48
  */
49
49
  export declare function makeTable(options: any): {
50
50
  new (identifier: Id, source: any): {
51
- "__#4@#record": any;
52
- "__#4@#changes": any;
53
- "__#4@#version": number;
54
- "__#4@#entry": Entry;
55
- "__#4@#saveMode": boolean;
56
- "__#4@#loadedFromSource": boolean;
51
+ "__#5@#record": any;
52
+ "__#5@#changes": any;
53
+ "__#5@#version": number;
54
+ "__#5@#entry": Entry;
55
+ "__#5@#saveMode": boolean;
56
+ "__#5@#loadedFromSource": boolean;
57
57
  /**
58
58
  * This is a request to explicitly ensure that the record is loaded from source, rather than only using the local record.
59
59
  * This will load from source if the current record is expired, missing, or invalidated.
@@ -185,9 +185,9 @@ export declare function makeTable(options: any): {
185
185
  validate(record: any, patch?: any): void;
186
186
  getUpdatedTime(): number;
187
187
  wasLoadedFromSource(): boolean | void;
188
- readonly "__#5@#id": Id;
189
- readonly "__#5@#context": Context;
190
- "__#5@#isCollection": boolean;
188
+ readonly "__#6@#id": Id;
189
+ readonly "__#6@#context": Context;
190
+ "__#6@#isCollection": boolean;
191
191
  post(new_record: any): Promise<any>;
192
192
  readonly isCollection: boolean;
193
193
  connect(query?: {}): AsyncIterable<any>;
@@ -238,12 +238,12 @@ export declare function makeTable(options: any): {
238
238
  * @returns
239
239
  */
240
240
  getResource(id: Id, request: Context, resource_options?: any): Promise<{
241
- "__#4@#record": any;
242
- "__#4@#changes": any;
243
- "__#4@#version": number;
244
- "__#4@#entry": Entry;
245
- "__#4@#saveMode": boolean;
246
- "__#4@#loadedFromSource": boolean;
241
+ "__#5@#record": any;
242
+ "__#5@#changes": any;
243
+ "__#5@#version": number;
244
+ "__#5@#entry": Entry;
245
+ "__#5@#saveMode": boolean;
246
+ "__#5@#loadedFromSource": boolean;
247
247
  /**
248
248
  * This is a request to explicitly ensure that the record is loaded from source, rather than only using the local record.
249
249
  * This will load from source if the current record is expired, missing, or invalidated.
@@ -375,21 +375,21 @@ export declare function makeTable(options: any): {
375
375
  validate(record: any, patch?: any): void;
376
376
  getUpdatedTime(): number;
377
377
  wasLoadedFromSource(): boolean | void;
378
- readonly "__#5@#id": Id;
379
- readonly "__#5@#context": Context;
380
- "__#5@#isCollection": boolean;
378
+ readonly "__#6@#id": Id;
379
+ readonly "__#6@#context": Context;
380
+ "__#6@#isCollection": boolean;
381
381
  post(new_record: any): Promise<any>;
382
382
  readonly isCollection: boolean;
383
383
  connect(query?: {}): AsyncIterable<any>;
384
384
  getId(): Id;
385
385
  getContext(): Context;
386
386
  }> | {
387
- "__#4@#record": any;
388
- "__#4@#changes": any;
389
- "__#4@#version": number;
390
- "__#4@#entry": Entry;
391
- "__#4@#saveMode": boolean;
392
- "__#4@#loadedFromSource": boolean;
387
+ "__#5@#record": any;
388
+ "__#5@#changes": any;
389
+ "__#5@#version": number;
390
+ "__#5@#entry": Entry;
391
+ "__#5@#saveMode": boolean;
392
+ "__#5@#loadedFromSource": boolean;
393
393
  /**
394
394
  * This is a request to explicitly ensure that the record is loaded from source, rather than only using the local record.
395
395
  * This will load from source if the current record is expired, missing, or invalidated.
@@ -521,9 +521,9 @@ export declare function makeTable(options: any): {
521
521
  validate(record: any, patch?: any): void;
522
522
  getUpdatedTime(): number;
523
523
  wasLoadedFromSource(): boolean | void;
524
- readonly "__#5@#id": Id;
525
- readonly "__#5@#context": Context;
526
- "__#5@#isCollection": boolean;
524
+ readonly "__#6@#id": Id;
525
+ readonly "__#6@#context": Context;
526
+ "__#6@#isCollection": boolean;
527
527
  post(new_record: any): Promise<any>;
528
528
  readonly isCollection: boolean;
529
529
  connect(query?: {}): AsyncIterable<any>;
@@ -5,21 +5,12 @@
5
5
  * - The first 2 bytes indicate the type of storage:
6
6
  * - 0: Uncompressed
7
7
  * - 1: Compressed with deflate
8
+ * - 0xff: Error state (followed by error message). A record can be saved prior to an error in saving a blob, so we must be capable of tracking and even replicating that state
8
9
  * - The next 6 bytes are the size of the content
9
10
  * - While the file is being written, 0xffffffffffff is used as a placeholder to indicate that the file is not finished being written (this nicely matches the logic that if the written content size is less than the indicated content size, it is not finished)
10
11
  * - Note that for compressed data, the size is the uncompressed size, and the compressed size in the file
11
12
  */
12
13
  import type { LMDBStore } from 'lmdb';
13
- type StorageInfo = {
14
- storageIndex: number;
15
- fileId: string;
16
- store?: any;
17
- filePath?: string;
18
- recordId?: number;
19
- contentBuffer?: Buffer;
20
- source?: NodeJS.ReadableStream;
21
- storageBuffer?: Buffer;
22
- };
23
14
  export declare const Blob: {
24
15
  new (blobParts?: BlobPart[], options?: BlobPropertyBag): Blob;
25
16
  prototype: Blob;
@@ -30,7 +21,7 @@ export declare const Blob: {
30
21
  text(): Promise<string>;
31
22
  arrayBuffer(): Promise<ArrayBufferLike>;
32
23
  readonly size: number;
33
- slice(): void;
24
+ slice(): /*elided*/ any;
34
25
  bytes(): Promise<Buffer>;
35
26
  readonly type: string;
36
27
  };
@@ -44,18 +35,24 @@ declare namespace InstanceOfBlobWithNoConstructor {
44
35
  text(): Promise<string>;
45
36
  arrayBuffer(): Promise<ArrayBufferLike>;
46
37
  readonly size: number;
47
- slice(): void;
38
+ slice(): /*elided*/ any;
48
39
  bytes(): Promise<Buffer>;
49
40
  readonly type: string;
50
41
  };
51
42
  }
52
43
  /**
53
44
  * A blob that is backed by a file, and can be saved to the database as a reference
45
+ * Note that this is used instead of the native Blob class for a few reasons:
46
+ * 1. This has the built-in functionality for reading from the file-based storage
47
+ * 2. This support for streams and asynchronous access to data that may not have a known size ahead of time
48
+ * 3. This also avoids the Blob constructor which is expensive due to the transferred setup
49
+ * Harper still supports saving native Blobs, but when they blobs are retrieved from storage, they always use this class.
54
50
  */
55
51
  declare class FileBackedBlob extends InstanceOfBlobWithNoConstructor {
52
+ #private;
53
+ type: string;
54
+ size: number;
56
55
  finished: Promise<void>;
57
- onError: ((error: Error) => void)[];
58
- options?: StorageInfo;
59
56
  constructor(options?: BlobCreationOptions);
60
57
  on(type: string, callback: (error: Error) => void): void;
61
58
  toJSON(): {
@@ -65,17 +62,17 @@ declare class FileBackedBlob extends InstanceOfBlobWithNoConstructor {
65
62
  bytes(): Promise<Buffer>;
66
63
  arrayBuffer(): Promise<ArrayBuffer>;
67
64
  stream(): ReadableStream;
68
- get size(): number;
69
- slice(): void;
70
- get type(): string;
65
+ slice(start: number, end: number, type?: string): Blob;
66
+ save(targetTable: any): Promise<void>;
71
67
  }
72
68
  /**
73
69
  * Delete the file for the blob
74
70
  * @param blob
75
71
  */
76
- export declare function deleteBlob(blob: Blob): Promise<void>;
72
+ export declare function deleteBlob(blob: Blob): void;
77
73
  export declare function setDeletionDelay(delay: number): void;
78
74
  export type BlobCreationOptions = {
75
+ type?: string;
79
76
  compress?: boolean;
80
77
  flush?: boolean;
81
78
  size?: number;
@@ -78,10 +78,10 @@ export declare function dropDatabase(database_name: any): Promise<void>;
78
78
  */
79
79
  export declare function table(table_definition: TableDefinition): {
80
80
  new (identifier: import("./ResourceInterface").Id, source: any): {
81
- "__#4@#record": any;
82
- "__#4@#changes": any;
83
- "__#4@#version": number;
84
- "__#4@#entry": {
81
+ "__#5@#record": any;
82
+ "__#5@#changes": any;
83
+ "__#5@#version": number;
84
+ "__#5@#entry": {
85
85
  key: any;
86
86
  value: any;
87
87
  version: number;
@@ -89,8 +89,8 @@ export declare function table(table_definition: TableDefinition): {
89
89
  expiresAt: number;
90
90
  deref?: () => any;
91
91
  };
92
- "__#4@#saveMode": boolean;
93
- "__#4@#loadedFromSource": boolean;
92
+ "__#5@#saveMode": boolean;
93
+ "__#5@#loadedFromSource": boolean;
94
94
  ensureLoaded(): any;
95
95
  get(query?: import("./ResourceInterface").Query | string): Promise<object | void> | object | void;
96
96
  allowRead(user: any, query: any): any;
@@ -176,9 +176,9 @@ export declare function table(table_definition: TableDefinition): {
176
176
  validate(record: any, patch?: any): void;
177
177
  getUpdatedTime(): number;
178
178
  wasLoadedFromSource(): boolean | void;
179
- readonly "__#5@#id": import("./ResourceInterface").Id;
180
- readonly "__#5@#context": import("./ResourceInterface").Context;
181
- "__#5@#isCollection": boolean;
179
+ readonly "__#6@#id": import("./ResourceInterface").Id;
180
+ readonly "__#6@#context": import("./ResourceInterface").Context;
181
+ "__#6@#isCollection": boolean;
182
182
  post(new_record: any): Promise<any>;
183
183
  readonly isCollection: boolean;
184
184
  connect(query?: {}): AsyncIterable<any>;
@@ -225,10 +225,10 @@ export declare function table(table_definition: TableDefinition): {
225
225
  readonly isCaching: any;
226
226
  readonly shouldRevalidateEvents: boolean;
227
227
  getResource(id: import("./ResourceInterface").Id, request: import("./ResourceInterface").Context, resource_options?: any): Promise<{
228
- "__#4@#record": any;
229
- "__#4@#changes": any;
230
- "__#4@#version": number;
231
- "__#4@#entry": {
228
+ "__#5@#record": any;
229
+ "__#5@#changes": any;
230
+ "__#5@#version": number;
231
+ "__#5@#entry": {
232
232
  key: any;
233
233
  value: any;
234
234
  version: number;
@@ -236,8 +236,8 @@ export declare function table(table_definition: TableDefinition): {
236
236
  expiresAt: number;
237
237
  deref?: () => any;
238
238
  };
239
- "__#4@#saveMode": boolean;
240
- "__#4@#loadedFromSource": boolean;
239
+ "__#5@#saveMode": boolean;
240
+ "__#5@#loadedFromSource": boolean;
241
241
  ensureLoaded(): any;
242
242
  get(query?: import("./ResourceInterface").Query | string): Promise<object | void> | object | void;
243
243
  allowRead(user: any, query: any): any;
@@ -323,19 +323,19 @@ export declare function table(table_definition: TableDefinition): {
323
323
  validate(record: any, patch?: any): void;
324
324
  getUpdatedTime(): number;
325
325
  wasLoadedFromSource(): boolean | void;
326
- readonly "__#5@#id": import("./ResourceInterface").Id;
327
- readonly "__#5@#context": import("./ResourceInterface").Context;
328
- "__#5@#isCollection": boolean;
326
+ readonly "__#6@#id": import("./ResourceInterface").Id;
327
+ readonly "__#6@#context": import("./ResourceInterface").Context;
328
+ "__#6@#isCollection": boolean;
329
329
  post(new_record: any): Promise<any>;
330
330
  readonly isCollection: boolean;
331
331
  connect(query?: {}): AsyncIterable<any>;
332
332
  getId(): import("./ResourceInterface").Id;
333
333
  getContext(): import("./ResourceInterface").Context;
334
334
  }> | {
335
- "__#4@#record": any;
336
- "__#4@#changes": any;
337
- "__#4@#version": number;
338
- "__#4@#entry": {
335
+ "__#5@#record": any;
336
+ "__#5@#changes": any;
337
+ "__#5@#version": number;
338
+ "__#5@#entry": {
339
339
  key: any;
340
340
  value: any;
341
341
  version: number;
@@ -343,8 +343,8 @@ export declare function table(table_definition: TableDefinition): {
343
343
  expiresAt: number;
344
344
  deref?: () => any;
345
345
  };
346
- "__#4@#saveMode": boolean;
347
- "__#4@#loadedFromSource": boolean;
346
+ "__#5@#saveMode": boolean;
347
+ "__#5@#loadedFromSource": boolean;
348
348
  ensureLoaded(): any;
349
349
  get(query?: import("./ResourceInterface").Query | string): Promise<object | void> | object | void;
350
350
  allowRead(user: any, query: any): any;
@@ -430,9 +430,9 @@ export declare function table(table_definition: TableDefinition): {
430
430
  validate(record: any, patch?: any): void;
431
431
  getUpdatedTime(): number;
432
432
  wasLoadedFromSource(): boolean | void;
433
- readonly "__#5@#id": import("./ResourceInterface").Id;
434
- readonly "__#5@#context": import("./ResourceInterface").Context;
435
- "__#5@#isCollection": boolean;
433
+ readonly "__#6@#id": import("./ResourceInterface").Id;
434
+ readonly "__#6@#context": import("./ResourceInterface").Context;
435
+ "__#6@#isCollection": boolean;
436
436
  post(new_record: any): Promise<any>;
437
437
  readonly isCollection: boolean;
438
438
  connect(query?: {}): AsyncIterable<any>;