@nocobase/resourcer
Advanced tools
Comparing version 0.5.0-alpha.32 to 0.5.0-alpha.33
@@ -90,3 +90,3 @@ "use strict"; | ||
this.middlewares = []; | ||
options = utils_1.requireModule(options); | ||
options = (0, utils_1.requireModule)(options); | ||
@@ -236,3 +236,3 @@ if (typeof options === 'function') { | ||
getHandler() { | ||
const handler = utils_1.requireModule(this.handler || this.resource.resourcer.getRegisteredHandler(this.name)); | ||
const handler = (0, utils_1.requireModule)(this.handler || this.resource.resourcer.getRegisteredHandler(this.name)); | ||
@@ -252,3 +252,3 @@ if (typeof handler !== 'function') { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return yield koa_compose_1.default(this.getHandlers())(context, next); | ||
return yield (0, koa_compose_1.default)(this.getHandlers())(context, next); | ||
}); | ||
@@ -255,0 +255,0 @@ } |
@@ -24,3 +24,3 @@ "use strict"; | ||
constructor(options) { | ||
options = utils_1.requireModule(options); | ||
options = (0, utils_1.requireModule)(options); | ||
@@ -37,3 +37,3 @@ if (typeof options === 'function') { | ||
getHandler() { | ||
const handler = utils_1.requireModule(this.options.handler); | ||
const handler = (0, utils_1.requireModule)(this.options.handler); | ||
@@ -40,0 +40,0 @@ if (typeof handler !== 'function') { |
@@ -102,3 +102,3 @@ "use strict"; | ||
files.forEach(file => { | ||
const options = utils_1.requireModule(file); | ||
const options = (0, utils_1.requireModule)(file); | ||
const table = this.define(typeof options === 'function' ? options(this) : options); | ||
@@ -185,3 +185,3 @@ resources.set(table.getName(), table); | ||
ctx.resourcer = this; | ||
let params = utils_1.parseRequest({ | ||
let params = (0, utils_1.parseRequest)({ | ||
path: ctx.request.path, | ||
@@ -199,6 +199,6 @@ method: ctx.request.method | ||
try { | ||
const resource = this.getResource(utils_1.getNameByParams(params)); | ||
const resource = this.getResource((0, utils_1.getNameByParams)(params)); | ||
if (resource.options.type && resource.options.type !== 'single') { | ||
params = utils_1.parseRequest({ | ||
params = (0, utils_1.parseRequest)({ | ||
path: ctx.request.path, | ||
@@ -217,7 +217,7 @@ method: ctx.request.method, | ||
ctx.action = this.getAction(utils_1.getNameByParams(params), params.actionName).clone(); | ||
ctx.action = this.getAction((0, utils_1.getNameByParams)(params), params.actionName).clone(); | ||
ctx.action.setContext(ctx); | ||
const query = utils_1.parseQuery(ctx.request.querystring); | ||
const query = (0, utils_1.parseQuery)(ctx.request.querystring); | ||
if (path_to_regexp_1.pathToRegexp('/resourcer/{:associatedName.}?:resourceName{\\::actionName}').test(ctx.request.path)) { | ||
if ((0, path_to_regexp_1.pathToRegexp)('/resourcer/{:associatedName.}?:resourceName{\\::actionName}').test(ctx.request.path)) { | ||
yield ctx.action.mergeParams(Object.assign(Object.assign(Object.assign({}, query), params), ctx.request.body)); | ||
@@ -230,3 +230,3 @@ } else { | ||
return koa_compose_1.default(ctx.action.getHandlers())(ctx, next); | ||
return (0, koa_compose_1.default)(ctx.action.getHandlers())(ctx, next); | ||
} catch (error) { | ||
@@ -233,0 +233,0 @@ return next(); |
@@ -64,3 +64,3 @@ "use strict"; | ||
const keys = []; | ||
const regexp = path_to_regexp_1.pathToRegexp('/resourcer/{:associatedName.}?:resourceName{\\::actionName}', keys); | ||
const regexp = (0, path_to_regexp_1.pathToRegexp)('/resourcer/{:associatedName.}?:resourceName{\\::actionName}', keys); | ||
const matches = regexp.exec(request.path); | ||
@@ -164,3 +164,3 @@ | ||
const keys = []; | ||
const regexp = path_to_regexp_1.pathToRegexp(`${prefix}${path}`, keys, {}); | ||
const regexp = (0, path_to_regexp_1.pathToRegexp)(`${prefix}${path}`, keys, {}); | ||
const matches = regexp.exec(request.path); | ||
@@ -167,0 +167,0 @@ |
{ | ||
"name": "@nocobase/resourcer", | ||
"version": "0.5.0-alpha.32", | ||
"version": "0.5.0-alpha.33", | ||
"description": "", | ||
@@ -21,3 +21,3 @@ "main": "./lib/index.js", | ||
}, | ||
"gitHead": "7be6327458cb376e7281cff42a43a282105b65f8" | ||
"gitHead": "3479b7ea27be4507fc48f2ac3462798b5f9bc8b9" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
169125