@splitsoftware/splitio-commons 1.17.0-rc.3 → 1.17.0-rc.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/CHANGES.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  1.17.0 (September 6, 2024)
2
2
  - Added `sync.requestOptions.getHeaderOverrides` configuration option to enhance SDK HTTP request Headers for Authorization Frameworks.
3
- - Added lastUpdate property to ReadinessManager to keep track of the timestamp of the last SDK event, used on React and Redux SDKs.
3
+ - Added `isTimedout` and `lastUpdate` properties to IStatusInterface to keep track of the timestamp of the last SDK event, used on React and Redux SDKs.
4
4
  - Updated some transitive dependencies for vulnerability fixes.
5
5
 
6
6
  1.16.0 (June 13, 2024)
@@ -129,8 +129,9 @@ function readinessManagerFactory(EventEmitter, readyTimeout, splits) {
129
129
  splits.removeAllListeners();
130
130
  },
131
131
  isReady: function () { return isReady; },
132
- hasTimedout: function () { return hasTimedout; },
133
132
  isReadyFromCache: function () { return isReadyFromCache; },
133
+ isTimedout: function () { return hasTimedout && !isReady; },
134
+ hasTimedout: function () { return hasTimedout; },
134
135
  isDestroyed: function () { return isDestroyed; },
135
136
  isOperational: function () { return (isReady || isReadyFromCache) && !isDestroyed; },
136
137
  lastUpdate: function () { return lastUpdate; }
@@ -107,14 +107,14 @@ function sdkReadinessManagerFactory(log, EventEmitter, readyTimeout, readinessMa
107
107
  }
108
108
  return readyPromise;
109
109
  },
110
- // Expose status for internal purposes only. Not considered part of the public API, and might be updated eventually.
111
110
  __getStatus: function () {
112
111
  return {
113
112
  isReady: readinessManager.isReady(),
114
113
  isReadyFromCache: readinessManager.isReadyFromCache(),
115
- isOperational: readinessManager.isOperational(),
114
+ isTimedout: readinessManager.isTimedout(),
116
115
  hasTimedout: readinessManager.hasTimedout(),
117
116
  isDestroyed: readinessManager.isDestroyed(),
117
+ isOperational: readinessManager.isOperational(),
118
118
  lastUpdate: readinessManager.lastUpdate(),
119
119
  };
120
120
  },
@@ -126,8 +126,9 @@ export function readinessManagerFactory(EventEmitter, readyTimeout, splits) {
126
126
  splits.removeAllListeners();
127
127
  },
128
128
  isReady: function () { return isReady; },
129
- hasTimedout: function () { return hasTimedout; },
130
129
  isReadyFromCache: function () { return isReadyFromCache; },
130
+ isTimedout: function () { return hasTimedout && !isReady; },
131
+ hasTimedout: function () { return hasTimedout; },
131
132
  isDestroyed: function () { return isDestroyed; },
132
133
  isOperational: function () { return (isReady || isReadyFromCache) && !isDestroyed; },
133
134
  lastUpdate: function () { return lastUpdate; }
@@ -104,14 +104,14 @@ export function sdkReadinessManagerFactory(log, EventEmitter, readyTimeout, read
104
104
  }
105
105
  return readyPromise;
106
106
  },
