@platformatic/gateway 3.32.0-alpha.0 → 3.32.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 CHANGED
@@ -32,7 +32,7 @@ export interface PlatformaticGatewayConfig {
32
32
  logger?:
33
33
  | boolean
34
34
  | {
35
- level: (
35
+ level?: (
36
36
  | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent")
37
37
  | {
38
38
  [k: string]: unknown;
@@ -409,7 +409,7 @@ export interface PlatformaticGatewayConfig {
409
409
  };
410
410
  workersRestartDelay?: number | string;
411
411
  logger?: {
412
- level: (
412
+ level?: (
413
413
  | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent")
414
414
  | {
415
415
  [k: string]: unknown;
@@ -512,7 +512,6 @@ export interface PlatformaticGatewayConfig {
512
512
  maxHeapTotal?: number | string;
513
513
  maxYoungGeneration?: number | string;
514
514
  codeRangeSize?: number | string;
515
- noHeapCheck?: boolean | string;
516
515
  };
517
516
  undici?: {
518
517
  agentOptions?: {
@@ -564,6 +563,18 @@ export interface PlatformaticGatewayConfig {
564
563
  maxSize?: number;
565
564
  maxEntrySize?: number;
566
565
  maxCount?: number;
566
+ /**
567
+ * Whitelist of origins to cache. Supports exact strings and regex patterns (e.g., "/https:\\/\\/.*\\.example\\.com/").
568
+ */
569
+ origins?: string[];
570
+ /**
571
+ * Default cache duration in seconds for responses without explicit expiration headers.
572
+ */
573
+ cacheByDefault?: number;
574
+ /**
575
+ * Cache type. "shared" caches may be shared between users, "private" caches are user-specific.
576
+ */
577
+ type?: "shared" | "private";
567
578
  [k: string]: unknown;
568
579
  };
569
580
  watch?: boolean | string;
@@ -793,6 +804,18 @@ export interface PlatformaticGatewayConfig {
793
804
  [k: string]: string | [string, ...string[]];
794
805
  };
795
806
  };
807
+ compileCache?:
808
+ | boolean
809
+ | {
810
+ /**
811
+ * Enable Node.js module compile cache for faster startup
812
+ */
813
+ enabled?: boolean;
814
+ /**
815
+ * Directory to store compile cache. Defaults to .plt/compile-cache in app root
816
+ */
817
+ directory?: string;
818
+ };
796
819
  application?: {
797
820
  reuseTcpPorts?: boolean;
798
821
  workers?:
@@ -816,7 +839,6 @@ export interface PlatformaticGatewayConfig {
816
839
  maxHeapTotal?: number | string;
817
840
  maxYoungGeneration?: number | string;
818
841
  codeRangeSize?: number | string;
819
- noHeapCheck?: boolean | string;
820
842
  };
821
843
  arguments?: string[];
822
844
  env?: {
@@ -852,6 +874,18 @@ export interface PlatformaticGatewayConfig {
852
874
  )[];
853
875
  [k: string]: unknown;
854
876
  };
877
+ compileCache?:
878
+ | boolean
879
+ | {
880
+ /**
881
+ * Enable Node.js module compile cache for faster startup
882
+ */
883
+ enabled?: boolean;
884
+ /**
885
+ * Directory to store compile cache. Defaults to .plt/compile-cache in app root
886
+ */
887
+ directory?: string;
888
+ };
855
889
  };
856
890
  };
857
891
  telemetry?: {
package/index.d.ts CHANGED
@@ -4,13 +4,14 @@ import {
4
4
  Configuration,
5
5
  ServiceCapability,
6
6
  Generator as ServiceGenerator,
7
+ PlatformaticServiceConfig,
7
8
  ServerInstance as ServiceServerInstance
8
9
  } from '@platformatic/service'
9
10
  import { JSONSchemaType } from 'ajv'
10
11
  import { FastifyError, FastifyInstance } from 'fastify'
11
12
  import type { PlatformaticGatewayConfig } from './config.d.ts'
12
13
 
13
- export { PlatformaticService } from '@platformatic/service'
14
+ export type { PlatformaticServiceConfig } from '@platformatic/service'
14
15
  export type { PlatformaticGatewayConfig } from './config.d.ts'
15
16
 
16
17
  export type GatewayCapability = ServiceCapability<PlatformaticGatewayConfig>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/gateway",
3
- "version": "3.32.0-alpha.0",
3
+ "version": "3.32.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -33,7 +33,7 @@
33
33
  "typescript": "^5.5.4",
34
34
  "why-is-node-running": "2",
35
35
  "ws": "^8.16.0",
36
- "@platformatic/db": "3.32.0-alpha.0"
36
+ "@platformatic/db": "3.32.0"
37
37
  },
38
38
  "dependencies": {
39
39
  "@fastify/error": "^4.0.0",
@@ -64,11 +64,11 @@
64
64
  "rfdc": "^1.3.1",
65
65
  "semgrator": "^0.3.0",
66
66
  "undici": "^7.0.0",
67
- "@platformatic/basic": "3.32.0-alpha.0",
68
- "@platformatic/telemetry": "3.32.0-alpha.0",
69
- "@platformatic/service": "3.32.0-alpha.0",
70
- "@platformatic/foundation": "^3.32.0-alpha.0",
71
- "@platformatic/scalar-theme": "3.32.0-alpha.0"
67
+ "@platformatic/basic": "3.32.0",
68
+ "@platformatic/scalar-theme": "3.32.0",
69
+ "@platformatic/foundation": "^3.32.0",
70
+ "@platformatic/service": "3.32.0",
71
+ "@platformatic/telemetry": "3.32.0"
72
72
  },
73
73
  "engines": {
74
74
  "node": ">=22.19.0"
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/gateway/3.32.0-alpha.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/gateway/3.32.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Gateway Config",
5
5
  "type": "object",
@@ -97,7 +97,6 @@
97
97
  "properties": {
98
98
  "level": {
99
99
  "type": "string",
100
- "default": "info",
101
100
  "oneOf": [
102
101
  {
103
102
  "enum": [
@@ -240,9 +239,6 @@
240
239
  "additionalProperties": true
241
240
  }
242
241
  },
243
- "required": [
244
- "level"
245
- ],
246
242
  "default": {},
247
243
  "additionalProperties": true
248
244
  }
@@ -1472,16 +1468,6 @@
1472
1468
  "type": "string"
1473
1469
  }
1474
1470
  ]
1475
- },
1476
- "noHeapCheck": {
1477
- "anyOf": [
1478
- {
1479
- "type": "boolean"
1480
- },
1481
- {
1482
- "type": "string"
1483
- }
1484
- ]
1485
1471
  }
1486
1472
  },
1487
1473
  "additionalProperties": false
@@ -1606,6 +1592,28 @@
1606
1592
  }
1607
1593
  }
1608
1594
  }
1595
+ },
1596
+ "compileCache": {
1597
+ "anyOf": [
1598
+ {
1599
+ "type": "boolean"
1600
+ },
1601
+ {
1602
+ "type": "object",
1603
+ "properties": {
1604
+ "enabled": {
1605
+ "type": "boolean",
1606
+ "default": true,
1607
+ "description": "Enable Node.js module compile cache for faster startup"
1608
+ },
1609
+ "directory": {
1610
+ "type": "string",
1611
+ "description": "Directory to store compile cache. Defaults to .plt/compile-cache in app root"
1612
+ }
1613
+ },
1614
+ "additionalProperties": false
1615
+ }
1616
+ ]
1609
1617
  }
1610
1618
  }
1611
1619
  }
@@ -1685,7 +1693,6 @@
1685
1693
  "properties": {
1686
1694
  "level": {
1687
1695
  "type": "string",
1688
- "default": "info",
1689
1696
  "oneOf": [
1690
1697
  {
1691
1698
  "enum": [
@@ -1828,9 +1835,6 @@
1828
1835
  "additionalProperties": true
1829
1836
  }
1830
1837
  },
1831
- "required": [
1832
- "level"
1833
- ],
1834
1838
  "default": {},
1835
1839
  "additionalProperties": true
1836
1840
  },
@@ -2126,17 +2130,6 @@
2126
2130
  }
2127
2131
  ],
2128
2132
  "default": 268435456
2129
- },
2130
- "noHeapCheck": {
2131
- "anyOf": [
2132
- {
2133
- "type": "boolean"
2134
- },
2135
- {
2136
- "type": "string"
2137
- }
2138
- ],
2139
- "default": false
2140
2133
  }
2141
2134
  },
