@bernierllc/retry-suite 0.3.0 → 0.5.1
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/admin/admin-server.js +6 -3
- package/dist/config/configuration-manager.js +2 -1
- package/dist/errors.d.ts +11 -0
- package/dist/errors.js +24 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/integrations/email-integration.js +4 -1
- package/dist/integrations/integration-manager.js +2 -1
- package/dist/integrations/slack-integration.js +2 -1
- package/dist/integrations/webhook-integration.js +2 -1
- package/dist/retry-suite.js +13 -4
- package/package.json +6 -6
|
@@ -51,10 +51,13 @@ const mockPath = {
|
|
|
51
51
|
join: (...args) => args.join('/')
|
|
52
52
|
};
|
|
53
53
|
class AdminServer {
|
|
54
|
+
app;
|
|
55
|
+
server = null;
|
|
56
|
+
wss = null;
|
|
57
|
+
config;
|
|
58
|
+
retrySuite;
|
|
59
|
+
connectedClients = new Set();
|
|
54
60
|
constructor(config, retrySuite) {
|
|
55
|
-
this.server = null;
|
|
56
|
-
this.wss = null;
|
|
57
|
-
this.connectedClients = new Set();
|
|
58
61
|
this.config = config;
|
|
59
62
|
this.retrySuite = retrySuite;
|
|
60
63
|
this.app = mockExpress();
|
|
@@ -9,8 +9,9 @@ Redistribution or use in other products or commercial offerings is not permitted
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.ConfigurationManager = void 0;
|
|
11
11
|
class ConfigurationManager {
|
|
12
|
+
config;
|
|
13
|
+
configValidators = new Map();
|
|
12
14
|
constructor(initialConfig) {
|
|
13
|
-
this.configValidators = new Map();
|
|
14
15
|
this.config = { ...initialConfig };
|
|
15
16
|
this.setupValidators();
|
|
16
17
|
}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type RetrySuiteErrorCode = 'RETRY_SUITE_ERROR' | 'INVALID_INPUT' | 'OPERATION_FAILED';
|
|
2
|
+
export interface RetrySuiteErrorOptions {
|
|
3
|
+
cause?: Error;
|
|
4
|
+
code?: RetrySuiteErrorCode;
|
|
5
|
+
context?: Record<string, unknown>;
|
|
6
|
+
}
|
|
7
|
+
export declare class RetrySuiteError extends Error {
|
|
8
|
+
readonly code: RetrySuiteErrorCode;
|
|
9
|
+
readonly context?: Record<string, unknown>;
|
|
10
|
+
constructor(message: string, options?: RetrySuiteErrorOptions);
|
|
11
|
+
}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
Copyright (c) 2025 Bernier LLC
|
|
4
|
+
|
|
5
|
+
This file is licensed to the client under a limited-use license.
|
|
6
|
+
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
7
|
+
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.RetrySuiteError = void 0;
|
|
11
|
+
class RetrySuiteError extends Error {
|
|
12
|
+
code;
|
|
13
|
+
context;
|
|
14
|
+
constructor(message, options) {
|
|
15
|
+
super(message, options?.cause ? { cause: options.cause } : undefined);
|
|
16
|
+
this.name = 'RetrySuiteError';
|
|
17
|
+
this.code = options?.code ?? 'RETRY_SUITE_ERROR';
|
|
18
|
+
if (options?.context !== undefined) {
|
|
19
|
+
this.context = options.context;
|
|
20
|
+
}
|
|
21
|
+
Error.captureStackTrace?.(this, this.constructor);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.RetrySuiteError = RetrySuiteError;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { RetrySuite } from './retry-suite';
|
|
2
|
+
export { RetrySuiteError, type RetrySuiteErrorCode, type RetrySuiteErrorOptions } from './errors';
|
|
2
3
|
export { AdminServer } from './admin/admin-server';
|
|
3
4
|
export { IntegrationManager } from './integrations/integration-manager';
|
|
4
5
|
export { ConfigurationManager } from './config/configuration-manager';
|
package/dist/index.js
CHANGED
|
@@ -7,10 +7,12 @@ The client may use and modify this code *only within the scope of the project it
|
|
|
7
7
|
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.RetriesList = exports.AlertsList = exports.MetricsOverview = exports.RetryDashboard = exports.WebhookIntegration = exports.EmailIntegration = exports.SlackIntegration = exports.ConfigurationManager = exports.IntegrationManager = exports.AdminServer = exports.RetrySuite = void 0;
|
|
10
|
+
exports.RetriesList = exports.AlertsList = exports.MetricsOverview = exports.RetryDashboard = exports.WebhookIntegration = exports.EmailIntegration = exports.SlackIntegration = exports.ConfigurationManager = exports.IntegrationManager = exports.AdminServer = exports.RetrySuiteError = exports.RetrySuite = void 0;
|
|
11
11
|
// Main classes
|
|
12
12
|
var retry_suite_1 = require("./retry-suite");
|
|
13
13
|
Object.defineProperty(exports, "RetrySuite", { enumerable: true, get: function () { return retry_suite_1.RetrySuite; } });
|
|
14
|
+
var errors_1 = require("./errors");
|
|
15
|
+
Object.defineProperty(exports, "RetrySuiteError", { enumerable: true, get: function () { return errors_1.RetrySuiteError; } });
|
|
14
16
|
var admin_server_1 = require("./admin/admin-server");
|
|
15
17
|
Object.defineProperty(exports, "AdminServer", { enumerable: true, get: function () { return admin_server_1.AdminServer; } });
|
|
16
18
|
var integration_manager_1 = require("./integrations/integration-manager");
|
|
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.EmailIntegration = void 0;
|
|
11
11
|
// Mock EmailSender for development
|
|
12
12
|
class MockEmailSender {
|
|
13
|
+
config;
|
|
13
14
|
constructor(config) {
|
|
14
15
|
this.config = config;
|
|
15
16
|
}
|
|
@@ -20,8 +21,10 @@ class MockEmailSender {
|
|
|
20
21
|
}
|
|
21
22
|
}
|
|
22
23
|
class EmailIntegration {
|
|
24
|
+
type = 'email';
|
|
25
|
+
config;
|
|
26
|
+
emailSender;
|
|
23
27
|
constructor(config) {
|
|
24
|
-
this.type = 'email';
|
|
25
28
|
this.config = config;
|
|
26
29
|
this.emailSender = new MockEmailSender({
|
|
27
30
|
provider: config.provider,
|
|
@@ -12,8 +12,9 @@ const slack_integration_1 = require("./slack-integration");
|
|
|
12
12
|
const email_integration_1 = require("./email-integration");
|
|
13
13
|
const webhook_integration_1 = require("./webhook-integration");
|
|
14
14
|
class IntegrationManager {
|
|
15
|
+
integrations = new Map();
|
|
16
|
+
config;
|
|
15
17
|
constructor(config) {
|
|
16
|
-
this.integrations = new Map();
|
|
17
18
|
this.config = config;
|
|
18
19
|
this.setupIntegrations();
|
|
19
20
|
}
|
|
@@ -9,8 +9,9 @@ Redistribution or use in other products or commercial offerings is not permitted
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.SlackIntegration = void 0;
|
|
11
11
|
class SlackIntegration {
|
|
12
|
+
type = 'slack';
|
|
13
|
+
config;
|
|
12
14
|
constructor(config) {
|
|
13
|
-
this.type = 'slack';
|
|
14
15
|
this.config = config;
|
|
15
16
|
}
|
|
16
17
|
async sendAlert(alert) {
|
|
@@ -9,8 +9,9 @@ Redistribution or use in other products or commercial offerings is not permitted
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.WebhookIntegration = void 0;
|
|
11
11
|
class WebhookIntegration {
|
|
12
|
+
type = 'webhook';
|
|
13
|
+
config;
|
|
12
14
|
constructor(config) {
|
|
13
|
-
this.type = 'webhook';
|
|
14
15
|
this.config = config;
|
|
15
16
|
}
|
|
16
17
|
async sendAlert(alert) {
|
package/dist/retry-suite.js
CHANGED
|
@@ -14,6 +14,7 @@ exports.RetrySuite = void 0;
|
|
|
14
14
|
// import { MetricsCollector } from '@bernierllc/retry-metrics';
|
|
15
15
|
// Simple mock implementations for development
|
|
16
16
|
class MockRetryManager {
|
|
17
|
+
config;
|
|
17
18
|
constructor(config) {
|
|
18
19
|
this.config = config;
|
|
19
20
|
}
|
|
@@ -28,13 +29,13 @@ class MockRetryManager {
|
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
class MockMemoryStorage {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
32
|
+
data = new Map();
|
|
33
|
+
constructor() { }
|
|
34
34
|
async get(key) { return this.data.get(key); }
|
|
35
35
|
async set(key, value) { this.data.set(key, value); }
|
|
36
36
|
}
|
|
37
37
|
class MockMetricsCollector {
|
|
38
|
+
config;
|
|
38
39
|
constructor(config) {
|
|
39
40
|
this.config = config;
|
|
40
41
|
}
|
|
@@ -51,8 +52,16 @@ const admin_server_1 = require("./admin/admin-server");
|
|
|
51
52
|
const integration_manager_1 = require("./integrations/integration-manager");
|
|
52
53
|
const configuration_manager_1 = require("./config/configuration-manager");
|
|
53
54
|
class RetrySuite {
|
|
55
|
+
retryManager;
|
|
56
|
+
stateStorage;
|
|
57
|
+
metricsCollector;
|
|
58
|
+
adminServer;
|
|
59
|
+
integrationManager;
|
|
60
|
+
configManager;
|
|
61
|
+
config;
|
|
62
|
+
retryStates = new Map();
|
|
63
|
+
metrics;
|
|
54
64
|
constructor(config) {
|
|
55
|
-
this.retryStates = new Map();
|
|
56
65
|
this.config = config;
|
|
57
66
|
this.configManager = new configuration_manager_1.ConfigurationManager(config);
|
|
58
67
|
// Initialize core services
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bernierllc/retry-suite",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Complete retry system with admin interface, monitoring dashboard, and comprehensive retry workflows",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"react-dom": "^18.2.0",
|
|
29
29
|
"uuid": "^11.1.0",
|
|
30
30
|
"ws": "^8.14.2",
|
|
31
|
-
"@bernierllc/
|
|
32
|
-
"@bernierllc/
|
|
33
|
-
"@bernierllc/retry-
|
|
34
|
-
"@bernierllc/retry-metrics": "0.
|
|
35
|
-
"@bernierllc/
|
|
31
|
+
"@bernierllc/message-queue": "1.5.0",
|
|
32
|
+
"@bernierllc/retry-manager": "1.4.0",
|
|
33
|
+
"@bernierllc/retry-state": "0.5.0",
|
|
34
|
+
"@bernierllc/retry-metrics": "0.5.0",
|
|
35
|
+
"@bernierllc/email-sender": "5.7.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/compression": "^1.7.2",
|