@burdenoff/be-sdk 2026.716.1 → 2026.716.3

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 (48) hide show
  1. package/dist/EventQueueFactory-ELT7NDXK.js +7 -0
  2. package/dist/{EventQueueFactory-BDOT45WD.js.map → EventQueueFactory-ELT7NDXK.js.map} +1 -1
  3. package/dist/cache/index.d.ts +2 -1
  4. package/dist/cache/index.js +2 -1
  5. package/dist/{chunk-GVZ5BDER.js → chunk-45R453OS.js} +3 -3
  6. package/dist/{chunk-GVZ5BDER.js.map → chunk-45R453OS.js.map} +1 -1
  7. package/dist/{chunk-5ORHPLOA.js → chunk-JNJSSBKO.js} +19 -2
  8. package/dist/chunk-JNJSSBKO.js.map +1 -0
  9. package/dist/{chunk-YKY24YLZ.js → chunk-JUHRQMJ5.js} +3 -3
  10. package/dist/{chunk-YKY24YLZ.js.map → chunk-JUHRQMJ5.js.map} +1 -1
  11. package/dist/{chunk-LHLOJS52.js → chunk-KG5OPQYA.js} +2 -2
  12. package/dist/{chunk-LHLOJS52.js.map → chunk-KG5OPQYA.js.map} +1 -1
  13. package/dist/{chunk-IMMJMVP7.js → chunk-NONIGJN4.js} +3 -3
  14. package/dist/{chunk-IMMJMVP7.js.map → chunk-NONIGJN4.js.map} +1 -1
  15. package/dist/{chunk-CAI5GJJ6.js → chunk-Q4IWDFOO.js} +149 -14
  16. package/dist/chunk-Q4IWDFOO.js.map +1 -0
  17. package/dist/{chunk-7ZA3VD6V.js → chunk-Q4WBZFNJ.js} +4 -4
  18. package/dist/{chunk-7ZA3VD6V.js.map → chunk-Q4WBZFNJ.js.map} +1 -1
  19. package/dist/{chunk-OQ62HA7Z.js → chunk-URDYOM2L.js} +3 -3
  20. package/dist/{chunk-OQ62HA7Z.js.map → chunk-URDYOM2L.js.map} +1 -1
  21. package/dist/chunk-VBXPFYZ5.js +61 -0
  22. package/dist/chunk-VBXPFYZ5.js.map +1 -0
  23. package/dist/{chunk-A6WNRJZF.js → chunk-WFVLQELZ.js} +4 -4
  24. package/dist/{chunk-A6WNRJZF.js.map → chunk-WFVLQELZ.js.map} +1 -1
  25. package/dist/{chunk-GCY2FTHD.js → chunk-XGW2CPEJ.js} +3 -3
  26. package/dist/{chunk-GCY2FTHD.js.map → chunk-XGW2CPEJ.js.map} +1 -1
  27. package/dist/event-queue/index.d.ts +2 -1
  28. package/dist/event-queue/index.js +4 -3
  29. package/dist/export/index.js +3 -3
  30. package/dist/gateway/index.js +2 -2
  31. package/dist/gateway/security/index.js +1 -1
  32. package/dist/graph/index.js +5 -4
  33. package/dist/{index-Mr2ATGnY.d.ts → index-CEuTmf0x.d.ts} +9 -1
  34. package/dist/{index-5QTY_V54.d.ts → index-CQGCVFmI.d.ts} +7 -2
  35. package/dist/index-CoMKgL-p.d.ts +12 -0
  36. package/dist/index.d.ts +5 -3
  37. package/dist/index.js +20 -16
  38. package/dist/index.js.map +1 -1
  39. package/dist/init/index.js +3 -3
  40. package/dist/lifecycle/index.d.ts +1 -0
  41. package/dist/lifecycle/index.js +5 -0
  42. package/dist/lifecycle/index.js.map +1 -0
  43. package/dist/prisma/index.js +4 -3
  44. package/dist/shutdown-registry-CW9LryO8.d.ts +10 -0
  45. package/package.json +3 -3
  46. package/dist/EventQueueFactory-BDOT45WD.js +0 -6
  47. package/dist/chunk-5ORHPLOA.js.map +0 -1
  48. package/dist/chunk-CAI5GJJ6.js.map +0 -1
@@ -1,3 +1,4 @@
1
+ import { registerDisposable, unregisterDisposable } from './chunk-VBXPFYZ5.js';
1
2
  import { DEFAULT_LAYER_RESOURCES } from './chunk-YFOHAHZE.js';
