flagsmith-nodejs 2.0.0-beta.5 → 2.0.0
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/.github/workflows/pull_request.yaml +37 -29
- package/.tool-versions +1 -0
- package/README.md +7 -0
- package/example/package-lock.json +1 -996
- package/flagsmith-engine/features/models.ts +28 -6
- package/flagsmith-engine/features/util.ts +9 -0
- package/flagsmith-engine/identities/models.ts +1 -1
- package/flagsmith-engine/index.ts +7 -5
- package/flagsmith-engine/organisations/models.ts +1 -1
- package/flagsmith-engine/segments/models.ts +21 -4
- package/flagsmith-engine/segments/util.ts +8 -0
- package/flagsmith-engine/utils/collections.ts +1 -12
- package/flagsmith-engine/utils/hashing/index.ts +5 -2
- package/flagsmith-engine/utils/index.ts +6 -2
- package/package.json +4 -1
- package/sdk/analytics.ts +0 -2
- package/sdk/index.ts +84 -28
- package/sdk/polling_manager.ts +0 -1
- package/sdk/types.ts +8 -0
- package/sdk/utils.ts +4 -5
- package/tests/engine/unit/{egine.test.ts → engine.test.ts} +20 -0
- package/tests/engine/unit/features/models.test.ts +8 -4
- package/tests/engine/unit/identities/identities_builders.test.ts +13 -0
- package/tests/engine/unit/identities/identities_models.test.ts +3 -14
- package/tests/engine/unit/organization/models.test.ts +1 -1
- package/tests/engine/unit/segments/segments_model.test.ts +22 -1
- package/tests/engine/unit/utils.ts +1 -1
- package/tests/sdk/analytics.test.ts +11 -0
- package/tests/sdk/flagsmith-cache.test.ts +150 -0
- package/tests/sdk/flagsmith-environment-flags.test.ts +197 -0
- package/tests/sdk/flagsmith-identity-flags.test.ts +140 -0
- package/tests/sdk/flagsmith.test.ts +100 -85
- package/tests/sdk/polling.test.ts +25 -0
- package/tests/sdk/utils.ts +21 -2
- package/tsconfig.json +2 -1
- package/.idea/flagsmith-nodejs-client.iml +0 -12
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/build/flagsmith-engine/environments/integrations/models.d.ts +0 -4
- package/build/flagsmith-engine/environments/integrations/models.js +0 -8
- package/build/flagsmith-engine/environments/models.d.ts +0 -25
- package/build/flagsmith-engine/environments/models.js +0 -40
- package/build/flagsmith-engine/environments/util.d.ts +0 -3
- package/build/flagsmith-engine/environments/util.js +0 -19
- package/build/flagsmith-engine/features/constants.d.ts +0 -4
- package/build/flagsmith-engine/features/constants.js +0 -7
- package/build/flagsmith-engine/features/models.d.ts +0 -32
- package/build/flagsmith-engine/features/models.js +0 -85
- package/build/flagsmith-engine/features/util.d.ts +0 -3
- package/build/flagsmith-engine/features/util.js +0 -20
- package/build/flagsmith-engine/identities/models.d.ts +0 -15
- package/build/flagsmith-engine/identities/models.js +0 -47
- package/build/flagsmith-engine/identities/traits/models.d.ts +0 -5
- package/build/flagsmith-engine/identities/traits/models.js +0 -12
- package/build/flagsmith-engine/identities/util.d.ts +0 -4
- package/build/flagsmith-engine/identities/util.js +0 -22
- package/build/flagsmith-engine/index.d.ts +0 -8
- package/build/flagsmith-engine/index.js +0 -61
- package/build/flagsmith-engine/organisations/models.d.ts +0 -9
- package/build/flagsmith-engine/organisations/models.js +0 -21
- package/build/flagsmith-engine/organisations/util.d.ts +0 -2
- package/build/flagsmith-engine/organisations/util.js +0 -8
- package/build/flagsmith-engine/projects/models.d.ts +0 -10
- package/build/flagsmith-engine/projects/models.js +0 -17
- package/build/flagsmith-engine/projects/util.d.ts +0 -2
- package/build/flagsmith-engine/projects/util.js +0 -15
- package/build/flagsmith-engine/segments/constants.d.ts +0 -26
- package/build/flagsmith-engine/segments/constants.js +0 -31
- package/build/flagsmith-engine/segments/evaluators.d.ts +0 -6
- package/build/flagsmith-engine/segments/evaluators.js +0 -29
- package/build/flagsmith-engine/segments/models.d.ts +0 -31
- package/build/flagsmith-engine/segments/models.js +0 -83
- package/build/flagsmith-engine/segments/util.d.ts +0 -4
- package/build/flagsmith-engine/segments/util.js +0 -23
- package/build/flagsmith-engine/utils/collections.d.ts +0 -4
- package/build/flagsmith-engine/utils/collections.js +0 -16
- package/build/flagsmith-engine/utils/errors.d.ts +0 -2
- package/build/flagsmith-engine/utils/errors.js +0 -6
- package/build/flagsmith-engine/utils/hashing/index.d.ts +0 -9
- package/build/flagsmith-engine/utils/hashing/index.js +0 -54
- package/build/flagsmith-engine/utils/index.d.ts +0 -1
- package/build/flagsmith-engine/utils/index.js +0 -14
- package/build/index.d.ts +0 -1
- package/build/index.js +0 -11
- package/build/sdk/analytics.d.ts +0 -28
- package/build/sdk/analytics.js +0 -60
- package/build/sdk/errors.d.ts +0 -4
- package/build/sdk/errors.js +0 -9
- package/build/sdk/index.d.ts +0 -118
- package/build/sdk/index.js +0 -263
- package/build/sdk/models.d.ts +0 -55
- package/build/sdk/models.js +0 -101
- package/build/sdk/polling_manager.d.ts +0 -9
- package/build/sdk/polling_manager.js +0 -31
- package/build/sdk/utils.d.ts +0 -12
- package/build/sdk/utils.js +0 -45
- package/tests/engine/engine-tests/engine-test-data/data/environment_n9fbf9h3v4fFgH3U3ngWhb.json +0 -12393
- package/tests/engine/engine-tests/engine-test-data/readme.md +0 -30
|
@@ -1,33 +1,41 @@
|
|
|
1
1
|
name: Unit/Integration Tests
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
4
|
+
pull_request:
|
|
5
|
+
types:
|
|
6
|
+
- opened
|
|
7
|
+
- synchronize
|
|
8
|
+
- reopened
|
|
9
|
+
- ready_for_review
|
|
10
|
+
push:
|
|
11
|
+
branches:
|
|
12
|
+
- main
|
|
13
13
|
jobs:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
14
|
+
build-and-test:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v2
|
|
18
|
+
- name: Checkout submodules # checkout rest
|
|
19
|
+
shell: bash
|
|
20
|
+
run: |
|
|
21
|
+
# If your submodules are configured to use SSH instead of HTTPS please uncomment the following line
|
|
22
|
+
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
|
23
|
+
auth_header="$(git config --local --get http.https://github.com/.extraheader)"
|
|
24
|
+
git submodule sync --recursive
|
|
25
|
+
git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1
|
|
26
|
+
- uses: actions/setup-node@v1
|
|
27
|
+
with:
|
|
28
|
+
node-version: "15.x"
|
|
29
|
+
- name: cache node modules
|
|
30
|
+
uses: actions/cache@v1
|
|
31
|
+
with:
|
|
32
|
+
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
|
|
33
|
+
key: npm-${{ hashFiles('package-lock.json') }}
|
|
34
|
+
restore-keys: |
|
|
35
|
+
npm-${{ hashFiles('package-lock.json') }}
|
|
36
|
+
npm-
|
|
37
|
+
- run: npm i -g npm@7.0.2
|
|
38
|
+
- run: npm install
|
|
39
|
+
- run: npm test
|
|
40
|
+
env:
|
|
41
|
+
CI: true
|
package/.tool-versions
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodejs 16.14.0
|
package/README.md
CHANGED
|
@@ -19,6 +19,13 @@ Please read [CONTRIBUTING.md](https://gist.github.com/kyle-ssg/c36a03aebe492e45c
|
|
|
19
19
|
|
|
20
20
|
If you encounter a bug or feature request we would like to hear about it. Before you submit an issue please search existing issues in order to prevent duplicates.
|
|
21
21
|
|
|
22
|
+
## Testing
|
|
23
|
+
|
|
24
|
+
To run the local tests you need to run following command beforehand:
|
|
25
|
+
```
|
|
26
|
+
git submodule add git@github.com:Flagsmith/engine-test-data.git tests/engine/engine-tests/engine-test-data/
|
|
27
|
+
```
|
|
28
|
+
|
|
22
29
|
## Get in touch
|
|
23
30
|
|
|
24
31
|
If you have any questions about our projects you can email <a href="mailto:support@flagsmith.com">support@flagsmith.com</a>.
|