node-server-engine 1.5.1 → 1.6.0
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/README.md +41 -0
- package/dist/utils/report/output.js +123 -7
- package/dist/utils/report/output.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -679,6 +679,47 @@ The server engine standardizes the way errors are handled and reported. The erro
|
|
|
679
679
|
|
|
680
680
|
Errors are a crucial part of the application, they are what helps us to properly debug the program and offer support when need, as well as what exposes issues to the client.
|
|
681
681
|
|
|
682
|
+
#### Log Output Formats
|
|
683
|
+
|
|
684
|
+
The engine automatically adapts log output based on the environment:
|
|
685
|
+
|
|
686
|
+
**Local Development (Readable Format)**
|
|
687
|
+
- Colorized output with severity levels
|
|
688
|
+
- Formatted timestamps and file locations
|
|
689
|
+
- Pretty-printed data objects
|
|
690
|
+
- Stack traces with proper formatting
|
|
691
|
+
- HTTP request context when available
|
|
692
|
+
|
|
693
|
+
**Production/GCP (JSON Format)**
|
|
694
|
+
- Structured JSON for log aggregation
|
|
695
|
+
- Google Cloud Error Reporting integration
|
|
696
|
+
- Kubernetes pod information
|
|
697
|
+
- Service context metadata
|
|
698
|
+
|
|
699
|
+
**Control Log Format**
|
|
700
|
+
|
|
701
|
+
You can override the automatic detection:
|
|
702
|
+
|
|
703
|
+
```bash
|
|
704
|
+
# Force readable local format (useful for local Docker)
|
|
705
|
+
LOG_FORMAT=local npm start
|
|
706
|
+
|
|
707
|
+
# Force JSON format (useful for local testing)
|
|
708
|
+
LOG_FORMAT=json npm start
|
|
709
|
+
```
|
|
710
|
+
|
|
711
|
+
**Example Local Output:**
|
|
712
|
+
```
|
|
713
|
+
[2025-12-10T10:30:45.123Z] ERROR src/endpoints/users.ts:42 User not found
|
|
714
|
+
Error Code: user-not-found
|
|
715
|
+
Status: 404
|
|
716
|
+
Data:
|
|
717
|
+
{
|
|
718
|
+
"userId": "abc-123",
|
|
719
|
+
"requestId": "req-456"
|
|
720
|
+
}
|
|
721
|
+
```
|
|
722
|
+
|
|
682
723
|
By standard, the client receives the following body when an error happens.
|
|
683
724
|
|
|
684
725
|
```javascript
|
|
@@ -9,9 +9,115 @@ exports.output = output;
|
|
|
9
9
|
var _crypto = require("crypto");
|
|
10
10
|
var _callsite = _interopRequireDefault(require("callsite"));
|
|
11
11
|
var _jsonStringifySafe = _interopRequireDefault(require("json-stringify-safe"));
|
|
12
|
+
var _const = require("../../const");
|
|
12
13
|
// NOTE: Server instance id (helpful for distributed logs)
|
|
13
14
|
const INSTANCE_ID = exports.INSTANCE_ID = (0, _crypto.randomUUID)();
|
|
14
15
|
|
|
16
|
+
// ANSI color codes for terminal output
|
|
17
|
+
const colors = {
|
|
18
|
+
reset: '\x1b[0m',
|
|
19
|
+
bright: '\x1b[1m',
|
|
20
|
+
dim: '\x1b[2m',
|
|
21
|
+
red: '\x1b[31m',
|
|
22
|
+
green: '\x1b[32m',
|
|
23
|
+
yellow: '\x1b[33m',
|
|
24
|
+
blue: '\x1b[34m',
|
|
25
|
+
magenta: '\x1b[35m',
|
|
26
|
+
cyan: '\x1b[36m',
|
|
27
|
+
white: '\x1b[37m',
|
|
28
|
+
gray: '\x1b[90m'
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Get color for log severity level
|
|
33
|
+
*/
|
|
34
|
+
function getSeverityColor(severity) {
|
|
35
|
+
switch (severity) {
|
|
36
|
+
case _const.LogSeverity.DEBUG:
|
|
37
|
+
return colors.cyan;
|
|
38
|
+
case _const.LogSeverity.INFO:
|
|
39
|
+
return colors.green;
|
|
40
|
+
case _const.LogSeverity.WARNING:
|
|
41
|
+
return colors.yellow;
|
|
42
|
+
case _const.LogSeverity.ERROR:
|
|
43
|
+
return colors.red;
|
|
44
|
+
case _const.LogSeverity.CRITICAL:
|
|
45
|
+
return `${colors.bright}${colors.red}`;
|
|
46
|
+
default:
|
|
47
|
+
return colors.white;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Format log entry for human-readable local development output
|
|
53
|
+
*/
|
|
54
|
+
function formatLocalLog(entry) {
|
|
55
|
+
const timestamp = new Date().toISOString();
|
|
56
|
+
const severity = entry.severity || 'INFO';
|
|
57
|
+
const severityColor = getSeverityColor(severity);
|
|
58
|
+
const parts = [];
|
|
59
|
+
|
|
60
|
+
// Timestamp and severity
|
|
61
|
+
parts.push(`${colors.gray}[${timestamp}]${colors.reset} ${severityColor}${severity.padEnd(8)}${colors.reset}`);
|
|
62
|
+
|
|
63
|
+
// File location
|
|
64
|
+
if (entry.fileName) {
|
|
65
|
+
parts.push(`${colors.dim}${entry.fileName}:${entry.lineNumber || '?'}${colors.reset}`);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Message
|
|
69
|
+
if (entry.message) {
|
|
70
|
+
parts.push(`${colors.bright}${entry.message}${colors.reset}`);
|
|
71
|
+
}
|
|
72
|
+
let output = parts.join(' ');
|
|
73
|
+
|
|
74
|
+
// Error details
|
|
75
|
+
if (entry.errorType) {
|
|
76
|
+
output += `\n ${colors.red}Error Type:${colors.reset} ${entry.errorType}`;
|
|
77
|
+
}
|
|
78
|
+
if (entry.errorCode) {
|
|
79
|
+
output += `\n ${colors.red}Error Code:${colors.reset} ${entry.errorCode}`;
|
|
80
|
+
}
|
|
81
|
+
if (entry.statusCode) {
|
|
82
|
+
const statusColor = entry.statusCode >= 500 ? colors.red : entry.statusCode >= 400 ? colors.yellow : colors.green;
|
|
83
|
+
output += `\n ${colors.cyan}Status:${colors.reset} ${statusColor}${entry.statusCode}${colors.reset}`;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Stack trace
|
|
87
|
+
if (entry.stack_trace) {
|
|
88
|
+
output += `\n${colors.gray}Stack Trace:${colors.reset}\n${colors.dim}${entry.stack_trace}${colors.reset}`;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Additional data
|
|
92
|
+
if (entry.data && Object.keys(entry.data).length > 0) {
|
|
93
|
+
output += `\n${colors.cyan}Data:${colors.reset}\n${colors.dim}${JSON.stringify(entry.data, null, 2)}${colors.reset}`;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// HTTP request context
|
|
97
|
+
if (entry.context?.httpRequest) {
|
|
98
|
+
const req = entry.context.httpRequest;
|
|
99
|
+
output += `\n${colors.magenta}Request:${colors.reset}`;
|
|
100
|
+
output += `\n ${colors.dim}${req.method} ${req.url}${colors.reset}`;
|
|
101
|
+
if (req.userAgent) {
|
|
102
|
+
output += `\n ${colors.dim}User-Agent: ${req.userAgent}${colors.reset}`;
|
|
103
|
+
}
|
|
104
|
+
if (req.remoteIp) {
|
|
105
|
+
output += `\n ${colors.dim}IP: ${req.remoteIp}${colors.reset}`;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return output;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Check if running in local development environment
|
|
113
|
+
*/
|
|
114
|
+
function isLocalDevelopment() {
|
|
115
|
+
// Allow forcing local format via environment variable
|
|
116
|
+
if (process.env.LOG_FORMAT === 'local') return true;
|
|
117
|
+
if (process.env.LOG_FORMAT === 'json') return false;
|
|
118
|
+
return process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'dev' || !process.env.NODE_ENV && !process.env.KUBERNETES_POD_NAME && !process.env.CLOUD_RUN_JOB;
|
|
119
|
+
}
|
|
120
|
+
|
|
15
121
|
/** Add metadata to the log entry and print it */
|
|
16
122
|
function output(data) {
|
|
17
123
|
// Gather useful information about where the logger was called from
|
|
@@ -29,20 +135,30 @@ function output(data) {
|
|
|
29
135
|
instance: process.env.KUBERNETES_POD_NAME ?? INSTANCE_ID
|
|
30
136
|
}
|
|
31
137
|
};
|
|
32
|
-
|
|
138
|
+
|
|
33
139
|
// Ignore when silenced
|
|
34
140
|
if (process.env.SILENCE_REPORT) return fullEntry;
|
|
35
141
|
if (process.env.NODE_ENV === 'test') {
|
|
36
|
-
// In test mode pretty print
|
|
142
|
+
// In test mode pretty print with full depth
|
|
37
143
|
console.dir(fullEntry, {
|
|
38
144
|
depth: 5
|
|
39
145
|
});
|
|
40
|
-
} else if (
|
|
41
|
-
//
|
|
42
|
-
|
|
146
|
+
} else if (isLocalDevelopment()) {
|
|
147
|
+
// Local development: use formatted, colorized output
|
|
148
|
+
const formattedLog = formatLocalLog(fullEntry);
|
|
149
|
+
if (data.severity === _const.LogSeverity.ERROR || data.severity === _const.LogSeverity.CRITICAL || data.statusCode && data.statusCode >= 500) {
|
|
150
|
+
console.error(formattedLog);
|
|
151
|
+
} else {
|
|
152
|
+
console.log(formattedLog);
|
|
153
|
+
}
|
|
43
154
|
} else {
|
|
44
|
-
//
|
|
45
|
-
|
|
155
|
+
// Production/GCP: use JSON format for structured logging
|
|
156
|
+
const entry = (0, _jsonStringifySafe.default)(fullEntry);
|
|
157
|
+
if (data.statusCode && data.statusCode >= 500) {
|
|
158
|
+
console.error(entry);
|
|
159
|
+
} else {
|
|
160
|
+
console.log(entry);
|
|
161
|
+
}
|
|
46
162
|
}
|
|
47
163
|
return fullEntry;
|
|
48
164
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","names":["_crypto","require","_callsite","_interopRequireDefault","_jsonStringifySafe","INSTANCE_ID","exports","randomUUID","output","data","call","callsite","fullEntry","lineNumber","getLineNumber","fileName","getFileName","replace","serviceContext","service","process","env","CHART","HOSTNAME","version","BUILD_ID","environment","NODE_ENV","instance","KUBERNETES_POD_NAME","entry","stringify","SILENCE_REPORT","console","dir","depth","statusCode","error","log"],"sources":["../../../src/utils/report/output.ts"],"sourcesContent":["import { randomUUID } from 'crypto';\nimport callsite from 'callsite';\nimport stringify from 'json-stringify-safe';\nimport { LogEntry, FullLogEntry } from './output.types';\n\n// NOTE: Server instance id (helpful for distributed logs)\nexport const INSTANCE_ID = randomUUID();\n\n/** Add metadata to the log entry and print it */\nexport function output(data: LogEntry): FullLogEntry {\n // Gather useful information about where the logger was called from\n const call = callsite()[2];\n\n // Append additional metadata to the log entry\n const fullEntry: FullLogEntry = {\n ...data,\n lineNumber: call.getLineNumber(),\n fileName: call\n .getFileName()\n .replace(/.*node_modules\\//, '')\n .replace(/.*src\\//, 'src/'),\n serviceContext: {\n service: process.env.CHART ?? process.env.HOSTNAME,\n version: process.env.BUILD_ID,\n environment: process.env.NODE_ENV,\n instance: process.env.KUBERNETES_POD_NAME ?? INSTANCE_ID\n }\n };\n\n const entry = stringify(fullEntry);\n // Ignore when silenced\n if (process.env.SILENCE_REPORT) return fullEntry;\n\n if (process.env.NODE_ENV === 'test') {\n // In test mode pretty print\n console.dir(fullEntry, { depth: 5 });\n } else if (data.statusCode && data.statusCode >= 500) {\n // Log to stderr when it is a 500+ error\n console.error(entry);\n } else {\n // Default to regular logging\n console.log(entry);\n }\n return fullEntry;\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAD,sBAAA,CAAAF,OAAA;AAGA;AACO,MAAMI,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,IAAAE,kBAAU,EAAC,CAAC;;AAEvC;AACO,SAASC,MAAMA,CAACC,IAAc,EAAgB;EACnD;EACA,MAAMC,IAAI,GAAG,IAAAC,iBAAQ,EAAC,CAAC,CAAC,CAAC,CAAC;;EAE1B;EACA,MAAMC,SAAuB,GAAG;IAC9B,GAAGH,IAAI;IACPI,UAAU,EAAEH,IAAI,CAACI,aAAa,CAAC,CAAC;IAChCC,QAAQ,EAAEL,IAAI,CACXM,WAAW,CAAC,CAAC,CACbC,OAAO,CAAC,kBAAkB,EAAE,EAAE,CAAC,CAC/BA,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC;IAC7BC,cAAc,EAAE;MACdC,OAAO,EAAEC,OAAO,CAACC,GAAG,CAACC,KAAK,IAAIF,OAAO,CAACC,GAAG,CAACE,QAAQ;MAClDC,OAAO,EAAEJ,OAAO,CAACC,GAAG,CAACI,QAAQ;MAC7BC,WAAW,EAAEN,OAAO,CAACC,GAAG,CAACM,QAAQ;MACjCC,QAAQ,EAAER,OAAO,CAACC,GAAG,CAACQ,mBAAmB,IAAIxB;IAC/C;EACF,CAAC;EAED,MAAMyB,KAAK,GAAG,IAAAC,0BAAS,EAACnB,SAAS,CAAC;EAClC;EACA,IAAIQ,OAAO,CAACC,GAAG,CAACW,cAAc,EAAE,OAAOpB,SAAS;EAEhD,IAAIQ,OAAO,CAACC,GAAG,CAACM,QAAQ,KAAK,MAAM,EAAE;IACnC;IACAM,OAAO,CAACC,GAAG,CAACtB,SAAS,EAAE;MAAEuB,KAAK,EAAE;IAAE,CAAC,CAAC;EACtC,CAAC,MAAM,IAAI1B,IAAI,CAAC2B,UAAU,IAAI3B,IAAI,CAAC2B,UAAU,IAAI,GAAG,EAAE;IACpD;IACAH,OAAO,CAACI,KAAK,CAACP,KAAK,CAAC;EACtB,CAAC,MAAM;IACL;IACAG,OAAO,CAACK,GAAG,CAACR,KAAK,CAAC;EACpB;EACA,OAAOlB,SAAS;AAClB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"output.js","names":["_crypto","require","_callsite","_interopRequireDefault","_jsonStringifySafe","_const","INSTANCE_ID","exports","randomUUID","colors","reset","bright","dim","red","green","yellow","blue","magenta","cyan","white","gray","getSeverityColor","severity","LogSeverity","DEBUG","INFO","WARNING","ERROR","CRITICAL","formatLocalLog","entry","timestamp","Date","toISOString","severityColor","parts","push","padEnd","fileName","lineNumber","message","output","join","errorType","errorCode","statusCode","statusColor","stack_trace","data","Object","keys","length","JSON","stringify","context","httpRequest","req","method","url","userAgent","remoteIp","isLocalDevelopment","process","env","LOG_FORMAT","NODE_ENV","KUBERNETES_POD_NAME","CLOUD_RUN_JOB","call","callsite","fullEntry","getLineNumber","getFileName","replace","serviceContext","service","CHART","HOSTNAME","version","BUILD_ID","environment","instance","SILENCE_REPORT","console","dir","depth","formattedLog","error","log"],"sources":["../../../src/utils/report/output.ts"],"sourcesContent":["import { randomUUID } from 'crypto';\nimport callsite from 'callsite';\nimport stringify from 'json-stringify-safe';\nimport { LogEntry, FullLogEntry } from './output.types';\nimport { LogSeverity } from 'const';\n\n// NOTE: Server instance id (helpful for distributed logs)\nexport const INSTANCE_ID = randomUUID();\n\n// ANSI color codes for terminal output\nconst colors = {\n reset: '\\x1b[0m',\n bright: '\\x1b[1m',\n dim: '\\x1b[2m',\n red: '\\x1b[31m',\n green: '\\x1b[32m',\n yellow: '\\x1b[33m',\n blue: '\\x1b[34m',\n magenta: '\\x1b[35m',\n cyan: '\\x1b[36m',\n white: '\\x1b[37m',\n gray: '\\x1b[90m'\n};\n\n/**\n * Get color for log severity level\n */\nfunction getSeverityColor(severity?: string): string {\n switch (severity) {\n case LogSeverity.DEBUG:\n return colors.cyan;\n case LogSeverity.INFO:\n return colors.green;\n case LogSeverity.WARNING:\n return colors.yellow;\n case LogSeverity.ERROR:\n return colors.red;\n case LogSeverity.CRITICAL:\n return `${colors.bright}${colors.red}`;\n default:\n return colors.white;\n }\n}\n\n/**\n * Format log entry for human-readable local development output\n */\nfunction formatLocalLog(entry: FullLogEntry): string {\n const timestamp = new Date().toISOString();\n const severity = entry.severity || 'INFO';\n const severityColor = getSeverityColor(severity);\n \n const parts: string[] = [];\n \n // Timestamp and severity\n parts.push(\n `${colors.gray}[${timestamp}]${colors.reset} ${severityColor}${severity.padEnd(8)}${colors.reset}`\n );\n \n // File location\n if (entry.fileName) {\n parts.push(`${colors.dim}${entry.fileName}:${entry.lineNumber || '?'}${colors.reset}`);\n }\n \n // Message\n if (entry.message) {\n parts.push(`${colors.bright}${entry.message}${colors.reset}`);\n }\n \n let output = parts.join(' ');\n \n // Error details\n if (entry.errorType) {\n output += `\\n ${colors.red}Error Type:${colors.reset} ${entry.errorType}`;\n }\n \n if (entry.errorCode) {\n output += `\\n ${colors.red}Error Code:${colors.reset} ${entry.errorCode}`;\n }\n \n if (entry.statusCode) {\n const statusColor = entry.statusCode >= 500 ? colors.red : entry.statusCode >= 400 ? colors.yellow : colors.green;\n output += `\\n ${colors.cyan}Status:${colors.reset} ${statusColor}${entry.statusCode}${colors.reset}`;\n }\n \n // Stack trace\n if (entry.stack_trace) {\n output += `\\n${colors.gray}Stack Trace:${colors.reset}\\n${colors.dim}${entry.stack_trace}${colors.reset}`;\n }\n \n // Additional data\n if (entry.data && Object.keys(entry.data).length > 0) {\n output += `\\n${colors.cyan}Data:${colors.reset}\\n${colors.dim}${JSON.stringify(entry.data, null, 2)}${colors.reset}`;\n }\n \n // HTTP request context\n if (entry.context?.httpRequest) {\n const req = entry.context.httpRequest;\n output += `\\n${colors.magenta}Request:${colors.reset}`;\n output += `\\n ${colors.dim}${req.method} ${req.url}${colors.reset}`;\n if (req.userAgent) {\n output += `\\n ${colors.dim}User-Agent: ${req.userAgent}${colors.reset}`;\n }\n if (req.remoteIp) {\n output += `\\n ${colors.dim}IP: ${req.remoteIp}${colors.reset}`;\n }\n }\n \n return output;\n}\n\n/**\n * Check if running in local development environment\n */\nfunction isLocalDevelopment(): boolean {\n // Allow forcing local format via environment variable\n if (process.env.LOG_FORMAT === 'local') return true;\n if (process.env.LOG_FORMAT === 'json') return false;\n \n return (\n process.env.NODE_ENV === 'development' ||\n process.env.NODE_ENV === 'dev' ||\n (!process.env.NODE_ENV && !process.env.KUBERNETES_POD_NAME && !process.env.CLOUD_RUN_JOB)\n );\n}\n\n/** Add metadata to the log entry and print it */\nexport function output(data: LogEntry): FullLogEntry {\n // Gather useful information about where the logger was called from\n const call = callsite()[2];\n\n // Append additional metadata to the log entry\n const fullEntry: FullLogEntry = {\n ...data,\n lineNumber: call.getLineNumber(),\n fileName: call\n .getFileName()\n .replace(/.*node_modules\\//, '')\n .replace(/.*src\\//, 'src/'),\n serviceContext: {\n service: process.env.CHART ?? process.env.HOSTNAME,\n version: process.env.BUILD_ID,\n environment: process.env.NODE_ENV,\n instance: process.env.KUBERNETES_POD_NAME ?? INSTANCE_ID\n }\n };\n\n // Ignore when silenced\n if (process.env.SILENCE_REPORT) return fullEntry;\n\n if (process.env.NODE_ENV === 'test') {\n // In test mode pretty print with full depth\n console.dir(fullEntry, { depth: 5 });\n } else if (isLocalDevelopment()) {\n // Local development: use formatted, colorized output\n const formattedLog = formatLocalLog(fullEntry);\n if (data.severity === LogSeverity.ERROR || data.severity === LogSeverity.CRITICAL || (data.statusCode && data.statusCode >= 500)) {\n console.error(formattedLog);\n } else {\n console.log(formattedLog);\n }\n } else {\n // Production/GCP: use JSON format for structured logging\n const entry = stringify(fullEntry);\n if (data.statusCode && data.statusCode >= 500) {\n console.error(entry);\n } else {\n console.log(entry);\n }\n }\n \n return fullEntry;\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,kBAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,MAAA,GAAAJ,OAAA;AAEA;AACO,MAAMK,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG,IAAAE,kBAAU,EAAC,CAAC;;AAEvC;AACA,MAAMC,MAAM,GAAG;EACbC,KAAK,EAAE,SAAS;EAChBC,MAAM,EAAE,SAAS;EACjBC,GAAG,EAAE,SAAS;EACdC,GAAG,EAAE,UAAU;EACfC,KAAK,EAAE,UAAU;EACjBC,MAAM,EAAE,UAAU;EAClBC,IAAI,EAAE,UAAU;EAChBC,OAAO,EAAE,UAAU;EACnBC,IAAI,EAAE,UAAU;EAChBC,KAAK,EAAE,UAAU;EACjBC,IAAI,EAAE;AACR,CAAC;;AAED;AACA;AACA;AACA,SAASC,gBAAgBA,CAACC,QAAiB,EAAU;EACnD,QAAQA,QAAQ;IACd,KAAKC,kBAAW,CAACC,KAAK;MACpB,OAAOf,MAAM,CAACS,IAAI;IACpB,KAAKK,kBAAW,CAACE,IAAI;MACnB,OAAOhB,MAA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S,EAACiB,SAAS,CAAC;IAClC,IAAItB,IAAI,CAACH,UAAU,IAAIG,IAAI,CAACH,UAAU,IAAI,GAAG,EAAE;MAC7CsC,OAAO,CAACI,KAAK,CAACzD,KAAK,CAAC;IACtB,CAAC,MAAM;MACLqD,OAAO,CAACK,GAAG,CAAC1D,KAAK,CAAC;IACpB;EACF;EAEA,OAAOwC,SAAS;AAClB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-server-engine",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Framework used to develop backend services. This package ships with a lot of features to standardize the creation of services, letting you focus on the business logic.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|