@zintrust/workers 2.0.2 → 2.0.4

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.
Files changed (128) hide show
  1. package/dist/AnomalyDetection.js +3 -1
  2. package/dist/AutoScaler.js +3 -1
  3. package/dist/BroadcastWorker.js +2 -1
  4. package/dist/CanaryController.js +2 -1
  5. package/dist/ChaosEngineering.js +3 -1
  6. package/dist/CircuitBreaker.js +1 -1
  7. package/dist/ClusterLock.d.ts +1 -1
  8. package/dist/ClusterLock.js +5 -1
  9. package/dist/ComplianceManager.d.ts +1 -1
  10. package/dist/ComplianceManager.js +4 -1
  11. package/dist/DatacenterOrchestrator.js +2 -1
  12. package/dist/DeadLetterQueue.d.ts +1 -1
  13. package/dist/DeadLetterQueue.js +3 -1
  14. package/dist/HealthMonitor.js +2 -1
  15. package/dist/MultiQueueWorker.js +3 -1
  16. package/dist/NotificationWorker.js +1 -1
  17. package/dist/Observability.js +3 -1
  18. package/dist/PluginManager.js +2 -1
  19. package/dist/PriorityQueue.d.ts +1 -1
  20. package/dist/PriorityQueue.js +2 -1
  21. package/dist/ResourceMonitor.js +3 -1
  22. package/dist/SLAMonitor.js +3 -1
  23. package/dist/WorkerFactory.d.ts +2 -2
  24. package/dist/WorkerFactory.js +8 -2
  25. package/dist/WorkerInit.js +3 -1
  26. package/dist/WorkerMetrics.d.ts +1 -1
  27. package/dist/WorkerMetrics.js +3 -1
  28. package/dist/WorkerRegistry.d.ts +1 -1
  29. package/dist/WorkerRegistry.js +2 -1
  30. package/dist/WorkerShutdown.js +1 -1
  31. package/dist/WorkerVersioning.js +2 -1
  32. package/dist/config/workerConfig.js +1 -1
  33. package/dist/createQueueWorker.js +11 -44
  34. package/dist/dashboard/workers-api.js +6 -3
  35. package/dist/helper/index.d.ts +1 -1
  36. package/dist/http/WorkerApiController.d.ts +1 -1
  37. package/dist/http/WorkerApiController.js +1 -1
  38. package/dist/http/WorkerController.d.ts +1 -1
  39. package/dist/http/WorkerController.js +4 -1
  40. package/dist/http/WorkerMonitoringService.js +2 -1
  41. package/dist/http/middleware/CustomValidation.d.ts +1 -1
  42. package/dist/http/middleware/CustomValidation.js +1 -1
  43. package/dist/http/middleware/DatacenterValidator.d.ts +1 -1
  44. package/dist/http/middleware/DatacenterValidator.js +1 -1
  45. package/dist/http/middleware/EditWorkerValidation.d.ts +1 -1
  46. package/dist/http/middleware/EditWorkerValidation.js +1 -1
  47. package/dist/http/middleware/FeaturesValidator.d.ts +1 -1
  48. package/dist/http/middleware/FeaturesValidator.js +1 -1
  49. package/dist/http/middleware/InfrastructureValidator.d.ts +1 -1
  50. package/dist/http/middleware/InfrastructureValidator.js +1 -1
  51. package/dist/http/middleware/OptionsValidator.d.ts +1 -1
  52. package/dist/http/middleware/OptionsValidator.js +1 -1
  53. package/dist/http/middleware/PayloadSanitizer.d.ts +1 -1
  54. package/dist/http/middleware/PayloadSanitizer.js +1 -1
  55. package/dist/http/middleware/ProcessorPathSanitizer.d.ts +1 -1
  56. package/dist/http/middleware/ProcessorPathSanitizer.js +2 -1
  57. package/dist/http/middleware/QueueNameSanitizer.d.ts +1 -1
  58. package/dist/http/middleware/QueueNameSanitizer.js +1 -1
  59. package/dist/http/middleware/ValidateDriver.d.ts +1 -1
  60. package/dist/http/middleware/VersionSanitizer.d.ts +1 -1
  61. package/dist/http/middleware/VersionSanitizer.js +1 -1
  62. package/dist/http/middleware/WorkerNameSanitizer.d.ts +1 -1
  63. package/dist/http/middleware/WorkerNameSanitizer.js +1 -1
  64. package/dist/http/middleware/WorkerValidationChain.d.ts +1 -1
  65. package/dist/http/middleware/WorkerValidationChain.js +1 -1
  66. package/dist/queueMonitorHistory.js +3 -1
  67. package/dist/routes/workers.d.ts +1 -1
  68. package/dist/routes/workers.js +4 -1
  69. package/dist/storage/WorkerStore.d.ts +2 -2
  70. package/dist/telemetry/api/TelemetryAPI.js +1 -1
  71. package/dist/telemetry/api/TelemetryMonitoringService.d.ts +1 -1
  72. package/dist/telemetry/api/TelemetryMonitoringService.js +2 -1
  73. package/dist/telemetry/index.d.ts +1 -1
  74. package/dist/telemetry/index.js +2 -1
  75. package/dist/ui/router/ui.d.ts +1 -1
  76. package/dist/ui/router/ui.js +6 -1
  77. package/package.json +1 -1
  78. package/src/AnomalyDetection.ts +4 -2
  79. package/src/AutoScaler.ts +3 -2
  80. package/src/BroadcastWorker.ts +2 -1
  81. package/src/CanaryController.ts +2 -1
  82. package/src/ChaosEngineering.ts +3 -1
  83. package/src/CircuitBreaker.ts +1 -1
  84. package/src/ClusterLock.ts +5 -8
  85. package/src/ComplianceManager.ts +4 -7
  86. package/src/DatacenterOrchestrator.ts +2 -1
  87. package/src/DeadLetterQueue.ts +3 -1
  88. package/src/HealthMonitor.ts +2 -1
  89. package/src/MultiQueueWorker.ts +3 -1
  90. package/src/NotificationWorker.ts +1 -1
  91. package/src/Observability.ts +3 -1
  92. package/src/PluginManager.ts +2 -1
  93. package/src/PriorityQueue.ts +3 -1
  94. package/src/ResourceMonitor.ts +3 -1
  95. package/src/SLAMonitor.ts +3 -1
  96. package/src/WorkerFactory.ts +13 -19
  97. package/src/WorkerInit.ts +3 -1
  98. package/src/WorkerMetrics.ts +3 -7
  99. package/src/WorkerRegistry.ts +3 -1
  100. package/src/WorkerShutdown.ts +1 -1
  101. package/src/WorkerVersioning.ts +2 -1
  102. package/src/config/workerConfig.ts +1 -1
  103. package/src/createQueueWorker.ts +12 -45
  104. package/src/dashboard/workers-api.ts +8 -4
  105. package/src/helper/index.ts +1 -1
  106. package/src/http/WorkerApiController.ts +2 -2
  107. package/src/http/WorkerController.ts +5 -8
  108. package/src/http/WorkerMonitoringService.ts +2 -1
  109. package/src/http/middleware/CustomValidation.ts +2 -1
  110. package/src/http/middleware/DatacenterValidator.ts +2 -1
  111. package/src/http/middleware/EditWorkerValidation.ts +2 -1
  112. package/src/http/middleware/FeaturesValidator.ts +2 -1
  113. package/src/http/middleware/InfrastructureValidator.ts +2 -1
  114. package/src/http/middleware/OptionsValidator.ts +2 -1
  115. package/src/http/middleware/PayloadSanitizer.ts +2 -1
  116. package/src/http/middleware/ProcessorPathSanitizer.ts +3 -7
  117. package/src/http/middleware/QueueNameSanitizer.ts +2 -1
  118. package/src/http/middleware/ValidateDriver.ts +1 -1
  119. package/src/http/middleware/VersionSanitizer.ts +2 -1
  120. package/src/http/middleware/WorkerNameSanitizer.ts +2 -1
  121. package/src/http/middleware/WorkerValidationChain.ts +2 -1
  122. package/src/queueMonitorHistory.ts +3 -1
  123. package/src/routes/workers.ts +5 -2
  124. package/src/storage/WorkerStore.ts +2 -2
  125. package/src/telemetry/api/TelemetryAPI.ts +1 -1
  126. package/src/telemetry/api/TelemetryMonitoringService.ts +3 -2
  127. package/src/telemetry/index.ts +3 -2
  128. package/src/ui/router/ui.ts +9 -11
