@wildix/xbees-conversations-utils 1.1.88 → 1.1.90

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.
@@ -5,7 +5,7 @@ const processStreamBudgetHeaders_1 = require("./processStreamBudgetHeaders");
5
5
  const processStreamRateLimitHeaders_1 = require("./processStreamRateLimitHeaders");
6
6
  const attachedInterceptors = new WeakSet();
7
7
  function hasResponseInterceptors(value) {
8
- return (typeof value === 'object' &&
8
+ return ((typeof value === 'object' || typeof value === 'function') &&
9
9
  value !== null &&
10
10
  typeof value.interceptors?.response?.use === 'function');
11
11
  }
@@ -48,6 +48,7 @@ function registerStreamInterceptors(stream, context) {
48
48
  const { axiosInstance, source } = resolveAxiosInstance(stream);
49
49
  if (!axiosInstance || !axiosInstance.interceptors?.response?.use) {
50
50
  logger.warn('Unable to register stream budget & rate limit interceptors: axios instance not found', {
51
+ streamType: typeof stream,
51
52
  streamConstructorName: typeof stream === 'object' && stream !== null ? stream.constructor?.name : undefined,
52
53
  streamKeysPreview: getOwnKeysPreview(stream),
53
54
  hasAxiosInstanceField: typeof stream === 'object' && stream !== null && 'axiosInstance' in stream,
@@ -2,7 +2,7 @@ import { processStreamBudgetHeaders } from './processStreamBudgetHeaders';
2
2
  import { processStreamRateLimitHeaders } from './processStreamRateLimitHeaders';
3
3
  const attachedInterceptors = new WeakSet();
4
4
  function hasResponseInterceptors(value) {
5
- return (typeof value === 'object' &&
5
+ return ((typeof value === 'object' || typeof value === 'function') &&
6
6
  value !== null &&
7
7
  typeof value.interceptors?.response?.use === 'function');
8
8
  }
@@ -45,6 +45,7 @@ export function registerStreamInterceptors(stream, context) {
45
45
  const { axiosInstance, source } = resolveAxiosInstance(stream);
46
46
  if (!axiosInstance || !axiosInstance.interceptors?.response?.use) {
47
47
  logger.warn('Unable to register stream budget & rate limit interceptors: axios instance not found', {
48
+ streamType: typeof stream,
48
49
  streamConstructorName: typeof stream === 'object' && stream !== null ? stream.constructor?.name : undefined,
49
50
  streamKeysPreview: getOwnKeysPreview(stream),
50
51
  hasAxiosInstanceField: typeof stream === 'object' && stream !== null && 'axiosInstance' in stream,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wildix/xbees-conversations-utils",
3
- "version": "1.1.88",
3
+ "version": "1.1.90",
4
4
  "description": "",
5
5
  "main": "./dist-cjs/index.js",
6
6
  "module": "./dist-es/index.js",