@dvmkit/sdk 0.9.0 → 0.10.0

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 (52) hide show
  1. package/dist/{chunk-4VV7WACY.js → chunk-2XQLL6N6.js} +1 -1
  2. package/dist/{chunk-LCCG5HQM.js → chunk-3Q6FTZDB.js} +2 -2
  3. package/dist/{chunk-TRY7BJA4.js → chunk-3R7NQA3Z.js} +1 -1
  4. package/dist/{chunk-KGL3YMZA.js → chunk-AJ6UHXUA.js} +1 -1
  5. package/dist/{chunk-BAQRUYRL.js → chunk-EWZFANHJ.js} +1 -1
  6. package/dist/{chunk-K2MSIKMM.js → chunk-FFXXGCVG.js} +1 -1
  7. package/dist/{chunk-WLPLHXNP.js → chunk-JNECYURT.js} +1 -1
  8. package/dist/{chunk-TFDR2YP2.js → chunk-KFCEXCZM.js} +1 -1
  9. package/dist/{chunk-IYQQXEHV.js → chunk-LDIPVPKI.js} +1 -1
  10. package/dist/{chunk-QSZW2I5Y.js → chunk-M3T5JYDJ.js} +15 -8
  11. package/dist/{chunk-Q3VYRU5R.js → chunk-MB6R4XPZ.js} +1 -1
  12. package/dist/{chunk-IBX2ORBV.js → chunk-MMGSYMIC.js} +1 -1
  13. package/dist/{chunk-LFVIZH2G.js → chunk-MU3IE434.js} +278 -152
  14. package/dist/{chunk-OIP44KBB.js → chunk-QGNXYVBO.js} +47 -12
  15. package/dist/{chunk-73C4JN2E.js → chunk-QNKK7SPY.js} +273 -54
  16. package/dist/{chunk-YYRY32NR.js → chunk-STJBBVNL.js} +2 -2
  17. package/dist/{chunk-WB3E7KE7.js → chunk-VMHYGKWT.js} +1 -1
  18. package/dist/{chunk-GAZBBMAA.js → chunk-VTHYQCDB.js} +1 -1
  19. package/dist/{chunk-LW7KZQHG.js → chunk-VUGEEMLT.js} +1 -1
  20. package/dist/{chunk-HC4I7LAV.js → chunk-W3VGCNG6.js} +1 -1
  21. package/dist/{chunk-GODOH2AF.js → chunk-Y6DO5WSO.js} +1 -1
  22. package/dist/{chunk-ZBQKXAYK.js → chunk-YOSZIWC3.js} +1 -1
  23. package/dist/{content-retention-CVBYehRS.d.ts → content-retention-CrILCNxk.d.ts} +1 -1
  24. package/dist/{credit-ledger-CZQ56DYI.js → credit-ledger-4PZNAMDT.js} +3 -3
  25. package/dist/{credit-menu-QntEhZJS.d.ts → credit-menu-VwX_6KM7.d.ts} +4 -4
  26. package/dist/{fx-CMyNFenZ.d.ts → fx-BM5h4o5S.d.ts} +1 -1
  27. package/dist/index.d.ts +5 -5
  28. package/dist/index.js +4 -4
  29. package/dist/internal/caller.d.ts +7 -7
  30. package/dist/internal/caller.js +7 -7
  31. package/dist/internal/server.d.ts +7 -7
  32. package/dist/internal/server.js +20 -20
  33. package/dist/{job-store-qOD-FrQF.d.ts → job-store-92v8e1LQ.d.ts} +1 -1
  34. package/dist/{lightning-backend-DtdG6UT5.d.ts → lightning-backend-9oky_wJi.d.ts} +1 -1
  35. package/dist/{memory-credit-ledger-EMN7G3MO.js → memory-credit-ledger-RP7DT5IY.js} +4 -4
  36. package/dist/{mpp-setup-VW53KFPO.js → mpp-setup-FURD45LI.js} +3 -3
  37. package/dist/{payout-reporter-TZX2S7KG.js → payout-reporter-HVJ6WUF3.js} +2 -2
  38. package/dist/{postgres-consumed-credential-store-V464OAJB.js → postgres-consumed-credential-store-WO6OCFXZ.js} +1 -1
  39. package/dist/{postgres-job-store-27VOCSPO.js → postgres-job-store-FSRUPYH2.js} +2 -2
  40. package/dist/{postgres-replay-store-7GJFAQXY.js → postgres-replay-store-XXJSA457.js} +2 -2
  41. package/dist/{pricing-NNMBNP7N.js → pricing-X4XU5HXY.js} +3 -3
  42. package/dist/{revenue-reporter-4EAVPWXS.js → revenue-reporter-EV3K5L6B.js} +2 -2
  43. package/dist/server/index.d.ts +74 -11
  44. package/dist/server/index.js +65 -27
  45. package/dist/{step-cache-B7svmPz3.d.ts → step-cache--7yA5Ihr.d.ts} +48 -6
  46. package/dist/{tempo-charge-store-2RPOJBM2.js → tempo-charge-store-5JOIYUIH.js} +2 -2
  47. package/dist/{tempo-session-store-LI3Q3A3U.js → tempo-session-store-S6QMLQUA.js} +3 -3
  48. package/dist/testing/index.d.ts +3 -3
  49. package/dist/testing/index.js +6 -6
  50. package/dist/{usd-D3izFz71.d.ts → usd-C7lvLvLk.d.ts} +1 -1
  51. package/dist/{x402-SL36LSOD.js → x402-EN5LSOVM.js} +3 -3
  52. package/package.json +1 -1
