@psctickets/common 1.0.15 → 1.0.16

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.
@@ -0,0 +1,12 @@
1
+ import SignInTokenPayload from "../SignInTokenPayload";
2
+
3
+ /**
4
+ * There is a difference in how properties are added to global as opposed to the express' Request interface.
5
+ * This is because ts knows exactly the properties available in the interface, because it is something already declared
6
+ * using @types/express.
7
+ */
8
+ declare module "express" {
9
+ interface Request {
10
+ currentUser?: SignInTokenPayload;
11
+ }
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@psctickets/common",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "common package for tickets learning project",
5
5
  "main": "./build/index.js",
6
6
  "files": [
@@ -22,11 +22,15 @@
22
22
  "import": "./build/middlewares/index.js",
23
23
  "require": "./build/middlewares/index.js",
24
24
  "types": "./build/middlewares/index.d.ts"
25
+ },
26
+ "./types/express": {
27
+ "types": "./build/types/express/index.d.ts"
25
28
  }
26
29
  },
27
30
  "scripts": {
28
- "build": "npm run clean && tsc",
31
+ "build": "npm run clean && tsc && npm run copy-types",
29
32
  "clean": "del-cli ./build/*",
33
+ "copy-types": "cp -r src/types/express build/types/",
30
34
  "pub": "npm version patch && npm publish --access=public"
31
35
  },
32
36
  "keywords": [],