@forge/bridge

6.1.1-next.16.1.1-next.2
out/featureFlags/featureFlagEvents.js
out/featureFlags/featureFlagEvents.jsDeleted
−26
Index: package/out/featureFlags/featureFlagEvents.js
===================================================================
--- package/out/featureFlags/featureFlagEvents.js
+++ package/out/featureFlags/featureFlagEvents.js
@@ -1,26 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.trackFeatureFlagEvent = void 0;
-const bridge_1 = require("../bridge");
-const errors_1 = require("../errors");
-const utils_1 = require("../utils");
-const types_1 = require("./types");
-const maxOps = 500;
-const intervalInMs = 1000 * 25;
-const callBridge = (0, bridge_1.getCallBridge)();
-const validatePayload = (payload) => {
-    if (!payload || !payload.type || !payload.properties) {
-        throw new errors_1.BridgeAPIError('Missing required parameters. Parameter type, and properties are required in the payload.');
-    }
-    if (!(payload.type.toUpperCase() in types_1.FeatureFlagEventType)) {
-        throw new errors_1.BridgeAPIError('Event type is not supported');
-    }
-    if (Object.values(payload).some((val) => typeof val === 'function')) {
-        throw new errors_1.BridgeAPIError('Passing functions as part of the payload is not supported!');
-    }
-};
-const _trackFeatureFlagEvent = (payload) => {
-    validatePayload(payload);
-    return callBridge('trackFeatureFlagEvent', payload);
-};
-exports.trackFeatureFlagEvent = (0, utils_1.withRateLimiter)(_trackFeatureFlagEvent, maxOps, intervalInMs, `Feature flags calls are rate limited at ${maxOps}req/${intervalInMs / 1000}s`);