2
3
  import { logger } from './chunk-CBZNP6RF.js';
3
4
  import { __export, __name } from './chunk-XE4OXN2W.js';
@@ -439,8 +440,31 @@ var MemoryCacheProvider = class {
439
440
  };
440
441
 
441
442
  // src/cache/implementations/valkey/ValkeyGlideProvider.ts
442
- var CONNECT_RETRY_COOLDOWN_MS = 8e3;
443
- var CONNECT_ATTEMPT_TIMEOUT_MS = 2500;
443
+ function readPositiveIntEnv(name, fallback) {
444
+ const raw = process.env[name];
445
+ if (!raw) return fallback;
446
+ const parsed = parseInt(raw, 10);
447
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
448
+ }
449
+ __name(readPositiveIntEnv, "readPositiveIntEnv");
450
+ var CONNECT_RETRY_COOLDOWN_MS = readPositiveIntEnv("VALKEY_CONNECT_RETRY_COOLDOWN_MS", 8e3);
451
+ var CONNECT_ATTEMPT_TIMEOUT_MS = readPositiveIntEnv("VALKEY_CONNECT_ATTEMPT_TIMEOUT_MS", 4500);
452
+ var CONNECTION_TIMEOUT_MS = readPositiveIntEnv("VALKEY_CONNECTION_TIMEOUT_MS", 4e3);
453
+ var REQUEST_TIMEOUT_MS = readPositiveIntEnv("VALKEY_REQUEST_TIMEOUT_MS", 2e3);
454
+ var MAX_CONSECUTIVE_OP_FAILURES = readPositiveIntEnv("VALKEY_MAX_CONSECUTIVE_OP_FAILURES", 3);
455
+ function isConnectionLevelError(error) {
456
+ if (!(error instanceof Error)) return false;
457
+ const name = error.name;
458
+ if (name === "ClosingError" || name === "ConnectionError" || name === "TimeoutError") {
459
+ return true;
460
+ }
461
+ const message = error.message.toLowerCase();
462
+ if (message.includes("cooldown") || message.includes("budget")) {
463
+ return false;
464
+ }
465
+ return /connection|closing|closed|timed out|timeout|disconnect|socket|econnreset|broken pipe|not connected/.test(message);
466
+ }
467
+ __name(isConnectionLevelError, "isConnectionLevelError");
444
468
  var ValkeyGlideProvider = class {
445
469
  static {
446
470
  __name(this, "ValkeyGlideProvider");
@@ -457,12 +481,23 @@ var ValkeyGlideProvider = class {
457
481
  // Timestamp (ms) of the last failed connect attempt; 0 when the last attempt
458
482
  // succeeded. Drives the connect circuit-breaker in ensureConnected().
459
483
  lastConnectFailureAt = 0;
484
+ // Count of consecutive connection-level operation failures on an already-
485
+ // "connected" client, tracked across every command (any success resets it,
486
+ // any op's connection error increments it). When it reaches
487
+ // MAX_CONSECUTIVE_OP_FAILURES the wedged client is torn down so the next op
488
+ // rebuilds a fresh one instead of reusing a socket GLIDE's internal reconnect
489
+ // cannot recover. See noteOpError().
490
+ consecutiveOpFailures = 0;
460
491
  config;
461
492
  // Mutable: when a URL like `…/4` lands on Azure Managed Redis we fold the
462
493
  // DB index into the namespace at connect time to preserve per-service
463
- // isolation on the forced-DB-0 connection. Not const, but only ever
464
- // appended to once during connect().
494
+ // isolation on the forced-DB-0 connection. Appended exactly once across the
495
+ // instance's lifetime, guarded by `dbNamespaceSuffixApplied` (connect() can
496
+ // run repeatedly now that the self-heal path rebuilds the client).
465
497
  namespace;
498
+ // Set once the Azure DB-index `:db{N}` suffix has been folded into
499
+ // `namespace`, so reconnects do not re-append it.
500
+ dbNamespaceSuffixApplied = false;
466
501
  defaultTTL;
467
502
  enableLogging;
468
503
  // Statistics
@@ -616,8 +651,11 @@ var ValkeyGlideProvider = class {
616
651
  databaseFromUrl = parseInt(dbMatch[1], 10);
617
652
  const isAzureManagedRedis = /\.redis\.azure\.net$/i.test(host);
618
653
  if (isAzureManagedRedis && databaseFromUrl > 0) {
619
- logger.warn(`[ValkeyGlideProvider] Azure Managed Redis only supports DB 0; ignoring /${String(databaseFromUrl)} in URL and folding it into namespace.`);
620
- this.namespace = `${this.namespace}:db${String(databaseFromUrl)}`;
654
+ if (!this.dbNamespaceSuffixApplied) {
655
+ logger.warn(`[ValkeyGlideProvider] Azure Managed Redis only supports DB 0; ignoring /${String(databaseFromUrl)} in URL and folding it into namespace.`);
656
+ this.namespace = `${this.namespace}:db${String(databaseFromUrl)}`;
657
+ this.dbNamespaceSuffixApplied = true;
658
+ }
621
659
  databaseFromUrl = 0;
622
660
  }
623
661
  }
@@ -637,7 +675,10 @@ var ValkeyGlideProvider = class {
637
675
  } : void 0,
638
676
  clientName: this.config.name || `valkey-glide-${this.namespace}`,
639
677
  databaseId: this.config.db ?? databaseFromUrl,
640
- connectionTimeout: this.config.connectionTimeout,
678
+ // Bound every command (incl. reconnection during the request) so a
679
+ // dropped/reconnecting socket fails fast to a cache miss instead of
680
+ // hanging the calling resolver. THE fix for the "glide hangs" failure.
681
+ requestTimeout: REQUEST_TIMEOUT_MS,
641
682
  // Honour the configured reconnect tuning. Previously
642
683
  // maxReconnectAttempts/reconnectTimeWait were read into config but never
643
684
  // handed to GLIDE, so the client used its built-in default backoff. A
@@ -648,7 +689,13 @@ var ValkeyGlideProvider = class {
648
689
  factor: this.config.reconnectTimeWait ?? 1e3,
649
690
  exponentBase: 2
650
691
  },
651
- readFrom: "primary"
692
+ readFrom: "primary",
693
+ // GLIDE 2.x reads connectionTimeout from advancedConfiguration; a
694
+ // top-level value is ignored. Bounds the initial connect and every
695
+ // internal reconnect.
696
+ advancedConfiguration: {
697
+ connectionTimeout: this.config.connectionTimeout ?? CONNECTION_TIMEOUT_MS
698
+ }
652
699
  };
653
700
  if (this.config.cluster === true) {
654
701
  if (!GlideClusterClient) {
@@ -660,6 +707,7 @@ var ValkeyGlideProvider = class {
660
707
  duration_in_sec: 30
661
708
  },
662
709
  advancedConfiguration: {
710
+ ...baseClientConfig.advancedConfiguration,
663
711
  refreshTopologyFromInitialNodes: true
664
712
  }
665
713
  }));
@@ -677,6 +725,7 @@ var ValkeyGlideProvider = class {
677
725
  duration_in_sec: 30
678
726
  },
679
727
  advancedConfiguration: {
728
+ ...baseClientConfig.advancedConfiguration,
680
729
  refreshTopologyFromInitialNodes: true
681
730
  }
682
731
  }));
