@travetto/model-file 8.0.0-alpha.0 → 8.0.0-alpha.2
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 +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model-file",
|
|
3
|
-
"version": "8.0.0-alpha.
|
|
3
|
+
"version": "8.0.0-alpha.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "File system backing for the travetto model module.",
|
|
6
6
|
"keywords": [
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
"directory": "module/model-file"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@travetto/config": "^8.0.0-alpha.
|
|
30
|
-
"@travetto/di": "^8.0.0-alpha.
|
|
31
|
-
"@travetto/model": "^8.0.0-alpha.
|
|
32
|
-
"@travetto/schema": "^8.0.0-alpha.
|
|
29
|
+
"@travetto/config": "^8.0.0-alpha.2",
|
|
30
|
+
"@travetto/di": "^8.0.0-alpha.2",
|
|
31
|
+
"@travetto/model": "^8.0.0-alpha.2",
|
|
32
|
+
"@travetto/schema": "^8.0.0-alpha.2"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@travetto/cli": "^8.0.0-alpha.
|
|
36
|
-
"@travetto/test": "^8.0.0-alpha.
|
|
35
|
+
"@travetto/cli": "^8.0.0-alpha.3",
|
|
36
|
+
"@travetto/test": "^8.0.0-alpha.2"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
39
39
|
"@travetto/cli": {
|
package/src/service.ts
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
type Class, type TimeSpan, Runtime, type BinaryMetadata, type ByteRange, type BinaryType,
|
|
8
8
|
BinaryUtil, JSONUtil, BinaryMetadataUtil
|
|
9
9
|
} from '@travetto/runtime';
|
|
10
|
-
import { Injectable } from '@travetto/di';
|
|
10
|
+
import { Injectable, PostConstruct } from '@travetto/di';
|
|
11
11
|
import { Config } from '@travetto/config';
|
|
12
12
|
import { Required } from '@travetto/schema';
|
|
13
13
|
import {
|
|
@@ -30,7 +30,8 @@ export class FileModelConfig {
|
|
|
30
30
|
modifyStorage?: boolean;
|
|
31
31
|
cullRate?: number | TimeSpan;
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
@PostConstruct()
|
|
34
|
+
async finalizeConfig(): Promise<void> {
|
|
34
35
|
this.folder ??= path.resolve(os.tmpdir(), `trv_file_${Runtime.main.name.replace(/[^a-z]/ig, '_')}`);
|
|
35
36
|
}
|
|
36
37
|
}
|
|
@@ -90,7 +91,8 @@ export class FileModelService implements ModelCrudSupport, ModelBlobSupport, Mod
|
|
|
90
91
|
return file;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
|
|
94
|
+
@PostConstruct()
|
|
95
|
+
initializeClient(): void {
|
|
94
96
|
ModelExpiryUtil.registerCull(this);
|
|
95
97
|
}
|
|
96
98
|
|