@tsonic/express 10.0.37 → 10.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsonic/express",
3
- "version": "10.0.37",
3
+ "version": "10.0.39",
4
4
  "description": "TypeScript type definitions for Express.js style API on ASP.NET Core",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -18,8 +18,19 @@
18
18
  "type": "git",
19
19
  "url": "https://github.com/tsoniclang/express.git"
20
20
  },
21
- "peerDependencies": {
22
- "@tsonic/dotnet": "10.0.35",
23
- "@tsonic/core": "10.0.35"
21
+ "main": "index.d.ts",
22
+ "types": "index.d.ts",
23
+ "files": [
24
+ "**/*.d.ts",
25
+ "**/*.js",
26
+ "**/bindings.json",
27
+ "families.json",
28
+ "tsonic.bindings.json",
29
+ "docs/**/*.md",
30
+ "README.md",
31
+ "LICENSE"
32
+ ],
33
+ "dependencies": {
34
+ "@tsonic/js": "10.0.44"
24
35
  }
25
36
  }
@@ -9,7 +9,7 @@
9
9
  "packageReferences": [
10
10
  {
11
11
  "id": "Tsonic.Express",
12
- "version": "1.1.1",
12
+ "version": "1.1.2",
13
13
  "types": "@tsonic/express"
14
14
  }
15
15
  ]
@@ -1,5 +0,0 @@
1
- app.use(express.json());
2
- app.use(express.urlencoded());
3
- app.use(express.text());
4
- app.use(express.raw());
5
-
@@ -1,8 +0,0 @@
1
- app.get("/set-cookie", async (_req, res, _next) => {
2
- res.cookie("sid", "abc");
3
- res.send("ok");
4
- });
5
-
6
- app.get("/read-cookie", async (req, res, _next) => {
7
- res.json({ sid: req.cookies["sid"] });
8
- });
@@ -1,2 +0,0 @@
1
- app.use(express.cors());
2
-
@@ -1,8 +0,0 @@
1
- const app = express.create();
2
- const router = express.Router();
3
-
4
- router.get("/ping", async (_req, res, _next) => {
5
- res.send("pong");
6
- });
7
-
8
- app.use("/api", router);
@@ -1,3 +0,0 @@
1
- app.useError(async (err, _req, res, _next) => {
2
- res.status(500).json({ error: `${err}` });
3
- });
@@ -1,11 +0,0 @@
1
- import { express } from "@tsonic/express/index.js";
2
-
3
- export function main(): void {
4
- const app = express.create();
5
-
6
- app.get("/", async (_req, res, _next) => {
7
- res.send("hello");
8
- });
9
-
10
- app.listen(3000);
11
- }
@@ -1,3 +0,0 @@
1
- const server = app.listen(3000);
2
- server.close();
3
-
@@ -1,4 +0,0 @@
1
- app.use(async (req, _res, next) => {
2
- // Do something with req
3
- await next();
4
- });
@@ -1,8 +0,0 @@
1
- const upload = express.multipart();
2
-
3
- app.post("/upload", upload.single("avatar"), async (req, res, _next) => {
4
- res.json({
5
- filename: req.file?.originalname,
6
- fields: req.body,
7
- });
8
- });
@@ -1,11 +0,0 @@
1
- import { express } from "@tsonic/express/index.js";
2
-
3
- export function main(): void {
4
- const app = express.create();
5
-
6
- app.get("/", async (_req, res, _next) => {
7
- res.json({ ok: true });
8
- });
9
-
10
- app.listen(3000);
11
- }
@@ -1,18 +0,0 @@
1
- app.get("/health", async (_req, res, _next) => {
2
- res.send("ok");
3
- });
4
- app.post("/items", async (req, res, _next) => {
5
- res.json(req.body);
6
- });
7
- app.put("/items/:id", async (req, res, _next) => {
8
- res.send(req.params["id"] ?? "");
9
- });
10
- app.delete("/items/:id", async (_req, res, _next) => {
11
- res.sendStatus(204);
12
- });
13
- app.patch("/items/:id", async (_req, res, _next) => {
14
- res.sendStatus(204);
15
- });
16
- app.all("/anything", async (_req, res, _next) => {
17
- res.send("matched");
18
- });
@@ -1,2 +0,0 @@
1
- app.use(express.static("./public"));
2
-