framework-do-dede 1.0.38 → 1.0.39

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,5 +1,4 @@
1
1
  import { Registry } from "../di/registry";
2
- import { StorageGateway } from "../protocols/StorageGateway";
3
2
  export function Storage(gatewayName) {
4
3
  return function (target, propertyKey) {
5
4
  const instanceSymbol = Symbol();
@@ -11,7 +10,7 @@ export function Storage(gatewayName) {
11
10
  throw new Error(`StorageGateway ${gatewayName} not registered`);
12
11
  }
13
12
  const GatewayClass = Registry.resolve(gatewayName);
14
- if (!(GatewayClass instanceof StorageGateway)) {
13
+ if (!GatewayClass.save || !GatewayClass.get || !GatewayClass.delete) {
15
14
  throw new Error(`${gatewayName} is not a valid StorageGateway`);
16
15
  }
17
16
  this[instanceSymbol] = GatewayClass;
@@ -1,4 +1,4 @@
1
- export declare abstract class StorageGateway {
1
+ export interface StorageGateway {
2
2
  save(file: File, path: string): Promise<void>;
3
3
  get(key: string): Promise<string>;
4
4
  delete(key: string): Promise<boolean>;
@@ -1,11 +1 @@
1
- export class StorageGateway {
2
- save(file, path) {
3
- throw new Error(this.constructor.name + ' save method not implemented');
4
- }
5
- get(key) {
6
- throw new Error(this.constructor.name + ' get method not implemented');
7
- }
8
- delete(key) {
9
- throw new Error(this.constructor.name + ' delete method not implemented');
10
- }
11
- }
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "framework-do-dede",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",