@eppo/node-server-sdk
Advanced tools
Comparing version 1.0.7 to 1.1.0
import { IAssignmentLogger } from './assignment-logger'; | ||
import { IEppoClient } from './eppo-client'; | ||
import { IEppoClient } from './client/eppo-client'; | ||
/** | ||
@@ -23,3 +23,3 @@ * Configuration used for initializing the Eppo client | ||
export { IAssignmentEvent, IAssignmentLogger } from './assignment-logger'; | ||
export { IEppoClient } from './eppo-client'; | ||
export { IEppoClient } from './client/eppo-client'; | ||
/** | ||
@@ -26,0 +26,0 @@ * Initializes the Eppo client with configuration parameters. |
@@ -5,6 +5,6 @@ "use strict"; | ||
const axios_1 = require("axios"); | ||
const eppo_client_1 = require("./client/eppo-client"); | ||
const configuration_store_1 = require("./configuration-store"); | ||
const constants_1 = require("./constants"); | ||
const eppo_client_1 = require("./eppo-client"); | ||
const experiment_configuration_requestor_1 = require("./experiment/experiment-configuration-requestor"); | ||
const experiment_configuration_requestor_1 = require("./experiment-configuration-requestor"); | ||
const http_client_1 = require("./http-client"); | ||
@@ -11,0 +11,0 @@ const poller_1 = require("./poller"); |
@@ -1,3 +0,3 @@ | ||
import { Rule } from './rule'; | ||
export declare function matchesAnyRule(subjectAttributes: Record<string, any>, rules: Rule[]): boolean; | ||
import { IRule } from './dto/rule-dto'; | ||
export declare function findMatchingRule(subjectAttributes: Record<string, any>, rules: IRule[]): IRule; | ||
//# sourceMappingURL=rule_evaluator.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.matchesAnyRule = void 0; | ||
exports.findMatchingRule = void 0; | ||
/* eslint-disable @typescript-eslint/no-explicit-any */ | ||
const rule_1 = require("./rule"); | ||
function matchesAnyRule(subjectAttributes, rules) { | ||
const rule_dto_1 = require("./dto/rule-dto"); | ||
function findMatchingRule(subjectAttributes, rules) { | ||
for (const rule of rules) { | ||
if (matchesRule(subjectAttributes, rule)) { | ||
return true; | ||
return rule; | ||
} | ||
} | ||
return false; | ||
return null; | ||
} | ||
exports.matchesAnyRule = matchesAnyRule; | ||
exports.findMatchingRule = findMatchingRule; | ||
function matchesRule(subjectAttributes, rule) { | ||
@@ -26,15 +26,15 @@ const conditionEvaluations = evaluateRuleConditions(subjectAttributes, rule.conditions); | ||
switch (condition.operator) { | ||
case rule_1.OperatorType.GTE: | ||
case rule_dto_1.OperatorType.GTE: | ||
return compareNumber(value, condition.value, (a, b) => a >= b); | ||
case rule_1.OperatorType.GT: | ||
case rule_dto_1.OperatorType.GT: | ||
return compareNumber(value, condition.value, (a, b) => a > b); | ||
case rule_1.OperatorType.LTE: | ||
case rule_dto_1.OperatorType.LTE: | ||
return compareNumber(value, condition.value, (a, b) => a <= b); | ||
case rule_1.OperatorType.LT: | ||
case rule_dto_1.OperatorType.LT: | ||
return compareNumber(value, condition.value, (a, b) => a < b); | ||
case rule_1.OperatorType.MATCHES: | ||
case rule_dto_1.OperatorType.MATCHES: | ||
return new RegExp(condition.value).test(value); | ||
case rule_1.OperatorType.ONE_OF: | ||
case rule_dto_1.OperatorType.ONE_OF: | ||
return isOneOf(value, condition.value); | ||
case rule_1.OperatorType.NOT_ONE_OF: | ||
case rule_dto_1.OperatorType.NOT_ONE_OF: | ||
return isNotOneOf(value, condition.value); | ||
@@ -41,0 +41,0 @@ } |
@@ -1,4 +0,4 @@ | ||
import { IShardRange } from './experiment/variation'; | ||
import { IShardRange } from './dto/variation-dto'; | ||
export declare function getShard(input: string, subjectShards: number): number; | ||
export declare function isShardInRange(shard: number, range: IShardRange): boolean; | ||
//# sourceMappingURL=shard.d.ts.map |
{ | ||
"name": "@eppo/node-server-sdk", | ||
"version": "1.0.7", | ||
"version": "1.1.0", | ||
"description": "Eppo node server SDK", | ||
@@ -14,3 +14,3 @@ "main": "dist/index.js", | ||
"lint:fix-pre-commit": "eslint -c .eslintrc.pre-commit.js --fix '**/*.{ts,tsx}' --no-eslintrc --cache", | ||
"prepare": "husky install && rm -rf dist/ && tsc && api-extractor run --local", | ||
"prepare": "make prepare", | ||
"pre-commit": "lint-staged && tsc && yarn docs", | ||
@@ -17,0 +17,0 @@ "typecheck": "tsc", |
@@ -8,2 +8,2 @@ # Eppo Server-Side SDK for Node.js | ||
Refer to our [SDK documentation](https://docs.geteppo.com/feature-flagging/randomization-sdk) for how to install and use the SDK. | ||
Refer to our [SDK documentation](https://docs.geteppo.com/prerequisites/feature-flagging/randomization-sdk/server-sdks/node) for how to install and use the SDK. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
48782
69
676