@@ -1,4 +1,4 @@
1
- import { Logger } from '@zintrust/core';
1
+ import { Logger } from '@zintrust/core/logger';
2
2
  const validateConcurrency = (concurrency) => {
3
3
  if (concurrency === undefined || concurrency === null) {
4
4
  return 'Concurrency is required';
@@ -1,4 +1,4 @@
1
- import { type IRequest, type IResponse } from '@zintrust/core';
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,4 +1,4 @@
1
- import { Logger } from '@zintrust/core';
1
+ import { Logger } from '@zintrust/core/logger';
2
2
  /**
3
3
  * Middleware to strip unknown properties from the request body.
4
4
  * Only properties included in the allowedKeys list are preserved.
@@ -1,3 +1,3 @@
1
- import { type IRequest, type IResponse } from '@zintrust/core';
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, NodeSingletons, workersConfig, } from '@zintrust/core';
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 { type IRequest, type IResponse } from '@zintrust/core';
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;
@@ -1,4 +1,4 @@
1
- import { Logger } from '@zintrust/core';
1
+ import { Logger } from '@zintrust/core/logger';
2
2
  const QUEUE_NAME_PATTERN = /^[a-zA-Z0-9_-]{3,50}$/;
3
3
  export const withQueueNameValidation = (handler) => {
4
4
  return async (req, res) => {
@@ -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 { type IRequest, type IResponse } from '@zintrust/core';
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,4 +1,4 @@
1
- import { Logger } from '@zintrust/core';
1
+ import { Logger } from '@zintrust/core/logger';
2
2
  const VERSION_PATTERN = /^\d+\.\d+\.\d+$/;
3
3
  export const withVersionValidation = (handler) => {
4
4
  return async (req, res) => {
@@ -1,3 +1,3 @@
1
- import { type IRequest, type IResponse } from '@zintrust/core';
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 { Logger } from '@zintrust/core';
1
+ import { Logger } from '@zintrust/core/logger';
2
2
  const WORKER_NAME_PATTERN = /^[a-zA-Z0-9_-]{3,50}$/;
3
3
  export const withWorkerNameValidation = (handler) => {
4
4
  return async (req, res) => {
@@ -1,4 +1,4 @@
1
- import { type IRequest, type IResponse } from '@zintrust/core';
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,4 @@
1
- import { Logger } from '@zintrust/core';
1
+ import { Logger } from '@zintrust/core/logger';
2
2
  // Import individual validators
3
3
  import { withDatacenterValidation } from './DatacenterValidator.js';
4
4
  import { withFeaturesValidation } from './FeaturesValidator.js';
@@ -1,4 +1,6 @@
1
- import { isNonEmptyString, isObject, Logger, queueConfig } from '@zintrust/core';
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)) {
@@ -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 = {
@@ -2,7 +2,10 @@
2
2
  * Worker Management Routes
3
3
  * HTTP API for managing workers with dashboard functionality
4
4
  */
5
- import { Cloudflare, Env, Logger, Router } from '@zintrust/core';
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 { createRedisConnection } from '@zintrust/core';
6
- import { type IDatabase } from '@zintrust/core';
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';
@@ -1,4 +1,4 @@
1
- import type { IResponse } from '@zintrust/core';
1
+ import type { IResponse } from '@zintrust/core/http';
2
2
  import type { createSnapshotBuilder, TelemetrySettings } from './TelemetryAPI';
3
3
  export type TelemetrySnapshotData = {
4
4
  type: string;
@@ -1,4 +1,5 @@
1
- import { Logger, NodeSingletons } from '@zintrust/core';
1
+ import { Logger } from '@zintrust/core/logger';
2
+ import { NodeSingletons } from '@zintrust/core/workers';
2
3
  const createFallbackEmitter = () => {
3
4
  const listeners = new Map();
4
5
  return {
@@ -1,4 +1,4 @@
1
- import type { IRouter } from '@zintrust/core';
1
+ import type { IRouter } from '@zintrust/core/http';
2
2
  export type TelemetryDashboardConfig = {
3
3
  enabled?: boolean;
4
4
  basePath?: string;
@@ -1,4 +1,5 @@
1
- import { Env, Router } from '@zintrust/core';
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';
@@ -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;
@@ -1,4 +1,9 @@
1
- import { Cloudflare, Env, ErrorFactory, Logger, MIME_TYPES, NodeSingletons, Router, } from '@zintrust/core';
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zintrust/workers",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Worker orchestration and background job management for ZinTrust.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -4,7 +4,9 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import { ErrorFactory, Logger, generateUuid } from '@zintrust/core';
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
- } as IAnomaly;
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 type { WorkerConfig } from '@zintrust/core';
8
- import { ErrorFactory, Logger, workersConfig } from '@zintrust/core';
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;
@@ -5,7 +5,8 @@
5
5
  * Use with Queue.dequeue() in a background process or cron job.
6
6
  */
7
7
 
8
- import { Broadcast, isArray, isNonEmptyString, Logger } from '@zintrust/core';
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 = {
@@ -4,7 +4,8 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import { ErrorFactory, Logger } from '@zintrust/core';
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 =
@@ -4,7 +4,9 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import { ErrorFactory, Logger, generateUuid } from '@zintrust/core';
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';
@@ -4,7 +4,7 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import { Logger } from '@zintrust/core';
7
+ import { Logger } from '@zintrust/core/logger';
8
8
 
9
9
  export type CircuitState = 'closed' | 'open' | 'half-open';
10
10
 
@@ -4,14 +4,11 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import {
8
- Cloudflare,
9
- ErrorFactory,
10
- Logger,
11
- createRedisConnection,
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
 
@@ -4,13 +4,10 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import {
8
- ErrorFactory,
9
- Logger,
10
- NodeSingletons,
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, Logger } from '@zintrust/core';
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 = {
@@ -4,7 +4,9 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import { ErrorFactory, Logger, createRedisConnection, type RedisConfig } 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';
8
10
  import { keyPrefixFor } from './config/workerConfig';
9
11
 
10
12
  type RedisConnection = ReturnType<typeof createRedisConnection>;
@@ -1,4 +1,5 @@
1
- import { ErrorFactory, Logger } from '@zintrust/core';
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
 
@@ -4,7 +4,9 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import { ErrorFactory, Logger, ShutdownTrace } from '@zintrust/core';
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
 
@@ -5,7 +5,7 @@
5
5
  * Use with Queue.dequeue() in a background process or cron job.
6
6
  */
7
7
 
8
- import { Notification } from '@zintrust/core';
8
+ import { Notification } from '@zintrust/core/mail';
9
9
  import { createQueueWorker } from './createQueueWorker';
10
10
 
11
11
  type NotificationJob = {
@@ -5,7 +5,9 @@
5
5
  */
6
6
 
7
7
  import type { Span, SpanOptions, Tracer } from '@opentelemetry/api';
8
- import { ErrorFactory, Logger, generateUuid } from '@zintrust/core';
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 = {
@@ -4,7 +4,8 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import { ErrorFactory, Logger } from '@zintrust/core';
7
+ import { ErrorFactory } from '@zintrust/core/errors';
8
+ import { Logger } from '@zintrust/core/logger';
8
9
 
9
10
  export type PluginHook =
10
11
  | 'beforeStart'
@@ -4,7 +4,9 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import { ErrorFactory, Logger, type RedisConfig } from '@zintrust/core';
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';
@@ -4,7 +4,9 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import { Env, Logger, NodeSingletons } from '@zintrust/core';
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
 
package/src/SLAMonitor.ts CHANGED
@@ -4,7 +4,9 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import { ErrorFactory, Logger, generateUuid } from '@zintrust/core';
7
+ import { ErrorFactory } from '@zintrust/core/errors';
8
+ import { Logger } from '@zintrust/core/logger';
9
+ import { generateUuid } from '@zintrust/core/utils';
8
10
  import { HealthMonitor, type HealthCheckResult } from './HealthMonitor';
9
11
  import { WorkerMetrics, type MetricPoint, type MetricType } from './WorkerMetrics';
10
12
 
@@ -5,31 +5,25 @@
5
5
  */
6
6
 
7
7
  import * as ZintrustCoreModule from '@zintrust/core';
8
+ import { Cloudflare, databaseConfig, Env, queueConfig, workersConfig } from '@zintrust/core/config';
9
+ import { useEnsureDbConnected, type IDatabase } from '@zintrust/core/database';
10
+ import { ErrorFactory } from '@zintrust/core/errors';
11
+ import { Logger } from '@zintrust/core/logger';
12
+ import { DatabaseConnectionRegistry, registerDatabasesFromRuntimeConfig } from '@zintrust/core/orm';
13
+ import { JobStateTracker } from '@zintrust/core/queue';
8
14
  import {
9
- Env,
10
- ErrorFactory,
11
- generateUuid,
15
+ createRedisConnection,
12
16
  getBullMQSafeQueueName,
17
+ type RedisConfig,
18
+ } from '@zintrust/core/redis';
19
+ import {
20
+ generateUuid,
13
21
  isFunction,
14
22
  isNonEmptyString,
15
23
  isObject,
16
- JobStateTracker,
17
- Logger,
18
- NodeSingletons,
19
- useEnsureDbConnected,
20
24
  ZintrustLang,
21
- type IDatabase,
22
- type WorkerStatus,
23
- } from '@zintrust/core';
24
- import {
25
- Cloudflare,
26
- createRedisConnection,
27
- databaseConfig,
28
- queueConfig,
29
- workersConfig,
30
- type RedisConfig,
31
- } from '@zintrust/core/config';
32
- import { DatabaseConnectionRegistry, registerDatabasesFromRuntimeConfig } from '@zintrust/core/orm';
25
+ } from '@zintrust/core/utils';
26
+ import { NodeSingletons, type WorkerStatus } from '@zintrust/core/workers';
33
27
  import { Worker, type Job, type WorkerOptions } from 'bullmq';
34
28
  import { AutoScaler, type AutoScalerConfig } from './AutoScaler';
35
29
  import { CanaryController } from './CanaryController';
package/src/WorkerInit.ts CHANGED
@@ -8,7 +8,9 @@
8
8
  * - Ensures graceful startup and shutdown
9
9
  */
10
10
 
11
- import { Env, isObject, Logger } from '@zintrust/core';
11
+ import { Env } from '@zintrust/core/config';
12
+ import { Logger } from '@zintrust/core/logger';
13
+ import { isObject } from '@zintrust/core/utils';
12
14
  import { ResourceMonitor } from './ResourceMonitor';
13
15
  import type { WorkerPersistenceConfig } from './WorkerFactory';
14
16
  import { WorkerFactory } from './WorkerFactory';
@@ -4,13 +4,9 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import {
8
- ErrorFactory,
9
- Logger,
10
- RedisKeys,
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 { RedisKeys, createRedisConnection, type RedisConfig } from '@zintrust/core/redis';
14
10
 
15
11
  type RedisConnection = ReturnType<typeof createRedisConnection>;
16
12
  type RedisPipeline = ReturnType<RedisConnection['pipeline']>;
@@ -4,7 +4,9 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import { ErrorFactory, Logger, type WorkerConfig, type WorkerStatus } from '@zintrust/core';
7
+ import { ErrorFactory } from '@zintrust/core/errors';
8
+ import { Logger } from '@zintrust/core/logger';
9
+ import { type WorkerConfig, type WorkerStatus } from '@zintrust/core/workers';
8
10
  import { AnomalyDetection } from './AnomalyDetection';
9
11
 
10
12
  export type WorkerMetadata = {
@@ -5,7 +5,7 @@
5
5
  * Coordinates orderly shutdown of all worker modules and the WorkerFactory.
6
6
  */
7
7
 
8
- import { Logger } from '@zintrust/core';
8
+ import { Logger } from '@zintrust/core/logger';
9
9
  import { WorkerFactory } from './WorkerFactory';
10
10
 
11
11
  // ============================================================================
@@ -4,7 +4,8 @@
4
4
  * Sealed namespace for immutability
5
5
  */
6
6
 
7
- import { ErrorFactory, Logger } from '@zintrust/core';
7
+ import { ErrorFactory } from '@zintrust/core/errors';
8
+ import { Logger } from '@zintrust/core/logger';
8
9
 
9
10
  export type SemanticVersion = {
10
11
  major: number;
@@ -1,4 +1,4 @@
1
- import { Env, appConfig } from '@zintrust/core';
1
+ import { appConfig, Env } from '@zintrust/core/config';
2
2
 
3
3
  const normalizeBaseUrl = (value: string): string => {
4
4
  let end = value.length;