@zintrust/workers 2.0.3 → 2.0.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/AnomalyDetection.js +3 -1
- package/dist/AutoScaler.js +3 -1
- package/dist/BroadcastWorker.js +2 -1
- package/dist/CanaryController.js +2 -1
- package/dist/ChaosEngineering.js +3 -1
- package/dist/CircuitBreaker.js +1 -1
- package/dist/ClusterLock.d.ts +1 -1
- package/dist/ClusterLock.js +5 -1
- package/dist/ComplianceManager.d.ts +1 -1
- package/dist/ComplianceManager.js +4 -1
- package/dist/DatacenterOrchestrator.js +2 -1
- package/dist/DeadLetterQueue.d.ts +1 -1
- package/dist/DeadLetterQueue.js +3 -1
- package/dist/HealthMonitor.js +2 -1
- package/dist/MultiQueueWorker.js +3 -1
- package/dist/NotificationWorker.js +1 -1
- package/dist/Observability.js +3 -1
- package/dist/PluginManager.js +2 -1
- package/dist/PriorityQueue.d.ts +1 -1
- package/dist/PriorityQueue.js +2 -1
- package/dist/ResourceMonitor.js +3 -1
- package/dist/SLAMonitor.js +3 -1
- package/dist/WorkerFactory.d.ts +2 -2
- package/dist/WorkerFactory.js +8 -2
- package/dist/WorkerInit.js +3 -1
- package/dist/WorkerMetrics.d.ts +1 -1
- package/dist/WorkerMetrics.js +3 -1
- package/dist/WorkerRegistry.d.ts +1 -1
- package/dist/WorkerRegistry.js +2 -1
- package/dist/WorkerShutdown.js +1 -1
- package/dist/WorkerVersioning.js +2 -1
- package/dist/config/workerConfig.js +1 -1
- package/dist/createQueueWorker.js +11 -44
- package/dist/dashboard/workers-api.js +7 -3
- package/dist/helper/index.d.ts +6 -1
- package/dist/helper/index.js +51 -0
- package/dist/http/WorkerApiController.d.ts +1 -1
- package/dist/http/WorkerApiController.js +29 -4
- package/dist/http/WorkerController.d.ts +1 -1
- package/dist/http/WorkerController.js +4 -1
- package/dist/http/WorkerMonitoringService.js +2 -1
- package/dist/http/middleware/CustomValidation.d.ts +1 -1
- package/dist/http/middleware/CustomValidation.js +1 -1
- package/dist/http/middleware/DatacenterValidator.d.ts +1 -1
- package/dist/http/middleware/DatacenterValidator.js +1 -1
- package/dist/http/middleware/EditWorkerValidation.d.ts +1 -1
- package/dist/http/middleware/EditWorkerValidation.js +1 -1
- package/dist/http/middleware/FeaturesValidator.d.ts +1 -1
- package/dist/http/middleware/FeaturesValidator.js +1 -1
- package/dist/http/middleware/InfrastructureValidator.d.ts +1 -1
- package/dist/http/middleware/InfrastructureValidator.js +1 -1
- package/dist/http/middleware/OptionsValidator.d.ts +1 -1
- package/dist/http/middleware/OptionsValidator.js +1 -1
- package/dist/http/middleware/PayloadSanitizer.d.ts +1 -1
- package/dist/http/middleware/PayloadSanitizer.js +1 -1
- package/dist/http/middleware/ProcessorPathSanitizer.d.ts +1 -1
- package/dist/http/middleware/ProcessorPathSanitizer.js +2 -1
- package/dist/http/middleware/QueueNameSanitizer.d.ts +1 -1
- package/dist/http/middleware/QueueNameSanitizer.js +1 -1
- package/dist/http/middleware/ValidateDriver.d.ts +1 -1
- package/dist/http/middleware/VersionSanitizer.d.ts +1 -1
- package/dist/http/middleware/VersionSanitizer.js +1 -1
- package/dist/http/middleware/WorkerNameSanitizer.d.ts +1 -1
- package/dist/http/middleware/WorkerNameSanitizer.js +1 -1
- package/dist/http/middleware/WorkerValidationChain.d.ts +1 -1
- package/dist/http/middleware/WorkerValidationChain.js +1 -1
- package/dist/queueMonitorHistory.js +3 -1
- package/dist/routes/workers.d.ts +1 -1
- package/dist/routes/workers.js +4 -1
- package/dist/storage/WorkerStore.d.ts +2 -2
- package/dist/telemetry/api/TelemetryAPI.js +1 -1
- package/dist/telemetry/api/TelemetryMonitoringService.d.ts +1 -1
- package/dist/telemetry/api/TelemetryMonitoringService.js +2 -1
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +2 -1
- package/dist/ui/router/ui.d.ts +1 -1
- package/dist/ui/router/ui.js +6 -1
- package/package.json +1 -1
- package/src/AnomalyDetection.ts +4 -2
- package/src/AutoScaler.ts +3 -2
- package/src/BroadcastWorker.ts +2 -1
- package/src/CanaryController.ts +2 -1
- package/src/ChaosEngineering.ts +3 -1
- package/src/CircuitBreaker.ts +1 -1
- package/src/ClusterLock.ts +5 -8
- package/src/ComplianceManager.ts +4 -7
- package/src/DatacenterOrchestrator.ts +2 -1
- package/src/DeadLetterQueue.ts +3 -1
- package/src/HealthMonitor.ts +2 -1
- package/src/MultiQueueWorker.ts +3 -1
- package/src/NotificationWorker.ts +1 -1
- package/src/Observability.ts +3 -1
- package/src/PluginManager.ts +2 -1
- package/src/PriorityQueue.ts +3 -1
- package/src/ResourceMonitor.ts +3 -1
- package/src/SLAMonitor.ts +3 -1
- package/src/WorkerFactory.ts +13 -19
- package/src/WorkerInit.ts +3 -1
- package/src/WorkerMetrics.ts +3 -7
- package/src/WorkerRegistry.ts +3 -1
- package/src/WorkerShutdown.ts +1 -1
- package/src/WorkerVersioning.ts +2 -1
- package/src/config/workerConfig.ts +1 -1
- package/src/createQueueWorker.ts +12 -45
- package/src/dashboard/workers-api.ts +7 -3
- package/src/helper/index.ts +61 -1
- package/src/http/WorkerApiController.ts +38 -5
- package/src/http/WorkerController.ts +5 -8
- package/src/http/WorkerMonitoringService.ts +2 -1
- package/src/http/middleware/CustomValidation.ts +2 -1
- package/src/http/middleware/DatacenterValidator.ts +2 -1
- package/src/http/middleware/EditWorkerValidation.ts +2 -1
- package/src/http/middleware/FeaturesValidator.ts +2 -1
- package/src/http/middleware/InfrastructureValidator.ts +2 -1
- package/src/http/middleware/OptionsValidator.ts +2 -1
- package/src/http/middleware/PayloadSanitizer.ts +2 -1
- package/src/http/middleware/ProcessorPathSanitizer.ts +3 -7
- package/src/http/middleware/QueueNameSanitizer.ts +2 -1
- package/src/http/middleware/ValidateDriver.ts +1 -1
- package/src/http/middleware/VersionSanitizer.ts +2 -1
- package/src/http/middleware/WorkerNameSanitizer.ts +2 -1
- package/src/http/middleware/WorkerValidationChain.ts +2 -1
- package/src/queueMonitorHistory.ts +3 -1
- package/src/routes/workers.ts +5 -2
- package/src/storage/WorkerStore.ts +2 -2
- package/src/telemetry/api/TelemetryAPI.ts +1 -1
- package/src/telemetry/api/TelemetryMonitoringService.ts +3 -2
- package/src/telemetry/index.ts +3 -2
- package/src/ui/router/ui.ts +9 -11
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Worker API Controller
|
|
3
3
|
* HTTP handlers for worker management API
|
|
4
4
|
*/
|
|
5
|
-
import { Logger } from '@zintrust/core';
|
|
5
|
+
import { Logger } from '@zintrust/core/logger';
|
|
6
6
|
import { getWorkerDetails, getWorkers } from '../dashboard/workers-api.js';
|
|
7
|
-
import { getParam } from '../helper/index.js';
|
|
7
|
+
import { getParam, maskInfrastructurePasswords } from '../helper/index.js';
|
|
8
8
|
import { WorkerFactory } from '../WorkerFactory.js';
|
|
9
9
|
/**
|
|
10
10
|
* Helper to safely get a single string value from query params
|
|
@@ -76,7 +76,24 @@ export const listWorkers = async (req, res) => {
|
|
|
76
76
|
includeInactive: getBooleanParam(query, 'includeInactive', false),
|
|
77
77
|
};
|
|
78
78
|
const result = await getWorkers(queryParams);
|
|
79
|
-
|
|
79
|
+
// Mask passwords in infrastructure data for all workers
|
|
80
|
+
const maskedWorkers = result.workers.map((worker) => {
|
|
81
|
+
const maskedWorker = { ...worker };
|
|
82
|
+
if (maskedWorker.details?.configuration) {
|
|
83
|
+
maskedWorker.details = {
|
|
84
|
+
...maskedWorker.details,
|
|
85
|
+
configuration: {
|
|
86
|
+
...maskedWorker.details.configuration,
|
|
87
|
+
infrastructure: maskInfrastructurePasswords(maskedWorker.details.configuration['infrastructure']),
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
return maskedWorker;
|
|
92
|
+
});
|
|
93
|
+
res.json({
|
|
94
|
+
...result,
|
|
95
|
+
workers: maskedWorkers,
|
|
96
|
+
});
|
|
80
97
|
}
|
|
81
98
|
catch (error) {
|
|
82
99
|
Logger.error('Error fetching workers:', error);
|
|
@@ -98,6 +115,7 @@ export const getWorkerDetailsHandler = async (req, res) => {
|
|
|
98
115
|
}
|
|
99
116
|
const driver = getQueryParam(req.getQuery?.() || {}, 'driver');
|
|
100
117
|
const details = await getWorkerDetails(name, driver);
|
|
118
|
+
// Password masking is already applied in buildWorkerConfiguration
|
|
101
119
|
res.json(details);
|
|
102
120
|
}
|
|
103
121
|
catch (error) {
|
|
@@ -195,6 +213,7 @@ const getWorkerJsonHandler = async (req, res) => {
|
|
|
195
213
|
code: 'WORKER_NOT_FOUND',
|
|
196
214
|
});
|
|
197
215
|
}
|
|
216
|
+
// Mask passwords in infrastructure data (already applied in buildWorkerConfiguration)
|
|
198
217
|
return res.json({
|
|
199
218
|
success: true,
|
|
200
219
|
data: worker,
|
|
@@ -231,9 +250,14 @@ const getWorkerDriverDataHandler = async (req, res) => {
|
|
|
231
250
|
code: 'WORKER_NOT_FOUND',
|
|
232
251
|
});
|
|
233
252
|
}
|
|
253
|
+
// Mask passwords in infrastructure data
|
|
254
|
+
const maskedData = {
|
|
255
|
+
...persistedData,
|
|
256
|
+
infrastructure: maskInfrastructurePasswords(persistedData['infrastructure']),
|
|
257
|
+
};
|
|
234
258
|
return res.json({
|
|
235
259
|
success: true,
|
|
236
|
-
data:
|
|
260
|
+
data: maskedData,
|
|
237
261
|
});
|
|
238
262
|
}
|
|
239
263
|
catch (error) {
|
|
@@ -281,6 +305,7 @@ const updateWorkerJsonHandler = async (req, res) => {
|
|
|
281
305
|
// For now, return the updated data as if it was updated
|
|
282
306
|
// In a real implementation, this would update the worker in the database
|
|
283
307
|
const updatedWorker = { ...existingWorker, ...workerData };
|
|
308
|
+
// Password masking is already applied in buildWorkerConfiguration via getWorkerDetails
|
|
284
309
|
return res.json({
|
|
285
310
|
success: true,
|
|
286
311
|
data: updatedWorker,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Worker Controller
|
|
3
3
|
* HTTP handlers for worker management API
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import type { IRequest, IResponse } from '@zintrust/core/http';
|
|
6
6
|
/**
|
|
7
7
|
* Create a new worker instance
|
|
8
8
|
* @param req.body.name - Worker name (required)
|
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
* Worker Controller
|
|
4
4
|
* HTTP handlers for worker management API
|
|
5
5
|
*/
|
|
6
|
-
import { Cloudflare
|
|
6
|
+
import { Cloudflare } from '@zintrust/core/cloudflare';
|
|
7
|
+
import { Env } from '@zintrust/core/config';
|
|
8
|
+
import { getValidatedBody } from '@zintrust/core/http';
|
|
9
|
+
import { Logger } from '@zintrust/core/logger';
|
|
7
10
|
import { CanaryController } from '../CanaryController.js';
|
|
8
11
|
import { HealthMonitor } from '../HealthMonitor.js';
|
|
9
12
|
import { getParam } from '../helper/index.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Logger
|
|
1
|
+
import { Logger } from '@zintrust/core/logger';
|
|
2
|
+
import { NodeSingletons, workersConfig } from '@zintrust/core/workers';
|
|
2
3
|
import { HealthMonitor } from '../HealthMonitor.js';
|
|
3
4
|
import { getWorkers } from '../dashboard/workers-api.js';
|
|
4
5
|
const createFallbackEmitter = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IRequest, IResponse } from '@zintrust/core/http';
|
|
2
2
|
export type RouteHandler = (req: IRequest, res: IResponse) => Promise<void> | void;
|
|
3
3
|
export interface ValidationSchema {
|
|
4
4
|
[key: string]: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IRequest, IResponse } from '@zintrust/core/http';
|
|
2
2
|
export type RouteHandler = (req: IRequest, res: IResponse) => Promise<void> | void;
|
|
3
3
|
export declare const withDatacenterValidation: (handler: RouteHandler) => RouteHandler;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IRequest, IResponse } from '@zintrust/core/http';
|
|
2
2
|
export type RouteHandler = (req: IRequest, res: IResponse) => Promise<void> | void;
|
|
3
3
|
/**
|
|
4
4
|
* Composite middleware for worker edit validation
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IRequest, IResponse } from '@zintrust/core/http';
|
|
2
2
|
export type RouteHandler = (req: IRequest, res: IResponse) => Promise<void> | void;
|
|
3
3
|
export declare const withFeaturesValidation: (handler: RouteHandler) => RouteHandler;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IRequest, IResponse } from '@zintrust/core/http';
|
|
2
2
|
export type RouteHandler = (req: IRequest, res: IResponse) => Promise<void> | void;
|
|
3
3
|
export interface InfrastructureConfig {
|
|
4
4
|
persistence: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Logger } from '@zintrust/core';
|
|
1
|
+
import { Logger } from '@zintrust/core/logger';
|
|
2
2
|
const VALID_DRIVERS = new Set(['database', 'redis', 'memory']);
|
|
3
3
|
const VALID_DEAD_LETTER_POLICIES = new Set(['expire', 'retry', 'dead-letter']);
|
|
4
4
|
const validatePersistence = (persistence) => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IRequest, IResponse } from '@zintrust/core/http';
|
|
2
2
|
export type RouteHandler = (req: IRequest, res: IResponse) => Promise<void> | void;
|
|
3
3
|
export declare const withOptionsValidation: (handler: RouteHandler) => RouteHandler;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IRequest, IResponse } from '@zintrust/core/http';
|
|
2
2
|
export type RouteHandler = (req: IRequest, res: IResponse) => Promise<void> | void;
|
|
3
3
|
/**
|
|
4
4
|
* Middleware to strip unknown properties from the request body.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IRequest, IResponse } from '@zintrust/core/http';
|
|
2
2
|
export type RouteHandler = (req: IRequest, res: IResponse) => Promise<void> | void;
|
|
3
3
|
export declare const withProcessorPathValidation: (handler: RouteHandler) => RouteHandler;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Logger
|
|
1
|
+
import { Logger } from '@zintrust/core/logger';
|
|
2
|
+
import { NodeSingletons, workersConfig } from '@zintrust/core/workers';
|
|
2
3
|
const PROCESSOR_PATH_PATTERN = /^[a-zA-Z0-9/_.-]+\.(ts|js|mjs|cjs)$/;
|
|
3
4
|
const isUrlSpec = (value) => {
|
|
4
5
|
if (value.startsWith('url:'))
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IRequest, IResponse } from '@zintrust/core/http';
|
|
2
2
|
export type RouteHandler = (req: IRequest, res: IResponse) => Promise<void> | void;
|
|
3
3
|
export declare const withQueueNameValidation: (handler: RouteHandler) => RouteHandler;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* Validate Driver Middleware
|
|
3
3
|
* Ensures the 'driver' query parameter is valid if present.
|
|
4
4
|
*/
|
|
5
|
-
import type { IRequest, IResponse } from '@zintrust/core';
|
|
5
|
+
import type { IRequest, IResponse } from '@zintrust/core/http';
|
|
6
6
|
export type RouteHandler = (req: IRequest, res: IResponse) => Promise<void> | void;
|
|
7
7
|
export declare const withDriverValidation: (handler: RouteHandler) => RouteHandler;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IRequest, IResponse } from '@zintrust/core/http';
|
|
2
2
|
export type RouteHandler = (req: IRequest, res: IResponse) => Promise<void> | void;
|
|
3
3
|
export declare const withVersionValidation: (handler: RouteHandler) => RouteHandler;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IRequest, IResponse } from '@zintrust/core/http';
|
|
2
2
|
export type RouteHandler = (req: IRequest, res: IResponse) => Promise<void> | void;
|
|
3
3
|
export declare const withWorkerNameValidation: (handler: RouteHandler) => RouteHandler;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { IRequest, IResponse } from '@zintrust/core/http';
|
|
2
2
|
export type RouteHandler = (req: IRequest, res: IResponse) => Promise<void> | void;
|
|
3
3
|
/**
|
|
4
4
|
* Composite middleware for worker creation validation
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { queueConfig } from '@zintrust/core/config';
|
|
2
|
+
import { Logger } from '@zintrust/core/logger';
|
|
3
|
+
import { isNonEmptyString, isObject } from '@zintrust/core/utils';
|
|
2
4
|
let queueMonitorMetricsPromise = null;
|
|
3
5
|
const toFiniteInteger = (value, fallback) => {
|
|
4
6
|
if (typeof value === 'number' && Number.isFinite(value)) {
|
package/dist/routes/workers.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Worker Management Routes
|
|
3
3
|
* HTTP API for managing workers with dashboard functionality
|
|
4
4
|
*/
|
|
5
|
-
import type { IRouter } from '@zintrust/core';
|
|
5
|
+
import type { IRouter } from '@zintrust/core/http';
|
|
6
6
|
import { type WorkersDashboardUiOptions } from '../dashboard';
|
|
7
7
|
type WorkerUiOptions = WorkersDashboardUiOptions;
|
|
8
8
|
type RouteOptions = {
|
package/dist/routes/workers.js
CHANGED
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
* Worker Management Routes
|
|
3
3
|
* HTTP API for managing workers with dashboard functionality
|
|
4
4
|
*/
|
|
5
|
-
import { Cloudflare
|
|
5
|
+
import { Cloudflare } from '@zintrust/core/cloudflare';
|
|
6
|
+
import { Env } from '@zintrust/core/config';
|
|
7
|
+
import { Router } from '@zintrust/core/http';
|
|
8
|
+
import { Logger } from '@zintrust/core/logger';
|
|
6
9
|
import { HealthMonitor } from '../HealthMonitor.js';
|
|
7
10
|
import { ValidationSchemas, withCustomValidation } from '../http/middleware/CustomValidation.js';
|
|
8
11
|
import { withEditWorkerValidation } from '../http/middleware/EditWorkerValidation.js';
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* Worker Store
|
|
3
3
|
* Persistence layer for workers (memory, redis, db)
|
|
4
4
|
*/
|
|
5
|
-
import type
|
|
6
|
-
import { type
|
|
5
|
+
import { type IDatabase } from '@zintrust/core/database';
|
|
6
|
+
import { type createRedisConnection } from '@zintrust/core/redis';
|
|
7
7
|
type RedisConnection = ReturnType<typeof createRedisConnection>;
|
|
8
8
|
export type WorkerRecord = {
|
|
9
9
|
name: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Logger } from '@zintrust/core';
|
|
1
|
+
import { Logger } from '@zintrust/core/logger';
|
|
2
2
|
import { getWorkers } from '../../dashboard/workers-api.js';
|
|
3
3
|
import { HealthMonitor } from '../../HealthMonitor.js';
|
|
4
4
|
import { ResourceMonitor } from '../../ResourceMonitor.js';
|
package/dist/telemetry/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Env
|
|
1
|
+
import { Env } from '@zintrust/core/config';
|
|
2
|
+
import { Router } from '@zintrust/core/http';
|
|
2
3
|
import { createSnapshotBuilder } from './api/TelemetryAPI.js';
|
|
3
4
|
import { teleStream } from './api/TelemetryMonitoringService.js';
|
|
4
5
|
import { getDashboardHtml } from './routes/dashboard.js';
|
package/dist/ui/router/ui.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { IRouter } from '@zintrust/core';
|
|
1
|
+
import type { IRouter } from '@zintrust/core/http';
|
|
2
2
|
export declare const uiResolver: (uiBasePath: string) => Promise<string>;
|
|
3
3
|
export declare const registerStaticAssets: (router: IRouter, middleware: ReadonlyArray<string>) => void;
|
package/dist/ui/router/ui.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import { Cloudflare
|
|
1
|
+
import { Cloudflare } from '@zintrust/core/cloudflare';
|
|
2
|
+
import { Env } from '@zintrust/core/config';
|
|
3
|
+
import { ErrorFactory } from '@zintrust/core/errors';
|
|
4
|
+
import { MIME_TYPES, Router } from '@zintrust/core/http';
|
|
5
|
+
import { Logger } from '@zintrust/core/logger';
|
|
6
|
+
import { NodeSingletons } from '@zintrust/core/workers';
|
|
2
7
|
import { BrandFavicon } from '../BrandFavicon.js';
|
|
3
8
|
import { INDEX_HTML, MAIN_JS, STYLES_CSS, ZINTRUST_SVG } from './EmbeddedAssets.js';
|
|
4
9
|
const isCloudflare = (() => {
|
package/package.json
CHANGED
package/src/AnomalyDetection.ts
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
* Sealed namespace for immutability
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { ErrorFactory
|
|
7
|
+
import { ErrorFactory } from '@zintrust/core/errors';
|
|
8
|
+
import { Logger } from '@zintrust/core/logger';
|
|
9
|
+
import { generateUuid } from '@zintrust/core/utils';
|
|
8
10
|
import { ResourceMonitor } from './ResourceMonitor';
|
|
9
11
|
import { WorkerMetrics, type MetricPoint, type MetricType } from './WorkerMetrics';
|
|
10
12
|
|
|
@@ -293,7 +295,7 @@ export const AnomalyDetection = Object.freeze({
|
|
|
293
295
|
severity: selectSeverity(zScore),
|
|
294
296
|
possibleCauses: buildPossibleCauses(metric),
|
|
295
297
|
recommendations: buildRecommendations(metric),
|
|
296
|
-
}
|
|
298
|
+
};
|
|
297
299
|
})
|
|
298
300
|
);
|
|
299
301
|
|
package/src/AutoScaler.ts
CHANGED
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* Sealed namespace for immutability
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
7
|
+
import { ErrorFactory } from '@zintrust/core/errors';
|
|
8
|
+
import { Logger } from '@zintrust/core/logger';
|
|
9
|
+
import { type WorkerConfig, workersConfig } from '@zintrust/core/workers';
|
|
9
10
|
|
|
10
11
|
export type ScalingDecision = {
|
|
11
12
|
workerName: string;
|
package/src/BroadcastWorker.ts
CHANGED
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
* Use with Queue.dequeue() in a background process or cron job.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Logger } from '@zintrust/core/logger';
|
|
9
|
+
import { Broadcast, isArray, isNonEmptyString } from '@zintrust/core/utils';
|
|
9
10
|
import { createQueueWorker } from './createQueueWorker';
|
|
10
11
|
|
|
11
12
|
type BroadcastJob = {
|
package/src/CanaryController.ts
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Sealed namespace for immutability
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { ErrorFactory
|
|
7
|
+
import { ErrorFactory } from '@zintrust/core/errors';
|
|
8
|
+
import { Logger } from '@zintrust/core/logger';
|
|
8
9
|
import { CircuitBreaker } from './CircuitBreaker';
|
|
9
10
|
|
|
10
11
|
export type CanaryStage =
|
package/src/ChaosEngineering.ts
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
* Sealed namespace for immutability
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { ErrorFactory
|
|
7
|
+
import { ErrorFactory } from '@zintrust/core/errors';
|
|
8
|
+
import { Logger } from '@zintrust/core/logger';
|
|
9
|
+
import { generateUuid } from '@zintrust/core/utils';
|
|
8
10
|
import { CircuitBreaker } from './CircuitBreaker';
|
|
9
11
|
import { Observability } from './Observability';
|
|
10
12
|
import { ResourceMonitor } from './ResourceMonitor';
|
package/src/CircuitBreaker.ts
CHANGED
package/src/ClusterLock.ts
CHANGED
|
@@ -4,14 +4,11 @@
|
|
|
4
4
|
* Sealed namespace for immutability
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
generateUuid,
|
|
13
|
-
type RedisConfig,
|
|
14
|
-
} from '@zintrust/core';
|
|
7
|
+
import { Cloudflare } from '@zintrust/core/cloudflare';
|
|
8
|
+
import { ErrorFactory } from '@zintrust/core/errors';
|
|
9
|
+
import { Logger } from '@zintrust/core/logger';
|
|
10
|
+
import { createRedisConnection, type RedisConfig } from '@zintrust/core/redis';
|
|
11
|
+
import { generateUuid } from '@zintrust/core/utils';
|
|
15
12
|
|
|
16
13
|
type RedisConnection = ReturnType<typeof createRedisConnection>;
|
|
17
14
|
|
package/src/ComplianceManager.ts
CHANGED
|
@@ -4,13 +4,10 @@
|
|
|
4
4
|
* Sealed namespace for immutability
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
createRedisConnection,
|
|
12
|
-
type RedisConfig,
|
|
13
|
-
} from '@zintrust/core';
|
|
7
|
+
import { ErrorFactory } from '@zintrust/core/errors';
|
|
8
|
+
import { Logger } from '@zintrust/core/logger';
|
|
9
|
+
import { createRedisConnection, type RedisConfig } from '@zintrust/core/redis';
|
|
10
|
+
import { NodeSingletons } from '@zintrust/core/workers';
|
|
14
11
|
|
|
15
12
|
type RedisConnection = ReturnType<typeof createRedisConnection>;
|
|
16
13
|
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* Sealed namespace for immutability
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { ErrorFactory
|
|
7
|
+
import { ErrorFactory } from '@zintrust/core/errors';
|
|
8
|
+
import { Logger } from '@zintrust/core/logger';
|
|
8
9
|
import { ClusterLock } from './ClusterLock';
|
|
9
10
|
|
|
10
11
|
export type DatacenterRegion = {
|
package/src/DeadLetterQueue.ts
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
* Sealed namespace for immutability
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { ErrorFactory
|
|
7
|
+
import { ErrorFactory } from '@zintrust/core/errors';
|
|
8
|
+
import { Logger } from '@zintrust/core/logger';
|
|
9
|
+
import { createRedisConnection, type RedisConfig } from '@zintrust/core/redis';
|
|
8
10
|
import { keyPrefixFor } from './config/workerConfig';
|
|
9
11
|
|
|
10
12
|
type RedisConnection = ReturnType<typeof createRedisConnection>;
|
package/src/HealthMonitor.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ErrorFactory
|
|
1
|
+
import { ErrorFactory } from '@zintrust/core/errors';
|
|
2
|
+
import { Logger } from '@zintrust/core/logger';
|
|
2
3
|
import type { Worker } from 'bullmq';
|
|
3
4
|
import { WorkerCreationStatus, WorkerFactory } from './WorkerFactory';
|
|
4
5
|
|
package/src/MultiQueueWorker.ts
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
* Sealed namespace for immutability
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { ErrorFactory
|
|
7
|
+
import { ErrorFactory } from '@zintrust/core/errors';
|
|
8
|
+
import { Logger } from '@zintrust/core/logger';
|
|
9
|
+
import { ShutdownTrace } from '@zintrust/core/workers';
|
|
8
10
|
import { Worker, type Job, type WorkerOptions } from 'bullmq';
|
|
9
11
|
import { PriorityQueue } from './PriorityQueue';
|
|
10
12
|
|
package/src/Observability.ts
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import type { Span, SpanOptions, Tracer } from '@opentelemetry/api';
|
|
8
|
-
import { ErrorFactory
|
|
8
|
+
import { ErrorFactory } from '@zintrust/core/errors';
|
|
9
|
+
import { Logger } from '@zintrust/core/logger';
|
|
10
|
+
import { generateUuid } from '@zintrust/core/utils';
|
|
9
11
|
import type { Counter, Gauge, Histogram, Registry, Summary } from 'prom-client';
|
|
10
12
|
|
|
11
13
|
export type ObservabilityConfig = {
|
package/src/PluginManager.ts
CHANGED
package/src/PriorityQueue.ts
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
* Sealed namespace for immutability
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { ErrorFactory
|
|
7
|
+
import { ErrorFactory } from '@zintrust/core/errors';
|
|
8
|
+
import { Logger } from '@zintrust/core/logger';
|
|
9
|
+
import type { RedisConfig } from '@zintrust/core/redis';
|
|
8
10
|
import type { Queue } from 'bullmq';
|
|
9
11
|
|
|
10
12
|
export type PriorityLevel = 'critical' | 'high' | 'normal' | 'low';
|
package/src/ResourceMonitor.ts
CHANGED
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
* Sealed namespace for immutability
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { Env
|
|
7
|
+
import { Env } from '@zintrust/core/config';
|
|
8
|
+
import { Logger } from '@zintrust/core/logger';
|
|
9
|
+
import { NodeSingletons } from '@zintrust/core/workers';
|
|
8
10
|
|
|
9
11
|
const getOsModule = (): typeof NodeSingletons.os => NodeSingletons?.os ?? null;
|
|
10
12
|
|