Skip to content

Commit 893e99e

Browse files
author
Emmanuel Zamora
committed
[SDKS-6958][DW] Replace splits, splitName, web console and apikey
1 parent 5b2e06b commit 893e99e

7 files changed

Lines changed: 35 additions & 31 deletions

File tree

README.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Below is a simple example that describes the instantiation of Split Evaluator:
1515

1616
### Usage via NodeJs
1717
1. Install npm packages via `npm install`
18-
2. Then, execute `SPLIT_EVALUATOR_API_KEY=<YOUR-SDK-API-KEY> SPLIT_EVALUATOR_AUTH_TOKEN=<YOUR-AUTH-TOKEN> SPLIT_EVALUATOR_SERVER_PORT=7548 SPLIT_EVALUATOR_LOG_LEVEL=debug npm start`
18+
2. Then, execute `SPLIT_EVALUATOR_API_KEY=<YOUR-SDK-KEY> SPLIT_EVALUATOR_AUTH_TOKEN=<YOUR-AUTH-TOKEN> SPLIT_EVALUATOR_SERVER_PORT=7548 SPLIT_EVALUATOR_LOG_LEVEL=debug npm start`
1919

2020
### Docker
2121
1. You can pull the Docker image from [Docker Hub](https://hub.docker.com/r/splitsoftware/split-evaluator) and run it into your container environment.
@@ -29,7 +29,7 @@ docker pull splitsoftware/split-evaluator:latest
2929
```shell
3030
docker run --rm --name split-evaluator \
3131
-p 7548:7548 \
32-
-e SPLIT_EVALUATOR_API_KEY=<YOUR-SDK-API-KEY> \
32+
-e SPLIT_EVALUATOR_API_KEY=<YOUR-SDK-KEY> \
3333
-e SPLIT_EVALUATOR_AUTH_TOKEN=<YOUR-AUTH-TOKEN> \
3434
splitsoftware/split-evaluator
3535
```
@@ -53,16 +53,20 @@ To learn more about Split, contact hello@split.io, or get started with feature f
5353

5454
Split has built and maintains SDKs for:
5555

56+
* .NET [Github](https://github.com/splitio/dotnet-client) [Docs](https://help.split.io/hc/en-us/articles/360020240172--NET-SDK)
57+
* Android [Github](https://github.com/splitio/android-client) [Docs](https://help.split.io/hc/en-us/articles/360020343291-Android-SDK)
58+
* GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK)
59+
* iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)
5660
* Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK)
5761
* Javascript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
62+
* Javascript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK)
5863
* Node [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
59-
* .NET [Github](https://github.com/splitio/.net-core-client) [Docs](https://help.split.io/hc/en-us/articles/360020240172--NET-SDK)
60-
* Ruby [Github](https://github.com/splitio/ruby-client) [Docs](https://help.split.io/hc/en-us/articles/360020673251-Ruby-SDK)
6164
* PHP [Github](https://github.com/splitio/php-client) [Docs](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK)
6265
* Python [Github](https://github.com/splitio/python-client) [Docs](https://help.split.io/hc/en-us/articles/360020359652-Python-SDK)
63-
* GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK)
64-
* Android [Github](https://github.com/splitio/android-client) [Docs](https://help.split.io/hc/en-us/articles/360020343291-Android-SDK)
65-
* IOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)
66+
* React [Github](https://github.com/splitio/react-client) [Docs](https://help.split.io/hc/en-us/articles/360038825091-React-SDK)
67+
* React Native [Github](https://github.com/splitio/react-native-client) [Docs](https://help.split.io/hc/en-us/articles/4406066357901-React-Native-SDK)
68+
* Redux [Github](https://github.com/splitio/redux-client) [Docs](https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK)
69+
* Ruby [Github](https://github.com/splitio/ruby-client) [Docs](https://help.split.io/hc/en-us/articles/360020673251-Ruby-SDK)
6670

6771
For a comprehensive list of opensource projects visit our [Github page](https://github.com/splitio?utf8=%E2%9C%93&query=%20only%3Apublic%20).
6872

environmentManager/__tests__/manager.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const app = require('../../app');
55
describe('environmentManager - manager endpoints', () => {
66

77
// splits
8-
test('[/splits] should be 200 if is valid authToken and return splits on split2 yaml file for key_red', async () => {
8+
test('[/splits] should be 200 if is valid authToken and return feature flags on split2 yaml file for key_red', async () => {
99
const response = await request(app)
1010
.get('/manager/splits')
1111
.set('Authorization', 'key_red');
@@ -16,7 +16,7 @@ describe('environmentManager - manager endpoints', () => {
1616
);
1717
});
1818

19-
test('[/splits] should be 200 if is valid authToken and return splits on split1 yaml file for key_blue', async () => {
19+
test('[/splits] should be 200 if is valid authToken and return feature flags on split1 yaml file for key_blue', async () => {
2020
const response = await request(app)
2121
.get('/manager/splits')
2222
.set('Authorization', 'key_blue');
@@ -38,15 +38,15 @@ describe('environmentManager - manager endpoints', () => {
3838

3939

4040
// split
41-
test('[/split] should be 200 if is valid authToken and return split testing_split_red for key_red', async () => {
41+
test('[/split] should be 200 if is valid authToken and return feature flag testing_split_red for key_red', async () => {
4242
const response = await request(app)
4343
.get('/manager/split?split-name=testing_split_red')
4444
.set('Authorization', 'key_red');
4545
expect(response.statusCode).toBe(200);
4646
expect(response.body.name).toEqual('testing_split_red');
4747
});
4848

49-
test('[/split] should be 200 if is valid authToken and return split testing_split_blue for key_blue', async () => {
49+
test('[/split] should be 200 if is valid authToken and return feature flag testing_split_blue for key_blue', async () => {
5050
const response = await request(app)
5151
.get('/manager/split?split-name=testing_split_blue')
5252
.set('Authorization', 'key_blue');
@@ -65,7 +65,7 @@ describe('environmentManager - manager endpoints', () => {
6565

6666

6767
// names
68-
test('[/names] should be 200 if is valid authToken and return splits in split2.yml', async () => {
68+
test('[/names] should be 200 if is valid authToken and return feature flags in split2.yml', async () => {
6969
const response = await request(app)
7070
.get('/manager/names')
7171
.set('Authorization', 'key_red');
@@ -76,7 +76,7 @@ describe('environmentManager - manager endpoints', () => {
7676
);
7777
});
7878

79-
test('[/names] should be 200 if is valid authToken and return splits in split1.yml', async () => {
79+
test('[/names] should be 200 if is valid authToken and return feature flags in split1.yml', async () => {
8080
const response = await request(app)
8181
.get('/manager/names')
8282
.set('Authorization', 'key_blue');

manager/__tests__/splitNames.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('names', () => {
1919
done();
2020
});
2121

22-
test('should be 200 and retuns the splits defined in YAML', async (done) => {
22+
test('should be 200 and retuns the feature flags defined in YAML', async (done) => {
2323
const response = await request(app)
2424
.get('/manager/names')
2525
.set('Authorization', 'test');

manager/__tests__/splits.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('splits', () => {
1919
done();
2020
});
2121

22-
test('should be 200 and returns the splits added in YAML', async (done) => {
22+
test('should be 200 and returns the feature flags added in YAML', async (done) => {
2323
const response = await request(app)
2424
.get('/manager/splits')
2525
.set('Authorization', 'test');

openapi/openapi.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ components:
3838
required: true
3939
schema:
4040
type: string
41-
description: The name of the splits you want to include in the evaluation.
41+
description: The name of the feature flags you want to include in the evaluation.
4242
example: SPLIT_NAME1,SPLIT_NAME2,SPLIT_NAME3
4343
bucketing-key:
4444
in: query
@@ -483,7 +483,7 @@ paths:
483483
get:
484484
tags:
485485
- client
486-
summary: matches splits for passed trafficType and evaluates with passed key
486+
summary: matches feature flags for passed trafficType and evaluates with passed key
487487
description: Calls getTreatments method from the SDK once it have all the splitNames for the keys provided.
488488
parameters:
489489
- $ref: '#/components/parameters/keys'
@@ -530,7 +530,7 @@ paths:
530530
post:
531531
tags:
532532
- client
533-
summary: matches splits for passed trafficType and evaluates with passed key, but receiving the attributes on the request body.
533+
summary: matches feature flags for passed trafficType and evaluates with passed key, but receiving the attributes on the request body.
534534
description: Calls getTreatments method from the SDK once it have all the splitNames for the keys provided.
535535
parameters:
536536
- $ref: '#/components/parameters/keys'
@@ -579,7 +579,7 @@ paths:
579579
get:
580580
tags:
581581
- client
582-
summary: matches splits for passed trafficType and evaluates with passed key and attaches configs
582+
summary: matches feature flags for passed trafficType and evaluates with passed key and attaches configs
583583
description: Calls getTreatmentsWithConfig method from the SDK once it have all the splitNames for the keys provided.
584584
parameters:
585585
- $ref: '#/components/parameters/keys'
@@ -630,7 +630,7 @@ paths:
630630
post:
631631
tags:
632632
- client
633-
summary: matches splits for passed trafficType and evaluates with passed key and attaches configs, but receiving the attributes on the request body.
633+
summary: matches feature flags for passed trafficType and evaluates with passed key and attaches configs, but receiving the attributes on the request body.
634634
description: Calls getTreatmentsWithConfig method from the SDK once it have all the splitNames for the keys provided.
635635
parameters:
636636
- $ref: '#/components/parameters/keys'

utils/inputValidation/__tests__/splits.test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const splitsValidator = require('../splits');
22

3-
describe('splits validator', () => {
3+
describe('feature flags validator', () => {
44
test('should return error on undefined', done => {
55
const expected = 'you passed a null or undefined split-names, split-names must be a non-empty array.';
66

@@ -16,7 +16,7 @@ describe('splits validator', () => {
1616
const expected = 'split-names must be a non-empty array.';
1717

1818
const result = splitsValidator('');
19-
19+
2020
expect(result).toHaveProperty('valid', false);
2121
expect(result).toHaveProperty('error', expected);
2222
expect(result).not.toHaveProperty('value');
@@ -27,7 +27,7 @@ describe('splits validator', () => {
2727
const expected = 'split-names must be a non-empty array.';
2828

2929
const result = splitsValidator(' ');
30-
30+
3131
expect(result).toHaveProperty('valid', false);
3232
expect(result).toHaveProperty('error', expected);
3333
expect(result).not.toHaveProperty('value');
@@ -36,7 +36,7 @@ describe('splits validator', () => {
3636

3737
test('should be valid when ok', done => {
3838
const result = splitsValidator('my-split');
39-
39+
4040
expect(result).toHaveProperty('valid', true);
4141
expect(result).toHaveProperty('value', ['my-split']);
4242
expect(result).not.toHaveProperty('error');
@@ -45,7 +45,7 @@ describe('splits validator', () => {
4545

4646
test('should be valid when ok and should trim', done => {
4747
const result = splitsValidator(' my-split ');
48-
48+
4949
expect(result).toHaveProperty('valid', true);
5050
expect(result).toHaveProperty('value', ['my-split']);
5151
expect(result).not.toHaveProperty('error');
@@ -54,7 +54,7 @@ describe('splits validator', () => {
5454

5555
test('should be valid on multiple inputs and repeated splits', done => {
5656
const result = splitsValidator(' my-split ,my-split2, my-split, test');
57-
57+
5858
expect(result).toHaveProperty('valid', true);
5959
expect(result).toHaveProperty('value', ['my-split','my-split2','test']);
6060
expect(result).not.toHaveProperty('error');

utils/inputValidation/splits.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ const okWrapper = require('./wrapper/ok');
33
const lang = require('../lang');
44
const splitValidator = require('./split');
55

6-
const validateSplits = (maybeSplits) => {
6+
const validateSplits = (maybeFeatureFlags) => {
77
// eslint-disable-next-line eqeqeq
8-
if (maybeSplits == undefined) return errorWrapper('you passed a null or undefined split-names, split-names must be a non-empty array.');
8+
if (maybeFeatureFlags == undefined) return errorWrapper('you passed a null or undefined split-names, split-names must be a non-empty array.');
99

10-
maybeSplits = maybeSplits.split(',');
10+
maybeFeatureFlags = maybeFeatureFlags.split(',');
1111

12-
if (maybeSplits.length > 0) {
12+
if (maybeFeatureFlags.length > 0) {
1313
let validatedArray = [];
1414
// Remove invalid values
15-
maybeSplits.forEach(maybeSplit => {
15+
maybeFeatureFlags.forEach(maybeSplit => {
1616
const splitValidation = splitValidator(maybeSplit);
1717
if (splitValidation.valid) validatedArray.push(splitValidation.value);
1818
});

0 commit comments

Comments
 (0)