@devcycle/nodejs-server-sdk
Version:
The DevCycle NodeJS Server SDK used for feature management.
25 lines • 1.13 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.DVCRequestEvent = void 0;
const eventQueue_1 = require("../eventQueue");
const js_cloud_server_sdk_1 = require("@devcycle/js-cloud-server-sdk");
class DVCRequestEvent {
constructor(event, user_id, featureVars) {
const { type, target, date, value, metaData } = event;
(0, js_cloud_server_sdk_1.checkParamDefined)('type', type);
(0, js_cloud_server_sdk_1.checkParamString)('type', type);
(0, js_cloud_server_sdk_1.checkParamDefined)('user_id', user_id);
(0, js_cloud_server_sdk_1.checkParamString)('user_id', user_id);
const isCustomEvent = !eventQueue_1.EventTypes[type];
this.type = isCustomEvent ? 'customEvent' : type;
this.target = target;
this.customType = isCustomEvent ? type : undefined;
this.user_id = user_id;
this.clientDate = date || Date.now();
this.value = value;
this.featureVars = featureVars;
this.metaData = metaData;
}
}
exports.DVCRequestEvent = DVCRequestEvent;
//# sourceMappingURL=requestEvent.js.map
;