@travetto/model-file 8.0.3 → 8.0.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 +2 -2
- package/src/service.ts +5 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/model-file",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.4",
|
|
4
4
|
"description": "File system backing for the travetto model module.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"datastore",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@travetto/config": "^8.0.3",
|
|
33
33
|
"@travetto/di": "^8.0.1",
|
|
34
|
-
"@travetto/model": "^8.0.
|
|
34
|
+
"@travetto/model": "^8.0.4",
|
|
35
35
|
"@travetto/schema": "^8.0.2"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
package/src/service.ts
CHANGED
|
@@ -282,10 +282,14 @@ export class FileModelService implements ModelCrudSupport, ModelBlobSupport, Mod
|
|
|
282
282
|
await fs.rm(path.resolve(this.config.folder, this.config.namespace), { recursive: true, force: true });
|
|
283
283
|
}
|
|
284
284
|
|
|
285
|
-
async truncateModel(cls: Class<
|
|
285
|
+
async truncateModel<T extends ModelType>(cls: Class<T>): Promise<void> {
|
|
286
286
|
await fs.rm(await this.#resolveName(cls), { recursive: true, force: true });
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
+
async deleteModel<T extends ModelType>(cls: Class<T>): Promise<void> {
|
|
290
|
+
await this.truncateModel(cls);
|
|
291
|
+
}
|
|
292
|
+
|
|
289
293
|
async truncateBlob(): Promise<void> {
|
|
290
294
|
await fs.rm(await this.#resolveName(ModelBlobNamespace), { recursive: true, force: true });
|
|
291
295
|
}
|