2142
2135
  "additionalProperties": false
@@ -2268,6 +2261,26 @@
2268
2261
  },
2269
2262
  "maxCount": {
2270
2263
  "type": "integer"
2264
+ },
2265
+ "origins": {
2266
+ "type": "array",
2267
+ "items": {
2268
+ "type": "string"
2269
+ },
2270
+ "description": "Whitelist of origins to cache. Supports exact strings and regex patterns (e.g., \"/https:\\\\/\\\\/.*\\\\.example\\\\.com/\")."
2271
+ },
2272
+ "cacheByDefault": {
2273
+ "type": "integer",
2274
+ "description": "Default cache duration in seconds for responses without explicit expiration headers."
2275
+ },
2276
+ "type": {
2277
+ "type": "string",
2278
+ "enum": [
2279
+ "shared",
2280
+ "private"
2281
+ ],
2282
+ "default": "shared",
2283
+ "description": "Cache type. \"shared\" caches may be shared between users, \"private\" caches are user-specific."
2271
2284
  }
2272
2285
  }
2273
2286
  }
@@ -2883,6 +2896,28 @@
2883
2896
  ],
2884
2897
  "additionalProperties": false
2885
2898
  },
2899
+ "compileCache": {
2900
+ "anyOf": [
2901
+ {
2902
+ "type": "boolean"
2903
+ },
2904
+ {
2905
+ "type": "object",
2906
+ "properties": {
2907
+ "enabled": {
2908
+ "type": "boolean",
2909
+ "default": true,
2910
+ "description": "Enable Node.js module compile cache for faster startup"
2911
+ },
2912
+ "directory": {
2913
+ "type": "string",
2914
+ "description": "Directory to store compile cache. Defaults to .plt/compile-cache in app root"
2915
+ }
2916
+ },
2917
+ "additionalProperties": false
2918
+ }
2919
+ ]
2920
+ },
2886
2921
  "application": {
2887
2922
  "type": "object",
2888
2923
  "properties": {
@@ -3030,16 +3065,6 @@
3030
3065
  "type": "string"
3031
3066
  }
3032
3067
  ]
3033
- },
3034
- "noHeapCheck": {
3035
- "anyOf": [
3036
- {
3037
- "type": "boolean"
3038
- },
3039
- {
3040
- "type": "string"
3041
- }
3042
- ]
3043
3068
  }
3044
3069
  },
3045
3070
  "additionalProperties": false
@@ -3157,6 +3182,28 @@
3157
3182
  }
3158
3183
  }
3159
3184
  }
3185
+ },
3186
+ "compileCache": {
3187
+ "anyOf": [
3188
+ {
3189
+ "type": "boolean"
3190
+ },
3191
+ {
3192
+ "type": "object",
3193
+ "properties": {
3194
+ "enabled": {
3195
+ "type": "boolean",
3196
+ "default": true,
3197
+ "description": "Enable Node.js module compile cache for faster startup"
3198
+ },
3199
+ "directory": {
3200
+ "type": "string",
3201
+ "description": "Directory to store compile cache. Defaults to .plt/compile-cache in app root"
3202
+ }
3203
+ },
3204
+ "additionalProperties": false
3205
+ }
3206
+ ]
3160
3207
  }
3161
3208
  },
3162
3209
  "additionalProperties": false