@@ -688,6 +737,8 @@ var ValkeyGlideProvider = class {
688
737
  }
689
738
  this.connected = true;
690
739
  this.lastConnectFailureAt = 0;
740
+ this.consecutiveOpFailures = 0;
741
+ registerDisposable(this);
691
742
  if (this.enableLogging) {
692
743
  logger.info(`[ValkeyGlideProvider:${this.namespace}] Connected to Valkey`, {
693
744
  host,
@@ -705,7 +756,16 @@ var ValkeyGlideProvider = class {
705
756
  /**
706
757
  * Disconnect from Valkey server
707
758
  */
759
+ /** Label for the graceful-shutdown registry. */
760
+ get shutdownName() {
761
+ return `valkey-cache:${this.namespace}`;
762
+ }
763
+ /** Close the client on graceful shutdown. */
764
+ dispose() {
765
+ return this.disconnect();
766
+ }
708
767
  async disconnect() {
768
+ unregisterDisposable(this);
709
769
  if (this.client) {
710
770
  await this.client.close();
711
771
  this.client = null;
@@ -718,6 +778,47 @@ var ValkeyGlideProvider = class {
718
778
  }
719
779
  }
720
780
  /**
781
+ * A command completed — the connection is proven alive, so clear the
782
+ * teardown counter. Called from every command's success path.
783
+ */
784
+ recordOpSuccess() {
785
+ if (this.consecutiveOpFailures !== 0) {
786
+ this.consecutiveOpFailures = 0;
787
+ }
788
+ }
789
+ /**
790
+ * Record an operation error and, if the client looks wedged (enough
791
+ * consecutive connection-level failures), tear it down so the next op builds a
792
+ * fresh one. Non-connection errors (bad command, serialization) are ignored so
793
+ * they never trip the teardown.
794
+ */
795
+ noteOpError(error) {
796
+ if (!isConnectionLevelError(error)) {
797
+ return;
798
+ }
799
+ this.consecutiveOpFailures += 1;
800
+ if (this.consecutiveOpFailures >= MAX_CONSECUTIVE_OP_FAILURES) {
801
+ this.resetClientForReconnect();
802
+ }
803
+ }
804
+ /**
805
+ * Drop the current client so the next ensureConnected() creates a new one.
806
+ * Arms the connect circuit-breaker so ops fast-fail (cache miss) during the
807
+ * cooldown rather than racing a fresh connect on every call, and closes the
808
+ * dead client in the background so its socket is not leaked.
809
+ */
810
+ resetClientForReconnect() {
811
+ const dead = this.client;
812
+ this.client = null;
813
+ this.connected = false;
814
+ this.consecutiveOpFailures = 0;
815
+ this.lastConnectFailureAt = Date.now();
816
+ logger.warn(`[ValkeyGlideProvider:${this.namespace}] Tearing down wedged client after ${String(MAX_CONSECUTIVE_OP_FAILURES)} consecutive connection failures; rebuilding on next op`);
817
+ if (dead) {
818
+ void dead.close().catch(() => void 0);
819
+ }
820
+ }
821
+ /**
721
822
  * Check if connected
722
823
  */
723
824
  isConnected() {
@@ -776,6 +877,7 @@ var ValkeyGlideProvider = class {
776
877
  const memoryMatch = memoryRegex.exec(info);
777
878
  const memoryUsed = memoryMatch && memoryMatch[1] ? parseInt(memoryMatch[1], 10) : void 0;
778
879
  const keyCount = await client.dbsize();
880
+ this.recordOpSuccess();
779
881
  return {
780
882
  hits: this.stats.hits,
781
883
  misses: this.stats.misses,
@@ -790,6 +892,7 @@ var ValkeyGlideProvider = class {
790
892
  }
791
893
  };
792
894
  } catch (error) {
895
+ this.noteOpError(error);
793
896
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Failed to get statistics:`, error);
794
897
  return {
795
898
  hits: this.stats.hits,
@@ -818,6 +921,7 @@ var ValkeyGlideProvider = class {
818
921
  const client = await this.ensureConnected();
819
922
  const cacheKey = this.buildKey(key);
820
923
  const value = await client.get(cacheKey);
924
+ this.recordOpSuccess();
821
925
  if (value === null) {
822
926
  this.stats.misses++;
823
927
  if (this.enableLogging) {
@@ -837,6 +941,7 @@ var ValkeyGlideProvider = class {
837
941
  return entry.data;
838
942
  } catch (error) {
839
943
  this.stats.errors++;
944
+ this.noteOpError(error);
840
945
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Error getting cache key:`, error);
841
946
  return null;
842
947
  }
@@ -861,6 +966,7 @@ var ValkeyGlideProvider = class {
861
966
  count: ttlSeconds
862
967
  }
863
968
  });
969
+ this.recordOpSuccess();
864
970
  this.stats.sets++;
865
971
  if (this.enableLogging) {
866
972
  logger.debug(`[ValkeyGlideProvider:${this.namespace}] Cache set`, {
@@ -871,6 +977,7 @@ var ValkeyGlideProvider = class {
871
977
  return true;
872
978
  } catch (error) {
873
979
  this.stats.errors++;
980
+ this.noteOpError(error);
874
981
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Error setting cache key:`, error);
875
982
  return false;
876
983
  }
@@ -885,6 +992,7 @@ var ValkeyGlideProvider = class {
885
992
  const result = await client.del([
886
993
  cacheKey
887
994
  ]);
995
+ this.recordOpSuccess();
888
996
  this.stats.deletes++;
889
997
  if (this.enableLogging) {
890
998
  logger.debug(`[ValkeyGlideProvider:${this.namespace}] Cache delete`, {
@@ -895,6 +1003,7 @@ var ValkeyGlideProvider = class {
895
1003
  return result > 0;
896
1004
  } catch (error) {
897
1005
  this.stats.errors++;
1006
+ this.noteOpError(error);
898
1007
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Error deleting cache key:`, error);
899
1008
  return false;
900
1009
  }
@@ -909,9 +1018,11 @@ var ValkeyGlideProvider = class {
909
1018
  const exists = await client.exists([
910
1019
  cacheKey
911
1020
  ]);
1021
+ this.recordOpSuccess();
912
1022
  return exists === 1;
913
1023
  } catch (error) {
914
1024
  this.stats.errors++;
1025
+ this.noteOpError(error);
915
1026
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Error checking cache key:`, error);
916
1027
  return false;
917
1028
  }
@@ -923,9 +1034,12 @@ var ValkeyGlideProvider = class {
923
1034
  try {
924
1035
  const client = await this.ensureConnected();
925
1036
  const cacheKey = this.buildKey(key);
926
- return await client.ttl(cacheKey);
1037
+ const result = await client.ttl(cacheKey);
1038
+ this.recordOpSuccess();
1039
+ return result;
927
1040
  } catch (error) {
928
1041
  this.stats.errors++;
1042
+ this.noteOpError(error);
929
1043
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Error getting TTL:`, error);
930
1044
  return -2;
931
1045
  }
@@ -937,9 +1051,12 @@ var ValkeyGlideProvider = class {
937
1051
  try {
938
1052
  const client = await this.ensureConnected();
939
1053
  const cacheKey = this.buildKey(key);
940
- return await client.expire(cacheKey, ttl);
1054
+ const result = await client.expire(cacheKey, ttl);
1055
+ this.recordOpSuccess();
1056
+ return result;
941
1057
  } catch (error) {
942
1058
  this.stats.errors++;
1059
+ this.noteOpError(error);
943
1060
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Error setting expiration:`, error);
944
1061
  return false;
945
1062
  }
@@ -956,6 +1073,7 @@ var ValkeyGlideProvider = class {
956
1073
  const client = await this.ensureConnected();
957
1074
  const cacheKeys = keys.map((key) => this.buildKey(key));
958
1075
  const values = await client.mget(cacheKeys);
1076
+ this.recordOpSuccess();
959
1077
  for (let i = 0; i < keys.length; i++) {
960
1078
  const key = keys[i];
961
1079
  if (!key) continue;
@@ -976,6 +1094,7 @@ var ValkeyGlideProvider = class {
976
1094
  return result;
977
1095
  } catch (error) {
978
1096
  this.stats.errors++;
1097
+ this.noteOpError(error);
979
1098
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Error in batch get:`, error);
980
1099
  return result;
981
1100
  }
@@ -1002,6 +1121,7 @@ var ValkeyGlideProvider = class {
1002
1121
  keyValuePairs[cacheKey] = JSON.stringify(entry);
1003
1122
  }
1004
1123
  await client.mset(keyValuePairs);
1124
+ this.recordOpSuccess();
1005
1125
  for (const cacheKey of Object.keys(keyValuePairs)) {
1006
1126
  await client.expire(cacheKey, ttlSeconds);
1007
1127
  }
@@ -1015,6 +1135,7 @@ var ValkeyGlideProvider = class {
1015
1135
  return true;
1016
1136
  } catch (error) {
1017
1137
  this.stats.errors++;
1138
+ this.noteOpError(error);
1018
1139
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Error in batch set:`, error);
1019
1140
  return false;
1020
1141
  }
@@ -1030,6 +1151,7 @@ var ValkeyGlideProvider = class {
1030
1151
  const client = await this.ensureConnected();
1031
1152
  const cacheKeys = keys.map((key) => this.buildKey(key));
1032
1153
  const result = await client.del(cacheKeys);
1154
+ this.recordOpSuccess();
1033
1155
  this.stats.deletes += result;
1034
1156
  if (this.enableLogging) {
1035
1157
  logger.debug(`[ValkeyGlideProvider:${this.namespace}] Batch delete`, {
@@ -1040,6 +1162,7 @@ var ValkeyGlideProvider = class {
1040
1162
  return result;
1041
1163
  } catch (error) {
1042
1164
  this.stats.errors++;
1165
+ this.noteOpError(error);
1043
1166
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Error in batch delete:`, error);
1044
1167
  return 0;
1045
1168
  }
@@ -1052,6 +1175,7 @@ var ValkeyGlideProvider = class {
1052
1175
  const client = await this.ensureConnected();
1053
1176
  const searchPattern = this.buildKey(pattern);
1054
1177
  const keys = await this.getKeys(searchPattern);
1178
+ this.recordOpSuccess();
1055
1179
  if (keys.length === 0) {
1056
1180
  return 0;
1057
1181
  }
@@ -1065,6 +1189,7 @@ var ValkeyGlideProvider = class {
1065
1189
  return result;
1066
1190
  } catch (error) {
1067
1191
  this.stats.errors++;
1192
+ this.noteOpError(error);
1068
1193
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Error clearing pattern:`, error);
1069
1194
  return 0;
1070
1195
  }
@@ -1077,6 +1202,7 @@ var ValkeyGlideProvider = class {
1077
1202
  await this.ensureConnected();
1078
1203
  const searchPattern = this.buildKey(options.pattern);
1079
1204
  const keys = await this.getKeys(searchPattern);
1205
+ this.recordOpSuccess();
1080
1206
  const prefix = `${this.namespace}:`;
1081
1207
  const cleanKeys = keys.map((key) => key.replace(prefix, ""));
1082
1208
  const limitedKeys = options.limit ? cleanKeys.slice(0, options.limit) : cleanKeys;
@@ -1087,6 +1213,7 @@ var ValkeyGlideProvider = class {
1087
1213
  };
1088
1214
  } catch (error) {
1089
1215
  this.stats.errors++;
1216
+ this.noteOpError(error);
1090
1217
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Error getting keys:`, error);
1091
1218
  return {
1092
1219
  keys: [],
@@ -1103,6 +1230,7 @@ var ValkeyGlideProvider = class {
1103
1230
  const client = await this.ensureConnected();
1104
1231
  const pattern = this.buildKey("*");
1105
1232
  const keys = await this.getKeys(pattern);
1233
+ this.recordOpSuccess();
1106
1234
  if (keys.length > 0) {
1107
1235
  await client.del(keys);
1108
1236
  if (this.enableLogging) {
@@ -1112,6 +1240,7 @@ var ValkeyGlideProvider = class {
1112
1240
  return true;
1113
1241
  } catch (error) {
1114
1242
  this.stats.errors++;
1243
+ this.noteOpError(error);
1115
1244
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Error clearing cache:`, error);
1116
1245
  return false;
1117
1246
  }
@@ -1123,9 +1252,12 @@ var ValkeyGlideProvider = class {
1123
1252
  try {
1124
1253
  const client = await this.ensureConnected();
1125
1254
  const cacheKey = this.buildKey(key);
1126
- return await client.incrBy(cacheKey, amount);
1255
+ const result = await client.incrBy(cacheKey, amount);
1256
+ this.recordOpSuccess();
1257
+ return result;
1127
1258
  } catch (error) {
1128
1259
  this.stats.errors++;
1260
+ this.noteOpError(error);
1129
1261
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Error incrementing:`, error);
1130
1262
  throw error;
1131
1263
  }
@@ -1137,9 +1269,12 @@ var ValkeyGlideProvider = class {
1137
1269
  try {
1138
1270
  const client = await this.ensureConnected();
1139
1271
  const cacheKey = this.buildKey(key);
1140
- return await client.decrBy(cacheKey, amount);
1272
+ const result = await client.decrBy(cacheKey, amount);
1273
+ this.recordOpSuccess();
1274
+ return result;
1141
1275
  } catch (error) {
1142
1276
  this.stats.errors++;
1277
+ this.noteOpError(error);
1143
1278
  logger.error(`[ValkeyGlideProvider:${this.namespace}] Error decrementing:`, error);
1144
1279
  throw error;
1145
1280
  }
@@ -1475,5 +1610,5 @@ async function closeAllCaches() {
1475
1610
  __name(closeAllCaches, "closeAllCaches");
1476
1611
 
1477
1612
  export { CacheFactory, CacheProviderType, MemoryCacheProvider, ValkeyGlideProvider, cache_exports, closeAllCaches, createCache, getCache, getValkeyClient };
1478
- //# sourceMappingURL=chunk-CAI5GJJ6.js.map
1479
- //# sourceMappingURL=chunk-CAI5GJJ6.js.map
1613
+ //# sourceMappingURL=chunk-Q4IWDFOO.js.map
1614
+ //# sourceMappingURL=chunk-Q4IWDFOO.js.map