@zenstackhq/runtime 0.1.3 → 0.1.5
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/lib/request-handler.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ import { AuthUser, Service } from './types';
|
|
|
3
3
|
export declare type RequestHandlerOptions = {
|
|
4
4
|
getServerUser: (req: NextApiRequest, res: NextApiResponse) => Promise<AuthUser | undefined>;
|
|
5
5
|
};
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function requestHandler<DbClient>(service: Service<DbClient>, options: RequestHandlerOptions): (req: NextApiRequest, res: NextApiResponse) => Promise<void>;
|
package/lib/request-handler.js
CHANGED
|
@@ -9,9 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.requestHandler = void 0;
|
|
13
13
|
const handler_1 = require("./handler");
|
|
14
|
-
function
|
|
14
|
+
function requestHandler(service, options) {
|
|
15
15
|
const dataHandler = new handler_1.DataHandler(service, options);
|
|
16
16
|
return (req, res) => __awaiter(this, void 0, void 0, function* () {
|
|
17
17
|
const [route, ...rest] = req.query.path;
|
|
@@ -23,5 +23,5 @@ function RequestHandler(service, options) {
|
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
exports.
|
|
26
|
+
exports.requestHandler = requestHandler;
|
|
27
27
|
//# sourceMappingURL=request-handler.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zenstackhq/runtime",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"description": "ZenStack runtime library",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -32,7 +32,6 @@
|
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "tsc",
|
|
34
34
|
"watch": "tsc --watch",
|
|
35
|
-
"test": "jest"
|
|
36
|
-
"npm-publish": "pnpm build && pnpm publish --no-git-checks --access public"
|
|
35
|
+
"test": "jest"
|
|
37
36
|
}
|
|
38
37
|
}
|