@travetto/model-file 7.0.0-rc.2 → 7.0.0-rc.4
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 +7 -7
- package/src/service.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model-file",
|
|
3
|
-
"version": "7.0.0-rc.
|
|
3
|
+
"version": "7.0.0-rc.4",
|
|
4
4
|
"description": "File system backing for the travetto model module.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datastore",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"directory": "module/model-file"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@travetto/config": "^7.0.0-rc.
|
|
29
|
-
"@travetto/di": "^7.0.0-rc.
|
|
30
|
-
"@travetto/model": "^7.0.0-rc.
|
|
31
|
-
"@travetto/schema": "^7.0.0-rc.
|
|
28
|
+
"@travetto/config": "^7.0.0-rc.4",
|
|
29
|
+
"@travetto/di": "^7.0.0-rc.4",
|
|
30
|
+
"@travetto/model": "^7.0.0-rc.4",
|
|
31
|
+
"@travetto/schema": "^7.0.0-rc.4"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"@travetto/cli": "^7.0.0-rc.
|
|
35
|
-
"@travetto/test": "^7.0.0-rc.
|
|
34
|
+
"@travetto/cli": "^7.0.0-rc.4",
|
|
35
|
+
"@travetto/test": "^7.0.0-rc.4"
|
|
36
36
|
},
|
|
37
37
|
"peerDependenciesMeta": {
|
|
38
38
|
"@travetto/cli": {
|
package/src/service.ts
CHANGED
|
@@ -4,7 +4,7 @@ import os from 'node:os';
|
|
|
4
4
|
import { pipeline } from 'node:stream/promises';
|
|
5
5
|
import path from 'node:path';
|
|
6
6
|
|
|
7
|
-
import { Class, TimeSpan, Runtime, BlobMeta, ByteRange, BinaryInput, BinaryUtil } from '@travetto/runtime';
|
|
7
|
+
import { Class, TimeSpan, Runtime, BlobMeta, ByteRange, BinaryInput, BinaryUtil, JSONUtil } from '@travetto/runtime';
|
|
8
8
|
import { Injectable } from '@travetto/di';
|
|
9
9
|
import { Config } from '@travetto/config';
|
|
10
10
|
import { Required } from '@travetto/schema';
|
|
@@ -26,7 +26,7 @@ export class FileModelConfig {
|
|
|
26
26
|
@Required(false)
|
|
27
27
|
folder: string;
|
|
28
28
|
namespace: string = '.';
|
|
29
|
-
|
|
29
|
+
modifyStorage?: boolean;
|
|
30
30
|
cullRate?: number | TimeSpan;
|
|
31
31
|
|
|
32
32
|
async postConstruct(): Promise<void> {
|
|
@@ -193,7 +193,7 @@ export class FileModelService implements ModelCrudSupport, ModelBlobSupport, Mod
|
|
|
193
193
|
async getBlobMeta(location: string): Promise<BlobMeta> {
|
|
194
194
|
const file = await this.#find(ModelBlobNamespace, META, location);
|
|
195
195
|
const content = await fs.readFile(file);
|
|
196
|
-
const text: BlobMeta =
|
|
196
|
+
const text: BlobMeta = JSONUtil.parseSafe(content.toString('utf8'));
|
|
197
197
|
return text;
|
|
198
198
|
}
|
|
199
199
|
|