@ductape/sdk 0.1.102 → 0.1.103
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/index.d.ts +1 -1
- package/dist/index.js +9 -3
- package/dist/index.js.map +1 -1
- package/dist/processor/services/processor.service.d.ts +5 -3
- package/dist/processor/services/processor.service.js +11 -10
- package/dist/processor/services/processor.service.js.map +1 -1
- package/dist/products/services/products.service.d.ts +23 -2
- package/dist/products/services/products.service.js +79 -2
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/resilience/healthcheck-cache-key.d.ts +10 -0
- package/dist/resilience/healthcheck-cache-key.js +19 -0
- package/dist/resilience/healthcheck-cache-key.js.map +1 -0
- package/dist/resilience/healthcheck.service.js +16 -9
- package/dist/resilience/healthcheck.service.js.map +1 -1
- package/dist/resilience/resilience.service.js +15 -2
- package/dist/resilience/resilience.service.js.map +1 -1
- package/dist/resilience/types/index.d.ts +8 -0
- package/dist/resilience/types/index.js +2 -0
- package/dist/resilience/types/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/productsBuilder.types.d.ts +13 -1
- package/dist/types/productsBuilder.types.js +5 -0
- package/dist/types/productsBuilder.types.js.map +1 -1
- package/package.json +1 -1
|
@@ -132,7 +132,7 @@ export default class ProcessorService implements IProcessorService {
|
|
|
132
132
|
}): Promise<void>;
|
|
133
133
|
/**
|
|
134
134
|
* Run a single healthcheck (one env) by dispatching to the correct processor based on probe type.
|
|
135
|
-
* Supports app, database, feature, graph, storage,
|
|
135
|
+
* Supports app, database, feature, graph, storage, and events. Falls back to processAction when probe is missing (app/event only).
|
|
136
136
|
* Public so the SDK monitor worker can call it with full healthcheck (including probe).
|
|
137
137
|
*/
|
|
138
138
|
runOneHealthcheck(healthcheck: {
|
|
@@ -147,7 +147,9 @@ export default class ProcessorService implements IProcessorService {
|
|
|
147
147
|
feature?: string;
|
|
148
148
|
workflow?: string;
|
|
149
149
|
graph?: string;
|
|
150
|
+
events?: string;
|
|
150
151
|
messageBroker?: string;
|
|
152
|
+
message_broker?: string;
|
|
151
153
|
storage?: string;
|
|
152
154
|
event?: string;
|
|
153
155
|
input?: any;
|
|
@@ -160,14 +162,14 @@ export default class ProcessorService implements IProcessorService {
|
|
|
160
162
|
/**
|
|
161
163
|
* Start healthcheck workers for all products/environments after Redis is connected.
|
|
162
164
|
* This is called automatically in the constructor if redisClient is present.
|
|
163
|
-
* Dispatches to app, database, feature, graph, storage, or
|
|
165
|
+
* Dispatches to app, database, feature, graph, storage, or events processor based on probe type.
|
|
164
166
|
* Every HEALTHCHECK_REFRESH_MS we re-fetch the list and only clear/recreate workers when the fingerprint
|
|
165
167
|
* (tag:env:interval set) has changed, so existing timers are not reset when nothing changed.
|
|
166
168
|
*/
|
|
167
169
|
private startHealthcheckWorkers;
|
|
168
170
|
/**
|
|
169
171
|
* Manually trigger healthcheck processing for all healthchecks (can be called externally if needed).
|
|
170
|
-
* Dispatches to app, database, feature, graph, storage, or
|
|
172
|
+
* Dispatches to app, database, feature, graph, storage, or events processor based on probe type.
|
|
171
173
|
*/
|
|
172
174
|
processAllHealthchecksForProduct(productTag: string): Promise<void>;
|
|
173
175
|
generateSession(payload: ISessionInput): Promise<ISessionOutput>;
|
|
@@ -574,11 +574,11 @@ class ProcessorService {
|
|
|
574
574
|
}
|
|
575
575
|
/**
|
|
576
576
|
* Run a single healthcheck (one env) by dispatching to the correct processor based on probe type.
|
|
577
|
-
* Supports app, database, feature, graph, storage,
|
|
577
|
+
* Supports app, database, feature, graph, storage, and events. Falls back to processAction when probe is missing (app/event only).
|
|
578
578
|
* Public so the SDK monitor worker can call it with full healthcheck (including probe).
|
|
579
579
|
*/
|
|
580
580
|
async runOneHealthcheck(healthcheck, envSlug, decryptedInput, productTag) {
|
|
581
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
581
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
582
582
|
const probe = healthcheck.probe;
|
|
583
583
|
const retries = (_a = healthcheck.retries) !== null && _a !== void 0 ? _a : 0;
|
|
584
584
|
const inferType = () => {
|
|
@@ -594,8 +594,8 @@ class ProcessorService {
|
|
|
594
594
|
return 'graph';
|
|
595
595
|
if (probe === null || probe === void 0 ? void 0 : probe.storage)
|
|
596
596
|
return 'storage';
|
|
597
|
-
if (probe === null || probe === void 0 ? void 0 : probe.messageBroker)
|
|
598
|
-
return '
|
|
597
|
+
if ((probe === null || probe === void 0 ? void 0 : probe.events) || (probe === null || probe === void 0 ? void 0 : probe.messageBroker) || (probe === null || probe === void 0 ? void 0 : probe.message_broker))
|
|
598
|
+
return 'events';
|
|
599
599
|
return 'app';
|
|
600
600
|
};
|
|
601
601
|
const type = inferType();
|
|
@@ -649,8 +649,9 @@ class ProcessorService {
|
|
|
649
649
|
retries,
|
|
650
650
|
});
|
|
651
651
|
}
|
|
652
|
+
case 'events':
|
|
652
653
|
case 'message_broker': {
|
|
653
|
-
const brokerTag = probe.messageBroker;
|
|
654
|
+
const brokerTag = (_j = (_h = probe.events) !== null && _h !== void 0 ? _h : probe.messageBroker) !== null && _j !== void 0 ? _j : probe.message_broker;
|
|
654
655
|
const topicOrAction = event !== null && event !== void 0 ? event : 'health';
|
|
655
656
|
return this.processMessageBrokerPublish({
|
|
656
657
|
env: envSlug,
|
|
@@ -663,8 +664,8 @@ class ProcessorService {
|
|
|
663
664
|
return this.processAction({
|
|
664
665
|
env: envSlug,
|
|
665
666
|
product: productTag,
|
|
666
|
-
app: (
|
|
667
|
-
action: (
|
|
667
|
+
app: (_k = healthcheck.app) !== null && _k !== void 0 ? _k : '',
|
|
668
|
+
action: (_m = (_l = healthcheck.event) !== null && _l !== void 0 ? _l : event) !== null && _m !== void 0 ? _m : '',
|
|
668
669
|
input: decryptedInput !== null && decryptedInput !== void 0 ? decryptedInput : {},
|
|
669
670
|
retries,
|
|
670
671
|
});
|
|
@@ -688,7 +689,7 @@ class ProcessorService {
|
|
|
688
689
|
/**
|
|
689
690
|
* Start healthcheck workers for all products/environments after Redis is connected.
|
|
690
691
|
* This is called automatically in the constructor if redisClient is present.
|
|
691
|
-
* Dispatches to app, database, feature, graph, storage, or
|
|
692
|
+
* Dispatches to app, database, feature, graph, storage, or events processor based on probe type.
|
|
692
693
|
* Every HEALTHCHECK_REFRESH_MS we re-fetch the list and only clear/recreate workers when the fingerprint
|
|
693
694
|
* (tag:env:interval set) has changed, so existing timers are not reset when nothing changed.
|
|
694
695
|
*/
|
|
@@ -732,7 +733,7 @@ class ProcessorService {
|
|
|
732
733
|
}
|
|
733
734
|
/**
|
|
734
735
|
* Manually trigger healthcheck processing for all healthchecks (can be called externally if needed).
|
|
735
|
-
* Dispatches to app, database, feature, graph, storage, or
|
|
736
|
+
* Dispatches to app, database, feature, graph, storage, or events processor based on probe type.
|
|
736
737
|
*/
|
|
737
738
|
async processAllHealthchecksForProduct(productTag) {
|
|
738
739
|
await this.productBuilderService.initializeProductByTag(productTag);
|
|
@@ -5295,7 +5296,7 @@ class ProcessorService {
|
|
|
5295
5296
|
* Updates the healthcheck in the remote DB for a product with all envs' results.
|
|
5296
5297
|
*/
|
|
5297
5298
|
async updateHealthcheckOnProcessor(productTag, envs) {
|
|
5298
|
-
return this.productBuilderService.
|
|
5299
|
+
return this.productBuilderService.updateHealthcheckStatuses(productTag, envs);
|
|
5299
5300
|
}
|
|
5300
5301
|
}
|
|
5301
5302
|
ProcessorService.HEALTHCHECK_REFRESH_MS = 60000;
|