Skip to content
This repository has been archived by the owner on May 30, 2024. It is now read-only.

prepare 5.10.0 release #165

Merged
merged 319 commits into from
Dec 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
319 commits
Select commit Hold shift + click to select a range
3ea8cb2
add option to reduce front-end metadata for untracked flags
eli-darkly Oct 5, 2018
6f11b2d
Merge branch 'master' of github.com:launchdarkly/node-client
eli-darkly Oct 5, 2018
2aee263
add unit tests for default value bug
eli-darkly Oct 5, 2018
7c532d9
Merge pull request #103 from launchdarkly/eb/defaults-unit-tests
eli-darkly Oct 5, 2018
6d4feea
refactor LDClient tests and add some new ones
eli-darkly Oct 5, 2018
1a6c80a
rm unused vars
eli-darkly Oct 5, 2018
5a49e12
Merge pull request #104 from launchdarkly/eb/refactor-client-tests
eli-darkly Oct 5, 2018
8a53c4d
Merge branch 'master' into eb/ch24449/less-metadata
eli-darkly Oct 5, 2018
47524ae
Merge pull request #102 from launchdarkly/eb/ch24449/less-metadata
eli-darkly Oct 8, 2018
1fa81a4
fix broken event source construction
eli-darkly Oct 8, 2018
7f51fd2
Merge pull request #105 from launchdarkly/eb/fix-stream-constructor
eli-darkly Oct 8, 2018
f728343
merge from public after release
LaunchDarklyCI Oct 8, 2018
8af9fd0
Factor out caching and update queue from redis store for use in dynam…
kbrackbill Nov 7, 2018
38b8df3
fix formatting
kbrackbill Nov 7, 2018
c69ca14
fix audit
kbrackbill Nov 7, 2018
ed6b677
consistency
kbrackbill Nov 7, 2018
874c0af
remove yarn stuff
kbrackbill Nov 8, 2018
da40318
make the caching into a wrapper around any feature store
kbrackbill Nov 8, 2018
b933e27
maybe better name?
kbrackbill Nov 8, 2018
caea5e8
Simplify things by just not adding the wrapper if a cache is not requ…
kbrackbill Nov 8, 2018
657526e
switch param order
kbrackbill Nov 8, 2018
c46a0dd
Fix caching behavior with upsert, move some more functionality to the…
kbrackbill Nov 9, 2018
4133909
clean up init logic
kbrackbill Nov 9, 2018
a1b9054
Implement more correct init logic, caching 'all' calls, and other min…
kbrackbill Nov 9, 2018
bfa9e12
undo change to gitignore
kbrackbill Nov 9, 2018
43c5566
add tests for CachingStoreWrapper + misc bug fixes
eli-darkly Nov 10, 2018
0b2119e
Merge pull request #107 from launchdarkly/eb/refactor-store-tests
eli-darkly Nov 10, 2018
5f14c15
basic tests for UpdateQueue
eli-darkly Nov 10, 2018
773e11e
typo
eli-darkly Nov 10, 2018
a0057ac
Merge pull request #108 from launchdarkly/eb/queue-tests
eli-darkly Nov 10, 2018
02f516a
add some more feature store test coverage + misc Redis fixes
eli-darkly Nov 10, 2018
465050a
Merge pull request #109 from launchdarkly/eb/store-base-tests
eli-darkly Nov 12, 2018
aab8fec
Merge pull request #106 from launchdarkly/kbrack/refactor-store
eli-darkly Nov 12, 2018
d72bb16
fix invalid data in feature store unit test
eli-darkly Nov 12, 2018
65aa128
Merge pull request #110 from launchdarkly/eb/fix-store-test
eli-darkly Nov 12, 2018
b9d1986
make internal feature store API more consistent, add comment
eli-darkly Nov 12, 2018
469ea5f
use published tunnel package instead of fork
eli-darkly Nov 12, 2018
281b090
rm test code
eli-darkly Nov 12, 2018
08a1a2e
Merge pull request #111 from launchdarkly/eb/store-internal-api
eli-darkly Nov 12, 2018
b2057e7
Merge pull request #112 from launchdarkly/eb/ch16613/tunnel-package
eli-darkly Nov 13, 2018
74657e8
filter out deleted items in wrapper's all()
eli-darkly Nov 13, 2018
0c0b112
remove redundant filtering
eli-darkly Nov 13, 2018
fd9f38e
Merge pull request #113 from launchdarkly/eb/filter-all
eli-darkly Nov 13, 2018
607d49d
merge from public after release
LaunchDarklyCI Nov 14, 2018
bbacd12
fix error handling when getting all items from store
eli-darkly Nov 15, 2018
99e5852
fix error in close of uncached store
eli-darkly Nov 15, 2018
92297bc
add test for upsert error
eli-darkly Nov 15, 2018
513e676
Merge pull request #114 from launchdarkly/eb/cache-fixes
eli-darkly Nov 15, 2018
ca32313
update package.lock
eli-darkly Nov 15, 2018
4beb25e
implement loading flags from a file
eli-darkly Nov 15, 2018
de27e98
don't use async/await in client code (Node 6 compatibility)
eli-darkly Nov 15, 2018
56e1c9e
comment edit
eli-darkly Nov 15, 2018
39290f3
merge from public after release
LaunchDarklyCI Nov 15, 2018
bf70857
Merge branch 'master' of github.com:launchdarkly/node-client
eli-darkly Nov 15, 2018
2d71e84
merge from public after release
LaunchDarklyCI Nov 15, 2018
62a23a3
Merge branch 'master' into eb/ch26318/file-data-source
eli-darkly Nov 15, 2018
94e5155
fix some undefined variable mistakes
eli-darkly Jan 10, 2019
bc5994c
use Babel for tests and migrate test code to newer syntax
eli-darkly Jan 10, 2019
f008213
Merge branch 'eb/babel-tests' into eb/ch26318/file-data-source1
eli-darkly Jan 10, 2019
f82b594
use async_utils
eli-darkly Jan 10, 2019
f6f037f
misc test fixes
eli-darkly Jan 10, 2019
ff2426b
ES2015 compatibility
eli-darkly Jan 10, 2019
5a4196c
Merge pull request #116 from launchdarkly/eb/babel-tests
eli-darkly Jan 10, 2019
99165c6
Merge branch 'master' into eb/ch26318/file-data-source
eli-darkly Jan 10, 2019
e0443aa
Merge pull request #115 from launchdarkly/eb/ch26318/file-data-source
eli-darkly Jan 10, 2019
144b73f
documentation fixes for FileDataSource
eli-darkly Jan 10, 2019
5f013fd
Merge pull request #117 from launchdarkly/eb/fix-file-source-docs
eli-darkly Jan 10, 2019
b6f11f7
implement dependency ordering for feature store data
eli-darkly Jan 11, 2019
0bb793d
readme fix
eli-darkly Jan 11, 2019
25fab20
Merge pull request #118 from launchdarkly/eb/ch29197/dependency-ordering
eli-darkly Jan 12, 2019
5ab1743
Merge branch 'master' of github.com:launchdarkly/node-client-private
eli-darkly Jan 12, 2019
1c3f4a5
merge from public after release
LaunchDarklyCI Jan 12, 2019
b6ab85b
add feature store test for prefix option
eli-darkly Jan 16, 2019
9b206f9
revise test interface for backward compatibility
eli-darkly Jan 16, 2019
0ce5dc9
Merge pull request #119 from launchdarkly/eb/ch30067/store-tests
eli-darkly Jan 16, 2019
89fc933
merge from public after release
LaunchDarklyCI Jan 16, 2019
8a4c846
add azure pipeline with redis, run tests
hroederld Feb 5, 2019
c504e2d
add redis ping
hroederld Feb 5, 2019
8edd79a
made indent consistent
hroederld Feb 5, 2019
00213f9
Merge pull request #120 from launchdarkly/hr/azure
hroederld Feb 5, 2019
e8be2b0
add basic TypeDoc build
eli-darkly Feb 6, 2019
a9afc6a
misc doc fixes
eli-darkly Feb 7, 2019
0ef07f6
misc doc fixes
eli-darkly Feb 7, 2019
1aea408
rm unused var
eli-darkly Feb 7, 2019
57562b8
add custom theme
eli-darkly Feb 7, 2019
9195633
better intro text
eli-darkly Feb 7, 2019
a16e460
Merge branch 'eb/ch30940/docs' into eb/ch30940/docs-theme
eli-darkly Feb 7, 2019
6d77ea2
fix config file so we don't need a custom theme
eli-darkly Feb 7, 2019
d3ebef4
stop file data source from doing unnecessary reloads
eli-darkly Feb 15, 2019
aaee20a
fix "npm audit" warnings
eli-darkly Feb 15, 2019
d7adba0
Merge pull request #123 from launchdarkly/eb/ch32160/npm-audit-warnings
eli-darkly Feb 15, 2019
fc78885
Merge branch 'master' into eb/ch32123/multi-reload
eli-darkly Feb 15, 2019
20e5438
fix track() and identify() to reject missing/keyless user
eli-darkly Feb 15, 2019
e419c3a
Merge branch 'master' into eb/ch30940/docs
eli-darkly Feb 15, 2019
73006a9
typo
eli-darkly Feb 16, 2019
43a12b9
comment
eli-darkly Feb 16, 2019
79517df
bump jest version due to vulnerability warning
eli-darkly Feb 16, 2019
d4d7dba
test fix due to changed jest behavior
eli-darkly Feb 16, 2019
1669ca8
Merge pull request #125 from launchdarkly/eb/ch32160/npm-warnings-2
eli-darkly Feb 16, 2019
074368b
Merge branch 'master' into eb/ch31956/track-warning
eli-darkly Feb 16, 2019
9e72d46
Merge pull request #124 from launchdarkly/eb/ch31956/track-warning
eli-darkly Feb 16, 2019
d5e7294
Merge branch 'master' into eb/ch32123/multi-reload
eli-darkly Feb 16, 2019
5dcae84
Merge branch 'master' into eb/ch30940/docs
eli-darkly Feb 16, 2019
74ecf0f
Merge pull request #122 from launchdarkly/eb/ch32123/multi-reload
eli-darkly Feb 16, 2019
8ee6a2e
rm debugging
eli-darkly Feb 16, 2019
d907ff9
Merge branch 'master' into eb/ch30940/docs
eli-darkly Feb 16, 2019
3143ffa
file time checking fix for Node <8
eli-darkly Feb 16, 2019
56009a9
file time checking fix for Node <8
eli-darkly Feb 16, 2019
b181e47
add TS test code, fix misc TS declaration problems
eli-darkly Feb 22, 2019
d1ea61b
Merge pull request #121 from launchdarkly/eb/ch30940/docs
eli-darkly Feb 22, 2019
4c21866
merge from public after release
LaunchDarklyCI Feb 22, 2019
ca2f27a
add experimentation event overrides for rules and fallthrough
eli-darkly Feb 26, 2019
38055b0
factor out some more event factory code
eli-darkly Feb 26, 2019
9cd8815
increase event queue size to 10000
bwoskow-ld Feb 28, 2019
3f5955a
Merge pull request #127 from launchdarkly/bw/ch33000/event-queue-size
bwoskow-ld Feb 28, 2019
d1197bb
add secondary attribute to LDUser interface
brooswit Mar 5, 2019
cac7c20
make secondary attribute optional
brooswit Mar 5, 2019
c8c6830
better attribute description
eli-darkly Mar 12, 2019
40c8a48
add secondary attribute to TS test code
eli-darkly Mar 12, 2019
660d770
Merge pull request #128 from launchdarkly/jw/ch33446
eli-darkly Mar 12, 2019
27c960c
bump up Jest version to avoid Node 11.11 bug
eli-darkly Mar 12, 2019
48af77f
Merge pull request #129 from launchdarkly/eb/ch33895/jest-upgrade
eli-darkly Mar 12, 2019
11b4bcd
allow caller to configure all TLS options supported by Node
eli-darkly Mar 13, 2019
25cac63
Merge commit '1a93e53157b12c7ebf90caf8080abbd4fcc5517d'
eli-darkly Mar 13, 2019
45b9675
Merge branch 'master' of github.com:launchdarkly/node-client
eli-darkly Mar 21, 2019
d07fce4
merge from public after release
LaunchDarklyCI Mar 21, 2019
c5aa3e2
Merge pull request #126 from launchdarkly/eb/ch32306/experiment
eli-darkly Mar 27, 2019
21bde79
stringify built-in user attributes in events, and secondary key for e…
eli-darkly Mar 29, 2019
f1cbb8b
null guard
eli-darkly Mar 29, 2019
5e53877
revert unnecessary change
eli-darkly Mar 29, 2019
3b103ec
move audit step to separate job
eli-darkly Apr 1, 2019
c61cee4
Merge pull request #131 from launchdarkly/eb/ch35405/npm-audit
eli-darkly Apr 1, 2019
9199650
Merge branch 'master' into eb/ch35206/stringify-attrs
eli-darkly Apr 1, 2019
235b5be
Merge pull request #130 from launchdarkly/eb/ch35206/stringify-attrs
eli-darkly Apr 1, 2019
a803222
merge from public after release
LaunchDarklyCI Apr 2, 2019
560cd7f
Merge branch 'master' into eb/ch33132/certificates
eli-darkly Apr 12, 2019
8562116
rename property, add TS docs
eli-darkly Apr 13, 2019
fdf3ef3
fix sending of update events on stream put
eli-darkly Apr 13, 2019
49422ac
misc fixes in polling
eli-darkly Apr 13, 2019
58c4c59
add TLS tests
eli-darkly Apr 13, 2019
f60004a
TS fix
eli-darkly Apr 13, 2019
12931ec
Merge branch 'master' into experiment
eli-darkly Apr 13, 2019
7298070
support metric value in track()
eli-darkly Apr 13, 2019
7153b63
Merge pull request #132 from launchdarkly/eb/ch33132/certificates
eli-darkly Apr 16, 2019
39fa152
update method description
eli-darkly Apr 17, 2019
a335537
Merge pull request #133 from launchdarkly/eb/ch32306/metric-value
eli-darkly Apr 17, 2019
3166765
don't fail test if there's one extra file reload
eli-darkly Apr 17, 2019
a7dc798
Merge pull request #134 from launchdarkly/eb/ch35022/windows-file-tests
eli-darkly Apr 17, 2019
8d54ca6
add unit tests for polling and requestor
eli-darkly Apr 17, 2019
5f62a34
apparently we can't use ES6 imports in this code although they worked…
eli-darkly Apr 17, 2019
6f0e4d9
Merge pull request #135 from launchdarkly/eb/ch36674/polling-tests
eli-darkly Apr 17, 2019
0c659c7
add ability to skip Redis tests
eli-darkly Apr 26, 2019
ffd881e
doc updates + build improvements
eli-darkly Apr 26, 2019
a66c770
fix repo name
eli-darkly Apr 26, 2019
360d71e
Merge pull request #137 from launchdarkly/eb/ch37610/no-db-tests
eli-darkly Apr 26, 2019
4e9c689
Merge pull request #138 from launchdarkly/eb/ch36754/readme-release
eli-darkly Apr 26, 2019
48cf8c7
Merge branch 'master' of github.com:launchdarkly/node-client
eli-darkly Apr 26, 2019
6080b1f
update package name + fix some test stuff
eli-darkly May 14, 2019
587169e
Merge pull request #139 from launchdarkly/eb/ch36754/package-name
eli-darkly May 14, 2019
41f939d
Merge branch 'master' into experiment
eli-darkly May 14, 2019
dad1760
Bump to a slightly newer version of 'request' to resolve a security v…
bwoskow-ld Jun 4, 2019
701cc94
Merge branch 'master' of github.com:launchdarkly/node-client
eli-darkly Jun 6, 2019
b745939
restore dependency change overwritten by merge
eli-darkly Jun 6, 2019
5b90e99
merge from public after release
LaunchDarklyCI Jun 6, 2019
59be7e0
Adding a note to reference the client-side sdk, plus fixing name inco…
bwoskow-ld Jun 26, 2019
718b706
Merge branch 'master' into experiment
eli-darkly Aug 20, 2019
7f50bbc
update doc comment for track() with metricValue
eli-darkly Aug 20, 2019
5efe84a
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
eli-darkly Aug 20, 2019
48d7e6e
Merge pull request #142 from launchdarkly/eb/ch32306/track-comment
eli-darkly Aug 20, 2019
856f694
Merge branch 'experiment'
eli-darkly Aug 20, 2019
2e8610f
fix merge error (obsolete code)
eli-darkly Aug 20, 2019
ea5894f
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
eli-darkly Aug 20, 2019
817df99
fix ruleIndex in rule match reason
eli-darkly Oct 10, 2019
7190f23
Merge pull request #143 from launchdarkly/eb/ch52234/rule-index
eli-darkly Oct 10, 2019
7a96e72
merge from public after release
LaunchDarklyCI Oct 10, 2019
b7f1426
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
eli-darkly Oct 11, 2019
6654243
reimplement flag change events to use dependency graph
eli-darkly Oct 17, 2019
ffd16f0
rm unused
eli-darkly Oct 17, 2019
597527c
fix setting of empty dependencies
eli-darkly Oct 17, 2019
55d5f7e
misc cleanup
eli-darkly Oct 17, 2019
de09377
typo
eli-darkly Oct 17, 2019
fa629a4
update syntax: const, let, arrow functions
eli-darkly Oct 18, 2019
38e308a
more syntax fixes, linting
eli-darkly Oct 18, 2019
51dc73d
more syntax fixes, linting
eli-darkly Oct 18, 2019
46e960a
more syntax fixes, linting
eli-darkly Oct 18, 2019
5633da7
downgrade ESLint because we must support Node 6
eli-darkly Oct 18, 2019
07827df
Merge pull request #145 from launchdarkly/eb/ch35417/es2015
eli-darkly Oct 18, 2019
9a69099
Merge branch 'master' into eb/ch52363/change-events
eli-darkly Oct 18, 2019
8361f7b
skip update event logic if there are no update event listeners
eli-darkly Oct 19, 2019
7ac9ab8
consequence of passing an empty object was correct but non-self-evident
eli-darkly Oct 19, 2019
aa48dc1
rm meaningless "arguments"
eli-darkly Oct 19, 2019
d0fdff1
avoid unnecessary deferral of internal callbacks
eli-darkly Oct 19, 2019
d268893
better handling of invalid data types
eli-darkly Oct 20, 2019
81b41ea
Merge pull request #144 from launchdarkly/eb/ch52363/change-events
eli-darkly Oct 22, 2019
9590571
Merge pull request #146 from launchdarkly/eb/ch53164/efficient-callbacks
eli-darkly Oct 22, 2019
f874713
fix regex, add comment
eli-darkly Oct 22, 2019
18c8d6d
don't signal init failure & don't fire an error unless it's unrecover…
eli-darkly Oct 22, 2019
1bb0cfc
fix tests
eli-darkly Oct 22, 2019
483e24c
remove unused "hoek" dependency
eli-darkly Oct 22, 2019
102b595
Merge pull request #149 from launchdarkly/eb/ch48460/dependencies
eli-darkly Oct 22, 2019
e5ce416
remove typedoc dependency
eli-darkly Oct 23, 2019
3b043e2
use semver 6.x
eli-darkly Oct 23, 2019
1e849f8
update eslint to 6.x
eli-darkly Oct 23, 2019
587b777
update async package (removes old lodash dependency)
eli-darkly Oct 23, 2019
7d8d074
update node-cache package (removes old lodash dependency)
eli-darkly Oct 23, 2019
04a80af
add audit script
eli-darkly Oct 23, 2019
81c3aad
Revert "update node-cache package (removes old lodash dependency)"
eli-darkly Oct 23, 2019
6af73a8
Revert "update async package (removes old lodash dependency)"
eli-darkly Oct 23, 2019
159924f
fix dependency path parsing
eli-darkly Oct 23, 2019
ee0c889
Revert "Revert "update async package (removes old lodash dependency)""
eli-darkly Oct 23, 2019
9de1e85
Revert "Revert "update node-cache package (removes old lodash depende…
eli-darkly Oct 23, 2019
5373bda
run "npm audit fix" for dev dependencies
eli-darkly Oct 23, 2019
bd06c68
Merge pull request #148 from launchdarkly/eb/ch46962/init-error
eli-darkly Oct 23, 2019
214b68e
Merge pull request #150 from launchdarkly/eb/ch53632/no-typedoc
eli-darkly Oct 23, 2019
025145d
Merge pull request #151 from launchdarkly/eb/ch53633/semver-update
eli-darkly Oct 23, 2019
83562a8
update eslint to 6.x (#152)
eli-darkly Oct 23, 2019
42ef9a5
Merge branch 'master' into eb/ch53542/npm-audit-fix
eli-darkly Oct 23, 2019
c2cde3b
Merge pull request #153 from launchdarkly/eb/ch53542/npm-audit-fix
eli-darkly Oct 23, 2019
41167dc
Merge pull request #147 from launchdarkly/eb/ch10795/bad-data
eli-darkly Oct 23, 2019
5693928
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
eli-darkly Oct 23, 2019
ea5e463
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
eli-darkly Oct 23, 2019
752b6d7
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
eli-darkly Oct 25, 2019
91c7b82
add TS decl for new Redis parameter
eli-darkly Oct 25, 2019
1d21356
add TS syntax check code
eli-darkly Oct 25, 2019
ab838aa
Merge pull request #154 from launchdarkly/eb/ch53636/redis-intf
eli-darkly Oct 29, 2019
1fe1826
Merge branch 'master' of github.com:launchdarkly/node-server-sdk
bwoskow-ld Nov 7, 2019
291c8bc
better config validation
eli-darkly Nov 19, 2019
07ba97e
rm unused
eli-darkly Nov 19, 2019
862a491
Merge pull request #155 from launchdarkly/eb/ch56521/validate-config
eli-darkly Nov 19, 2019
fb42a33
add more end-to-end tests, improve HTTP test helpers, general cleanup
eli-darkly Nov 20, 2019
7ca8250
rm nock
eli-darkly Nov 20, 2019
60222a2
Node 6 compatibility
eli-darkly Nov 20, 2019
96f0352
remove redundant helper, misc cleanup
eli-darkly Nov 20, 2019
a351318
Node 6 compatibility
eli-darkly Nov 20, 2019
e9c869e
fix comment
eli-darkly Nov 20, 2019
a556934
change asyncify to promisifySingle
eli-darkly Nov 20, 2019
ea227eb
misc fixes
eli-darkly Nov 20, 2019
42603da
add Windows CircleCI job
eli-darkly Nov 20, 2019
382ee93
fix config
eli-darkly Nov 20, 2019
193f2d4
syntax
eli-darkly Nov 20, 2019
dc2755a
Merge pull request #159 from launchdarkly/eb/ch56746/windows-ci
eli-darkly Nov 21, 2019
3da81f7
Merge pull request #157 from launchdarkly/eb/ch56656/http-test-cleanup
eli-darkly Nov 23, 2019
14f5f61
Merge pull request #158 from launchdarkly/eb/ch56656/better-async-helper
eli-darkly Nov 23, 2019
4f16b1d
revise tests to use new helper package
eli-darkly Nov 23, 2019
90ef205
Merge branch 'master' into eb/ch57131/new-test-package
eli-darkly Nov 23, 2019
677e1b2
use launchdarkly-js-test-helpers 1.0.0
eli-darkly Nov 26, 2019
438cf91
fix package reference
eli-darkly Nov 26, 2019
d7208df
minor fixes to config validation messages + add comment
eli-darkly Dec 4, 2019
cc9dbed
Merge pull request #163 from launchdarkly/eb/ch56521/config-validatio…
eli-darkly Dec 4, 2019
1f75d71
Merge pull request #162 from launchdarkly/eb/ch57131/new-test-package
eli-darkly Dec 6, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 35 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
version: 2.1

orbs:
win: circleci/windows@1.0.0

workflows:
workflow:
build-and-test-all:
jobs:
- build-and-test:
- build-test-linux:
name: latest Node version
docker-image: circleci/node:latest
run-lint: true
- build-and-test:
- build-test-linux:
name: oldest supported Node version
docker-image: circleci/node:6
run-lint: false
- build-test-windows:
name: Windows

jobs:
build-and-test:
build-test-linux:
parameters:
run-lint:
type: boolean
default: false
docker-image:
type: string
default: circleci/node:latest
docker:
- image: <<parameters.docker-image>>
- image: redis
Expand All @@ -43,3 +47,28 @@ jobs:
path: reports/junit
- store_artifacts:
path: reports/junit

build-test-windows:
executor:
name: win/vs2019
shell: powershell.exe
steps:
- checkout
- run:
name: set up Redis
command: |
$ProgressPreference = "SilentlyContinue" # prevents console errors from CircleCI host
iwr -outf redis.zip https://github.com/MicrosoftArchive/redis/releases/download/win-3.0.504/Redis-x64-3.0.504.zip
mkdir redis
Expand-Archive -Path redis.zip -DestinationPath redis
- run:
name: start Redis
command: |
cd redis
./redis-server --service-install
./redis-server --service-start
Start-Sleep -s 5
./redis-cli ping
- run: node --version
- run: npm install
- run: npm test
28 changes: 0 additions & 28 deletions azure-pipelines.yml

This file was deleted.

70 changes: 67 additions & 3 deletions configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ module.exports = (function() {
};
};

const typesForPropertiesWithNoDefault = {
// Add a value here if we add a configuration property whose type cannot be determined by looking
// in baseDefaults (for instance, the default is null but if the value isn't null it should be a
// string). The allowable values are 'boolean', 'string', 'number', 'object', 'function', or
// 'factory' (the last one means it can be either a function or an object).
eventProcessor: 'object',
featureStore: 'object',
logger: 'object', // winston.Logger
proxyAgent: 'object',
proxyAuth: 'string',
proxyHost: 'string',
proxyPort: 'number',
proxyScheme: 'string',
tlsParams: 'object', // LDTLSOptions
updateProcessor: 'factory', // gets special handling in validation
userAgent: 'string'
};

const deprecatedOptions = {
base_uri: 'baseUri',
stream_uri: 'streamUri',
Expand Down Expand Up @@ -58,7 +76,7 @@ module.exports = (function() {
// This works differently from Object.assign() in that it will *not* override a default value
// if the provided value is explicitly set to null.
const ret = Object.assign({}, config);
Object.keys(defaults).forEach(function(name) {
Object.keys(defaults).forEach(name => {
if (ret[name] === undefined || ret[name] === null) {
ret[name] = defaults[name];
}
Expand All @@ -70,6 +88,48 @@ module.exports = (function() {
return uri.replace(/\/+$/, '');
}

function validateTypesAndNames(config, defaultConfig) {
const typeDescForValue = value => {
if (value === null || value === undefined) {
return undefined;
}
if (Array.isArray(value)) {
return 'array';
}
const t = typeof(value);
if (t === 'boolean' || t === 'string' || t === 'number') {
return t;
}
return 'object';
};
Object.keys(config).forEach(name => {
const value = config[name];
if (value !== null && value !== undefined) {
const defaultValue = defaultConfig[name];
const typeDesc = typesForPropertiesWithNoDefault[name];
if (defaultValue === undefined && typeDesc === undefined) {
config.logger.warn(messages.unknownOption(name));
} else {
const expectedType = typeDesc || typeDescForValue(defaultValue);
const actualType = typeDescForValue(value);
if (actualType !== expectedType) {
if (expectedType == 'factory' && (typeof value === 'function' || typeof value === 'object')) {
// for some properties, we allow either a factory function or an instance
return;
}
if (expectedType === 'boolean') {
config[name] = !!value;
config.logger.warn(messages.wrongOptionTypeBoolean(name, actualType));
} else {
config.logger.warn(messages.wrongOptionType(name, expectedType, actualType));
config[name] = defaultConfig[name];
}
}
}
}
});
}

function validate(options) {
let config = Object.assign({}, options || {});

Expand All @@ -89,7 +149,10 @@ module.exports = (function() {

checkDeprecatedOptions(config);

config = applyDefaults(config, defaults());
const defaultConfig = defaults();
config = applyDefaults(config, defaultConfig);

validateTypesAndNames(config, defaultConfig);

config.baseUri = canonicalizeUri(config.baseUri);
config.streamUri = canonicalizeUri(config.streamUri);
Expand All @@ -100,6 +163,7 @@ module.exports = (function() {
}

return {
validate: validate
validate: validate,
defaults: defaults
};
})();
8 changes: 6 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare module 'launchdarkly-node-server-sdk' {
import { EventEmitter } from 'events';
import { ClientOpts } from 'redis';
import { ClientOpts, RedisClient } from 'redis';

namespace errors {
export const LDPollingError: ErrorConstructor;
Expand Down Expand Up @@ -52,6 +52,9 @@ declare module 'launchdarkly-node-server-sdk' {
* A string that should be prepended to all Redis keys used by the feature store.
* @param logger
* A custom logger for warnings and errors, if you are not using the default logger.
* @param client
* Pass this parameter if you already have a Redis client instance that you wish to reuse. In this case,
* `redisOpts` will be ignored.
*
* @returns
* An object to put in the `featureStore` property for [[LDOptions]].
Expand All @@ -60,7 +63,8 @@ declare module 'launchdarkly-node-server-sdk' {
redisOpts?: ClientOpts,
cacheTTL?: number,
prefix?: string,
logger?: LDLogger | object
logger?: LDLogger | object,
client?: RedisClient
): LDFeatureStore;

/**
Expand Down
8 changes: 8 additions & 0 deletions messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ exports.httpErrorMessage = (status, context, retryMessage) =>
+ ' - ' + (errors.isHttpErrorRecoverable(status) ? retryMessage : 'giving up permanently');

exports.missingUserKeyNoEvent = () => 'User was unspecified or had no key; event will not be sent';

exports.unknownOption = name => 'Ignoring unknown config option "' + name + '"';

exports.wrongOptionType = (name, expectedType, actualType) =>
'Config option "' + name + '" should be of type ' + expectedType + ', got ' + actualType + ', using default value';

exports.wrongOptionTypeBoolean = (name, actualType) =>
'Config option "' + name + '" should be a boolean, got ' + actualType + ', converting to boolean';
Loading