@buka/nestjs-kit 4.1.2 → 4.1.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## [4.1.4](https://github.com/buka-ltd/npm.nestjs-kit/compare/v4.1.3...v4.1.4) (2026-05-21)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * 修复setTimeout溢出问题 ([ac82108](https://github.com/buka-ltd/npm.nestjs-kit/commit/ac82108f1d958cc436584bc86bd1db01f215830c))
9
+
10
+ ## [4.1.3](https://github.com/buka-ltd/npm.nestjs-kit/compare/v4.1.2...v4.1.3) (2026-05-21)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * 修复格式化错误无效的问题 ([6fca5cb](https://github.com/buka-ltd/npm.nestjs-kit/commit/6fca5cbb5526055f34dc35028e9eb82c8c709866))
16
+
3
17
  ## [4.1.2](https://github.com/buka-ltd/npm.nestjs-kit/compare/v4.1.1...v4.1.2) (2026-05-21)
4
18
 
5
19
 
package/dist/index.js CHANGED
@@ -3558,7 +3558,8 @@ let OpenBaoTokenManager = _OpenBaoTokenManager = class OpenBaoTokenManager {
3558
3558
  return;
3559
3559
  }
3560
3560
  const renewBuffer = this.config.renewBufferSeconds ?? 30;
3561
- const renewInMs = Math.max((this.leaseDuration - renewBuffer) * 1e3, 1e3);
3561
+ const maxCheckInterval = Math.min(10080 * 60 * 1e3, this.leaseDuration * .7 * 1e3);
3562
+ const renewInMs = Math.min(Math.max((this.leaseDuration - renewBuffer) * 1e3, 1e3), maxCheckInterval);
3562
3563
  this.renewalTimer = setTimeout(() => {
3563
3564
  this.renewToken();
3564
3565
  }, renewInMs);
@@ -8148,10 +8149,10 @@ const KEQ_REQUEST_PROVIDER = {
8148
8149
  provide: OPEN_BAO_KEQ_REQUEST,
8149
8150
  useFactory: (options, tokenManager) => {
8150
8151
  const request = new keq.KeqRequest();
8152
+ request.use(formatError());
8151
8153
  request.use((0, _keq_request_url.setBaseUrl)(options.address + "/v1/"));
8152
8154
  request.use(setOpenBaoToken(() => tokenManager.getToken()));
8153
8155
  request.use((0, _keq_request_exception.validateStatusCode)());
8154
- request.use(formatError());
8155
8156
  return request;
8156
8157
  },
8157
8158
  inject: [MODULE_OPTIONS_TOKEN$3, OpenBaoTokenManager]