Comparing version 3.20.0 to 3.21.1
@@ -22,4 +22,22 @@ <!-- | ||
## v3.19.0 | ||
## v3.21.1 | ||
* Fix version in package.json and package-lock.json | ||
* Update npm ignores. | ||
## v3.21.0 | ||
* Allow clients to override API mappings for the Route operations (#201) | ||
* Handle a blocking/result response that is demoted to async (#199) | ||
* Fix handling of request exceptions in client.js (#196) | ||
* Allow update to action without requiring a code artifact (#195) | ||
## v3.20.0 | ||
* Removed all references to Incubator now Apache OpenWhisk has passed incubation (#190, #192) | ||
* Add proxy agent to be included by runtime, rather than building in (#175) | ||
* Re-worked CI/CD setup (#180) | ||
## v3.19.0-incubating | ||
* Initial release as an Apache Incubator project. | ||
@@ -26,0 +44,0 @@ * Add support for using HTTP Proxy with library (#147) |
@@ -48,3 +48,7 @@ /* | ||
if (options.blocking && options.result) { | ||
return super.invoke(options).then(result => result.response.result) | ||
return super.invoke(options).then(result => { | ||
if (result.response) { | ||
return result.response.result | ||
} else return Promise.reject(result) | ||
}) | ||
} | ||
@@ -91,6 +95,7 @@ | ||
actionBody (options) { | ||
const isUpdate = options && options.overwrite === true | ||
const isCodeAction = options.hasOwnProperty('action') | ||
const isSequenceAction = options.hasOwnProperty('sequence') | ||
if (!isCodeAction && !isSequenceAction) { | ||
if (!isCodeAction && !isSequenceAction && !isUpdate) { | ||
throw new Error(messages.MISSING_ACTION_OR_SEQ_BODY_ERROR) | ||
@@ -110,3 +115,4 @@ } | ||
const body = isCodeAction | ||
? this.actionBodyWithCode(options) : this.actionBodyWithSequence(options) | ||
? this.actionBodyWithCode(options) | ||
: isSequenceAction ? this.actionBodyWithSequence(options) : {} | ||
@@ -113,0 +119,0 @@ if (typeof options.params === 'object') { |
@@ -70,2 +70,10 @@ /* | ||
}) | ||
.catch(err => { | ||
// map any network/nodejs internal exception to the error structure expected by handleErrors() | ||
err.error = err.error || { | ||
error: err.message | ||
} | ||
err.options = err.options || opts | ||
throw err | ||
}) | ||
} | ||
@@ -72,0 +80,0 @@ |
@@ -65,3 +65,3 @@ /* | ||
//create(options: { name: string; namespace?: string; action: (string | Buffer | Action); kind?: Kind; overwrite?: boolean; params?: Dict; version?: string; }[]): Promise<Action[]>; | ||
update(options: { name: string; namespace?: string; action: (string | Buffer | Action); kind?: Kind; params?: Dict; annotations?: Dict; limits?: Limits; version?: string; }): Promise<Action>; | ||
update(options: { name: string; namespace?: string; action?: (string | Buffer | Action); kind?: Kind; params?: Dict; annotations?: Dict; limits?: Limits; version?: string; }): Promise<Action>; | ||
//update(options: ({ name: string; namespace?: string; action: (string | Buffer | Action); kind?: Kind; params?: Dict; version?: string; })[]): Promise<Action[]>; | ||
@@ -68,0 +68,0 @@ delete(options: string): Promise<Action>; |
@@ -26,4 +26,17 @@ /* | ||
class Routes extends BaseOperation { | ||
constructor (client, routeApiPathMapper) { | ||
super(client) | ||
if (typeof routeApiPathMapper === 'function') { | ||
this.routeApiPathMapper = routeApiPathMapper | ||
} else if (routeApiPathMapper) { | ||
throw new Error('Illegal parameter, must be a function.') | ||
} | ||
} | ||
routeMgmtApiPath (path) { | ||
return `web/whisk.system/apimgmt/${path}.http` | ||
if (this.routeApiPathMapper) { | ||
return this.routeApiPathMapper(path) | ||
} else { | ||
return `web/whisk.system/apimgmt/${path}` | ||
} | ||
} | ||
@@ -30,0 +43,0 @@ |
Apache OpenWhisk Client Js | ||
Copyright 2016-2019 The Apache Software Foundation | ||
Copyright 2016-2020 The Apache Software Foundation | ||
This product includes software developed at | ||
The Apache Software Foundation (http://www.apache.org/). |
{ | ||
"name": "openwhisk", | ||
"version": "3.20.0", | ||
"version": "3.21.1", | ||
"description": "JavaScript client library for the Apache OpenWhisk platform", | ||
@@ -47,2 +47,3 @@ "main": "lib/main.js", | ||
"jszip": "^3.1.3", | ||
"nock": "^11.7.0", | ||
"nyc": "^14.1.1", | ||
@@ -49,0 +50,0 @@ "pre-commit": "^1.2.2", |
@@ -656,3 +656,3 @@ <!-- | ||
```bash | ||
$ npm test:unit | ||
$ npm run test:unit | ||
``` | ||
@@ -659,0 +659,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1392
93949
9
21