@rasputin-ai/core 0.5.0-alpha.3 → 0.5.0-alpha.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/create-client/is-client-enabled.d.ts.map +1 -1
- package/dist/index.js +157 -69
- package/dist/sdk-meta.d.ts +1 -1
- package/dist/transport/create-transport.d.ts.map +1 -1
- package/dist/transport/send-batch.d.ts +13 -1
- package/dist/transport/send-batch.d.ts.map +1 -1
- package/dist/transport/transport-types.d.ts +23 -0
- package/dist/transport/transport-types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-client-enabled.d.ts","sourceRoot":"","sources":["../../src/create-client/is-client-enabled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7E,uDAAuD;AACvD,eAAO,MAAM,eAAe,GAAI,SAAS,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,KAAG,OACpD,CAAC;AAEzB,eAAO,MAAM,UAAU,QAAO,
|
|
1
|
+
{"version":3,"file":"is-client-enabled.d.ts","sourceRoot":"","sources":["../../src/create-client/is-client-enabled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7E,uDAAuD;AACvD,eAAO,MAAM,eAAe,GAAI,SAAS,IAAI,CAAC,eAAe,EAAE,SAAS,CAAC,KAAG,OACpD,CAAC;AAEzB,eAAO,MAAM,UAAU,QAAO,cA2B5B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -659,7 +659,7 @@ var resolveSourceMaps = async (frames) => {
|
|
|
659
659
|
|
|
660
660
|
// src/sdk-meta.ts
|
|
661
661
|
var SDK_NAME = "@rasputin-ai/core";
|
|
662
|
-
var SDK_VERSION = "0.5.0-alpha.
|
|
662
|
+
var SDK_VERSION = "0.5.0-alpha.5";
|
|
663
663
|
|
|
664
664
|
// src/suppression/identity-needs-message-template.ts
|
|
665
665
|
var identityNeedsMessageTemplate = (type, code) => {
|
|
@@ -979,6 +979,21 @@ var sendBatch = async (options) => {
|
|
|
979
979
|
if (options.sdkVersion) payload.sdk_version = options.sdkVersion;
|
|
980
980
|
if (options.sdkName) payload.sdk_name = options.sdkName;
|
|
981
981
|
if (options.idempotencyKey) payload.idempotency_key = options.idempotencyKey;
|
|
982
|
+
let attempts = 0;
|
|
983
|
+
let networkErrors = 0;
|
|
984
|
+
let rateLimitedResponses = 0;
|
|
985
|
+
let serverErrorResponses = 0;
|
|
986
|
+
const result = (outcome, failureKind = null, statusCode = null) => ({
|
|
987
|
+
outcome,
|
|
988
|
+
attempts,
|
|
989
|
+
retries: Math.max(0, attempts - 1),
|
|
990
|
+
networkErrors,
|
|
991
|
+
rateLimitedResponses,
|
|
992
|
+
serverErrorResponses,
|
|
993
|
+
aborted: failureKind === "aborted",
|
|
994
|
+
failureKind,
|
|
995
|
+
statusCode
|
|
996
|
+
});
|
|
982
997
|
const json = JSON.stringify(payload);
|
|
983
998
|
const headers = {
|
|
984
999
|
Authorization: `Bearer ${options.projectApiKey}`,
|
|
@@ -994,31 +1009,38 @@ var sendBatch = async (options) => {
|
|
|
994
1009
|
headers["Content-Encoding"] = "gzip";
|
|
995
1010
|
}
|
|
996
1011
|
for (let attempt = 0; attempt <= options.maxRetries; attempt++) {
|
|
997
|
-
if (options.signal?.aborted) return "failed";
|
|
1012
|
+
if (options.signal?.aborted) return result("failed", "aborted");
|
|
998
1013
|
try {
|
|
1014
|
+
attempts++;
|
|
999
1015
|
const response = await options.fetch(options.ingestUrl, {
|
|
1000
1016
|
method: "POST",
|
|
1001
1017
|
headers,
|
|
1002
1018
|
body,
|
|
1003
1019
|
signal: options.signal
|
|
1004
1020
|
});
|
|
1005
|
-
if (response.ok) return "ok";
|
|
1021
|
+
if (response.ok) return result("ok");
|
|
1006
1022
|
if (response.status === 429) {
|
|
1007
|
-
|
|
1023
|
+
rateLimitedResponses++;
|
|
1024
|
+
if (attempt === options.maxRetries)
|
|
1025
|
+
return result("failed", "rate_limited", response.status);
|
|
1008
1026
|
const wait = retryAfterMs(response) ?? backoffMs(attempt);
|
|
1009
1027
|
await sleep(wait, options.signal);
|
|
1010
1028
|
continue;
|
|
1011
1029
|
}
|
|
1012
|
-
if (response.status >= 400 && response.status < 500)
|
|
1013
|
-
|
|
1030
|
+
if (response.status >= 400 && response.status < 500) {
|
|
1031
|
+
return result("dropped", "non_retryable_http", response.status);
|
|
1032
|
+
}
|
|
1033
|
+
serverErrorResponses++;
|
|
1034
|
+
if (attempt === options.maxRetries) return result("failed", "server_error", response.status);
|
|
1014
1035
|
await sleep(backoffMs(attempt), options.signal);
|
|
1015
1036
|
} catch {
|
|
1016
|
-
if (options.signal?.aborted) return "failed";
|
|
1017
|
-
|
|
1037
|
+
if (options.signal?.aborted) return result("failed", "aborted");
|
|
1038
|
+
networkErrors++;
|
|
1039
|
+
if (attempt === options.maxRetries) return result("failed", "network_error");
|
|
1018
1040
|
await sleep(backoffMs(attempt), options.signal);
|
|
1019
1041
|
}
|
|
1020
1042
|
}
|
|
1021
|
-
return "failed";
|
|
1043
|
+
return result("failed", options.signal?.aborted ? "aborted" : "network_error");
|
|
1022
1044
|
};
|
|
1023
1045
|
|
|
1024
1046
|
// src/transport/transport-queue.ts
|
|
@@ -1112,6 +1134,20 @@ var createTransport = (options) => {
|
|
|
1112
1134
|
let closed = false;
|
|
1113
1135
|
let shuttingDown = false;
|
|
1114
1136
|
let retryBatch = null;
|
|
1137
|
+
let flushesStarted = 0;
|
|
1138
|
+
let flushesJoined = 0;
|
|
1139
|
+
let sendAttempts = 0;
|
|
1140
|
+
let sendRetries = 0;
|
|
1141
|
+
let batchReplays = 0;
|
|
1142
|
+
let batchesSucceeded = 0;
|
|
1143
|
+
let batchesDropped = 0;
|
|
1144
|
+
let batchesFailed = 0;
|
|
1145
|
+
let flushTimeouts = 0;
|
|
1146
|
+
let networkErrors = 0;
|
|
1147
|
+
let rateLimitedResponses = 0;
|
|
1148
|
+
let serverErrorResponses = 0;
|
|
1149
|
+
let lastFailureKind = null;
|
|
1150
|
+
let lastFailureStatusCode = null;
|
|
1115
1151
|
const schedule = () => {
|
|
1116
1152
|
if (timer || !enabled || closed) return;
|
|
1117
1153
|
timer = setInterval(() => {
|
|
@@ -1133,70 +1169,94 @@ var createTransport = (options) => {
|
|
|
1133
1169
|
return item.summary;
|
|
1134
1170
|
}
|
|
1135
1171
|
};
|
|
1172
|
+
const performFlush = async (timeoutMs) => {
|
|
1173
|
+
const controller = new AbortController();
|
|
1174
|
+
const timeout = timeoutMs > 0 ? setTimeout(() => controller.abort(), timeoutMs) : void 0;
|
|
1175
|
+
try {
|
|
1176
|
+
while (queue.size() > 0 || retryBatch) {
|
|
1177
|
+
if (controller.signal.aborted) break;
|
|
1178
|
+
const replaying = retryBatch !== null;
|
|
1179
|
+
const batch = retryBatch?.items ?? queue.drain(batchSize);
|
|
1180
|
+
const idempotencyKey = retryBatch?.idempotencyKey ?? crypto.randomUUID();
|
|
1181
|
+
retryBatch = null;
|
|
1182
|
+
if (batch.length === 0) break;
|
|
1183
|
+
if (replaying) batchReplays++;
|
|
1184
|
+
const events = [];
|
|
1185
|
+
const summaries = [];
|
|
1186
|
+
for (const item of batch) {
|
|
1187
|
+
if (item.kind === "summary") {
|
|
1188
|
+
summaries.push(await prepareSummary(item));
|
|
1189
|
+
continue;
|
|
1190
|
+
}
|
|
1191
|
+
if (options.prepareEvent && item.rawFrames.length > 0) {
|
|
1192
|
+
try {
|
|
1193
|
+
events.push(
|
|
1194
|
+
await options.prepareEvent({
|
|
1195
|
+
event: item.event,
|
|
1196
|
+
rawFrames: item.rawFrames
|
|
1197
|
+
})
|
|
1198
|
+
);
|
|
1199
|
+
} catch {
|
|
1200
|
+
events.push(item.event);
|
|
1201
|
+
}
|
|
1202
|
+
} else {
|
|
1203
|
+
events.push(item.event);
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
const result = await sendBatch({
|
|
1207
|
+
ingestUrl: options.ingestUrl,
|
|
1208
|
+
projectApiKey: options.projectApiKey,
|
|
1209
|
+
events,
|
|
1210
|
+
summaries,
|
|
1211
|
+
idempotencyKey,
|
|
1212
|
+
sdkVersion: options.sdkVersion,
|
|
1213
|
+
sdkName: options.sdkName,
|
|
1214
|
+
gzipThresholdBytes,
|
|
1215
|
+
maxRetries,
|
|
1216
|
+
fetch: fetchFn,
|
|
1217
|
+
signal: controller.signal
|
|
1218
|
+
});
|
|
1219
|
+
sendAttempts += result.attempts;
|
|
1220
|
+
sendRetries += result.retries;
|
|
1221
|
+
networkErrors += result.networkErrors;
|
|
1222
|
+
rateLimitedResponses += result.rateLimitedResponses;
|
|
1223
|
+
serverErrorResponses += result.serverErrorResponses;
|
|
1224
|
+
if (result.aborted) flushTimeouts++;
|
|
1225
|
+
if (result.outcome === "ok") batchesSucceeded++;
|
|
1226
|
+
else {
|
|
1227
|
+
lastFailureKind = result.failureKind;
|
|
1228
|
+
lastFailureStatusCode = result.statusCode;
|
|
1229
|
+
if (result.outcome === "dropped") batchesDropped++;
|
|
1230
|
+
else batchesFailed++;
|
|
1231
|
+
}
|
|
1232
|
+
if (result.outcome === "failed") {
|
|
1233
|
+
retryBatch = { items: batch, idempotencyKey };
|
|
1234
|
+
break;
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
} finally {
|
|
1238
|
+
if (timeout) clearTimeout(timeout);
|
|
1239
|
+
if (queue.size() === 0 && !retryBatch) stopTimer();
|
|
1240
|
+
}
|
|
1241
|
+
};
|
|
1136
1242
|
const flush = async (timeoutMs = 1e4) => {
|
|
1137
1243
|
if (!enabled || closed) {
|
|
1138
1244
|
queue.clear();
|
|
1139
1245
|
retryBatch = null;
|
|
1140
1246
|
return;
|
|
1141
1247
|
}
|
|
1142
|
-
if (flushing)
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
const summaries = [];
|
|
1155
|
-
for (const item of batch) {
|
|
1156
|
-
if (item.kind === "summary") {
|
|
1157
|
-
summaries.push(await prepareSummary(item));
|
|
1158
|
-
continue;
|
|
1159
|
-
}
|
|
1160
|
-
if (options.prepareEvent && item.rawFrames.length > 0) {
|
|
1161
|
-
try {
|
|
1162
|
-
events.push(
|
|
1163
|
-
await options.prepareEvent({
|
|
1164
|
-
event: item.event,
|
|
1165
|
-
rawFrames: item.rawFrames
|
|
1166
|
-
})
|
|
1167
|
-
);
|
|
1168
|
-
} catch {
|
|
1169
|
-
events.push(item.event);
|
|
1170
|
-
}
|
|
1171
|
-
} else {
|
|
1172
|
-
events.push(item.event);
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
1175
|
-
const result = await sendBatch({
|
|
1176
|
-
ingestUrl: options.ingestUrl,
|
|
1177
|
-
projectApiKey: options.projectApiKey,
|
|
1178
|
-
events,
|
|
1179
|
-
summaries,
|
|
1180
|
-
idempotencyKey,
|
|
1181
|
-
sdkVersion: options.sdkVersion,
|
|
1182
|
-
sdkName: options.sdkName,
|
|
1183
|
-
gzipThresholdBytes,
|
|
1184
|
-
maxRetries,
|
|
1185
|
-
fetch: fetchFn,
|
|
1186
|
-
signal: controller.signal
|
|
1187
|
-
});
|
|
1188
|
-
if (result === "failed") {
|
|
1189
|
-
retryBatch = { items: batch, idempotencyKey };
|
|
1190
|
-
break;
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
} finally {
|
|
1194
|
-
if (timeout) clearTimeout(timeout);
|
|
1195
|
-
if (queue.size() === 0 && !retryBatch) stopTimer();
|
|
1196
|
-
flushing = void 0;
|
|
1197
|
-
}
|
|
1198
|
-
})();
|
|
1199
|
-
return flushing;
|
|
1248
|
+
if (flushing) {
|
|
1249
|
+
flushesJoined++;
|
|
1250
|
+
return flushing;
|
|
1251
|
+
}
|
|
1252
|
+
flushesStarted++;
|
|
1253
|
+
const activeFlush = performFlush(timeoutMs);
|
|
1254
|
+
flushing = activeFlush;
|
|
1255
|
+
try {
|
|
1256
|
+
await activeFlush;
|
|
1257
|
+
} finally {
|
|
1258
|
+
if (flushing === activeFlush) flushing = void 0;
|
|
1259
|
+
}
|
|
1200
1260
|
};
|
|
1201
1261
|
const enqueue = (event, priority = "first", rawFrames = []) => {
|
|
1202
1262
|
if (!enabled || closed) return;
|
|
@@ -1248,7 +1308,21 @@ var createTransport = (options) => {
|
|
|
1248
1308
|
const queueStats = queue.getStats();
|
|
1249
1309
|
return {
|
|
1250
1310
|
...queueStats,
|
|
1251
|
-
queued: queueStats.queued + (retryBatch?.items.length ?? 0)
|
|
1311
|
+
queued: queueStats.queued + (retryBatch?.items.length ?? 0),
|
|
1312
|
+
flushesStarted,
|
|
1313
|
+
flushesJoined,
|
|
1314
|
+
sendAttempts,
|
|
1315
|
+
sendRetries,
|
|
1316
|
+
batchReplays,
|
|
1317
|
+
batchesSucceeded,
|
|
1318
|
+
batchesDropped,
|
|
1319
|
+
batchesFailed,
|
|
1320
|
+
flushTimeouts,
|
|
1321
|
+
networkErrors,
|
|
1322
|
+
rateLimitedResponses,
|
|
1323
|
+
serverErrorResponses,
|
|
1324
|
+
lastFailureKind,
|
|
1325
|
+
lastFailureStatusCode
|
|
1252
1326
|
};
|
|
1253
1327
|
}
|
|
1254
1328
|
};
|
|
@@ -1269,7 +1343,21 @@ var noopClient = () => ({
|
|
|
1269
1343
|
enqueued: 0,
|
|
1270
1344
|
droppedIncoming: 0,
|
|
1271
1345
|
droppedQueued: 0,
|
|
1272
|
-
droppedTotal: 0
|
|
1346
|
+
droppedTotal: 0,
|
|
1347
|
+
flushesStarted: 0,
|
|
1348
|
+
flushesJoined: 0,
|
|
1349
|
+
sendAttempts: 0,
|
|
1350
|
+
sendRetries: 0,
|
|
1351
|
+
batchReplays: 0,
|
|
1352
|
+
batchesSucceeded: 0,
|
|
1353
|
+
batchesDropped: 0,
|
|
1354
|
+
batchesFailed: 0,
|
|
1355
|
+
flushTimeouts: 0,
|
|
1356
|
+
networkErrors: 0,
|
|
1357
|
+
rateLimitedResponses: 0,
|
|
1358
|
+
serverErrorResponses: 0,
|
|
1359
|
+
lastFailureKind: null,
|
|
1360
|
+
lastFailureStatusCode: null
|
|
1273
1361
|
}
|
|
1274
1362
|
})
|
|
1275
1363
|
});
|
package/dist/sdk-meta.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-transport.d.ts","sourceRoot":"","sources":["../../src/transport/create-transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAe,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAoCxF,eAAO,MAAM,eAAe,GAAI,SAAS,sBAAsB,KAAG,
|
|
1
|
+
{"version":3,"file":"create-transport.d.ts","sourceRoot":"","sources":["../../src/transport/create-transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAe,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAoCxF,eAAO,MAAM,eAAe,GAAI,SAAS,sBAAsB,KAAG,SAoOjE,CAAC"}
|
|
@@ -14,7 +14,19 @@ type SendBatchOptions = {
|
|
|
14
14
|
fetch: TransportFetch;
|
|
15
15
|
signal?: AbortSignal;
|
|
16
16
|
};
|
|
17
|
+
export type SendBatchFailureKind = 'aborted' | 'network_error' | 'rate_limited' | 'server_error' | 'non_retryable_http';
|
|
18
|
+
export type SendBatchResult = {
|
|
19
|
+
outcome: 'ok' | 'dropped' | 'failed';
|
|
20
|
+
attempts: number;
|
|
21
|
+
retries: number;
|
|
22
|
+
networkErrors: number;
|
|
23
|
+
rateLimitedResponses: number;
|
|
24
|
+
serverErrorResponses: number;
|
|
25
|
+
aborted: boolean;
|
|
26
|
+
failureKind: SendBatchFailureKind | null;
|
|
27
|
+
statusCode: number | null;
|
|
28
|
+
};
|
|
17
29
|
/** POST `{ events, summaries? }` with Bearer auth, optional gzip, retries on 429/5xx/network. */
|
|
18
|
-
export declare const sendBatch: (options: SendBatchOptions) => Promise<
|
|
30
|
+
export declare const sendBatch: (options: SendBatchOptions) => Promise<SendBatchResult>;
|
|
19
31
|
export {};
|
|
20
32
|
//# sourceMappingURL=send-batch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-batch.d.ts","sourceRoot":"","sources":["../../src/transport/send-batch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,KAAK,gBAAgB,GAAG;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"send-batch.d.ts","sourceRoot":"","sources":["../../src/transport/send-batch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD,KAAK,gBAAgB,GAAG;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,aAAa,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,cAAc,CAAC;IACtB,MAAM,CAAC,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAC7B,SAAS,GACT,eAAe,GACf,cAAc,GACd,cAAc,GACd,oBAAoB,CAAC;AAExB,MAAM,MAAM,eAAe,GAAG;IAC7B,OAAO,EAAE,IAAI,GAAG,SAAS,GAAG,QAAQ,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,oBAAoB,GAAG,IAAI,CAAC;IACzC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,CAAC;AAkCF,iGAAiG;AACjG,eAAO,MAAM,SAAS,GAAU,SAAS,gBAAgB,KAAG,OAAO,CAAC,eAAe,CAgGlF,CAAC"}
|
|
@@ -31,6 +31,29 @@ export type TransportStats = {
|
|
|
31
31
|
droppedIncoming: number;
|
|
32
32
|
droppedQueued: number;
|
|
33
33
|
droppedTotal: number;
|
|
34
|
+
/** Flush operations that acquired the transport and attempted work. */
|
|
35
|
+
flushesStarted: number;
|
|
36
|
+
/** Flush calls that joined an operation already in progress. */
|
|
37
|
+
flushesJoined: number;
|
|
38
|
+
/** Individual HTTP attempts, including retries. */
|
|
39
|
+
sendAttempts: number;
|
|
40
|
+
/** HTTP attempts after the first attempt within a batch send. */
|
|
41
|
+
sendRetries: number;
|
|
42
|
+
/** Previously failed batches replayed by a later flush. */
|
|
43
|
+
batchReplays: number;
|
|
44
|
+
batchesSucceeded: number;
|
|
45
|
+
/** Batches discarded after a non-retryable HTTP response. */
|
|
46
|
+
batchesDropped: number;
|
|
47
|
+
/** Batch-send operations left queued for a later replay. */
|
|
48
|
+
batchesFailed: number;
|
|
49
|
+
/** Flush operations whose abort deadline was reached. */
|
|
50
|
+
flushTimeouts: number;
|
|
51
|
+
networkErrors: number;
|
|
52
|
+
rateLimitedResponses: number;
|
|
53
|
+
serverErrorResponses: number;
|
|
54
|
+
/** Categorical final failure only; never contains URLs, payloads, or error text. */
|
|
55
|
+
lastFailureKind: 'aborted' | 'network_error' | 'rate_limited' | 'server_error' | 'non_retryable_http' | null;
|
|
56
|
+
lastFailureStatusCode: number | null;
|
|
34
57
|
};
|
|
35
58
|
export type CreateTransportOptions = {
|
|
36
59
|
/** Real API ingest URL — `POST /ingest` (apps/api post-ingest.handler). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport-types.d.ts","sourceRoot":"","sources":["../../src/transport/transport-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kDAAkD,CAAC;AACpF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE5F;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE/D,MAAM,MAAM,WAAW,GACpB;IACA,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,WAAW,CAAC;IACnB,QAAQ,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC7B,6DAA6D;IAC7D,SAAS,EAAE,QAAQ,EAAE,CAAC;CACrB,GACD;IACA,IAAI,EA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