@webtypen/webframez-core 0.3.20 → 0.3.21

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.
@@ -62,10 +62,11 @@ class StorageFileInstance {
62
62
  }
63
63
  class StorageDisk {
64
64
  constructor(key) {
65
+ var _a;
65
66
  this.diskKey = key;
66
- this.config = Config_1.Config.get("storage.storages." + this.diskKey);
67
- if (!this.config.driver) {
68
- throw new Error(`[STORAGE ERROR] Missing driver for disk '${this.diskKey}'.`);
67
+ this.config = Config_1.Config.get("storage.disks." + this.diskKey);
68
+ if (!((_a = this.config) === null || _a === void 0 ? void 0 : _a.driver)) {
69
+ throw new Error(`[STORAGE ERROR] Missing config / config-driver-key for disk '${this.diskKey}'.`);
69
70
  }
70
71
  if (!exports.StorageDriverRegisty || !exports.StorageDriverRegisty.drivers || !exports.StorageDriverRegisty.drivers[this.config.driver]) {
71
72
  throw new Error(`[STORAGE ERROR] Invalid driver '${this.config.driver}' for disk '${this.diskKey}'.`);
@@ -146,7 +147,7 @@ class StorageFacade {
146
147
  this.drivers = {};
147
148
  }
148
149
  disk(diskKey) {
149
- const key = diskKey !== null && diskKey !== void 0 ? diskKey : Config_1.Config.get("storage.defaultStorage");
150
+ const key = diskKey !== null && diskKey !== void 0 ? diskKey : Config_1.Config.get("storage.defaultDisk");
150
151
  if (this.disks[key]) {
151
152
  return this.disks[key];
152
153
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webtypen/webframez-core",
3
- "version": "0.3.20",
3
+ "version": "0.3.21",
4
4
  "description": "The core package of the typescript based webframez (web-framework) by webtypen.de",
5
5
  "homepage": "https://webtypen.de/",
6
6
  "license": "MIT",
@@ -54,9 +54,9 @@ class StorageDisk {
54
54
 
55
55
  constructor(key: string) {
56
56
  this.diskKey = key;
57
- this.config = Config.get("storage.storages." + this.diskKey);
58
- if (!this.config.driver) {
59
- throw new Error(`[STORAGE ERROR] Missing driver for disk '${this.diskKey}'.`);
57
+ this.config = Config.get("storage.disks." + this.diskKey);
58
+ if (!this.config?.driver) {
59
+ throw new Error(`[STORAGE ERROR] Missing config / config-driver-key for disk '${this.diskKey}'.`);
60
60
  }
61
61
 
62
62
  if (!StorageDriverRegisty || !StorageDriverRegisty.drivers || !StorageDriverRegisty.drivers[this.config.driver]) {
@@ -126,7 +126,7 @@ class StorageFacade {
126
126
  drivers: { [key: string]: any } = {};
127
127
 
128
128
  disk(diskKey?: string) {
129
- const key = diskKey ?? Config.get("storage.defaultStorage");
129
+ const key = diskKey ?? Config.get("storage.defaultDisk");
130
130
  if (this.disks[key]) {
131
131
  return this.disks[key];
132
132
  }