vymo-config-stub-js v1.3.6
Methods exposed
There are two major functions exposed for initializing configuration fetch and polling. Apart from them there were other functions like
getClientsIncludingDisabled
, getClient
, getClientGlobalConfig
which are self explanatory.
Fetch first time configurations
context = {
URL: "Config service url to be used for polling"
}
.init(context)
Fetching specific client configurations
context = {
URL: "Config service url to be used for polling",
client: [] //"Array of clients which should be loaded"
}
.init(context)
Poll incremental configurations
context = {
URL: "Config service url to be used for polling",
TIMEOUT_IN_SECONDS: "Interval of polling"
client: [] //"Array of clients which should be loaded"
}
.poll(context)
Incase of standalone tasks, only first time fetch will be required, in such cases poll can be disabled. By default poll is set to true.
context = {
URL: "Config service url to be used for polling",
TIMEOUT_IN_SECONDS: "Interval of polling"
client: ["client"],
poll: false
}
.poll(context)
Also, JS client provides ability to listen to any configuration updates inmemory.
CLIENT_UPDATED - Gets called whenever any client update happens
GLOBAL_UPDATED - Gets called whenever any global update happens
Building the package
- nvm use 12
- npm publish
npm pack if error comes (npm ERR! 404 Not Found - PUT https://registry.npmjs.org/vymo-config-stub-js - Not found) do
npm login
and create login cred for Example: $ npm loginUsername: prudhvitejapotnuru
Password: Email: (this IS public) prudhvi@getvymo.com npm notice Please check your email for a one-time password (OTP) Enter one-time password from your authenticator app: Logged in as prudhvitejapotnuru on https://registry.npmjs.org/.
Make sure that the version is changed every time of retry.
- then do npm publish and npm pack
- a file will be present in same path
vymo-config-stub-js-{version}.tgz
- Copy this tgz inside the resources/ of {userService}(ex lms) directory
- Increment the version in the {userService}(ex lms) package.json
- Go to lms and update the version in the npm-shrinkwrap.json
- Commit the npm-shrinkwrap.json file else npm will not install the newer version even though you update version in the package.json