@depup/launchdarkly-node-server-sdk 7.0.4-depup.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/.babelrc +16 -0
- package/.circleci/config.yml +89 -0
- package/.eslintignore +5 -0
- package/.eslintrc.yaml +114 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +37 -0
- package/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/pull_request_template.md +21 -0
- package/.github/workflows/stale.yml +8 -0
- package/.hound.yml +33 -0
- package/.ldrelease/config.yml +28 -0
- package/.prettierrc +6 -0
- package/CHANGELOG.md +603 -0
- package/CODEOWNERS +2 -0
- package/CONTRIBUTING.md +55 -0
- package/LICENSE.txt +13 -0
- package/README.md +36 -0
- package/SECURITY.md +5 -0
- package/attribute_reference.js +217 -0
- package/big_segments.js +117 -0
- package/caching_store_wrapper.js +240 -0
- package/changes.json +30 -0
- package/configuration.js +235 -0
- package/context.js +98 -0
- package/context_filter.js +137 -0
- package/contract-tests/README.md +7 -0
- package/contract-tests/index.js +109 -0
- package/contract-tests/log.js +23 -0
- package/contract-tests/package.json +15 -0
- package/contract-tests/sdkClientEntity.js +110 -0
- package/contract-tests/testharness-suppressions.txt +2 -0
- package/diagnostic_events.js +151 -0
- package/docs/typedoc.js +10 -0
- package/errors.js +26 -0
- package/evaluator.js +822 -0
- package/event_factory.js +121 -0
- package/event_processor.js +320 -0
- package/event_summarizer.js +101 -0
- package/feature_store.js +120 -0
- package/feature_store_event_wrapper.js +258 -0
- package/file_data_source.js +192 -0
- package/flags_state.js +46 -0
- package/index.d.ts +2426 -0
- package/index.js +452 -0
- package/integrations.js +7 -0
- package/interfaces.js +2 -0
- package/loggers.js +125 -0
- package/messages.js +31 -0
- package/operators.js +106 -0
- package/package.json +105 -0
- package/polling.js +70 -0
- package/requestor.js +62 -0
- package/scripts/better-audit.sh +76 -0
- package/sharedtest/big_segment_store_tests.js +86 -0
- package/sharedtest/feature_store_tests.js +177 -0
- package/sharedtest/persistent_feature_store_tests.js +183 -0
- package/sharedtest/store_tests.js +7 -0
- package/streaming.js +179 -0
- package/test/LDClient-big-segments-test.js +92 -0
- package/test/LDClient-end-to-end-test.js +218 -0
- package/test/LDClient-evaluation-all-flags-test.js +226 -0
- package/test/LDClient-evaluation-test.js +204 -0
- package/test/LDClient-events-test.js +502 -0
- package/test/LDClient-listeners-test.js +180 -0
- package/test/LDClient-test.js +96 -0
- package/test/LDClient-tls-test.js +110 -0
- package/test/attribute_reference-test.js +494 -0
- package/test/big_segments-test.js +182 -0
- package/test/caching_store_wrapper-test.js +434 -0
- package/test/configuration-test.js +249 -0
- package/test/context-test.js +93 -0
- package/test/context_filter-test.js +424 -0
- package/test/diagnostic_events-test.js +152 -0
- package/test/evaluator-big-segments-test.js +301 -0
- package/test/evaluator-bucketing-test.js +333 -0
- package/test/evaluator-clause-test.js +277 -0
- package/test/evaluator-flag-test.js +452 -0
- package/test/evaluator-pre-conditions-test.js +105 -0
- package/test/evaluator-rule-test.js +131 -0
- package/test/evaluator-segment-match-test.js +310 -0
- package/test/evaluator_helpers.js +106 -0
- package/test/event_processor-test.js +680 -0
- package/test/event_summarizer-test.js +146 -0
- package/test/feature_store-test.js +42 -0
- package/test/feature_store_event_wrapper-test.js +182 -0
- package/test/feature_store_test_base.js +60 -0
- package/test/file_data_source-test.js +255 -0
- package/test/loggers-test.js +126 -0
- package/test/operators-test.js +102 -0
- package/test/polling-test.js +158 -0
- package/test/requestor-test.js +60 -0
- package/test/store_tests_big_segments-test.js +61 -0
- package/test/streaming-test.js +323 -0
- package/test/stubs.js +107 -0
- package/test/test_data-test.js +341 -0
- package/test/update_queue-test.js +61 -0
- package/test-types.ts +210 -0
- package/test_data.js +323 -0
- package/tsconfig.json +14 -0
- package/update_queue.js +28 -0
- package/utils/__tests__/httpUtils-test.js +39 -0
- package/utils/__tests__/wrapPromiseCallback-test.js +33 -0
- package/utils/asyncUtils.js +32 -0
- package/utils/httpUtils.js +105 -0
- package/utils/stringifyAttrs.js +14 -0
- package/utils/wrapPromiseCallback.js +36 -0
- package/versioned_data_kind.js +34 -0
package/.babelrc
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
version: 2.1
|
|
2
|
+
|
|
3
|
+
orbs:
|
|
4
|
+
win: circleci/windows@2.4.0
|
|
5
|
+
|
|
6
|
+
workflows:
|
|
7
|
+
build-and-test-all:
|
|
8
|
+
jobs:
|
|
9
|
+
# CircleCI's current generation of Node images, cimg/node, allow you to leave the
|
|
10
|
+
# patch version unpinned, but require you to specify the minor version. The one
|
|
11
|
+
# exception is cimg/node:current, which will always give us the latest release in
|
|
12
|
+
# the latest major version-- and the latest major version is where it's most likely
|
|
13
|
+
# that there would be a new minor version, anyway.
|
|
14
|
+
- build-test-linux:
|
|
15
|
+
name: latest Node version
|
|
16
|
+
docker-image: cimg/node:current
|
|
17
|
+
run-lint: true
|
|
18
|
+
- build-test-linux:
|
|
19
|
+
name: Node 17.9
|
|
20
|
+
docker-image: cimg/node:17.9
|
|
21
|
+
- build-test-linux:
|
|
22
|
+
name: Node 16.14
|
|
23
|
+
docker-image: cimg/node:16.14
|
|
24
|
+
- build-test-linux:
|
|
25
|
+
name: Node 15.14
|
|
26
|
+
docker-image: cimg/node:15.14
|
|
27
|
+
- build-test-linux:
|
|
28
|
+
name: Node 14.19
|
|
29
|
+
docker-image: cimg/node:14.19
|
|
30
|
+
- build-test-linux:
|
|
31
|
+
name: Node 13.14
|
|
32
|
+
docker-image: cimg/node:13.14
|
|
33
|
+
- build-test-linux:
|
|
34
|
+
name: Node 12.22
|
|
35
|
+
docker-image: cimg/node:12.22
|
|
36
|
+
- build-test-windows:
|
|
37
|
+
name: Windows
|
|
38
|
+
|
|
39
|
+
jobs:
|
|
40
|
+
build-test-linux:
|
|
41
|
+
parameters:
|
|
42
|
+
run-lint:
|
|
43
|
+
type: boolean
|
|
44
|
+
default: false
|
|
45
|
+
docker-image:
|
|
46
|
+
type: string
|
|
47
|
+
run-contract-tests:
|
|
48
|
+
type: boolean
|
|
49
|
+
default: true
|
|
50
|
+
docker:
|
|
51
|
+
- image: <<parameters.docker-image>>
|
|
52
|
+
steps:
|
|
53
|
+
- checkout
|
|
54
|
+
- run: echo "Node version:" `node --version`
|
|
55
|
+
- run: npm install
|
|
56
|
+
- run:
|
|
57
|
+
command: npm test
|
|
58
|
+
environment:
|
|
59
|
+
JEST_JUNIT_OUTPUT: "reports/junit/js-test-results.xml"
|
|
60
|
+
- run: npm run check-typescript
|
|
61
|
+
- when:
|
|
62
|
+
condition: <<parameters.run-lint>>
|
|
63
|
+
steps:
|
|
64
|
+
- run: npm run lint
|
|
65
|
+
- when:
|
|
66
|
+
condition: <<parameters.run-contract-tests>>
|
|
67
|
+
steps:
|
|
68
|
+
- run:
|
|
69
|
+
command: npm run contract-test-service
|
|
70
|
+
background: true
|
|
71
|
+
- run: mkdir -p reports/junit
|
|
72
|
+
- run: TEST_HARNESS_PARAMS="-junit reports/junit/contract-test-results.xml -skip-from contract-tests/testharness-suppressions.txt" npm run contract-test-harness
|
|
73
|
+
- run:
|
|
74
|
+
name: dependency audit
|
|
75
|
+
command: ./scripts/better-audit.sh
|
|
76
|
+
- store_test_results:
|
|
77
|
+
path: reports/junit
|
|
78
|
+
- store_artifacts:
|
|
79
|
+
path: reports/junit
|
|
80
|
+
|
|
81
|
+
build-test-windows:
|
|
82
|
+
executor:
|
|
83
|
+
name: win/default
|
|
84
|
+
shell: powershell.exe
|
|
85
|
+
steps:
|
|
86
|
+
- checkout
|
|
87
|
+
- run: node --version
|
|
88
|
+
- run: npm install
|
|
89
|
+
- run: npm test
|
package/.eslintignore
ADDED
package/.eslintrc.yaml
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
---
|
|
2
|
+
# parser: babel-eslint # we're not currently transpiling this SDK
|
|
3
|
+
root: true
|
|
4
|
+
extends:
|
|
5
|
+
- eslint:recommended # https://eslint.org/docs/rules/
|
|
6
|
+
env:
|
|
7
|
+
es6: true
|
|
8
|
+
node: true
|
|
9
|
+
parserOptions:
|
|
10
|
+
ecmaVersion: 2018
|
|
11
|
+
plugins:
|
|
12
|
+
#- babel
|
|
13
|
+
- prettier
|
|
14
|
+
globals:
|
|
15
|
+
VERSION: true
|
|
16
|
+
describe: true
|
|
17
|
+
it: true
|
|
18
|
+
expect: true
|
|
19
|
+
jest: true
|
|
20
|
+
beforeEach: true
|
|
21
|
+
afterEach: true
|
|
22
|
+
window: false # don't allow references to "window" or "document" in the Node SDK
|
|
23
|
+
document: false
|
|
24
|
+
rules:
|
|
25
|
+
# https://eslint.org/docs/rules/array-callback-return
|
|
26
|
+
array-callback-return: error
|
|
27
|
+
|
|
28
|
+
# https://eslint.org/docs/rules/arrow-body-style
|
|
29
|
+
arrow-body-style:
|
|
30
|
+
- error
|
|
31
|
+
- as-needed
|
|
32
|
+
|
|
33
|
+
# https://github.com/babel/eslint-plugin-babel
|
|
34
|
+
#babel/semi: error
|
|
35
|
+
|
|
36
|
+
# Deprecations are required to turn enforce this
|
|
37
|
+
camelcase: warn
|
|
38
|
+
|
|
39
|
+
# https://eslint.org/docs/rules/curly
|
|
40
|
+
curly:
|
|
41
|
+
- error
|
|
42
|
+
- all
|
|
43
|
+
|
|
44
|
+
# https://eslint.org/docs/rules/eqeqeq
|
|
45
|
+
eqeqeq: error
|
|
46
|
+
|
|
47
|
+
# https://eslint.org/docs/rules/no-array-constructor
|
|
48
|
+
no-array-constructor: error
|
|
49
|
+
|
|
50
|
+
# https://eslint.org/docs/rules/no-eval
|
|
51
|
+
no-eval: error
|
|
52
|
+
|
|
53
|
+
# https://eslint.org/docs/rules/no-implicit-coercion
|
|
54
|
+
no-implicit-coercion:
|
|
55
|
+
- 'off'
|
|
56
|
+
- boolean: false
|
|
57
|
+
number: true
|
|
58
|
+
string: true
|
|
59
|
+
allow: []
|
|
60
|
+
|
|
61
|
+
# https://eslint.org/docs/rules/no-implied-eval
|
|
62
|
+
no-implied-eval: error
|
|
63
|
+
|
|
64
|
+
# https://eslint.org/docs/rules/no-nested-ternary
|
|
65
|
+
no-nested-ternary: error
|
|
66
|
+
|
|
67
|
+
# https://eslint.org/docs/rules/no-new-object
|
|
68
|
+
no-new-object: error
|
|
69
|
+
|
|
70
|
+
# https://eslint.org/docs/rules/no-new-wrappers
|
|
71
|
+
no-new-wrappers: error
|
|
72
|
+
|
|
73
|
+
# https://eslint.org/docs/rules/no-param-reassign
|
|
74
|
+
no-param-reassign:
|
|
75
|
+
- error
|
|
76
|
+
- props: true
|
|
77
|
+
|
|
78
|
+
# https://eslint.org/docs/rules/no-restricted-syntax
|
|
79
|
+
no-restricted-syntax:
|
|
80
|
+
- error
|
|
81
|
+
- selector: ForInStatement
|
|
82
|
+
message: avoid for...in which can pick up properties from prototypes; use for...of, or plain for if you need array indices
|
|
83
|
+
|
|
84
|
+
# https://eslint.org/docs/rules/no-return-assign
|
|
85
|
+
no-return-assign: error
|
|
86
|
+
|
|
87
|
+
# https://eslint.org/docs/rules/no-self-compare
|
|
88
|
+
no-self-compare: error
|
|
89
|
+
|
|
90
|
+
# https://eslint.org/docs/rules/no-use-before-define
|
|
91
|
+
no-use-before-define:
|
|
92
|
+
- error
|
|
93
|
+
- functions: false
|
|
94
|
+
|
|
95
|
+
# https://eslint.org/docs/rules/no-var
|
|
96
|
+
no-var: error
|
|
97
|
+
|
|
98
|
+
# https://eslint.org/docs/rules/prefer-arrow-callback
|
|
99
|
+
prefer-arrow-callback: error
|
|
100
|
+
|
|
101
|
+
# https://eslint.org/docs/rules/prefer-const
|
|
102
|
+
prefer-const: error
|
|
103
|
+
|
|
104
|
+
# https://github.com/prettier/eslint-plugin-prettier
|
|
105
|
+
prettier/prettier:
|
|
106
|
+
- error
|
|
107
|
+
|
|
108
|
+
quotes:
|
|
109
|
+
- error
|
|
110
|
+
- single
|
|
111
|
+
- avoidEscape: true
|
|
112
|
+
|
|
113
|
+
# https://eslint.org/docs/rules/radix
|
|
114
|
+
radix: error
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is this a support request?**
|
|
11
|
+
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the SDK code. If you're not sure whether the problem you are having is specifically related to the SDK, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/hc/en-us/requests/new) or by emailing support@launchdarkly.com.
|
|
12
|
+
|
|
13
|
+
Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.
|
|
14
|
+
|
|
15
|
+
**Describe the bug**
|
|
16
|
+
A clear and concise description of what the bug is.
|
|
17
|
+
|
|
18
|
+
**To reproduce**
|
|
19
|
+
Steps to reproduce the behavior.
|
|
20
|
+
|
|
21
|
+
**Expected behavior**
|
|
22
|
+
A clear and concise description of what you expected to happen.
|
|
23
|
+
|
|
24
|
+
**Logs**
|
|
25
|
+
If applicable, add any log output related to your problem.
|
|
26
|
+
|
|
27
|
+
**SDK version**
|
|
28
|
+
The version of this SDK that you are using.
|
|
29
|
+
|
|
30
|
+
**Language version, developer tools**
|
|
31
|
+
For instance, Go 1.11 or Ruby 2.5.3. If you are using a language that requires a separate compiler, such as C, please include the name and version of the compiler too.
|
|
32
|
+
|
|
33
|
+
**OS/platform**
|
|
34
|
+
For instance, Ubuntu 16.04, Windows 10, or Android 4.0.3. If your code is running in a browser, please also include the browser type and version.
|
|
35
|
+
|
|
36
|
+
**Additional context**
|
|
37
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: ''
|
|
5
|
+
labels: ''
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context about the feature request here.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
**Requirements**
|
|
2
|
+
|
|
3
|
+
- [ ] I have added test coverage for new or changed functionality
|
|
4
|
+
- [ ] I have followed the repository's [pull request submission guidelines](../blob/master/CONTRIBUTING.md#submitting-pull-requests)
|
|
5
|
+
- [ ] I have validated my changes against all supported platform versions
|
|
6
|
+
|
|
7
|
+
**Related issues**
|
|
8
|
+
|
|
9
|
+
Provide links to any issues in this repository or elsewhere relating to this pull request.
|
|
10
|
+
|
|
11
|
+
**Describe the solution you've provided**
|
|
12
|
+
|
|
13
|
+
Provide a clear and concise description of what you expect to happen.
|
|
14
|
+
|
|
15
|
+
**Describe alternatives you've considered**
|
|
16
|
+
|
|
17
|
+
Provide a clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
|
|
21
|
+
Add any other context about the pull request here.
|
package/.hound.yml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
asi: false,
|
|
3
|
+
bitwise: true,
|
|
4
|
+
browser: true,
|
|
5
|
+
camelcase: false,
|
|
6
|
+
curly: true,
|
|
7
|
+
forin: true,
|
|
8
|
+
immed: true,
|
|
9
|
+
latedef: "nofunc",
|
|
10
|
+
maxlen: 120,
|
|
11
|
+
newcap: true,
|
|
12
|
+
noarg: true,
|
|
13
|
+
noempty: true,
|
|
14
|
+
nonew: true,
|
|
15
|
+
eqeqeq: true,
|
|
16
|
+
predef: [
|
|
17
|
+
"$",
|
|
18
|
+
"jQuery",
|
|
19
|
+
"jasmine",
|
|
20
|
+
"beforeEach",
|
|
21
|
+
"describe",
|
|
22
|
+
"expect",
|
|
23
|
+
"it",
|
|
24
|
+
"angular",
|
|
25
|
+
"inject",
|
|
26
|
+
"module",
|
|
27
|
+
"require"
|
|
28
|
+
],
|
|
29
|
+
quotmark: true,
|
|
30
|
+
trailing: true,
|
|
31
|
+
undef: true,
|
|
32
|
+
unused: true
|
|
33
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
|
|
3
|
+
repo:
|
|
4
|
+
public: node-server-sdk
|
|
5
|
+
private: node-server-sdk-private
|
|
6
|
+
|
|
7
|
+
branches:
|
|
8
|
+
- name: main
|
|
9
|
+
description: 7.x
|
|
10
|
+
- name: 6.x
|
|
11
|
+
- name: 5.x
|
|
12
|
+
|
|
13
|
+
publications:
|
|
14
|
+
- url: https://www.npmjs.com/package/launchdarkly-node-server-sdk
|
|
15
|
+
description: npm
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
- docker:
|
|
19
|
+
image: node:12-buster
|
|
20
|
+
template:
|
|
21
|
+
name: npm
|
|
22
|
+
|
|
23
|
+
documentation:
|
|
24
|
+
gitHubPages: true
|
|
25
|
+
title: LaunchDarkly Server-Side Node SDK
|
|
26
|
+
|
|
27
|
+
sdk:
|
|
28
|
+
displayName: "Node"
|