@bleedingdev/modern-js-server-core 3.9.0-ultramodern.4 → 3.9.0-ultramodern.5
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/dist/cjs/adapters/node/index.js +4 -0
- package/dist/cjs/adapters/node/plugins/static.js +107 -29
- package/dist/cjs/index.js +10 -34
- package/dist/cjs/plugins/compat/index.js +1 -0
- package/dist/cjs/serverBase.js +58 -17
- package/dist/cjs/utils/error.js +0 -10
- package/dist/esm/adapters/node/index.mjs +1 -0
- package/dist/esm/adapters/node/plugins/static.mjs +107 -32
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/plugins/compat/index.mjs +1 -0
- package/dist/esm/serverBase.mjs +58 -17
- package/dist/esm/utils/error.mjs +0 -1
- package/dist/esm-node/adapters/node/index.mjs +1 -0
- package/dist/esm-node/adapters/node/plugins/static.mjs +107 -32
- package/dist/esm-node/index.mjs +1 -1
- package/dist/esm-node/plugins/compat/index.mjs +1 -0
- package/dist/esm-node/serverBase.mjs +58 -17
- package/dist/esm-node/utils/error.mjs +0 -1
- package/dist/types/adapters/node/index.d.ts +2 -0
- package/dist/types/adapters/node/plugins/static.d.ts +42 -4
- package/dist/types/index.d.ts +1 -2
- package/dist/types/serverBase.d.ts +6 -0
- package/dist/types/types/config/bff.d.ts +4 -15
- package/dist/types/types/config/server.d.ts +1 -3
- package/dist/types/types/plugins/plugin.d.ts +15 -1
- package/dist/types/utils/error.d.ts +0 -2
- package/package.json +5 -6
- package/dist/cjs/adapters/node/plugins/staticModuleFederation.js +0 -173
- package/dist/cjs/adapters/node/plugins/staticPrecompressed.js +0 -152
- package/dist/cjs/adapters/node/plugins/staticServing.js +0 -206
- package/dist/cjs/types/config/bffRuntime.js +0 -18
- package/dist/cjs/types/config/serverTelemetry.js +0 -18
- package/dist/esm/adapters/node/plugins/staticModuleFederation.mjs +0 -104
- package/dist/esm/adapters/node/plugins/staticPrecompressed.mjs +0 -111
- package/dist/esm/adapters/node/plugins/staticServing.mjs +0 -152
- package/dist/esm/types/config/bffRuntime.mjs +0 -0
- package/dist/esm/types/config/serverTelemetry.mjs +0 -0
- package/dist/esm-node/adapters/node/plugins/staticModuleFederation.mjs +0 -105
- package/dist/esm-node/adapters/node/plugins/staticPrecompressed.mjs +0 -112
- package/dist/esm-node/adapters/node/plugins/staticServing.mjs +0 -153
- package/dist/esm-node/types/config/bffRuntime.mjs +0 -1
- package/dist/esm-node/types/config/serverTelemetry.mjs +0 -1
- package/dist/types/adapters/node/plugins/staticModuleFederation.d.ts +0 -13
- package/dist/types/adapters/node/plugins/staticPrecompressed.d.ts +0 -13
- package/dist/types/adapters/node/plugins/staticServing.d.ts +0 -25
- package/dist/types/types/config/bffRuntime.d.ts +0 -116
- package/dist/types/types/config/serverTelemetry.d.ts +0 -319
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
export interface ServerTelemetryExporterOptions {
|
|
2
|
-
enabled?: boolean;
|
|
3
|
-
endpoint?: string;
|
|
4
|
-
headers?: Record<string, string>;
|
|
5
|
-
timeoutMs?: number;
|
|
6
|
-
}
|
|
7
|
-
export interface ServerTelemetryVictoriaMetricsOptions extends ServerTelemetryExporterOptions {
|
|
8
|
-
metricPrefix?: string;
|
|
9
|
-
}
|
|
10
|
-
export interface ServerTelemetrySloUserConfig {
|
|
11
|
-
/**
|
|
12
|
-
* Queue utilization ratio threshold that emits SLO degradation alerts.
|
|
13
|
-
*
|
|
14
|
-
* @default 0.8
|
|
15
|
-
*/
|
|
16
|
-
queueUtilizationWarnThreshold?: number;
|
|
17
|
-
/**
|
|
18
|
-
* Total dropped-envelope threshold that emits SLO degradation alerts.
|
|
19
|
-
*
|
|
20
|
-
* @default 1
|
|
21
|
-
*/
|
|
22
|
-
queueDroppedWarnThreshold?: number;
|
|
23
|
-
/**
|
|
24
|
-
* Cooldown between SLO alert emissions for the same alert type.
|
|
25
|
-
*
|
|
26
|
-
* @default 60000
|
|
27
|
-
*/
|
|
28
|
-
alertCooldownMs?: number;
|
|
29
|
-
}
|
|
30
|
-
export interface ServerTelemetryCanaryContractGateUserConfig {
|
|
31
|
-
/**
|
|
32
|
-
* Whether this contract gate currently passes.
|
|
33
|
-
*/
|
|
34
|
-
passed: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Optional failure reason used for rollback diagnostics.
|
|
37
|
-
*/
|
|
38
|
-
reason?: string;
|
|
39
|
-
}
|
|
40
|
-
export interface ServerTelemetryCanaryAutopilotUserConfig {
|
|
41
|
-
/**
|
|
42
|
-
* Enable automatic contract gate synchronization from a gate snapshot file.
|
|
43
|
-
*
|
|
44
|
-
* @default true
|
|
45
|
-
*/
|
|
46
|
-
enabled?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Path to contract gate snapshot JSON file.
|
|
49
|
-
*
|
|
50
|
-
* @default ".modern/contract-gates.json"
|
|
51
|
-
*/
|
|
52
|
-
gateSnapshotPath?: string;
|
|
53
|
-
/**
|
|
54
|
-
* Poll interval for reading gate snapshot changes.
|
|
55
|
-
*
|
|
56
|
-
* @default 15000
|
|
57
|
-
*/
|
|
58
|
-
pollIntervalMs?: number;
|
|
59
|
-
/**
|
|
60
|
-
* Marks gate entries as failed when they are older than this threshold.
|
|
61
|
-
*
|
|
62
|
-
* @default 600000
|
|
63
|
-
*/
|
|
64
|
-
gateStaleAfterMs?: number;
|
|
65
|
-
/**
|
|
66
|
-
* Runtime MF fallback signal ingestion.
|
|
67
|
-
*/
|
|
68
|
-
runtimeFallbackSignal?: ServerTelemetryCanaryRuntimeFallbackSignalUserConfig;
|
|
69
|
-
/**
|
|
70
|
-
* Optional pluggable state store backend for contract gate snapshots.
|
|
71
|
-
* When omitted, snapshots are read/written from gateSnapshotPath on local disk.
|
|
72
|
-
*/
|
|
73
|
-
stateStore?: ServerTelemetryCanaryAutopilotStateStoreUserConfig;
|
|
74
|
-
}
|
|
75
|
-
export interface ServerTelemetryCanaryAutopilotStateStoreUserConfig {
|
|
76
|
-
/**
|
|
77
|
-
* Path or package name of a module that exports
|
|
78
|
-
* `createContractGateSnapshotStore(context)`.
|
|
79
|
-
*/
|
|
80
|
-
module: string;
|
|
81
|
-
/**
|
|
82
|
-
* Optional adapter-specific configuration.
|
|
83
|
-
*/
|
|
84
|
-
options?: Record<string, unknown>;
|
|
85
|
-
}
|
|
86
|
-
export interface ServerTelemetryCanaryRuntimeFallbackSignalUserConfig {
|
|
87
|
-
/**
|
|
88
|
-
* Enable runtime MF fallback signal ingestion endpoint.
|
|
89
|
-
*
|
|
90
|
-
* Opt-in: when enabled, `auth` must be configured with a token
|
|
91
|
-
* (`expectedValue` or `expectedValueEnv`) or server setup throws.
|
|
92
|
-
*
|
|
93
|
-
* @default false
|
|
94
|
-
*/
|
|
95
|
-
enabled?: boolean;
|
|
96
|
-
/**
|
|
97
|
-
* HTTP endpoint path for runtime fallback events.
|
|
98
|
-
*
|
|
99
|
-
* @default "/_modern/contract-gates/runtime-fallback"
|
|
100
|
-
*/
|
|
101
|
-
endpoint?: string;
|
|
102
|
-
/**
|
|
103
|
-
* Contract gate name updated by runtime fallback events.
|
|
104
|
-
*
|
|
105
|
-
* @default "runtime-mf-fallback-health"
|
|
106
|
-
*/
|
|
107
|
-
gateName?: string;
|
|
108
|
-
/**
|
|
109
|
-
* How long a runtime fallback signal should hold gate failure status.
|
|
110
|
-
*
|
|
111
|
-
* @default 300000
|
|
112
|
-
*/
|
|
113
|
-
failureHoldMs?: number;
|
|
114
|
-
/**
|
|
115
|
-
* Maximum accepted request body size in bytes.
|
|
116
|
-
*
|
|
117
|
-
* @default 16384
|
|
118
|
-
*/
|
|
119
|
-
maxBodyBytes?: number;
|
|
120
|
-
/**
|
|
121
|
-
* Optional runtime trust policy for fallback signal ingestion.
|
|
122
|
-
* Use this to restrict who can mutate canary contract gates.
|
|
123
|
-
*/
|
|
124
|
-
trustPolicy?: ServerTelemetryCanaryRuntimeFallbackSignalTrustPolicyUserConfig;
|
|
125
|
-
/**
|
|
126
|
-
* Optional request authentication for runtime fallback signal endpoint.
|
|
127
|
-
*/
|
|
128
|
-
auth?: ServerTelemetryCanaryRuntimeFallbackSignalAuthUserConfig;
|
|
129
|
-
}
|
|
130
|
-
export interface ServerTelemetryCanaryRuntimeFallbackSignalAuthUserConfig {
|
|
131
|
-
/**
|
|
132
|
-
* Enable auth guard for runtime fallback signal endpoint.
|
|
133
|
-
*
|
|
134
|
-
* @default false
|
|
135
|
-
*/
|
|
136
|
-
enabled?: boolean;
|
|
137
|
-
/**
|
|
138
|
-
* Header name carrying runtime fallback auth token.
|
|
139
|
-
*
|
|
140
|
-
* @default "x-modernjs-runtime-signal-token"
|
|
141
|
-
*/
|
|
142
|
-
headerName?: string;
|
|
143
|
-
/**
|
|
144
|
-
* Expected token value. Prefer using expectedValueEnv in production.
|
|
145
|
-
*/
|
|
146
|
-
expectedValue?: string;
|
|
147
|
-
/**
|
|
148
|
-
* Name of environment variable that stores expected token value.
|
|
149
|
-
*/
|
|
150
|
-
expectedValueEnv?: string;
|
|
151
|
-
}
|
|
152
|
-
export interface ServerTelemetryCanaryRuntimeFallbackSignalTrustPolicyUserConfig {
|
|
153
|
-
/**
|
|
154
|
-
* Allowlist of app names accepted by runtime fallback signal endpoint.
|
|
155
|
-
* Empty means no app-name allowlist check.
|
|
156
|
-
*/
|
|
157
|
-
allowedApps?: string[];
|
|
158
|
-
/**
|
|
159
|
-
* Allowlist of entry origins accepted by runtime fallback signal endpoint.
|
|
160
|
-
* Values should be URL origins (for example https://erp.example.com).
|
|
161
|
-
* Empty means no entry-origin allowlist check.
|
|
162
|
-
*/
|
|
163
|
-
allowedEntryOrigins?: string[];
|
|
164
|
-
/**
|
|
165
|
-
* Expected runtime digest per appName.
|
|
166
|
-
*/
|
|
167
|
-
expectedRuntimeDigests?: Record<string, string>;
|
|
168
|
-
/**
|
|
169
|
-
* Require runtimeDigest to be present in signal payload metadata.
|
|
170
|
-
*
|
|
171
|
-
* @default false
|
|
172
|
-
*/
|
|
173
|
-
enforceRuntimeDigest?: boolean;
|
|
174
|
-
/**
|
|
175
|
-
* Maximum accepted signals per app+origin window.
|
|
176
|
-
*
|
|
177
|
-
* @default 30
|
|
178
|
-
*/
|
|
179
|
-
maxSignalsPerWindow?: number;
|
|
180
|
-
/**
|
|
181
|
-
* Sliding window size in milliseconds for maxSignalsPerWindow.
|
|
182
|
-
*
|
|
183
|
-
* @default 60000
|
|
184
|
-
*/
|
|
185
|
-
windowMs?: number;
|
|
186
|
-
/**
|
|
187
|
-
* Drop duplicate fallback events with the same fingerprint during this window.
|
|
188
|
-
*
|
|
189
|
-
* @default 10000
|
|
190
|
-
*/
|
|
191
|
-
dedupeWindowMs?: number;
|
|
192
|
-
}
|
|
193
|
-
export interface ServerTelemetryCanaryUserConfig {
|
|
194
|
-
/**
|
|
195
|
-
* Enable canary rollout/rollback orchestration.
|
|
196
|
-
*
|
|
197
|
-
* @default false
|
|
198
|
-
*/
|
|
199
|
-
enabled?: boolean;
|
|
200
|
-
/**
|
|
201
|
-
* Periodic canary evaluation interval in milliseconds.
|
|
202
|
-
*
|
|
203
|
-
* @default 15000
|
|
204
|
-
*/
|
|
205
|
-
evaluationIntervalMs?: number;
|
|
206
|
-
/**
|
|
207
|
-
* Required consecutive healthy evaluations before promotion.
|
|
208
|
-
*
|
|
209
|
-
* @default 3
|
|
210
|
-
*/
|
|
211
|
-
minConsecutiveHealthyEvaluations?: number;
|
|
212
|
-
/**
|
|
213
|
-
* Consecutive failing evaluations before automated rollback.
|
|
214
|
-
*
|
|
215
|
-
* @default 2
|
|
216
|
-
*/
|
|
217
|
-
rollbackConsecutiveFailures?: number;
|
|
218
|
-
/**
|
|
219
|
-
* Maximum queue utilization ratio allowed during canary.
|
|
220
|
-
*
|
|
221
|
-
* @default 0.8
|
|
222
|
-
*/
|
|
223
|
-
maxQueueUtilization?: number;
|
|
224
|
-
/**
|
|
225
|
-
* Maximum allowed total dropped envelopes during canary.
|
|
226
|
-
*
|
|
227
|
-
* @default 0
|
|
228
|
-
*/
|
|
229
|
-
maxTotalDropped?: number;
|
|
230
|
-
/**
|
|
231
|
-
* Maximum allowed unhealthy exporters during canary.
|
|
232
|
-
*
|
|
233
|
-
* @default 0
|
|
234
|
-
*/
|
|
235
|
-
maxUnhealthyExporters?: number;
|
|
236
|
-
/**
|
|
237
|
-
* Contract gate map used in rollout decisions.
|
|
238
|
-
* `true` means passing, `false` means failing.
|
|
239
|
-
*/
|
|
240
|
-
contractGates?: Record<string, boolean | ServerTelemetryCanaryContractGateUserConfig>;
|
|
241
|
-
/**
|
|
242
|
-
* Contract-gate autopilot settings.
|
|
243
|
-
*/
|
|
244
|
-
autopilot?: ServerTelemetryCanaryAutopilotUserConfig;
|
|
245
|
-
}
|
|
246
|
-
export interface ServerTelemetryUserConfig {
|
|
247
|
-
/**
|
|
248
|
-
* Enable framework telemetry envelope emission.
|
|
249
|
-
* @default false
|
|
250
|
-
*/
|
|
251
|
-
enabled?: boolean;
|
|
252
|
-
/**
|
|
253
|
-
* Logical service name attached to every telemetry envelope.
|
|
254
|
-
* @default server.metaName
|
|
255
|
-
*/
|
|
256
|
-
service?: string;
|
|
257
|
-
/**
|
|
258
|
-
* Logical module name attached to every telemetry envelope.
|
|
259
|
-
* @default "server"
|
|
260
|
-
*/
|
|
261
|
-
module?: string;
|
|
262
|
-
/**
|
|
263
|
-
* Environment attached to every telemetry envelope.
|
|
264
|
-
* @default process.env.NODE_ENV || "development"
|
|
265
|
-
*/
|
|
266
|
-
environment?: string;
|
|
267
|
-
/**
|
|
268
|
-
* Sampling rate for monitor events.
|
|
269
|
-
* @default 1
|
|
270
|
-
*/
|
|
271
|
-
samplingRate?: number;
|
|
272
|
-
/**
|
|
273
|
-
* Flush window in milliseconds for exporter batches.
|
|
274
|
-
* @default 1000
|
|
275
|
-
*/
|
|
276
|
-
flushIntervalMs?: number;
|
|
277
|
-
/**
|
|
278
|
-
* Maximum envelopes in one emitted batch.
|
|
279
|
-
* @default 50
|
|
280
|
-
*/
|
|
281
|
-
maxBatchSize?: number;
|
|
282
|
-
/**
|
|
283
|
-
* Maximum envelopes buffered before backpressure drops oldest.
|
|
284
|
-
* @default 1000
|
|
285
|
-
*/
|
|
286
|
-
maxQueueSize?: number;
|
|
287
|
-
/**
|
|
288
|
-
* Envelope attribute keys that should be redacted.
|
|
289
|
-
*/
|
|
290
|
-
redactionKeys?: string[];
|
|
291
|
-
/**
|
|
292
|
-
* Control startup exporter health probe behavior.
|
|
293
|
-
* When enabled (default), server initialization emits a startup probe and
|
|
294
|
-
* marks exporters healthy/unhealthy before serving traffic.
|
|
295
|
-
* When fail-loud mode is enabled (default), initialization throws if at
|
|
296
|
-
* least one configured exporter is unhealthy.
|
|
297
|
-
*
|
|
298
|
-
* @default true
|
|
299
|
-
*/
|
|
300
|
-
failLoudStartup?: boolean;
|
|
301
|
-
/**
|
|
302
|
-
* Queue backpressure/degradation SLO alert thresholds.
|
|
303
|
-
*/
|
|
304
|
-
slo?: ServerTelemetrySloUserConfig;
|
|
305
|
-
/**
|
|
306
|
-
* Canary rollout and automated rollback orchestration policy.
|
|
307
|
-
*/
|
|
308
|
-
canary?: ServerTelemetryCanaryUserConfig;
|
|
309
|
-
exporters?: {
|
|
310
|
-
/**
|
|
311
|
-
* OpenTelemetry HTTP exporter.
|
|
312
|
-
*/
|
|
313
|
-
otlp?: ServerTelemetryExporterOptions;
|
|
314
|
-
/**
|
|
315
|
-
* VictoriaMetrics Prometheus import exporter.
|
|
316
|
-
*/
|
|
317
|
-
victoriaMetrics?: ServerTelemetryVictoriaMetricsOptions;
|
|
318
|
-
};
|
|
319
|
-
}
|