@secondlayer/sdk 14.5.1 → 15.0.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/README.md +21 -36
- package/dist/index.d.ts +558 -143
- package/dist/index.js +3 -23
- package/dist/index.js.map +12 -12
- package/dist/streams/index.d.ts +109 -59
- package/dist/streams/index.js.map +3 -3
- package/dist/subgraphs/index.d.ts +554 -128
- package/dist/subgraphs/index.js.map +9 -9
- package/dist/webhooks/doctor.d.ts +2 -13
- package/dist/webhooks/doctor.js +3 -23
- package/dist/webhooks/doctor.js.map +3 -3
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -3041,9 +3041,7 @@ var CODE_PRIORITY = [
|
|
|
3041
3041
|
"receiver_rate_limited",
|
|
3042
3042
|
"receiver_slow",
|
|
3043
3043
|
"delivery_lag",
|
|
3044
|
-
"no_deliveries"
|
|
3045
|
-
"subgraph_gaps",
|
|
3046
|
-
"subgraph_catching_up"
|
|
3044
|
+
"no_deliveries"
|
|
3047
3045
|
];
|
|
3048
3046
|
function pickPrimary(issues) {
|
|
3049
3047
|
if (issues.length === 0)
|
|
@@ -3063,15 +3061,6 @@ function hintFor(issue) {
|
|
|
3063
3061
|
function buildDoctorReport(input) {
|
|
3064
3062
|
const successful = input.deliveries.filter(isSuccessDelivery).length;
|
|
3065
3063
|
const failed = input.deliveries.length - successful;
|
|
3066
|
-
const subgraph = input.subgraph ? {
|
|
3067
|
-
name: input.subgraph.name,
|
|
3068
|
-
status: input.subgraph.status,
|
|
3069
|
-
syncStatus: input.subgraph.sync.status,
|
|
3070
|
-
lastProcessedBlock: input.subgraph.sync.lastProcessedBlock,
|
|
3071
|
-
chainTip: input.subgraph.sync.chainTip,
|
|
3072
|
-
gapCount: input.subgraph.sync.gaps.count,
|
|
3073
|
-
integrity: input.subgraph.sync.integrity
|
|
3074
|
-
} : null;
|
|
3075
3064
|
const hints = [];
|
|
3076
3065
|
const issues = [];
|
|
3077
3066
|
if (input.webhook.warning) {
|
|
@@ -3102,14 +3091,6 @@ function buildDoctorReport(input) {
|
|
|
3102
3091
|
hints.push(`Dead-letter rows exist; inspect with secondlayer webhooks dead ${input.webhook.id} and requeue selected rows.`);
|
|
3103
3092
|
issues.push({ code: "dead_letters", severity: "bad" });
|
|
3104
3093
|
}
|
|
3105
|
-
if (subgraph?.gapCount && subgraph.gapCount > 0) {
|
|
3106
|
-
hints.push(`Linked subgraph has gaps; run secondlayer subgraphs gaps ${input.webhook.subgraphName}.`);
|
|
3107
|
-
issues.push({ code: "subgraph_gaps", severity: "calm" });
|
|
3108
|
-
}
|
|
3109
|
-
if (subgraph?.syncStatus === "catching_up") {
|
|
3110
|
-
hints.push("Linked subgraph is still catching up; new matching rows may arrive later.");
|
|
3111
|
-
issues.push({ code: "subgraph_catching_up", severity: "calm" });
|
|
3112
|
-
}
|
|
3113
3094
|
for (const detector of [
|
|
3114
3095
|
detectReceiverRateLimited,
|
|
3115
3096
|
detectReceiverDown,
|
|
@@ -3128,7 +3109,7 @@ function buildDoctorReport(input) {
|
|
|
3128
3109
|
hints.push(hintFor(lagIssue));
|
|
3129
3110
|
}
|
|
3130
3111
|
if (input.deliveries.length === 0) {
|
|
3131
|
-
hints.push("No deliveries yet; confirm
|
|
3112
|
+
hints.push("No deliveries yet; confirm a chain event matching one of the triggers has happened since the webhook was created.");
|
|
3132
3113
|
issues.push({ code: "no_deliveries", severity: "calm" });
|
|
3133
3114
|
}
|
|
3134
3115
|
if (hints.length === 0) {
|
|
@@ -3143,7 +3124,6 @@ function buildDoctorReport(input) {
|
|
|
3143
3124
|
last: input.deliveries[0] ?? null
|
|
3144
3125
|
},
|
|
3145
3126
|
deadCount: input.dead.length,
|
|
3146
|
-
subgraph,
|
|
3147
3127
|
hints,
|
|
3148
3128
|
issues,
|
|
3149
3129
|
primary: pickPrimary(issues)
|
|
@@ -3477,5 +3457,5 @@ export {
|
|
|
3477
3457
|
verifyWebhookSignature
|
|
3478
3458
|
};
|
|
3479
3459
|
|
|
3480
|
-
//# debugId=
|
|
3460
|
+
//# debugId=1299ECB68A5C2FAD64756E2164756E21
|
|
3481
3461
|
//# sourceMappingURL=index.js.map
|