featureflow-node-sdk 0.6.9-alpha → 0.6.9
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/dist/Client.d.ts +13 -0
- package/dist/Client.js +1 -12
- package/dist/Conditions.d.ts +1 -0
- package/dist/Evaluate.d.ts +11 -0
- package/dist/EvaluateHelpers.d.ts +5 -0
- package/dist/EventsClient.d.ts +19 -0
- package/dist/ExpressMiddleware.d.ts +1 -0
- package/dist/Feature.d.ts +12 -0
- package/dist/FeatureStore.d.ts +8 -0
- package/dist/PollingClient.d.ts +13 -0
- package/dist/User.d.ts +20 -0
- package/dist/debug.d.ts +2 -0
- package/dist/index.d.ts +11 -0
- package/package.json +5 -3
package/dist/Client.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default class Featureflow {
|
|
2
|
+
constructor(config: any, callback?: (_err: any, self: any) => void);
|
|
3
|
+
failoverVariants: {};
|
|
4
|
+
isReady: boolean;
|
|
5
|
+
config: any;
|
|
6
|
+
eventsClient: EventsClient;
|
|
7
|
+
close: PollingClient;
|
|
8
|
+
ready(callback?: () => void): any;
|
|
9
|
+
evaluateAll(): any;
|
|
10
|
+
evaluate(key: any): any;
|
|
11
|
+
}
|
|
12
|
+
import EventsClient from "./EventsClient";
|
|
13
|
+
import PollingClient from "./PollingClient";
|
package/dist/Client.js
CHANGED
|
@@ -44,7 +44,7 @@ var Featureflow = function (_EventEmitter) {
|
|
|
44
44
|
_inherits(Featureflow, _EventEmitter);
|
|
45
45
|
|
|
46
46
|
function Featureflow(config) {
|
|
47
|
-
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
|
|
47
|
+
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function (_err, self) {};
|
|
48
48
|
|
|
49
49
|
_classCallCheck(this, Featureflow);
|
|
50
50
|
|
|
@@ -105,17 +105,6 @@ var Featureflow = function (_EventEmitter) {
|
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
-
}, {
|
|
109
|
-
key: 'waitForReady',
|
|
110
|
-
value: function waitForReady() {
|
|
111
|
-
var _this3 = this;
|
|
112
|
-
|
|
113
|
-
return new Promise(function (resolve) {
|
|
114
|
-
_this3.ready(function () {
|
|
115
|
-
return resolve();
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
108
|
}, {
|
|
120
109
|
key: 'evaluateAll',
|
|
121
110
|
value: function (_evaluateAll) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function test(op: any, a: any, b: any): any;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default class Evaluate {
|
|
2
|
+
constructor(featureKey: any, evaluatedVariant: any, user: any, eventsClient: any);
|
|
3
|
+
featureKey: any;
|
|
4
|
+
evaluatedVariant: any;
|
|
5
|
+
user: any;
|
|
6
|
+
eventsClient: any;
|
|
7
|
+
is(value: any): boolean;
|
|
8
|
+
isOn(): boolean;
|
|
9
|
+
isOff(): boolean;
|
|
10
|
+
value(): any;
|
|
11
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export function featureEvaluation(feature: any, user: any): any;
|
|
2
|
+
export function ruleMatches(rule: any, user: any): boolean;
|
|
3
|
+
export function getVariantSplitKey(variantSplits: any, variantValue: any): any;
|
|
4
|
+
export function calculateHash(salt: any, feature: any, id: any): any;
|
|
5
|
+
export function getVariantValue(hash: any): number;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export default class EventsClient {
|
|
2
|
+
constructor(apiKey: any, eventsUrl?: string, disabled?: boolean);
|
|
3
|
+
SEND_INTERVAL: number;
|
|
4
|
+
QUEUE_SIZE: number;
|
|
5
|
+
clientVersion: string;
|
|
6
|
+
queue: any[];
|
|
7
|
+
overLimit: boolean;
|
|
8
|
+
apiKey: any;
|
|
9
|
+
eventsUrl: string;
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
sendInterval: number;
|
|
12
|
+
interval: number;
|
|
13
|
+
registerFeaturesEvent(features: any): void;
|
|
14
|
+
evaluateEvent(featureKey: any, evaluatedVariant: any, expectedVariant: any, user: any): void;
|
|
15
|
+
queueEvaluateEvent(event: any): void;
|
|
16
|
+
sendQueue(): void;
|
|
17
|
+
sendEvent(eventType: any, method: any, url: any, json: any): void;
|
|
18
|
+
close(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function _default(options: any): (req: any, res: any, next: any) => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export default class Feature {
|
|
2
|
+
constructor(key: any, failoverVariant?: string);
|
|
3
|
+
variants: any[];
|
|
4
|
+
key: any;
|
|
5
|
+
failoverVariant: string;
|
|
6
|
+
addVariant(key: any, value: any): Feature;
|
|
7
|
+
build(): {
|
|
8
|
+
key: any;
|
|
9
|
+
failoverVariant: string;
|
|
10
|
+
variants: any[];
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default class PollingClient {
|
|
2
|
+
constructor(url: any, config: any, callback: any);
|
|
3
|
+
DEFAULT_TIMEOUT: number;
|
|
4
|
+
DEFAULT_INTERVAL: number;
|
|
5
|
+
clientVersion: string;
|
|
6
|
+
url: any;
|
|
7
|
+
apiKey: any;
|
|
8
|
+
featureStore: any;
|
|
9
|
+
interval: number;
|
|
10
|
+
timeout: number;
|
|
11
|
+
etag: string;
|
|
12
|
+
getFeatures(callback?: () => void): void;
|
|
13
|
+
}
|
package/dist/User.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export class UserBuilder {
|
|
2
|
+
constructor(id: any);
|
|
3
|
+
id: any;
|
|
4
|
+
attributes: {
|
|
5
|
+
'featureflow.user.id': any[];
|
|
6
|
+
'featureflow.date': string[];
|
|
7
|
+
};
|
|
8
|
+
withAttribute(key: any, value: any): UserBuilder;
|
|
9
|
+
withAttributes(key: any, values: any): UserBuilder;
|
|
10
|
+
build(): User;
|
|
11
|
+
}
|
|
12
|
+
declare class User {
|
|
13
|
+
constructor(id: any, attributes: any);
|
|
14
|
+
id: any;
|
|
15
|
+
attributes: any;
|
|
16
|
+
getId(): any;
|
|
17
|
+
getAttributesForKey(key: any): any;
|
|
18
|
+
addAttribute(key: any, value: any): void;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
package/dist/debug.d.ts
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare namespace _default {
|
|
2
|
+
export { Client };
|
|
3
|
+
export { UserBuilder };
|
|
4
|
+
export { Feature };
|
|
5
|
+
export { ExpressClient };
|
|
6
|
+
}
|
|
7
|
+
export default _default;
|
|
8
|
+
import Client from "./Client";
|
|
9
|
+
import { UserBuilder } from "./User";
|
|
10
|
+
import Feature from "./Feature";
|
|
11
|
+
import ExpressClient from "./ExpressMiddleware";
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "featureflow-node-sdk",
|
|
3
|
-
"version": "0.6.9
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"description": "Featureflow sdk for Node",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
6
7
|
"engines": {
|
|
7
8
|
"node": ">4.0.0"
|
|
8
9
|
},
|
|
@@ -10,7 +11,7 @@
|
|
|
10
11
|
"dist"
|
|
11
12
|
],
|
|
12
13
|
"scripts": {
|
|
13
|
-
"build": "babel src -d dist",
|
|
14
|
+
"build": "babel src -d dist && tsc",
|
|
14
15
|
"watch": "babel --watch src -d dist",
|
|
15
16
|
"prepublish": "npm run build",
|
|
16
17
|
"test": "cucumber.js --compiler js:babel-core/register --tags \"not @ignore and not @integration\"",
|
|
@@ -31,7 +32,8 @@
|
|
|
31
32
|
"big-integer": "^1.6.17",
|
|
32
33
|
"debug": "^2.6.2",
|
|
33
34
|
"request": "^2.88.0",
|
|
34
|
-
"sha1-hex": "^1.0.0"
|
|
35
|
+
"sha1-hex": "^1.0.0",
|
|
36
|
+
"typescript": "^4.8.2"
|
|
35
37
|
},
|
|
36
38
|
"devDependencies": {
|
|
37
39
|
"babel-cli": "^6.26.0",
|