@platformatic/node 3.4.1 → 3.5.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/config.d.ts +343 -4
- package/index.js +23 -399
- package/lib/capability.js +407 -0
- package/lib/generator.js +134 -0
- package/lib/schema.js +23 -8
- package/lib/utils.js +69 -0
- package/package.json +17 -15
- package/schema.json +1376 -13
package/config.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* and run json-schema-to-typescript to regenerate this file.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
export interface
|
|
8
|
+
export interface PlatformaticNodeJsConfig {
|
|
9
9
|
$schema?: string;
|
|
10
10
|
logger?: {
|
|
11
11
|
level: (
|
|
@@ -29,8 +29,6 @@ export interface PlatformaticNodeJsStackable {
|
|
|
29
29
|
[k: string]: unknown;
|
|
30
30
|
};
|
|
31
31
|
level?: string;
|
|
32
|
-
additionalProperties?: never;
|
|
33
|
-
[k: string]: unknown;
|
|
34
32
|
}[];
|
|
35
33
|
options?: {
|
|
36
34
|
[k: string]: unknown;
|
|
@@ -42,6 +40,21 @@ export interface PlatformaticNodeJsStackable {
|
|
|
42
40
|
[k: string]: unknown;
|
|
43
41
|
};
|
|
44
42
|
};
|
|
43
|
+
formatters?: {
|
|
44
|
+
path: string;
|
|
45
|
+
};
|
|
46
|
+
timestamp?: "epochTime" | "unixTime" | "nullTime" | "isoTime";
|
|
47
|
+
redact?: {
|
|
48
|
+
paths: string[];
|
|
49
|
+
censor?: string;
|
|
50
|
+
};
|
|
51
|
+
base?: {
|
|
52
|
+
[k: string]: unknown;
|
|
53
|
+
} | null;
|
|
54
|
+
messageKey?: string;
|
|
55
|
+
customLevels?: {
|
|
56
|
+
[k: string]: unknown;
|
|
57
|
+
};
|
|
45
58
|
[k: string]: unknown;
|
|
46
59
|
};
|
|
47
60
|
server?: {
|
|
@@ -49,6 +62,7 @@ export interface PlatformaticNodeJsStackable {
|
|
|
49
62
|
port?: number | string;
|
|
50
63
|
http2?: boolean;
|
|
51
64
|
https?: {
|
|
65
|
+
allowHTTP1?: boolean;
|
|
52
66
|
key:
|
|
53
67
|
| string
|
|
54
68
|
| {
|
|
@@ -71,6 +85,8 @@ export interface PlatformaticNodeJsStackable {
|
|
|
71
85
|
path?: string;
|
|
72
86
|
}
|
|
73
87
|
)[];
|
|
88
|
+
requestCert?: boolean;
|
|
89
|
+
rejectUnauthorized?: boolean;
|
|
74
90
|
};
|
|
75
91
|
};
|
|
76
92
|
watch?:
|
|
@@ -95,11 +111,334 @@ export interface PlatformaticNodeJsStackable {
|
|
|
95
111
|
production?: string;
|
|
96
112
|
};
|
|
97
113
|
};
|
|
114
|
+
runtime?: {
|
|
115
|
+
preload?: string | string[];
|
|
116
|
+
basePath?: string;
|
|
117
|
+
services?: {
|
|
118
|
+
[k: string]: unknown;
|
|
119
|
+
}[];
|
|
120
|
+
workers?: number | string;
|
|
121
|
+
logger?: {
|
|
122
|
+
level: (
|
|
123
|
+
| ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent")
|
|
124
|
+
| {
|
|
125
|
+
[k: string]: unknown;
|
|
126
|
+
}
|
|
127
|
+
) &
|
|
128
|
+
string;
|
|
129
|
+
transport?:
|
|
130
|
+
| {
|
|
131
|
+
target?: string;
|
|
132
|
+
options?: {
|
|
133
|
+
[k: string]: unknown;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
| {
|
|
137
|
+
targets?: {
|
|
138
|
+
target?: string;
|
|
139
|
+
options?: {
|
|
140
|
+
[k: string]: unknown;
|
|
141
|
+
};
|
|
142
|
+
level?: string;
|
|
143
|
+
}[];
|
|
144
|
+
options?: {
|
|
145
|
+
[k: string]: unknown;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
pipeline?: {
|
|
149
|
+
target?: string;
|
|
150
|
+
options?: {
|
|
151
|
+
[k: string]: unknown;
|
|
152
|
+
};
|
|
153
|
+
};
|
|
154
|
+
formatters?: {
|
|
155
|
+
path: string;
|
|
156
|
+
};
|
|
157
|
+
timestamp?: "epochTime" | "unixTime" | "nullTime" | "isoTime";
|
|
158
|
+
redact?: {
|
|
159
|
+
paths: string[];
|
|
160
|
+
censor?: string;
|
|
161
|
+
};
|
|
162
|
+
base?: {
|
|
163
|
+
[k: string]: unknown;
|
|
164
|
+
} | null;
|
|
165
|
+
messageKey?: string;
|
|
166
|
+
customLevels?: {
|
|
167
|
+
[k: string]: unknown;
|
|
168
|
+
};
|
|
169
|
+
[k: string]: unknown;
|
|
170
|
+
};
|
|
171
|
+
server?: {
|
|
172
|
+
hostname?: string;
|
|
173
|
+
port?: number | string;
|
|
174
|
+
http2?: boolean;
|
|
175
|
+
https?: {
|
|
176
|
+
allowHTTP1?: boolean;
|
|
177
|
+
key:
|
|
178
|
+
| string
|
|
179
|
+
| {
|
|
180
|
+
path?: string;
|
|
181
|
+
}
|
|
182
|
+
| (
|
|
183
|
+
| string
|
|
184
|
+
| {
|
|
185
|
+
path?: string;
|
|
186
|
+
}
|
|
187
|
+
)[];
|
|
188
|
+
cert:
|
|
189
|
+
| string
|
|
190
|
+
| {
|
|
191
|
+
path?: string;
|
|
192
|
+
}
|
|
193
|
+
| (
|
|
194
|
+
| string
|
|
195
|
+
| {
|
|
196
|
+
path?: string;
|
|
197
|
+
}
|
|
198
|
+
)[];
|
|
199
|
+
requestCert?: boolean;
|
|
200
|
+
rejectUnauthorized?: boolean;
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
startTimeout?: number;
|
|
204
|
+
restartOnError?: boolean | number;
|
|
205
|
+
exitOnUnhandledErrors?: boolean;
|
|
206
|
+
gracefulShutdown?: {
|
|
207
|
+
runtime: number | string;
|
|
208
|
+
application: number | string;
|
|
209
|
+
};
|
|
210
|
+
health?: {
|
|
211
|
+
enabled?: boolean | string;
|
|
212
|
+
interval?: number | string;
|
|
213
|
+
gracePeriod?: number | string;
|
|
214
|
+
maxUnhealthyChecks?: number | string;
|
|
215
|
+
maxELU?: number | string;
|
|
216
|
+
maxHeapUsed?: number | string;
|
|
217
|
+
maxHeapTotal?: number | string;
|
|
218
|
+
maxYoungGeneration?: number | string;
|
|
219
|
+
};
|
|
220
|
+
undici?: {
|
|
221
|
+
agentOptions?: {
|
|
222
|
+
[k: string]: unknown;
|
|
223
|
+
};
|
|
224
|
+
interceptors?:
|
|
225
|
+
| {
|
|
226
|
+
module: string;
|
|
227
|
+
options: {
|
|
228
|
+
[k: string]: unknown;
|
|
229
|
+
};
|
|
230
|
+
[k: string]: unknown;
|
|
231
|
+
}[]
|
|
232
|
+
| {
|
|
233
|
+
Client?: {
|
|
234
|
+
module: string;
|
|
235
|
+
options: {
|
|
236
|
+
[k: string]: unknown;
|
|
237
|
+
};
|
|
238
|
+
[k: string]: unknown;
|
|
239
|
+
}[];
|
|
240
|
+
Pool?: {
|
|
241
|
+
module: string;
|
|
242
|
+
options: {
|
|
243
|
+
[k: string]: unknown;
|
|
244
|
+
};
|
|
245
|
+
[k: string]: unknown;
|
|
246
|
+
}[];
|
|
247
|
+
Agent?: {
|
|
248
|
+
module: string;
|
|
249
|
+
options: {
|
|
250
|
+
[k: string]: unknown;
|
|
251
|
+
};
|
|
252
|
+
[k: string]: unknown;
|
|
253
|
+
}[];
|
|
254
|
+
[k: string]: unknown;
|
|
255
|
+
};
|
|
256
|
+
[k: string]: unknown;
|
|
257
|
+
};
|
|
258
|
+
httpCache?:
|
|
259
|
+
| boolean
|
|
260
|
+
| {
|
|
261
|
+
store?: string;
|
|
262
|
+
/**
|
|
263
|
+
* @minItems 1
|
|
264
|
+
*/
|
|
265
|
+
methods?: [string, ...string[]];
|
|
266
|
+
cacheTagsHeader?: string;
|
|
267
|
+
maxSize?: number;
|
|
268
|
+
maxEntrySize?: number;
|
|
269
|
+
maxCount?: number;
|
|
270
|
+
[k: string]: unknown;
|
|
271
|
+
};
|
|
272
|
+
watch?: boolean | string;
|
|
273
|
+
managementApi?:
|
|
274
|
+
| boolean
|
|
275
|
+
| string
|
|
276
|
+
| {
|
|
277
|
+
logs?: {
|
|
278
|
+
maxSize?: number;
|
|
279
|
+
};
|
|
280
|
+
};
|
|
281
|
+
metrics?:
|
|
282
|
+
| boolean
|
|
283
|
+
| {
|
|
284
|
+
port?: number | string;
|
|
285
|
+
enabled?: boolean | string;
|
|
286
|
+
hostname?: string;
|
|
287
|
+
endpoint?: string;
|
|
288
|
+
auth?: {
|
|
289
|
+
username: string;
|
|
290
|
+
password: string;
|
|
291
|
+
};
|
|
292
|
+
labels?: {
|
|
293
|
+
[k: string]: string;
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* The label name to use for the application identifier in metrics (e.g., applicationId, serviceId)
|
|
297
|
+
*/
|
|
298
|
+
applicationLabel?: string;
|
|
299
|
+
readiness?:
|
|
300
|
+
| boolean
|
|
301
|
+
| {
|
|
302
|
+
endpoint?: string;
|
|
303
|
+
success?: {
|
|
304
|
+
statusCode?: number;
|
|
305
|
+
body?: string;
|
|
306
|
+
};
|
|
307
|
+
fail?: {
|
|
308
|
+
statusCode?: number;
|
|
309
|
+
body?: string;
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
liveness?:
|
|
313
|
+
| boolean
|
|
314
|
+
| {
|
|
315
|
+
endpoint?: string;
|
|
316
|
+
success?: {
|
|
317
|
+
statusCode?: number;
|
|
318
|
+
body?: string;
|
|
319
|
+
};
|
|
320
|
+
fail?: {
|
|
321
|
+
statusCode?: number;
|
|
322
|
+
body?: string;
|
|
323
|
+
};
|
|
324
|
+
};
|
|
325
|
+
plugins?: string[];
|
|
326
|
+
};
|
|
327
|
+
telemetry?: {
|
|
328
|
+
enabled?: boolean | string;
|
|
329
|
+
/**
|
|
330
|
+
* The name of the application. Defaults to the folder name if not specified.
|
|
331
|
+
*/
|
|
332
|
+
applicationName: string;
|
|
333
|
+
/**
|
|
334
|
+
* The version of the application (optional)
|
|
335
|
+
*/
|
|
336
|
+
version?: string;
|
|
337
|
+
/**
|
|
338
|
+
* An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced.
|
|
339
|
+
*/
|
|
340
|
+
skip?: {
|
|
341
|
+
/**
|
|
342
|
+
* The path to skip. Can be a string or a regex.
|
|
343
|
+
*/
|
|
344
|
+
path?: string;
|
|
345
|
+
/**
|
|
346
|
+
* HTTP method to skip
|
|
347
|
+
*/
|
|
348
|
+
method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
|
|
349
|
+
[k: string]: unknown;
|
|
350
|
+
}[];
|
|
351
|
+
exporter?:
|
|
352
|
+
| {
|
|
353
|
+
type?: "console" | "otlp" | "zipkin" | "memory" | "file";
|
|
354
|
+
/**
|
|
355
|
+
* Options for the exporter. These are passed directly to the exporter.
|
|
356
|
+
*/
|
|
357
|
+
options?: {
|
|
358
|
+
/**
|
|
359
|
+
* The URL to send the traces to. Not used for console or memory exporters.
|
|
360
|
+
*/
|
|
361
|
+
url?: string;
|
|
362
|
+
/**
|
|
363
|
+
* Headers to send to the exporter. Not used for console or memory exporters.
|
|
364
|
+
*/
|
|
365
|
+
headers?: {
|
|
366
|
+
[k: string]: unknown;
|
|
367
|
+
};
|
|
368
|
+
/**
|
|
369
|
+
* The path to write the traces to. Only for file exporter.
|
|
370
|
+
*/
|
|
371
|
+
path?: string;
|
|
372
|
+
[k: string]: unknown;
|
|
373
|
+
};
|
|
374
|
+
additionalProperties?: never;
|
|
375
|
+
[k: string]: unknown;
|
|
376
|
+
}[]
|
|
377
|
+
| {
|
|
378
|
+
type?: "console" | "otlp" | "zipkin" | "memory" | "file";
|
|
379
|
+
/**
|
|
380
|
+
* Options for the exporter. These are passed directly to the exporter.
|
|
381
|
+
*/
|
|
382
|
+
options?: {
|
|
383
|
+
/**
|
|
384
|
+
* The URL to send the traces to. Not used for console or memory exporters.
|
|
385
|
+
*/
|
|
386
|
+
url?: string;
|
|
387
|
+
/**
|
|
388
|
+
* Headers to send to the exporter. Not used for console or memory exporters.
|
|
389
|
+
*/
|
|
390
|
+
headers?: {
|
|
391
|
+
[k: string]: unknown;
|
|
392
|
+
};
|
|
393
|
+
/**
|
|
394
|
+
* The path to write the traces to. Only for file exporter.
|
|
395
|
+
*/
|
|
396
|
+
path?: string;
|
|
397
|
+
[k: string]: unknown;
|
|
398
|
+
};
|
|
399
|
+
additionalProperties?: never;
|
|
400
|
+
[k: string]: unknown;
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
inspectorOptions?: {
|
|
404
|
+
host?: string;
|
|
405
|
+
port?: number;
|
|
406
|
+
breakFirstLine?: boolean;
|
|
407
|
+
watchDisabled?: boolean;
|
|
408
|
+
[k: string]: unknown;
|
|
409
|
+
};
|
|
410
|
+
applicationTimeout?: number | string;
|
|
411
|
+
messagingTimeout?: number | string;
|
|
412
|
+
env?: {
|
|
413
|
+
[k: string]: string;
|
|
414
|
+
};
|
|
415
|
+
sourceMaps?: boolean;
|
|
416
|
+
scheduler?: {
|
|
417
|
+
enabled?: boolean | string;
|
|
418
|
+
name: string;
|
|
419
|
+
cron: string;
|
|
420
|
+
callbackUrl: string;
|
|
421
|
+
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
422
|
+
headers?: {
|
|
423
|
+
[k: string]: string;
|
|
424
|
+
};
|
|
425
|
+
body?:
|
|
426
|
+
| string
|
|
427
|
+
| {
|
|
428
|
+
[k: string]: unknown;
|
|
429
|
+
};
|
|
430
|
+
maxRetries?: number;
|
|
431
|
+
[k: string]: unknown;
|
|
432
|
+
}[];
|
|
433
|
+
};
|
|
98
434
|
node?: {
|
|
99
435
|
main?: string;
|
|
100
436
|
/**
|
|
101
|
-
* This Node.js application requires the Absolute URL from the
|
|
437
|
+
* This Node.js application requires the Absolute URL from the Gateway
|
|
102
438
|
*/
|
|
103
439
|
absoluteUrl?: boolean;
|
|
440
|
+
dispatchViaHttp?: boolean;
|
|
441
|
+
disablePlatformaticInBuild?: boolean;
|
|
442
|
+
hasServer?: boolean;
|
|
104
443
|
};
|
|
105
444
|
}
|