@platformatic/gateway 3.29.0 → 3.30.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 +4 -6
- package/lib/capability.js +0 -1
- package/lib/proxy.js +13 -1
- package/package.json +8 -8
- package/schema.json +33 -5
package/config.d.ts
CHANGED
|
@@ -403,6 +403,8 @@ export interface PlatformaticGatewayConfig {
|
|
|
403
403
|
maxMemory?: number;
|
|
404
404
|
cooldown?: number;
|
|
405
405
|
gracePeriod?: number;
|
|
406
|
+
scaleUpELU?: number;
|
|
407
|
+
scaleDownELU?: number;
|
|
406
408
|
[k: string]: unknown;
|
|
407
409
|
};
|
|
408
410
|
workersRestartDelay?: number | string;
|
|
@@ -735,13 +737,7 @@ export interface PlatformaticGatewayConfig {
|
|
|
735
737
|
maxWorkers?: number;
|
|
736
738
|
cooldownSec?: number;
|
|
737
739
|
gracePeriod?: number;
|
|
738
|
-
/**
|
|
739
|
-
* @deprecated
|
|
740
|
-
*/
|
|
741
740
|
scaleUpELU?: number;
|
|
742
|
-
/**
|
|
743
|
-
* @deprecated
|
|
744
|
-
*/
|
|
745
741
|
scaleDownELU?: number;
|
|
746
742
|
/**
|
|
747
743
|
* @deprecated
|
|
@@ -805,6 +801,8 @@ export interface PlatformaticGatewayConfig {
|
|
|
805
801
|
static?: number;
|
|
806
802
|
minimum?: number;
|
|
807
803
|
maximum?: number;
|
|
804
|
+
scaleUpELU?: number;
|
|
805
|
+
scaleDownELU?: number;
|
|
808
806
|
[k: string]: unknown;
|
|
809
807
|
};
|
|
810
808
|
health?: {
|
package/lib/capability.js
CHANGED
package/lib/proxy.js
CHANGED
|
@@ -11,9 +11,21 @@ const kProxyRoute = Symbol('plt.gateway.proxy.route')
|
|
|
11
11
|
|
|
12
12
|
const urlPattern = /^https?:\/\//
|
|
13
13
|
|
|
14
|
+
function isLocalApplication (application) {
|
|
15
|
+
if (!application.origin) {
|
|
16
|
+
return true
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return application.origin.endsWith('.plt.local')
|
|
20
|
+
}
|
|
21
|
+
|
|
14
22
|
async function resolveApplicationProxyParameters (application) {
|
|
15
23
|
// Get meta information from the application, if any, to eventually hook up to a TCP port
|
|
16
|
-
|
|
24
|
+
// Only fetch meta for local applications - remote applications won't be in the runtime
|
|
25
|
+
let allMeta = {}
|
|
26
|
+
if (isLocalApplication(application)) {
|
|
27
|
+
allMeta = (await globalThis[kITC]?.send('getApplicationMeta', application.id)) ?? {}
|
|
28
|
+
}
|
|
17
29
|
const meta = allMeta.gateway ?? allMeta.composer ?? { prefix: application.id }
|
|
18
30
|
|
|
19
31
|
// If no prefix could be found, assume the application id
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/gateway",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.30.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.
|
|
36
|
+
"@platformatic/db": "3.30.0"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@fastify/error": "^4.0.0",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"console-table-printer": "^2.12.0",
|
|
50
50
|
"execa": "^9.0.0",
|
|
51
51
|
"fast-deep-equal": "^3.1.3",
|
|
52
|
-
"fastify": "^5.
|
|
52
|
+
"fastify": "^5.7.0",
|
|
53
53
|
"fastify-plugin": "^5.0.0",
|
|
54
54
|
"graphql": "^16.8.1",
|
|
55
55
|
"help-me": "^5.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.
|
|
68
|
-
"@platformatic/
|
|
69
|
-
"@platformatic/service": "3.
|
|
70
|
-
"@platformatic/telemetry": "3.
|
|
71
|
-
"@platformatic/
|
|
67
|
+
"@platformatic/basic": "3.30.0",
|
|
68
|
+
"@platformatic/scalar-theme": "3.30.0",
|
|
69
|
+
"@platformatic/service": "3.30.0",
|
|
70
|
+
"@platformatic/telemetry": "3.30.0",
|
|
71
|
+
"@platformatic/foundation": "^3.30.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.
|
|
2
|
+
"$id": "https://schemas.platformatic.dev/@platformatic/gateway/3.30.0.json",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"title": "Platformatic Gateway Config",
|
|
5
5
|
"type": "object",
|
|
@@ -1354,6 +1354,16 @@
|
|
|
1354
1354
|
"maximum": {
|
|
1355
1355
|
"type": "number",
|
|
1356
1356
|
"minimum": 0
|
|
1357
|
+
},
|
|
1358
|
+
"scaleUpELU": {
|
|
1359
|
+
"type": "number",
|
|
1360
|
+
"minimum": 0,
|
|
1361
|
+
"maximum": 1
|
|
1362
|
+
},
|
|
1363
|
+
"scaleDownELU": {
|
|
1364
|
+
"type": "number",
|
|
1365
|
+
"minimum": 0,
|
|
1366
|
+
"maximum": 1
|
|
1357
1367
|
}
|
|
1358
1368
|
}
|
|
1359
1369
|
}
|
|
@@ -1633,6 +1643,16 @@
|
|
|
1633
1643
|
"gracePeriod": {
|
|
1634
1644
|
"type": "number",
|
|
1635
1645
|
"minimum": 0
|
|
1646
|
+
},
|
|
1647
|
+
"scaleUpELU": {
|
|
1648
|
+
"type": "number",
|
|
1649
|
+
"minimum": 0,
|
|
1650
|
+
"maximum": 1
|
|
1651
|
+
},
|
|
1652
|
+
"scaleDownELU": {
|
|
1653
|
+
"type": "number",
|
|
1654
|
+
"minimum": 0,
|
|
1655
|
+
"maximum": 1
|
|
1636
1656
|
}
|
|
1637
1657
|
}
|
|
1638
1658
|
}
|
|
@@ -2665,14 +2685,12 @@
|
|
|
2665
2685
|
"scaleUpELU": {
|
|
2666
2686
|
"type": "number",
|
|
2667
2687
|
"minimum": 0,
|
|
2668
|
-
"maximum": 1
|
|
2669
|
-
"deprecated": true
|
|
2688
|
+
"maximum": 1
|
|
2670
2689
|
},
|
|
2671
2690
|
"scaleDownELU": {
|
|
2672
2691
|
"type": "number",
|
|
2673
2692
|
"minimum": 0,
|
|
2674
|
-
"maximum": 1
|
|
2675
|
-
"deprecated": true
|
|
2693
|
+
"maximum": 1
|
|
2676
2694
|
},
|
|
2677
2695
|
"timeWindowSec": {
|
|
2678
2696
|
"type": "number",
|
|
@@ -2873,6 +2891,16 @@
|
|
|
2873
2891
|
"maximum": {
|
|
2874
2892
|
"type": "number",
|
|
2875
2893
|
"minimum": 0
|
|
2894
|
+
},
|
|
2895
|
+
"scaleUpELU": {
|
|
2896
|
+
"type": "number",
|
|
2897
|
+
"minimum": 0,
|
|
2898
|
+
"maximum": 1
|
|
2899
|
+
},
|
|
2900
|
+
"scaleDownELU": {
|
|
2901
|
+
"type": "number",
|
|
2902
|
+
"minimum": 0,
|
|
2903
|
+
"maximum": 1
|
|
2876
2904
|
}
|
|
2877
2905
|
}
|
|
2878
2906
|
}
|