cqrs-boilerplate-code 1.0.18 → 1.0.20
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/dist/index.d.ts
CHANGED
|
@@ -30,3 +30,6 @@ export * from './common-infra/socket.io/socket.gateway';
|
|
|
30
30
|
export * from './common-infra/socket.io/socket.module';
|
|
31
31
|
export * from './common-infra/socket.io/socket.options';
|
|
32
32
|
export * from './middleware/auth-middleware/auth.middleware';
|
|
33
|
+
export { AUTH_MIDDLEWARE_OPTIONS } from './middleware/auth-middleware/auth.middleware';
|
|
34
|
+
export { AuthMiddlewareOptions } from './middleware/auth-middleware/auth.middleware';
|
|
35
|
+
export * from './middleware/auth-middleware/jwt-validator';
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.AUTH_MIDDLEWARE_OPTIONS = void 0;
|
|
17
18
|
__exportStar(require("./core-common/constant/app.constant"), exports);
|
|
18
19
|
__exportStar(require("./core-common/error/custom-error/already-exists.error"), exports);
|
|
19
20
|
__exportStar(require("./core-common/error/custom-error/bad-request.error"), exports);
|
|
@@ -46,4 +47,7 @@ __exportStar(require("./common-infra/socket.io/socket.gateway"), exports);
|
|
|
46
47
|
__exportStar(require("./common-infra/socket.io/socket.module"), exports);
|
|
47
48
|
__exportStar(require("./common-infra/socket.io/socket.options"), exports);
|
|
48
49
|
__exportStar(require("./middleware/auth-middleware/auth.middleware"), exports);
|
|
50
|
+
var auth_middleware_1 = require("./middleware/auth-middleware/auth.middleware");
|
|
51
|
+
Object.defineProperty(exports, "AUTH_MIDDLEWARE_OPTIONS", { enumerable: true, get: function () { return auth_middleware_1.AUTH_MIDDLEWARE_OPTIONS; } });
|
|
52
|
+
__exportStar(require("./middleware/auth-middleware/jwt-validator"), exports);
|
|
49
53
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,sEAAmD;AAGnD,wFAAqE;AACrE,qFAAkE;AAClE,kFAA+D;AAC/D,2FAAwE;AACxE,mFAAgE;AAChE,yFAAsE;AACtE,mFAAgE;AAChE,6FAA0E;AAC1E,sFAAmE;AACnE,0FAAuE;AACvE,oFAAiE;AACjE,oEAAiD;AAGjD,4FAAyE;AACzE,8FAA2E;AAC3E,oEAAiD;AAGjD,wEAAqD;AACrD,qEAAkD;AAClD,sEAAmD;AAGnD,qEAAkD;AAClD,yEAAsD;AACtD,sEAAmD;AACnD,mEAAgD;AAGhD,0EAAuD;AACvD,oEAAiD;AACjD,kEAA+C;AAC/C,oEAAiD;AAGjD,sEAAmD;AACnD,0EAAuD;AACvD,yEAAsD;AACtD,0EAAuD;AAGvD,+EAA4D;AAC5D,gFAAsF;AAA7E,0HAAA,uBAAuB,OAAA;AAEhC,6EAA0D","sourcesContent":["\nexport * from './core-common/constant/app.constant'\n\n// Error Exports\nexport * from './core-common/error/custom-error/already-exists.error'\nexport * from './core-common/error/custom-error/bad-request.error'\nexport * from './core-common/error/custom-error/conflict.error'\nexport * from './core-common/error/custom-error/custom-validation-error'\nexport * from './core-common/error/custom-error/forbidden.error'\nexport * from './core-common/error/custom-error/internal-server.error'\nexport * from './core-common/error/custom-error/not-found.error'\nexport * from './core-common/error/custom-error/service-unavailable.error'\nexport * from './core-common/error/custom-error/unauthorized.error'\nexport * from './core-common/error/custom-error/unprocess-entity.error'\nexport * from './core-common/error/custom-error/validation.error'\nexport * from './core-common/error/generic.error'\n\n// Model Exports\nexport * from './core-common/response-model/generic-error-response.model'\nexport * from './core-common/response-model/generic-success-response.model'\nexport * from './core-common/result-model/result'\n\n// Logger Exports\nexport * from './core-common/logger/logger.interface'\nexport * from './core-common/logger/logger.module'\nexport * from './core-common/logger/logger.service'\n\n// Module Exports\nexport * from './common-infra/common-infra.module'\nexport * from './common-infra/database/typeorm.config'\nexport * from './core-common/constant/app.constant'\nexport * from './core-common/core-common.module'\n\n// HTTP Exports\nexport * from './common-infra/http/http-module.options'\nexport * from './common-infra/http/http.constant'\nexport * from './common-infra/http/http.module'\nexport * from './common-infra/http/https.service'\n\n// Socket.IO Exports\nexport * from './common-infra/socket.io/interfaces'\nexport * from './common-infra/socket.io/socket.gateway'\nexport * from './common-infra/socket.io/socket.module'\nexport * from './common-infra/socket.io/socket.options'\n\n// Middleware Exports\nexport * from './middleware/auth-middleware/auth.middleware'\nexport { AUTH_MIDDLEWARE_OPTIONS } from './middleware/auth-middleware/auth.middleware'\nexport { AuthMiddlewareOptions } from './middleware/auth-middleware/auth.middleware'\nexport * from './middleware/auth-middleware/jwt-validator'"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jwt-validator.js","sourceRoot":"","sources":["../../../src/middleware/auth-middleware/jwt-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,oCAWC;AAlBD,kDAAoC;AAOpC,SAAgB,YAAY,CAAC,OAA4B;IACrD,OAAO,CAAC,KAAa,EAAW,EAAE;
|
|
1
|
+
{"version":3,"file":"jwt-validator.js","sourceRoot":"","sources":["../../../src/middleware/auth-middleware/jwt-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,oCAWC;AAlBD,kDAAoC;AAOpC,SAAgB,YAAY,CAAC,OAA4B;IACrD,OAAO,CAAC,KAAa,EAAW,EAAE;QAC9B,IAAI,CAAC;YACD,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,EAAE;gBAC9B,UAAU,EAAE,OAAO,CAAC,UAAU;aACjC,CAAC,CAAC;YACH,OAAO,IAAI,CAAC;QAChB,CAAC;QAAC,MAAM,CAAC;YACL,OAAO,KAAK,CAAC;QACjB,CAAC;IACL,CAAC,CAAC;AACN,CAAC","sourcesContent":["import * as jwt from \"jsonwebtoken\";\n\nexport interface JwtValidatorOptions {\n secret: string;\n algorithms?: jwt.Algorithm[];\n}\n\nexport function jwtValidator(options: JwtValidatorOptions) {\n return (token: string): boolean => {\n try {\n jwt.verify(token, options.secret, {\n algorithms: options.algorithms,\n });\n return true;\n } catch {\n return false;\n }\n };\n}"]}
|