@statsig/client-core
Advanced tools
+1
-1
| { | ||
| "name": "@statsig/client-core", | ||
| "version": "3.32.1", | ||
| "version": "3.32.2", | ||
| "license": "ISC", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/statsig-io/js-client-monorepo", |
@@ -50,2 +50,3 @@ "use strict"; | ||
| eventCount: String(count), | ||
| reason, | ||
| }; | ||
@@ -52,0 +53,0 @@ if (metadata) { |
| import { EventBatch } from './EventBatch'; | ||
| import { NetworkCore } from './NetworkCore'; | ||
| import { StatsigClientEmitEventFunc } from './StatsigClientBase'; | ||
| import { LogEventCompressionMode, LoggingEnabledOption, NetworkConfigCommon, StatsigOptionsCommon } from './StatsigOptionsCommon'; | ||
| import { LogEventCompressionMode, NetworkConfigCommon, StatsigOptionsCommon } from './StatsigOptionsCommon'; | ||
| import { UrlConfiguration } from './UrlConfiguration'; | ||
@@ -12,6 +12,4 @@ export declare class EventSender { | ||
| private _emitter; | ||
| private _loggingEnabled; | ||
| constructor(sdkKey: string, network: NetworkCore, emitter: StatsigClientEmitEventFunc, logEventUrlConfig: UrlConfiguration, options: StatsigOptionsCommon<NetworkConfigCommon> | null, loggingEnabled: LoggingEnabledOption); | ||
| constructor(sdkKey: string, network: NetworkCore, emitter: StatsigClientEmitEventFunc, logEventUrlConfig: UrlConfiguration, options: StatsigOptionsCommon<NetworkConfigCommon> | null); | ||
| setLogEventCompressionMode(mode: LogEventCompressionMode): void; | ||
| setLoggingEnabled(enabled: LoggingEnabledOption): void; | ||
| sendBatch(batch: EventBatch): Promise<{ | ||
@@ -18,0 +16,0 @@ success: boolean; |
@@ -17,3 +17,3 @@ "use strict"; | ||
| class EventSender { | ||
| constructor(sdkKey, network, emitter, logEventUrlConfig, options, loggingEnabled) { | ||
| constructor(sdkKey, network, emitter, logEventUrlConfig, options) { | ||
| this._sdkKey = sdkKey; | ||
@@ -24,3 +24,2 @@ this._network = network; | ||
| this._logEventUrlConfig = logEventUrlConfig; | ||
| this._loggingEnabled = loggingEnabled; | ||
| } | ||
@@ -30,5 +29,2 @@ setLogEventCompressionMode(mode) { | ||
| } | ||
| setLoggingEnabled(enabled) { | ||
| this._loggingEnabled = enabled; | ||
| } | ||
| sendBatch(batch) { | ||
@@ -87,2 +83,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
| retries: 3, | ||
| preserveFailedStatusCode: true, | ||
| isCompressable: true, | ||
@@ -89,0 +86,0 @@ params: { |
@@ -23,2 +23,3 @@ import { BatchQueue } from './BatchedEventsQueue'; | ||
| private _isShuttingDown; | ||
| private _loggingEnabled; | ||
| private _sdkKey; | ||
@@ -25,0 +26,0 @@ private _storageKey; |
@@ -20,3 +20,5 @@ "use strict"; | ||
| const NetworkCore_1 = require("./NetworkCore"); | ||
| const SafeJs_1 = require("./SafeJs"); | ||
| const SessionID_1 = require("./SessionID"); | ||
| const StatsigOptionsCommon_1 = require("./StatsigOptionsCommon"); | ||
| const StorageProvider_1 = require("./StorageProvider"); | ||
@@ -40,6 +42,7 @@ class FlushCoordinator { | ||
| this._sdkKey = sdkKey; | ||
| this._eventSender = new EventSender_1.EventSender(sdkKey, network, emitter, logEventUrlConfig, options, loggingEnabled); | ||
| this._loggingEnabled = loggingEnabled; | ||
| this._eventSender = new EventSender_1.EventSender(sdkKey, network, emitter, logEventUrlConfig, options); | ||
| } | ||
| setLoggingEnabled(loggingEnabled) { | ||
| this._eventSender.setLoggingEnabled(loggingEnabled); | ||
| this._loggingEnabled = loggingEnabled; | ||
| } | ||
@@ -245,2 +248,7 @@ setLogEventCompressionMode(mode) { | ||
| return __awaiter(this, void 0, void 0, function* () { | ||
| if (this._loggingEnabled !== StatsigOptionsCommon_1.LoggingEnabledOption.always && | ||
| (0, SafeJs_1._isServerEnv)()) { | ||
| this._flushInterval.adjustForSuccess(); | ||
| return true; | ||
| } | ||
| const result = yield this._eventSender.sendBatch(batch); | ||
@@ -261,3 +269,3 @@ if (result.success) { | ||
| Log_1.Log.warn(`Dropped ${droppedCount} events`); | ||
| this._errorBoundary.logDroppedEvents(droppedCount, `Batch queue limit reached`, { | ||
| this._errorBoundary.logDroppedEvents(droppedCount, `Batch queue limit reached during batching`, { | ||
| loggingInterval: this._flushInterval.getCurrentIntervalMs(), | ||
@@ -305,3 +313,3 @@ batchSize: this._batchQueue.batchSize(), | ||
| Log_1.Log.warn(`Failed to requeue batch : dropped ${droppedCount} events due to full queue`); | ||
| this._errorBoundary.logDroppedEvents(droppedCount, `Batch queue limit reached`, { | ||
| this._errorBoundary.logDroppedEvents(droppedCount, `Batch queue limit reached during requeue`, { | ||
| loggingInterval: this._flushInterval.getCurrentIntervalMs(), | ||
@@ -308,0 +316,0 @@ batchSize: this._batchQueue.batchSize(), |
@@ -15,2 +15,3 @@ import './$_StatsigGlobal'; | ||
| attempt?: number; | ||
| preserveFailedStatusCode?: boolean; | ||
| params?: Record<string, string>; | ||
@@ -17,0 +18,0 @@ headers?: Record<string, string>; |
@@ -176,2 +176,8 @@ "use strict"; | ||
| (_d = this._errorBoundary) === null || _d === void 0 ? void 0 : _d.attachErrorIfNoneExists(formattedErrorMsg); | ||
| if (args.preserveFailedStatusCode && response != null) { | ||
| return { | ||
| body: null, | ||
| code: response.status, | ||
| }; | ||
| } | ||
| return null; | ||
@@ -178,0 +184,0 @@ } |
@@ -1,2 +0,2 @@ | ||
| export declare const SDK_VERSION = "3.32.1"; | ||
| export declare const SDK_VERSION = "3.32.2"; | ||
| export type StatsigMetadata = { | ||
@@ -3,0 +3,0 @@ readonly [key: string]: string | undefined | null; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| exports.StatsigMetadataProvider = exports.SDK_VERSION = void 0; | ||
| exports.SDK_VERSION = '3.32.1'; | ||
| exports.SDK_VERSION = '3.32.2'; | ||
| let metadata = { | ||
@@ -6,0 +6,0 @@ sdkVersion: exports.SDK_VERSION, |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
215499
0.23%5188
0.23%3
-25%