@doffy-gittix/common 1.0.3 → 1.0.6

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/build/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare const COOKIE_NAME: string;
1
+ export declare const COOKIE_NAME: string | undefined;
2
2
  export declare const COOKIE_KEY: string | undefined;
3
3
  export declare const JWT_KEY: string | undefined;
4
4
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,QAA6C,CAAC;AACtE,eAAO,MAAM,UAAU,oBAAyB,CAAC;AACjD,eAAO,MAAM,OAAO,oBAAsB,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,oBAA0B,CAAC;AACnD,eAAO,MAAM,UAAU,oBAAyB,CAAC;AACjD,eAAO,MAAM,OAAO,oBAAsB,CAAC"}
package/build/config.js CHANGED
@@ -1,4 +1,4 @@
1
- export const COOKIE_NAME = process.env.COOKIE_NAME || 'ticketing_jwt';
1
+ export const COOKIE_NAME = process.env.COOKIE_NAME;
2
2
  export const COOKIE_KEY = process.env.COOKIE_KEY;
3
3
  export const JWT_KEY = process.env.JWT_KEY;
4
4
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,eAAe,CAAC;AACtE,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;AACjD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC"}
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC;AACnD,MAAM,CAAC,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC;AACjD,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC"}
package/build/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './errors/index.js';
2
2
  export * from './middleware/index.js';
3
+ export * from './config.js';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC"}
package/build/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './errors/index.js';
2
2
  export * from './middleware/index.js';
3
+ export * from './config.js';
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC"}
@@ -7,11 +7,10 @@ declare global {
7
7
  namespace Express {
8
8
  interface Request {
9
9
  currentUser?: CurrentUser | null;
10
+ session?: Record<string, string>;
10
11
  }
11
12
  }
12
13
  }
13
- export declare const getCurrentUserHandler: (req: Request & {
14
- session?: Record<string, string>;
15
- }, _res: Response, next: NextFunction) => void;
14
+ export declare const getCurrentUserHandler: (req: Request, _res: Response, next: NextFunction) => void;
16
15
  export {};
17
16
  //# sourceMappingURL=get-current-user-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-current-user-handler.d.ts","sourceRoot":"","sources":["../../src/middleware/get-current-user-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI/D,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,OAAO,CAAC;QAChB,UAAU,OAAO;YACf,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;SAClC;KACF;CACF;AAED,eAAO,MAAM,qBAAqB,GAChC,KAAK,OAAO,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,EACnD,MAAM,QAAQ,EACd,MAAM,YAAY,SAcnB,CAAC"}
1
+ {"version":3,"file":"get-current-user-handler.d.ts","sourceRoot":"","sources":["../../src/middleware/get-current-user-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI/D,UAAU,WAAW;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,OAAO,CAAC;QAChB,UAAU,OAAO;YACf,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;YACjC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAClC;KACF;CACF;AAED,eAAO,MAAM,qBAAqB,GAChC,KAAK,OAAO,EACZ,MAAM,QAAQ,EACd,MAAM,YAAY,SAcnB,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import jwt from 'jsonwebtoken';
2
2
  import { COOKIE_NAME, JWT_KEY } from '../config.js';
3
3
  export const getCurrentUserHandler = (req, _res, next) => {
4
- const token = req.session?.[COOKIE_NAME];
4
+ const token = COOKIE_NAME && req.session?.[COOKIE_NAME];
5
5
  if (!token) {
6
6
  req.currentUser = null;
7
7
  return next();
@@ -1 +1 @@
1
- {"version":3,"file":"get-current-user-handler.js","sourceRoot":"","sources":["../../src/middleware/get-current-user-handler.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAepD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,GAAmD,EACnD,IAAc,EACd,IAAkB,EAClB,EAAE;IACF,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,CAAC;IACzC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC;IACD,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,OAAQ,CAAgB,CAAC;QAChE,GAAG,CAAC,WAAW,GAAG,YAAY,CAAC;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC;IACzB,CAAC;IACD,IAAI,EAAE,CAAC;AACT,CAAC,CAAC"}
1
+ {"version":3,"file":"get-current-user-handler.js","sourceRoot":"","sources":["../../src/middleware/get-current-user-handler.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,cAAc,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAgBpD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,GAAY,EACZ,IAAc,EACd,IAAkB,EAClB,EAAE;IACF,MAAM,KAAK,GAAG,WAAW,IAAI,GAAG,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,CAAC;IACxD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC;QACvB,OAAO,IAAI,EAAE,CAAC;IAChB,CAAC;IACD,IAAI,CAAC;QACH,MAAM,YAAY,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,OAAQ,CAAgB,CAAC;QAChE,GAAG,CAAC,WAAW,GAAG,YAAY,CAAC;IACjC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC;IACzB,CAAC;IACD,IAAI,EAAE,CAAC;AACT,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@doffy-gittix/common",
3
- "version": "1.0.3",
3
+ "version": "1.0.6",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",