@platformatic/nitro 3.74.0 → 3.75.1

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 CHANGED
@@ -122,6 +122,14 @@ export interface PlatformaticNitroConfig {
122
122
  * The maximum length of the queue of pending connections
123
123
  */
124
124
  backlog?: number;
125
+ /**
126
+ * The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed. When running behind a load balancer, set it higher than the load balancer idle timeout.
127
+ */
128
+ keepAliveTimeout?: number;
129
+ /**
130
+ * The number of milliseconds to wait to receive the complete HTTP headers from the client. It should be greater than keepAliveTimeout.
131
+ */
132
+ headersTimeout?: number;
125
133
  https?: {
126
134
  allowHTTP1?: boolean;
127
135
  key:
@@ -156,8 +164,8 @@ export interface PlatformaticNitroConfig {
156
164
  /**
157
165
  * @minItems 1
158
166
  */
159
- allow?: [string, ...string[]];
160
- ignore?: string[];
167
+ allow?: [string, ...string[]] | null;
168
+ ignore?: string[] | null;
161
169
  }
162
170
  | boolean
163
171
  | string;
@@ -198,9 +206,108 @@ export interface PlatformaticNitroConfig {
198
206
  }
199
207
  )[];
200
208
  basePath?: string;
201
- services?: {
209
+ services?: ({
202
210
  [k: string]: unknown;
203
- }[];
211
+ } & {
212
+ id?: string;
213
+ enabled?:
214
+ | boolean
215
+ | string
216
+ | {
217
+ [k: string]: boolean;
218
+ };
219
+ path?: string;
220
+ config?: string;
221
+ url?: string;
222
+ gitBranch?: string;
223
+ useHttp?: boolean;
224
+ websocket?: boolean;
225
+ reuseTcpPorts?: boolean;
226
+ workers?:
227
+ | number
228
+ | string
229
+ | {
230
+ static?: number;
231
+ minimum?: number;
232
+ maximum?: number;
233
+ scaleUpELU?: number;
234
+ scaleDownELU?: number;
235
+ [k: string]: unknown;
236
+ };
237
+ health?: {
238
+ enabled?: boolean | string;
239
+ interval?: number | string;
240
+ gracePeriod?: number | string;
241
+ maxUnhealthyChecks?: number | string;
242
+ maxELU?: number | string;
243
+ maxEventLoopDelay?: number | string;
244
+ maxEventLoopDelayP99?: number | string;
245
+ maxHeapUsed?: number | string;
246
+ maxHeapTotal?: number | string;
247
+ maxYoungGeneration?: number | string;
248
+ codeRangeSize?: number | string;
249
+ bufferPoolSize?: number | string;
250
+ defaultHighWaterMark?: number | string;
251
+ };
252
+ /**
253
+ * Overrides the runtime-level restartOnError for this application. Set to false or 0 to never restart the application when it crashes, a positive number to wait that amount of milliseconds between restarts, or true to use the default delay.
254
+ */
255
+ restartOnError?: boolean | number;
256
+ dependencies?: string[];
257
+ arguments?: string[];
258
+ env?: {
259
+ [k: string]: string;
260
+ };
261
+ envfile?: string;
262
+ sourceMaps?: boolean;
263
+ nodeModulesSourceMaps?: string[];
264
+ packageManager?: "npm" | "pnpm" | "yarn";
265
+ preload?: string | string[];
266
+ nodeOptions?: string;
267
+ execArgv?: string[];
268
+ permissions?: {
269
+ fs?: {
270
+ read?: string[];
271
+ write?: string[];
272
+ };
273
+ };
274
+ telemetry?: {
275
+ /**
276
+ * An array of instrumentations loaded if telemetry is enabled
277
+ */
278
+ instrumentations?: (
279
+ | string
280
+ | {
281
+ package: string;
282
+ exportName?: string;
283
+ options?: {
284
+ [k: string]: unknown;
285
+ };
286
+ [k: string]: unknown;
287
+ }
288
+ )[];
289
+ [k: string]: unknown;
290
+ };
291
+ compileCache?:
292
+ | boolean
293
+ | {
294
+ /**
295
+ * Enable Node.js module compile cache for faster startup
296
+ */
297
+ enabled?: boolean;
298
+ /**
299
+ * Directory to store compile cache. Defaults to .plt/compile-cache in app root
300
+ */
301
+ directory?: string;
302
+ };
303
+ management?:
304
+ | boolean
305
+ | {
306
+ enabled?: boolean;
307
+ operations?: string[];
308
+ };
309
+ [k: string]: unknown;
310
+ })[];
204
311
  workers?:
205
312
  | number
206
313
  | string
@@ -332,6 +439,14 @@ export interface PlatformaticNitroConfig {
332
439
  * The maximum length of the queue of pending connections
333
440
  */
334
441
  backlog?: number;
442
+ /**
443
+ * The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed. When running behind a load balancer, set it higher than the load balancer idle timeout.
444
+ */
445
+ keepAliveTimeout?: number;
446
+ /**
447
+ * The number of milliseconds to wait to receive the complete HTTP headers from the client. It should be greater than keepAliveTimeout.
448
+ */
449
+ headersTimeout?: number;
335
450
  http2?: boolean;
336
451
  https?: {
337
452
  allowHTTP1?: boolean;
@@ -754,6 +869,32 @@ export interface PlatformaticNitroConfig {
754
869
  * Enable the OpenTelemetry diagnostic logger. Diagnostic messages are forwarded to the Platformatic global logger using the current logger level.
755
870
  */
756
871
  diagLogger?: boolean | string;
872
+ /**
873
+ * How much to trace. Omitted, everything is recorded. Either a type out of the set OpenTelemetry defines for OTEL_TRACES_SAMPLER, or a package exporting a sampler.
874
+ */
875
+ sampler?:
876
+ | {
877
+ type:
878
+ | "always_on"
879
+ | "always_off"
880
+ | "traceidratio"
881
+ | "parentbased_always_on"
882
+ | "parentbased_always_off"
883
+ | "parentbased_traceidratio";
884
+ /**
885
+ * Options for the sampler, for instance { "ratio": 0.1 } for the ratio based ones.
886
+ */
887
+ options?: {
888
+ [k: string]: unknown;
889
+ };
890
+ }
891
+ | {
892
+ package: string;
893
+ exportName?: string;
894
+ options?: {
895
+ [k: string]: unknown;
896
+ };
897
+ };
757
898
  };
758
899
  verticalScaler?: {
759
900
  enabled?: boolean;
package/lib/schema.js CHANGED
@@ -32,6 +32,7 @@ delete server.properties.http2
32
32
  const vite = structuredClone(viteSchemaComponents.vite)
33
33
  delete vite.properties.ssr
34
34
  delete vite.properties.notFoundHandler
35
+ delete vite.properties.preCompressed
35
36
 
36
37
  export const schemaComponents = { nitro, vite }
37
38
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/nitro",
3
- "version": "3.74.0",
3
+ "version": "3.75.1",
4
4
  "description": "Platformatic Nitro Capability",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -29,19 +29,19 @@
29
29
  },
30
30
  "homepage": "https://github.com/platformatic/platformatic#readme",
31
31
  "dependencies": {
32
- "@platformatic/basic": "3.74.0",
33
- "@platformatic/foundation": "3.74.0",
34
- "@platformatic/globals": "3.74.0",
35
- "@platformatic/vite": "3.74.0",
32
+ "@platformatic/basic": "3.75.1",
33
+ "@platformatic/foundation": "3.75.1",
34
+ "@platformatic/globals": "3.75.1",
35
+ "@platformatic/vite": "3.75.1",
36
36
  "light-my-request": "^6.6.0",
37
37
  "semver": "^7.6.3"
38
38
  },
39
39
  "devDependencies": {
40
- "@platformatic/gateway": "3.74.0",
41
- "@platformatic/service": "3.74.0",
40
+ "@platformatic/gateway": "3.75.1",
41
+ "@platformatic/service": "3.75.1",
42
42
  "cleaner-spec-reporter": "^2.0.0",
43
43
  "eslint": "9",
44
- "json-schema-to-typescript": "^15.0.1",
44
+ "json-schema-to-typescript": "^16.0.0",
45
45
  "neostandard": "^0.14.0",
46
46
  "nitro": "^3.0.260610-beta",
47
47
  "nitropack": "^2.12.9",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/nitro/3.74.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/nitro/3.75.1.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Nitro Config",
5
5
  "type": "object",
@@ -280,6 +280,16 @@
280
280
  "type": "integer",
281
281
  "description": "The maximum length of the queue of pending connections"
282
282
  },
283
+ "keepAliveTimeout": {
284
+ "type": "integer",
285
+ "minimum": 0,
286
+ "description": "The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed. When running behind a load balancer, set it higher than the load balancer idle timeout."
287
+ },
288
+ "headersTimeout": {
289
+ "type": "integer",
290
+ "minimum": 0,
291
+ "description": "The number of milliseconds to wait to receive the complete HTTP headers from the client. It should be greater than keepAliveTimeout."
292
+ },
283
293
  "https": {
284
294
  "type": "object",
285
295
  "properties": {
@@ -1330,6 +1340,16 @@
1330
1340
  "type": "integer",
1331
1341
  "description": "The maximum length of the queue of pending connections"
1332
1342
  },
1343
+ "keepAliveTimeout": {
1344
+ "type": "integer",
1345
+ "minimum": 0,
1346
+ "description": "The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed. When running behind a load balancer, set it higher than the load balancer idle timeout."
1347
+ },
1348
+ "headersTimeout": {
1349
+ "type": "integer",
1350
+ "minimum": 0,
1351
+ "description": "The number of milliseconds to wait to receive the complete HTTP headers from the client. It should be greater than keepAliveTimeout."
1352
+ },
1333
1353
  "http2": {
1334
1354
  "type": "boolean"
1335
1355
  },
@@ -2574,6 +2594,56 @@
2574
2594
  }
2575
2595
  ],
2576
2596
  "description": "Enable the OpenTelemetry diagnostic logger. Diagnostic messages are forwarded to the Platformatic global logger using the current logger level."
2597
+ },
2598
+ "sampler": {
2599
+ "description": "How much to trace. Omitted, everything is recorded. Either a type out of the set OpenTelemetry defines for OTEL_TRACES_SAMPLER, or a package exporting a sampler.",
2600
+ "anyOf": [
2601
+ {
2602
+ "type": "object",
2603
+ "properties": {
2604
+ "type": {
2605
+ "type": "string",
2606
+ "enum": [
2607
+ "always_on",
2608
+ "always_off",
2609
+ "traceidratio",
2610
+ "parentbased_always_on",
2611
+ "parentbased_always_off",
2612
+ "parentbased_traceidratio"
2613
+ ]
2614
+ },
2615
+ "options": {
2616
+ "type": "object",
2617
+ "description": "Options for the sampler, for instance { \"ratio\": 0.1 } for the ratio based ones.",
2618
+ "additionalProperties": true
2619
+ }
2620
+ },
2621
+ "required": [
2622
+ "type"
2623
+ ],
2624
+ "additionalProperties": false
2625
+ },
2626
+ {
2627
+ "type": "object",
2628
+ "description": "A module exporting a sampler, or a factory which receives the options and returns one. A relative path is resolved against the application directory.",
2629
+ "properties": {
2630
+ "package": {
2631
+ "type": "string"
2632
+ },
2633
+ "exportName": {
2634
+ "type": "string"
2635
+ },
2636
+ "options": {
2637
+ "type": "object",
2638
+ "additionalProperties": true
2639
+ }
2640
+ },
2641
+ "required": [
2642
+ "package"
2643
+ ],
2644
+ "additionalProperties": false
2645
+ }
2646
+ ]
2577
2647
  }
2578
2648
  },
2579
2649
  "required": [