directus-transport-safe-run-middleware
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -18,3 +18,3 @@ import { Transport, TransportMethods, TransportOptions, TransportResponse } from '@directus/sdk'; | ||
constructor(app: Express); | ||
protected readonly request: <T = any, R = any>(method: TransportMethods, path: string, data?: Record<string, any>, options?: Omit<TransportOptions, 'url'>) => Promise<TransportResponse<T, R>>; | ||
protected request<T = any, R = any>(method: TransportMethods, path: string, data?: Record<string, any>, options?: Omit<TransportOptions, 'url'>): Promise<TransportResponse<T, R>>; | ||
} |
@@ -20,4 +20,7 @@ "use strict"; | ||
super({ url: '' }); | ||
this.request = (method, path, data, options) => __awaiter(this, void 0, void 0, function* () { | ||
var _a; | ||
this.app = (0, safe_run_middleware_1.default)(app); | ||
} | ||
request(method, path, data, options) { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
let response = yield this.app.runMiddleware(path, { | ||
@@ -36,5 +39,4 @@ method, | ||
}); | ||
this.app = (0, safe_run_middleware_1.default)(app); | ||
} | ||
} | ||
exports.default = DirectusTransportSafeRunMiddleware; |
{ | ||
"name": "directus-transport-safe-run-middleware", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A transport for the Directus JavaScript SDK which uses safe-run-middleware", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
59
5539