@statsig/client-core 3.33.0 → 3.33.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statsig/client-core",
3
- "version": "3.33.0",
3
+ "version": "3.33.1",
4
4
  "license": "ISC",
5
5
  "homepage": "https://github.com/statsig-io/js-client-monorepo",
6
6
  "repository": {
@@ -74,7 +74,7 @@ class FlushCoordinator {
74
74
  if (this._currentFlushPromise) {
75
75
  yield this._currentFlushPromise;
76
76
  }
77
- this._currentFlushPromise = this._executeFlush(FlushTypes_1.FlushType.Manual).finally(() => {
77
+ this._currentFlushPromise = this._executeFlush(FlushTypes_1.FlushTypeValues.Manual).finally(() => {
78
78
  this._currentFlushPromise = null;
79
79
  this._scheduleNextFlush();
80
80
  });
@@ -88,7 +88,7 @@ class FlushCoordinator {
88
88
  if (this._currentFlushPromise) {
89
89
  yield this._currentFlushPromise;
90
90
  }
91
- this._currentFlushPromise = this._executeFlush(FlushTypes_1.FlushType.Shutdown)
91
+ this._currentFlushPromise = this._executeFlush(FlushTypes_1.FlushTypeValues.Shutdown)
92
92
  .catch((error) => {
93
93
  Log_1.Log.error(`Error during shutdown flush: ${error}`);
94
94
  })
@@ -145,10 +145,10 @@ class FlushCoordinator {
145
145
  this._flushInterval.markFlushAttempt();
146
146
  let flushType;
147
147
  if (shouldFlushBySize) {
148
- flushType = FlushTypes_1.FlushType.ScheduledFullBatch;
148
+ flushType = FlushTypes_1.FlushTypeValues.ScheduledFullBatch;
149
149
  }
150
150
  else {
151
- flushType = FlushTypes_1.FlushType.ScheduledMaxTime;
151
+ flushType = FlushTypes_1.FlushTypeValues.ScheduledMaxTime;
152
152
  }
153
153
  this._currentFlushPromise = this._processNextBatch(flushType)
154
154
  .then(() => {
@@ -180,13 +180,13 @@ class FlushCoordinator {
180
180
  }
181
181
  _processLimitFlushInternal() {
182
182
  return __awaiter(this, void 0, void 0, function* () {
183
- const success = yield this._processNextBatch(FlushTypes_1.FlushType.Limit);
183
+ const success = yield this._processNextBatch(FlushTypes_1.FlushTypeValues.Limit);
184
184
  if (!success) {
185
185
  return;
186
186
  }
187
187
  while (this._flushInterval.hasCompletelyRecoveredFromBackoff() &&
188
188
  this.containsAtLeastOneFullBatch()) {
189
- const success = yield this._processNextBatch(FlushTypes_1.FlushType.Limit);
189
+ const success = yield this._processNextBatch(FlushTypes_1.FlushTypeValues.Limit);
190
190
  if (!success) {
191
191
  break;
192
192
  }
@@ -302,7 +302,7 @@ class FlushCoordinator {
302
302
  return false;
303
303
  }
304
304
  _handleFailure(batch, flushType, statusCode, failurePath, failureErrorMessage, failureDiagnosticBucket, failureDiagnosticMetadata) {
305
- if (flushType === FlushTypes_1.FlushType.Shutdown) {
305
+ if (flushType === FlushTypes_1.FlushTypeValues.Shutdown) {
306
306
  Log_1.Log.warn(`${flushType} flush failed during shutdown. ` +
307
307
  `${batch.events.length} event(s) will be saved to storage for retry in next session.`);
308
308
  this._saveShutdownFailedEventsToStorage(batch.events);
@@ -1,7 +1,8 @@
1
- export declare enum FlushType {
2
- ScheduledMaxTime = "scheduled:max_time",
3
- ScheduledFullBatch = "scheduled:full_batch",
4
- Limit = "limit",
5
- Manual = "manual",
6
- Shutdown = "shutdown"
7
- }
1
+ export declare const FlushTypeValues: {
2
+ readonly ScheduledMaxTime: "scheduled:max_time";
3
+ readonly ScheduledFullBatch: "scheduled:full_batch";
4
+ readonly Limit: "limit";
5
+ readonly Manual: "manual";
6
+ readonly Shutdown: "shutdown";
7
+ };
8
+ export type FlushType = (typeof FlushTypeValues)[keyof typeof FlushTypeValues];
package/src/FlushTypes.js CHANGED
@@ -1,12 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlushType = void 0;
4
- /* eslint-disable no-restricted-syntax */
5
- var FlushType;
6
- (function (FlushType) {
7
- FlushType["ScheduledMaxTime"] = "scheduled:max_time";
8
- FlushType["ScheduledFullBatch"] = "scheduled:full_batch";
9
- FlushType["Limit"] = "limit";
10
- FlushType["Manual"] = "manual";
11
- FlushType["Shutdown"] = "shutdown";
12
- })(FlushType || (exports.FlushType = FlushType = {}));
3
+ exports.FlushTypeValues = void 0;
4
+ exports.FlushTypeValues = {
5
+ ScheduledMaxTime: 'scheduled:max_time',
6
+ ScheduledFullBatch: 'scheduled:full_batch',
7
+ Limit: 'limit',
8
+ Manual: 'manual',
9
+ Shutdown: 'shutdown',
10
+ };
@@ -1,4 +1,4 @@
1
- export declare const SDK_VERSION = "3.33.0";
1
+ export declare const SDK_VERSION = "3.33.1";
2
2
  export type StatsigMetadata = {
3
3
  readonly [key: string]: string | undefined | null;
4
4
  readonly appVersion?: string;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StatsigMetadataProvider = exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = '3.33.0';
4
+ exports.SDK_VERSION = '3.33.1';
5
5
  let metadata = {
6
6
  sdkVersion: exports.SDK_VERSION,
7
7
  sdkType: 'js-mono', // js-mono is overwritten by Precomp and OnDevice clients