@plyaz/config 1.6.1 → 1.6.2
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/errors/index.cjs +3 -0
- package/dist/errors/index.cjs.map +1 -0
- package/dist/errors/index.mjs +3 -0
- package/dist/errors/index.mjs.map +1 -0
- package/dist/logger/index.cjs +3 -0
- package/dist/logger/index.cjs.map +1 -0
- package/dist/logger/index.mjs +3 -0
- package/dist/logger/index.mjs.map +1 -0
- package/package.json +13 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use strict';// @plyaz package - Built with tsup
|
|
2
|
+
var e={validation_error:{status:400,message:"errors.validation.error"},unauthorized:{status:401,message:"errors.auth.unauthorized"},payment_failed:{status:402,message:"errors.payment.failed"},forbidden:{status:403,message:"errors.auth.forbidden"},not_found:{status:404,message:"errors.common.notFound"},method_not_allowed:{status:405,message:"errors.common.methodNotAllowed"},user_already_exists:{status:409,message:"errors.user.alreadyExists"},unprocessable_entity:{status:422,message:"errors.validation.unprocessable"},too_many_requests:{status:429,message:"errors.rateLimit.tooManyRequests"},internal_server_error:{status:500,message:"errors.server.internal"},not_implemented:{status:501,message:"errors.server.notImplemented"},bad_gateway:{status:502,message:"errors.server.badGateway"},service_unavailable:{status:503,message:"errors.server.serviceUnavailable"},gateway_timeout:{status:504,message:"errors.server.gatewayTimeout"}},s={InvalidInput:{type:"form",message:"Invalid input",timestamp:new Date().toISOString()},[e.internal_server_error.status]:{type:"server",message:"Something went wrong",timestamp:new Date().toISOString()},[e.unauthorized.status]:{type:"auth",message:"Please log in again",timestamp:new Date().toISOString()}};exports.BASE_ERRORS_RESPONSE=s;exports.ERRORS_CODES=e;//# sourceMappingURL=index.cjs.map
|
|
3
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/errors/constants.ts"],"names":["ERRORS_CODES","BASE_ERRORS_RESPONSE"],"mappings":";AACO,I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AAK,CAAE,WAAA,EACxB,CAAA,CACA,CAACA,CAAAA,CAAa,YAAA,CAAa,MAAM,EAAG,CAClC,IAAA,CAAM,MAAA,CACN,OAAA,CAAS,qBAAA,CACT,UAAW,IAAI,IAAA,EAAK,CAAE,WAAA,EACxB,CACF","file":"index.cjs","sourcesContent":["// Errors Code with messages\nexport const ERRORS_CODES = {\n validation_error: {\n status: 400,\n message: 'errors.validation.error',\n },\n unauthorized: {\n status: 401,\n message: 'errors.auth.unauthorized',\n },\n payment_failed: {\n status: 402,\n message: 'errors.payment.failed',\n },\n forbidden: {\n status: 403,\n message: 'errors.auth.forbidden',\n },\n not_found: {\n status: 404,\n message: 'errors.common.notFound',\n },\n method_not_allowed: {\n status: 405,\n message: 'errors.common.methodNotAllowed',\n },\n user_already_exists: {\n status: 409,\n message: 'errors.user.alreadyExists',\n },\n unprocessable_entity: {\n status: 422,\n message: 'errors.validation.unprocessable',\n },\n too_many_requests: {\n status: 429,\n message: 'errors.rateLimit.tooManyRequests',\n },\n internal_server_error: {\n status: 500,\n message: 'errors.server.internal',\n },\n not_implemented: {\n status: 501,\n message: 'errors.server.notImplemented',\n },\n bad_gateway: {\n status: 502,\n message: 'errors.server.badGateway',\n },\n service_unavailable: {\n status: 503,\n message: 'errors.server.serviceUnavailable',\n },\n gateway_timeout: {\n status: 504,\n message: 'errors.server.gatewayTimeout',\n },\n} as const;\n\nexport const BASE_ERRORS_RESPONSE = {\n ['InvalidInput']: {\n type: 'form',\n message: 'Invalid input',\n timestamp: new Date().toISOString(),\n },\n [ERRORS_CODES.internal_server_error.status]: {\n type: 'server',\n message: 'Something went wrong',\n timestamp: new Date().toISOString(),\n },\n [ERRORS_CODES.unauthorized.status]: {\n type: 'auth',\n message: 'Please log in again',\n timestamp: new Date().toISOString(),\n },\n};\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// @plyaz package - Built with tsup
|
|
2
|
+
var e={validation_error:{status:400,message:"errors.validation.error"},unauthorized:{status:401,message:"errors.auth.unauthorized"},payment_failed:{status:402,message:"errors.payment.failed"},forbidden:{status:403,message:"errors.auth.forbidden"},not_found:{status:404,message:"errors.common.notFound"},method_not_allowed:{status:405,message:"errors.common.methodNotAllowed"},user_already_exists:{status:409,message:"errors.user.alreadyExists"},unprocessable_entity:{status:422,message:"errors.validation.unprocessable"},too_many_requests:{status:429,message:"errors.rateLimit.tooManyRequests"},internal_server_error:{status:500,message:"errors.server.internal"},not_implemented:{status:501,message:"errors.server.notImplemented"},bad_gateway:{status:502,message:"errors.server.badGateway"},service_unavailable:{status:503,message:"errors.server.serviceUnavailable"},gateway_timeout:{status:504,message:"errors.server.gatewayTimeout"}},s={InvalidInput:{type:"form",message:"Invalid input",timestamp:new Date().toISOString()},[e.internal_server_error.status]:{type:"server",message:"Something went wrong",timestamp:new Date().toISOString()},[e.unauthorized.status]:{type:"auth",message:"Please log in again",timestamp:new Date().toISOString()}};export{s as BASE_ERRORS_RESPONSE,e as ERRORS_CODES};//# sourceMappingURL=index.mjs.map
|
|
3
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/errors/constants.ts"],"names":["ERRORS_CODES","BASE_ERRORS_RESPONSE"],"mappings":";AACO,IAAMA,CAAAA,CAAe,CAC1B,gBAAA,CAAkB,CAChB,OAAQ,GAAA,CACR,OAAA,CAAS,yBACX,CAAA,CACA,aAAc,CACZ,MAAA,CAAQ,GAAA,CACR,OAAA,CAAS,0BACX,CAAA,CACA,cAAA,CAAgB,CACd,MAAA,CAAQ,GAAA,CACR,OAAA,CAAS,uBACX,CAAA,CACA,UAAW,CACT,MAAA,CAAQ,GAAA,CACR,OAAA,CAAS,uBACX,CAAA,CACA,SAAA,CAAW,CACT,MAAA,CAAQ,IACR,OAAA,CAAS,wBACX,CAAA,CACA,kBAAA,CAAoB,CAClB,MAAA,CAAQ,GAAA,CACR,OAAA,CAAS,gCACX,CAAA,CACA,mBAAA,CAAqB,CACnB,MAAA,CAAQ,IACR,OAAA,CAAS,2BACX,CAAA,CACA,oBAAA,CAAsB,CACpB,MAAA,CAAQ,GAAA,CACR,OAAA,CAAS,iCACX,CAAA,CACA,iBAAA,CAAmB,CACjB,MAAA,CAAQ,IACR,OAAA,CAAS,kCACX,CAAA,CACA,qBAAA,CAAuB,CACrB,MAAA,CAAQ,GAAA,CACR,OAAA,CAAS,wBACX,EACA,eAAA,CAAiB,CACf,MAAA,CAAQ,GAAA,CACR,OAAA,CAAS,8BACX,CAAA,CACA,WAAA,CAAa,CACX,MAAA,CAAQ,GAAA,CACR,OAAA,CAAS,0BACX,EACA,mBAAA,CAAqB,CACnB,MAAA,CAAQ,GAAA,CACR,QAAS,kCACX,CAAA,CACA,eAAA,CAAiB,CACf,MAAA,CAAQ,GAAA,CACR,OAAA,CAAS,8BACX,CACF,CAAA,CAEaC,CAAAA,CAAuB,CACjC,YAAA,CAAiB,CAChB,IAAA,CAAM,MAAA,CACN,OAAA,CAAS,eAAA,CACT,UAAW,IAAI,IAAA,EAAK,CAAE,WAAA,EACxB,CAAA,CACA,CAACD,CAAAA,CAAa,sBAAsB,MAAM,EAAG,CAC3C,IAAA,CAAM,SACN,OAAA,CAAS,sBAAA,CACT,SAAA,CAAW,IAAI,MAAK,CAAE,WAAA,EACxB,CAAA,CACA,CAACA,CAAAA,CAAa,YAAA,CAAa,MAAM,EAAG,CAClC,IAAA,CAAM,MAAA,CACN,OAAA,CAAS,qBAAA,CACT,UAAW,IAAI,IAAA,EAAK,CAAE,WAAA,EACxB,CACF","file":"index.mjs","sourcesContent":["// Errors Code with messages\nexport const ERRORS_CODES = {\n validation_error: {\n status: 400,\n message: 'errors.validation.error',\n },\n unauthorized: {\n status: 401,\n message: 'errors.auth.unauthorized',\n },\n payment_failed: {\n status: 402,\n message: 'errors.payment.failed',\n },\n forbidden: {\n status: 403,\n message: 'errors.auth.forbidden',\n },\n not_found: {\n status: 404,\n message: 'errors.common.notFound',\n },\n method_not_allowed: {\n status: 405,\n message: 'errors.common.methodNotAllowed',\n },\n user_already_exists: {\n status: 409,\n message: 'errors.user.alreadyExists',\n },\n unprocessable_entity: {\n status: 422,\n message: 'errors.validation.unprocessable',\n },\n too_many_requests: {\n status: 429,\n message: 'errors.rateLimit.tooManyRequests',\n },\n internal_server_error: {\n status: 500,\n message: 'errors.server.internal',\n },\n not_implemented: {\n status: 501,\n message: 'errors.server.notImplemented',\n },\n bad_gateway: {\n status: 502,\n message: 'errors.server.badGateway',\n },\n service_unavailable: {\n status: 503,\n message: 'errors.server.serviceUnavailable',\n },\n gateway_timeout: {\n status: 504,\n message: 'errors.server.gatewayTimeout',\n },\n} as const;\n\nexport const BASE_ERRORS_RESPONSE = {\n ['InvalidInput']: {\n type: 'form',\n message: 'Invalid input',\n timestamp: new Date().toISOString(),\n },\n [ERRORS_CODES.internal_server_error.status]: {\n type: 'server',\n message: 'Something went wrong',\n timestamp: new Date().toISOString(),\n },\n [ERRORS_CODES.unauthorized.status]: {\n type: 'auth',\n message: 'Please log in again',\n timestamp: new Date().toISOString(),\n },\n};\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
'use strict';// @plyaz package - Built with tsup
|
|
2
|
+
var e={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},r=["email","password","wallet","token","secret","ssn"];exports.LOGGER_LEVELS=e;exports.SENSITIVE_DATA=r;//# sourceMappingURL=index.cjs.map
|
|
3
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/logger/constants.ts"],"names":["LOGGER_LEVELS","SENSITIVE_DATA"],"mappings":";AACO,IAAMA,CAAAA,CAAgB,CAC3B,KAAA,CAAO,EAAA,CACP,MAAO,EAAA,CACP,IAAA,CAAM,EAAA,CACN,IAAA,CAAM,EAAA,CACN,KAAA,CAAO,GACP,KAAA,CAAO,EACT,EAGaC,CAAAA,CAAiB,CAAC,QAAS,UAAA,CAAY,QAAA,CAAU,OAAA,CAAS,QAAA,CAAU,KAAK","file":"index.cjs","sourcesContent":["// levels of the loggers\nexport const LOGGER_LEVELS = {\n trace: 10,\n debug: 20,\n info: 30,\n warn: 40,\n error: 50,\n fatal: 60,\n};\n\n// Sensitive fields excluded from logs\nexport const SENSITIVE_DATA = ['email', 'password', 'wallet', 'token', 'secret', 'ssn'];\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/logger/constants.ts"],"names":["LOGGER_LEVELS","SENSITIVE_DATA"],"mappings":";AACO,IAAMA,CAAAA,CAAgB,CAC3B,KAAA,CAAO,EAAA,CACP,MAAO,EAAA,CACP,IAAA,CAAM,EAAA,CACN,IAAA,CAAM,EAAA,CACN,KAAA,CAAO,GACP,KAAA,CAAO,EACT,EAGaC,CAAAA,CAAiB,CAAC,QAAS,UAAA,CAAY,QAAA,CAAU,OAAA,CAAS,QAAA,CAAU,KAAK","file":"index.mjs","sourcesContent":["// levels of the loggers\nexport const LOGGER_LEVELS = {\n trace: 10,\n debug: 20,\n info: 30,\n warn: 40,\n error: 50,\n fatal: 60,\n};\n\n// Sensitive fields excluded from logs\nexport const SENSITIVE_DATA = ['email', 'password', 'wallet', 'token', 'secret', 'ssn'];\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plyaz/config",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"author": "Redeemer Pace",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"description": "Provides shared configs and constants for @playz ecosystem.",
|
|
@@ -87,6 +87,18 @@
|
|
|
87
87
|
"require": "./dist/api/index.cjs",
|
|
88
88
|
"default": "./dist/api/index.mjs"
|
|
89
89
|
},
|
|
90
|
+
"./errors": {
|
|
91
|
+
"types": "./dist/errors/index.d.ts",
|
|
92
|
+
"import": "./dist/errors/index.mjs",
|
|
93
|
+
"require": "./dist/errors/index.cjs",
|
|
94
|
+
"default": "./dist/errors/index.mjs"
|
|
95
|
+
},
|
|
96
|
+
"./logger": {
|
|
97
|
+
"types": "./dist/logger/index.d.ts",
|
|
98
|
+
"import": "./dist/logger/index.mjs",
|
|
99
|
+
"require": "./dist/logger/index.cjs",
|
|
100
|
+
"default": "./dist/logger/index.mjs"
|
|
101
|
+
},
|
|
90
102
|
"./translations": {
|
|
91
103
|
"types": "./dist/translations/index.d.ts"
|
|
92
104
|
},
|