@@ -426,6 +426,7 @@ var diagnostic_catalogue_v1_default = {
426
426
  "tempo_session_close_recovery_failed",
427
427
  "tempo_session_close_recovery_search_paused",
428
428
  "tempo_session_close_recovery_unmatched",
429
+ "tempo_session_close_report_reopened",
429
430
  "tempo_session_close_report_written_off",
430
431
  "tempo_session_close_reservation_released",
431
432
  "tempo_session_close_settlement_callback_failed",
@@ -552,9 +553,12 @@ var diagnostic_catalogue_v1_default = {
552
553
  "/admin/credit/reconcile-tempo-drain",
553
554
  "/admin/credit/reconcile-x402-exact-settlement",
554
555
  "/admin/credit/reconcile-x402-settlement",
556
+ "/admin/credit/retry-tempo-close-report",
557
+ "/admin/credit/tempo-close-reports",
555
558
  "/admin/credit/tempo-drains",
556
559
  "/admin/credit/tempo-losses",
557
560
  "/admin/credit/write-off-invoice",
561
+ "/admin/credit/write-off-tempo-close-report",
558
562
  "/admin/credit/write-off-tempo-drain",
559
563
  "/admin/credit/write-off-x402-settlement",
560
564
  "/admin/credit/x402-exact-settlements",
@@ -959,7 +963,8 @@ var diagnostic_catalogue_v1_default = {
959
963
  "storefront_probe",
960
964
  "success",
961
965
  "verified",
962
- "wallet_reported_budget"
966
+ "wallet_reported_budget",
967
+ "written_off"
963
968
  ],
964
969
  integerFields: [
965
970
  "ageMs",
@@ -1000,6 +1005,9 @@ var diagnostic_catalogue_v1_default = {
1000
1005
  "key_hash",
1001
1006
  "prefix_hash"
1002
1007
  ],
1008
+ transactionHashFields: [
1009
+ "transaction_hash"
1010
+ ],
1003
1011
  urlFields: [
1004
1012
  "url",
1005
1013
  "facilitator_url",
@@ -1101,6 +1109,10 @@ var diagnostic_catalogue_v1_default = {
1101
1109
  "builder_pause",
1102
1110
  "withdrawn",
1103
1111
  "operator"
1112
+ ],
1113
+ tempoCloseReportPriorStatuses: [
1114
+ "no_report",
1115
+ "unmatched"
1104
1116
  ]
1105
1117
  };
1106
1118
 
@@ -1133,10 +1145,12 @@ var RAILS = new Set(diagnostic_catalogue_v1_default.rails);
1133
1145
  var STAGES = new Set(diagnostic_catalogue_v1_default.stages);
1134
1146
  var HANDLERS = new Set(diagnostic_catalogue_v1_default.handlers);
1135
1147
  var CURRENCIES = new Set(diagnostic_catalogue_v1_default.currencyTokens);
1148
+ var TEMPO_CLOSE_REPORT_PRIOR_STATUSES = new Set(diagnostic_catalogue_v1_default.tempoCloseReportPriorStatuses);
1136
1149
  var BOOLEAN_FIELDS = new Set(diagnostic_catalogue_v1_default.booleanFields);
1137
1150
  var INTEGER_FIELDS = new Set(diagnostic_catalogue_v1_default.integerFields);
1138
1151
  var TOKEN_FIELDS = new Set(diagnostic_catalogue_v1_default.tokenFields);
1139
1152
  var HASH_FIELDS = new Set(diagnostic_catalogue_v1_default.hashFields);
1153
+ var TRANSACTION_HASH_FIELDS = new Set(diagnostic_catalogue_v1_default.transactionHashFields);
1140
1154
  var URL_FIELDS = new Set(diagnostic_catalogue_v1_default.urlFields);
1141
1155
  var IDENTITY_FIELDS = new Set(diagnostic_catalogue_v1_default.identityFields);
1142
1156
  var CAPABILITY_FIELDS = new Set(diagnostic_catalogue_v1_default.capabilityFields);
@@ -1237,13 +1251,13 @@ function projectSpanRow(input) {
1237
1251
  }
1238
1252
  const sampleRate = ownValue(input, "sample_rate");
1239
1253
  const pid = ownValue(input, "pid");
1240
- const rawName = ownValue(input, "name");
1254
+ const name = projectEventName(ownValue(input, "name"));
1241
1255
  const row = {
1242
1256
  span_id: spanId,
1243
1257
  trace_id: traceId,
1244
1258
  parent_span_id: parentSpanId,
1245
1259
  dataset,
1246
- name: typeof rawName === "string" && EVENTS.has(rawName) ? rawName : "diagnostic.unknown",
1260
+ name,
1247
1261
  level,
1248
1262
  status,
1249
1263
  started_at_ms: startedAtMs,
@@ -1258,13 +1272,15 @@ function projectSpanRow(input) {
1258
1272
  ownValue(input, "dimensions"),
1259
1273
  dataset,
1260
1274
  authority,
1261
- identityAuthority
1275
+ identityAuthority,
1276
+ name
1262
1277
  ),
1263
1278
  attributes: projectFields(
1264
1279
  ownValue(input, "attributes"),
1265
1280
  dataset,
1266
1281
  authority,
1267
- identityAuthority
1282
+ identityAuthority,
1283
+ name
1268
1284
  ),
1269
1285
  error_message: null,
1270
1286
  error_stack: null,
@@ -1280,7 +1296,7 @@ function projectSpanRow(input) {
1280
1296
  return { ok: false, code: "invalid_span" };
1281
1297
  }
1282
1298
  }
1283
- function projectDiagnosticFields(input, dataset, authority, identityAuthority) {
1299
+ function projectDiagnosticFields(input, dataset, authority, identityAuthority, eventName) {
1284
1300
  try {
1285
1301
  const inheritedAuthority = isObject(input) ? VALUE_AUTHORITIES.get(input) : void 0;
1286
1302
  const effectiveAuthority = validAuthority(authority) ?? inheritedAuthority;
@@ -1290,7 +1306,8 @@ function projectDiagnosticFields(input, dataset, authority, identityAuthority) {
1290
1306
  input,
1291
1307
  dataset,
1292
1308
  effectiveAuthority,
1293
- effectiveIdentityAuthority
1309
+ effectiveIdentityAuthority,
1310
+ eventName
1294
1311
  );
1295
1312
  bindDiagnosticCapabilityAuthority(output, effectiveAuthority);
1296
1313
  bindDiagnosticIdentityAuthority(output, effectiveIdentityAuthority);
@@ -1302,7 +1319,7 @@ function projectDiagnosticFields(input, dataset, authority, identityAuthority) {
1302
1319
  function projectEventName(input, fallback = "diagnostic.unknown") {
1303
1320
  return typeof input === "string" && EVENTS.has(input) ? input : fallback;
1304
1321
  }
1305
- function projectFields(input, dataset, authority, identityAuthority) {
1322
+ function projectFields(input, dataset, authority, identityAuthority, eventName) {
1306
1323
  if (!isObject(input)) return {};
1307
1324
  const output = {};
1308
1325
  for (const [key, value] of ownDataEntries(input, 64)) {
@@ -1312,22 +1329,39 @@ function projectFields(input, dataset, authority, identityAuthority) {
1312
1329
  value,
1313
1330
  dataset,
1314
1331
  authority,
1315
- identityAuthority
1332
+ identityAuthority,
1333
+ eventName
1316
1334
  );
1317
1335
  if (projected !== void 0) output[key] = projected;
1318
1336
  }
1319
1337
  return output;
1320
1338
  }
1321
- function projectField(key, value, dataset, authority, identityAuthority) {
1339
+ function projectField(key, value, dataset, authority, identityAuthority, eventName) {
1322
1340
  const closedEnum = Object.hasOwn(PAYMENT_ENUMS, key) ? PAYMENT_ENUMS[key] : Object.hasOwn(ROUTER_ENUMS, key) ? ROUTER_ENUMS[key] : void 0;
1323
1341
  if (closedEnum)
1324
1342
  return typeof value === "string" && closedEnum.has(value) ? value : void 0;
1343
+ if (dataset === "tempo") {
1344
+ if (key === "prior_status")
1345
+ return typeof value === "string" && TEMPO_CLOSE_REPORT_PRIOR_STATUSES.has(value) ? value : void 0;
1346
+ const closeReportEvent = eventName === "tempo_session_close_report_written_off" || eventName === "tempo_session_close_report_reopened";
1347
+ const payerExitEvent = eventName === "tempo_session_close_exit_resolved";
1348
+ if (closeReportEvent || payerExitEvent) {
1349
+ if (key === "obligation_id")
1350
+ return typeof value === "string" && UUID_RE.test(value) ? value : void 0;
1351
+ if (key === "channel_id")
1352
+ return typeof value === "string" && /^0x[0-9a-fA-F]{64}$/.test(value) ? value : void 0;
1353
+ if (closeReportEvent && (key === "amount_native" || key === "amount_forgone_native") || payerExitEvent && key === "amount_at_stake_native")
1354
+ return typeof value === "string" && DECIMAL_RE.test(value) ? value : void 0;
1355
+ }
1356
+ }
1325
1357
  if (BOOLEAN_FIELDS.has(key))
1326
1358
  return typeof value === "boolean" ? value : void 0;
1327
1359
  if (INTEGER_FIELDS.has(key))
1328
1360
  return isNonnegativeSafeInteger(value) ? value : void 0;
1329
1361
  if (HASH_FIELDS.has(key))
1330
1362
  return typeof value === "string" && HASH_RE.test(value) ? value : void 0;
1363
+ if (TRANSACTION_HASH_FIELDS.has(key))
1364
+ return typeof value === "string" && /^0x[0-9a-fA-F]{64}$/.test(value) ? value : void 0;
1331
1365
  if (URL_FIELDS.has(key)) return projectOrigin(value);
1332
1366
  if (IDENTITY_FIELDS.has(key)) return projectIdentity(key, identityAuthority);
1333
1367
  if (TOKEN_FIELDS.has(key)) return void 0;
@@ -1499,10 +1533,11 @@ function writeDiagnostic(sinkLevel, event, fields, dataset, severityOverride) {
1499
1533
  try {
1500
1534
  const defaultSeverity = sinkLevel === "debug" || sinkLevel === "log" ? "info" : sinkLevel;
1501
1535
  const severity = severityOverride === "info" || severityOverride === "warn" || severityOverride === "error" ? severityOverride : defaultSeverity;
1536
+ const eventName = projectEventName(event);
1502
1537
  const record = {
1503
- event: projectEventName(event),
1538
+ event: eventName,
1504
1539
  level: severity,
1505
- ...projectDiagnosticFields(fields, dataset)
1540
+ ...projectDiagnosticFields(fields, dataset, void 0, void 0, eventName)
1506
1541
  };
1507
1542
  const sink = sinkLevel === "log" ? console.log : console[sinkLevel];
1508
1543
  sink(JSON.stringify(record));