Skip to content

Commit

Permalink
update dependencies and remove package-lock (#8)
Browse files Browse the repository at this point in the history
* update dependencies and remove package-lock

* eslint fixes
  • Loading branch information
moritzraho authored Sep 26, 2019
1 parent d63b735 commit d64c7f3
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 7,109 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ coverage
#custom
playground

.tvmCache
.tvmCache
package-lock.json
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false

This comment has been minimized.

Copy link
@shazron

shazron Oct 14, 2019

Member

Can we remove this file or this line? TESSA needs a package-lock.json to work and with automation, the TESSA reporting will fail. You still have the .gitignore line so you won't see it in your git modified files

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ env:
- CXX=g++-4.8
install:
- npm version
- npm ci
- npm install
script:
- npm test
after_success:
Expand Down
4 changes: 2 additions & 2 deletions lib/StateStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ function throwNotImplemented (methodName) {
}

// eslint-disable-next-line jsdoc/require-jsdoc
function validateInput (input, joiObject, details) {
const validation = joi.validate(input, joiObject)
function validateInput (input, schema, details) {
const validation = schema.validate(input)
if (validation.error) {
logAndThrow(new codes.ERROR_BAD_ARGUMENT({
messageValues: [validation.error.message],
Expand Down
9 changes: 5 additions & 4 deletions lib/impl/CosmosStateStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class CosmosStateStore extends StateStore {
* @private
*/
static async init (credentials) {
const validation = joi.validate(credentials, joi.object().label('cosmos').keys({
const validation = joi.object().label('cosmos').keys({
// either
resourceToken: joi.string(),
// or
Expand All @@ -80,7 +80,8 @@ class CosmosStateStore extends StateStore {
partitionKey: joi.string().required(),

expiration: joi.string() // allowed for tvm response
}).xor('masterKey', 'resourceToken').required())
}).xor('masterKey', 'resourceToken').required()
.validate(credentials)
if (validation.error) {
if (typeof credentials === 'object') {
if (credentials.masterKey) credentials.masterKey = '<hidden>'
Expand All @@ -92,7 +93,7 @@ class CosmosStateStore extends StateStore {
}))
}

let cosmosClient, container
let cosmosClient
if (credentials.resourceToken) {
cosmosClient = new cosmos.CosmosClient({ endpoint: credentials.endpoint, consistencyLevel: 'Session', tokenProvider: /* istanbul ignore next */ async () => credentials.resourceToken })
} else {
Expand All @@ -101,7 +102,7 @@ class CosmosStateStore extends StateStore {
// const { database } = await cosmosClient.databases.createIfNotExists({ id: credentials.databaseId })
// container = (await database.containers.createIfNotExists({ id: credentials.containerId })).container
}
container = cosmosClient.database(credentials.databaseId).container(credentials.containerId)
const container = cosmosClient.database(credentials.databaseId).container(credentials.containerId)
return new CosmosStateStore(container, credentials.partitionKey)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ async function init (config = {}) {
switch (provider) {
case 'cosmos':
if (config.cosmos) {
logger.debug(`init with user provided cosmosDB credentials`)
logger.debug('init with user provided cosmosDB credentials')
return CosmosStateStore.init(config.cosmos)
}
logger.debug('init with openwhisk credentials')
Expand Down
Loading

0 comments on commit d64c7f3

Please sign in to comment.