@platformatic/nest 3.68.0 → 3.70.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.
Files changed (3) hide show
  1. package/config.d.ts +96 -14
  2. package/package.json +8 -8
  3. package/schema.json +157 -33
package/config.d.ts CHANGED
@@ -9,13 +9,10 @@ export interface PlatformaticNestJSConfig {
9
9
  $schema?: string;
10
10
  module?: string;
11
11
  logger?: {
12
- level?: (
13
- | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent")
14
- | {
15
- [k: string]: unknown;
16
- }
17
- ) &
18
- string;
12
+ /**
13
+ * The log level. It must be one of the standard pino levels (fatal, error, warn, info, debug, trace, silent) or, when customLevels is set, one of the custom levels.
14
+ */
15
+ level?: string;
19
16
  transport?:
20
17
  | {
21
18
  target?: string;
@@ -48,6 +45,10 @@ export interface PlatformaticNestJSConfig {
48
45
  redact?: {
49
46
  paths: string[];
50
47
  censor?: string;
48
+ /**
49
+ * Remove the redacted keys entirely instead of replacing their values with the censor. Defaults to false.
50
+ */
51
+ remove?: boolean;
51
52
  };
52
53
  base?: {
53
54
  [k: string]: unknown;
@@ -56,6 +57,46 @@ export interface PlatformaticNestJSConfig {
56
57
  customLevels?: {
57
58
  [k: string]: unknown;
58
59
  };
60
+ /**
61
+ * The numeric value of the level defined in level, when it is not one of the standard pino levels.
62
+ */
63
+ levelVal?: number;
64
+ /**
65
+ * Only use the levels defined in customLevels and omit the standard pino ones.
66
+ */
67
+ useOnlyCustomLevels?: boolean;
68
+ /**
69
+ * How log levels are compared to the logger level. Use DESC when lower values are more severe. Defaults to ASC.
70
+ */
71
+ levelComparison?: "ASC" | "DESC";
72
+ /**
73
+ * A string prefixed to every message, including the ones of child loggers.
74
+ */
75
+ msgPrefix?: string;
76
+ /**
77
+ * The key under which any logged object is placed.
78
+ */
79
+ nestedKey?: string;
80
+ /**
81
+ * The key used for the serialized error in the log object. Defaults to err.
82
+ */
83
+ errorKey?: string;
84
+ /**
85
+ * The stringification limit at a specific nesting depth when logging circular objects. Defaults to 5.
86
+ */
87
+ depthLimit?: number;
88
+ /**
89
+ * The stringification limit of properties or elements when logging a circular object or array. Defaults to 100.
90
+ */
91
+ edgeLimit?: number;
92
+ /**
93
+ * Terminate each log line with \r\n instead of \n. Defaults to false.
94
+ */
95
+ crlf?: boolean;
96
+ /**
97
+ * Set to false to disable logging entirely. Defaults to true.
98
+ */
99
+ enabled?: boolean;
59
100
  openTelemetryExporter?: {
60
101
  protocol: "grpc" | "http";
61
102
  url: string;
@@ -171,13 +212,10 @@ export interface PlatformaticNestJSConfig {
171
212
  };
172
213
  workersRestartDelay?: number | string;
173
214
  logger?: {
174
- level?: (
175
- | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent")
176
- | {
177
- [k: string]: unknown;
178
- }
179
- ) &
180
- string;
215
+ /**
216
+ * The log level. It must be one of the standard pino levels (fatal, error, warn, info, debug, trace, silent) or, when customLevels is set, one of the custom levels.
217
+ */
218
+ level?: string;
181
219
  transport?:
182
220
  | {
183
221
  target?: string;
@@ -210,6 +248,10 @@ export interface PlatformaticNestJSConfig {
210
248
  redact?: {
211
249
  paths: string[];
212
250
  censor?: string;
251
+ /**
252
+ * Remove the redacted keys entirely instead of replacing their values with the censor. Defaults to false.
253
+ */
254
+ remove?: boolean;
213
255
  };
214
256
  base?: {
215
257
  [k: string]: unknown;
@@ -218,6 +260,46 @@ export interface PlatformaticNestJSConfig {
218
260
  customLevels?: {
219
261
  [k: string]: unknown;
220
262
  };
263
+ /**
264
+ * The numeric value of the level defined in level, when it is not one of the standard pino levels.
265
+ */
266
+ levelVal?: number;
267
+ /**
268
+ * Only use the levels defined in customLevels and omit the standard pino ones.
269
+ */
270
+ useOnlyCustomLevels?: boolean;
271
+ /**
272
+ * How log levels are compared to the logger level. Use DESC when lower values are more severe. Defaults to ASC.
273
+ */
274
+ levelComparison?: "ASC" | "DESC";
275
+ /**
276
+ * A string prefixed to every message, including the ones of child loggers.
277
+ */
278
+ msgPrefix?: string;
279
+ /**
280
+ * The key under which any logged object is placed.
281
+ */
282
+ nestedKey?: string;
283
+ /**
284
+ * The key used for the serialized error in the log object. Defaults to err.
285
+ */
286
+ errorKey?: string;
287
+ /**
288
+ * The stringification limit at a specific nesting depth when logging circular objects. Defaults to 5.
289
+ */
290
+ depthLimit?: number;
291
+ /**
292
+ * The stringification limit of properties or elements when logging a circular object or array. Defaults to 100.
293
+ */
294
+ edgeLimit?: number;
295
+ /**
296
+ * Terminate each log line with \r\n instead of \n. Defaults to false.
297
+ */
298
+ crlf?: boolean;
299
+ /**
300
+ * Set to false to disable logging entirely. Defaults to true.
301
+ */
302
+ enabled?: boolean;
221
303
  openTelemetryExporter?: {
222
304
  protocol: "grpc" | "http";
223
305
  url: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/nest",
3
- "version": "3.68.0",
3
+ "version": "3.70.0",
4
4
  "description": "Platformatic Nest.js Capability",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -18,10 +18,10 @@
18
18
  "get-port": "^7.1.0",
19
19
  "light-my-request": "^6.0.0",
20
20
  "pino-http": "^10.2.0",
21
- "@platformatic/basic": "3.68.0",
22
- "@platformatic/foundation": "3.68.0",
23
- "@platformatic/generators": "3.68.0",
24
- "@platformatic/globals": "3.68.0"
21
+ "@platformatic/basic": "3.70.0",
22
+ "@platformatic/generators": "3.70.0",
23
+ "@platformatic/globals": "3.70.0",
24
+ "@platformatic/foundation": "3.70.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@nestjs/cli": "^11.0.7",
@@ -32,11 +32,11 @@
32
32
  "eslint": "9",
33
33
  "json-schema-to-typescript": "^15.0.1",
34
34
  "neostandard": "^0.12.0",
35
- "tstyche": "^6.2.0",
35
+ "tstyche": "^7.0.0",
36
36
  "tsx": "^4.19.0",
37
37
  "typescript": "~6.0.3",
38
- "@platformatic/gateway": "3.68.0",
39
- "@platformatic/service": "3.68.0"
38
+ "@platformatic/gateway": "3.70.0",
39
+ "@platformatic/service": "3.70.0"
40
40
  },
41
41
  "engines": {
42
42
  "node": ">=22.19.0"
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/nest/3.68.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/nest/3.70.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic NestJS Config",
5
5
  "type": "object",
@@ -15,22 +15,7 @@
15
15
  "properties": {
16
16
  "level": {
17
17
  "type": "string",
18
- "oneOf": [
19
- {
20
- "enum": [
21
- "fatal",
22
- "error",
23
- "warn",
24
- "info",
25
- "debug",
26
- "trace",
27
- "silent"
28
- ]
29
- },
30
- {
31
- "pattern": "^\\{.+\\}$"
32
- }
33
- ]
18
+ "description": "The log level. It must be one of the standard pino levels (fatal, error, warn, info, debug, trace, silent) or, when customLevels is set, one of the custom levels."
34
19
  },
35
20
  "transport": {
36
21
  "anyOf": [
@@ -131,6 +116,10 @@
131
116
  "censor": {
132
117
  "type": "string",
133
118
  "default": "[redacted]"
119
+ },
120
+ "remove": {
121
+ "type": "boolean",
122
+ "description": "Remove the redacted keys entirely instead of replacing their values with the censor. Defaults to false."
134
123
  }
135
124
  },
136
125
  "required": [
@@ -156,6 +145,50 @@
156
145
  "type": "object",
157
146
  "additionalProperties": true
158
147
  },
148
+ "levelVal": {
149
+ "type": "integer",
150
+ "description": "The numeric value of the level defined in level, when it is not one of the standard pino levels."
151
+ },
152
+ "useOnlyCustomLevels": {
153
+ "type": "boolean",
154
+ "description": "Only use the levels defined in customLevels and omit the standard pino ones."
155
+ },
156
+ "levelComparison": {
157
+ "type": "string",
158
+ "enum": [
159
+ "ASC",
160
+ "DESC"
161
+ ],
162
+ "description": "How log levels are compared to the logger level. Use DESC when lower values are more severe. Defaults to ASC."
163
+ },
164
+ "msgPrefix": {
165
+ "type": "string",
166
+ "description": "A string prefixed to every message, including the ones of child loggers."
167
+ },
168
+ "nestedKey": {
169
+ "type": "string",
170
+ "description": "The key under which any logged object is placed."
171
+ },
172
+ "errorKey": {
173
+ "type": "string",
174
+ "description": "The key used for the serialized error in the log object. Defaults to err."
175
+ },
176
+ "depthLimit": {
177
+ "type": "integer",
178
+ "description": "The stringification limit at a specific nesting depth when logging circular objects. Defaults to 5."
179
+ },
180
+ "edgeLimit": {
181
+ "type": "integer",
182
+ "description": "The stringification limit of properties or elements when logging a circular object or array. Defaults to 100."
183
+ },
184
+ "crlf": {
185
+ "type": "boolean",
186
+ "description": "Terminate each log line with \\r\\n instead of \\n. Defaults to false."
187
+ },
188
+ "enabled": {
189
+ "type": "boolean",
190
+ "description": "Set to false to disable logging entirely. Defaults to true."
191
+ },
159
192
  "openTelemetryExporter": {
160
193
  "type": "object",
161
194
  "properties": {
@@ -177,6 +210,35 @@
177
210
  "additionalProperties": false
178
211
  }
179
212
  },
213
+ "if": {
214
+ "not": {
215
+ "required": [
216
+ "customLevels"
217
+ ]
218
+ }
219
+ },
220
+ "then": {
221
+ "properties": {
222
+ "level": {
223
+ "oneOf": [
224
+ {
225
+ "enum": [
226
+ "fatal",
227
+ "error",
228
+ "warn",
229
+ "info",
230
+ "debug",
231
+ "trace",
232
+ "silent"
233
+ ]
234
+ },
235
+ {
236
+ "pattern": "^\\{.+\\}$"
237
+ }
238
+ ]
239
+ }
240
+ }
241
+ },
180
242
  "default": {},
181
243
  "additionalProperties": true
182
244
  },
@@ -999,22 +1061,7 @@
999
1061
  "properties": {
1000
1062
  "level": {
1001
1063
  "type": "string",
1002
- "oneOf": [
1003
- {
1004
- "enum": [
1005
- "fatal",
1006
- "error",
1007
- "warn",
1008
- "info",
1009
- "debug",
1010
- "trace",
1011
- "silent"
1012
- ]
1013
- },
1014
- {
1015
- "pattern": "^\\{.+\\}$"
1016
- }
1017
- ]
1064
+ "description": "The log level. It must be one of the standard pino levels (fatal, error, warn, info, debug, trace, silent) or, when customLevels is set, one of the custom levels."
1018
1065
  },
1019
1066
  "transport": {
1020
1067
  "anyOf": [
@@ -1115,6 +1162,10 @@
1115
1162
  "censor": {
1116
1163
  "type": "string",
1117
1164
  "default": "[redacted]"
1165
+ },
1166
+ "remove": {
1167
+ "type": "boolean",
1168
+ "description": "Remove the redacted keys entirely instead of replacing their values with the censor. Defaults to false."
1118
1169
  }
1119
1170
  },
1120
1171
  "required": [
@@ -1140,6 +1191,50 @@
1140
1191
  "type": "object",
1141
1192
  "additionalProperties": true
1142
1193
  },
1194
+ "levelVal": {
1195
+ "type": "integer",
1196
+ "description": "The numeric value of the level defined in level, when it is not one of the standard pino levels."
1197
+ },
1198
+ "useOnlyCustomLevels": {
1199
+ "type": "boolean",
1200
+ "description": "Only use the levels defined in customLevels and omit the standard pino ones."
1201
+ },
1202
+ "levelComparison": {
1203
+ "type": "string",
1204
+ "enum": [
1205
+ "ASC",
1206
+ "DESC"
1207
+ ],
1208
+ "description": "How log levels are compared to the logger level. Use DESC when lower values are more severe. Defaults to ASC."
1209
+ },
1210
+ "msgPrefix": {
1211
+ "type": "string",
1212
+ "description": "A string prefixed to every message, including the ones of child loggers."
1213
+ },
1214
+ "nestedKey": {
1215
+ "type": "string",
1216
+ "description": "The key under which any logged object is placed."
1217
+ },
1218
+ "errorKey": {
1219
+ "type": "string",
1220
+ "description": "The key used for the serialized error in the log object. Defaults to err."
1221
+ },
1222
+ "depthLimit": {
1223
+ "type": "integer",
1224
+ "description": "The stringification limit at a specific nesting depth when logging circular objects. Defaults to 5."
1225
+ },
1226
+ "edgeLimit": {
1227
+ "type": "integer",
1228
+ "description": "The stringification limit of properties or elements when logging a circular object or array. Defaults to 100."
1229
+ },
1230
+ "crlf": {
1231
+ "type": "boolean",
1232
+ "description": "Terminate each log line with \\r\\n instead of \\n. Defaults to false."
1233
+ },
1234
+ "enabled": {
1235
+ "type": "boolean",
1236
+ "description": "Set to false to disable logging entirely. Defaults to true."
1237
+ },
1143
1238
  "openTelemetryExporter": {
1144
1239
  "type": "object",
1145
1240
  "properties": {
@@ -1161,6 +1256,35 @@
1161
1256
  "additionalProperties": false
1162
1257
  }
1163
1258
  },
1259
+ "if": {
1260
+ "not": {
1261
+ "required": [
1262
+ "customLevels"
1263
+ ]
1264
+ }
1265
+ },
1266
+ "then": {
1267
+ "properties": {
1268
+ "level": {
1269
+ "oneOf": [
1270
+ {
1271
+ "enum": [
1272
+ "fatal",
1273
+ "error",
1274
+ "warn",
1275
+ "info",
1276
+ "debug",
1277
+ "trace",
1278
+ "silent"
1279
+ ]
1280
+ },
1281
+ {
1282
+ "pattern": "^\\{.+\\}$"
1283
+ }
1284
+ ]
1285
+ }
1286
+ }
1287
+ },
1164
1288
  "default": {},
1165
1289
  "additionalProperties": true
1166
1290
  },