107
- // Expose status for internal purposes only. Not considered part of the public API, and might be updated eventually.
108
107
  __getStatus: function () {
109
108
  return {
110
109
  isReady: readinessManager.isReady(),
111
110
  isReadyFromCache: readinessManager.isReadyFromCache(),
112
- isOperational: readinessManager.isOperational(),
111
+ isTimedout: readinessManager.isTimedout(),
113
112
  hasTimedout: readinessManager.hasTimedout(),
114
113
  isDestroyed: readinessManager.isDestroyed(),
114
+ isOperational: readinessManager.isOperational(),
115
115
  lastUpdate: readinessManager.lastUpdate(),
116
116
  };
117
117
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@splitsoftware/splitio-commons",
3
- "version": "1.17.0-rc.3",
3
+ "version": "1.17.0-rc.4",
4
4
  "description": "Split JavaScript SDK common components",
5
5
  "main": "cjs/index.js",
6
6
  "module": "esm/index.js",
@@ -143,8 +143,9 @@ export function readinessManagerFactory(
143
143
  },
144
144
 
145
145
  isReady() { return isReady; },
146
- hasTimedout() { return hasTimedout; },
147
146
  isReadyFromCache() { return isReadyFromCache; },
147
+ isTimedout() { return hasTimedout && !isReady; },
148
+ hasTimedout() { return hasTimedout; },
148
149
  isDestroyed() { return isDestroyed; },
149
150
  isOperational() { return (isReady || isReadyFromCache) && !isDestroyed; },
150
151
  lastUpdate() { return lastUpdate; }
@@ -121,14 +121,14 @@ export function sdkReadinessManagerFactory(
121
121
  return readyPromise;
122
122
  },
123
123
 
124
- // Expose status for internal purposes only. Not considered part of the public API, and might be updated eventually.
125
124
  __getStatus() {
126
125
  return {
127
126
  isReady: readinessManager.isReady(),
128
127
  isReadyFromCache: readinessManager.isReadyFromCache(),
129
- isOperational: readinessManager.isOperational(),
128
+ isTimedout: readinessManager.isTimedout(),
130
129
  hasTimedout: readinessManager.hasTimedout(),
131
130
  isDestroyed: readinessManager.isDestroyed(),
131
+ isOperational: readinessManager.isOperational(),
132
132
  lastUpdate: readinessManager.lastUpdate(),
133
133
  };
134
134
  },
@@ -50,6 +50,7 @@ export interface IReadinessManager {
50
50
  /** Readiness status */
51
51
  isReady(): boolean,
52
52
  isReadyFromCache(): boolean,
53
+ isTimedout(): boolean,
53
54
  hasTimedout(): boolean,
54
55
  isDestroyed(): boolean,
55
56
  isOperational(): boolean,
package/src/types.ts CHANGED
@@ -409,6 +409,17 @@ export interface IStatusInterface extends IEventEmitter {
409
409
  * @returns {Promise<void>}
410
410
  */
411
411
  ready(): Promise<void>
412
+
413
+ // Expose status for internal purposes only. Not considered part of the public API, and might be updated eventually.
414
+ __getStatus(): {
415
+ isReady: boolean;
416
+ isReadyFromCache: boolean;
417
+ isTimedout: boolean;
418
+ hasTimedout: boolean;
419
+ isDestroyed: boolean;
420
+ isOperational: boolean;
421
+ lastUpdate: number;
422
+ }
412
423
  }
413
424
  /**
414
425
  * Common definitions between clients for different environments interface.
@@ -38,6 +38,7 @@ export interface IReadinessManager {
38
38
  /** Readiness status */
39
39
  isReady(): boolean;
40
40
  isReadyFromCache(): boolean;
41
+ isTimedout(): boolean;
41
42
  hasTimedout(): boolean;
42
43
  isDestroyed(): boolean;
43
44
  isOperational(): boolean;
package/types/types.d.ts CHANGED
@@ -407,6 +407,15 @@ export interface IStatusInterface extends IEventEmitter {
407
407
  * @returns {Promise<void>}
408
408
  */
409
409
  ready(): Promise<void>;
410
+ __getStatus(): {
411
+ isReady: boolean;
412
+ isReadyFromCache: boolean;
413
+ isTimedout: boolean;
414
+ hasTimedout: boolean;
415
+ isDestroyed: boolean;
416
+ isOperational: boolean;
417
+ lastUpdate: number;
418
+ };
410
419
  }
411
420
  /**
412
421
  * Common definitions between clients for different environments interface.