Comparing version 1.0.1 to 2.0.0
{ | ||
"name": "openwhisk", | ||
"version": "1.0.1", | ||
"description": "Easily call OpenWhisk REST microservies.", | ||
"main": "lib/index.js", | ||
"version": "2.0.0", | ||
"description": "JavaScript client library for the OpenWhisk platform", | ||
"main": "lib/main.js", | ||
"engines": { | ||
"node": ">=4.0.0" | ||
}, | ||
"directories": { | ||
"test": "tests" | ||
}, | ||
"scripts": { | ||
"compile": "babel -d lib/ src/", | ||
"prepublish": "npm run compile" | ||
"test": "ava test/unit", | ||
"test-integration": "ava test/integration" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/chyld/openwhisk.git" | ||
"url": "git+https://github.com/openwhisk/openwhisk-client-js.git" | ||
}, | ||
"keywords": [ | ||
"ibm", | ||
"openwhisk", | ||
"bluemix", | ||
"openwhisk" | ||
"nodejs" | ||
], | ||
"author": "Chyld Medford <chyld.medford@gmail.com>", | ||
"license": "MIT", | ||
"author": "James Thomas <james@jamesthom.as>", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/chyld/openwhisk/issues" | ||
"url": "https://github.com/openwhisk/openwhisk-client-js/issues" | ||
}, | ||
"homepage": "https://github.com/chyld/openwhisk", | ||
"homepage": "https://github.com/openwhisk/openwhisk-client-js#readme", | ||
"devDependencies": { | ||
"ava": "^0.13.0", | ||
"proxyquire": "1.7.4" | ||
}, | ||
"dependencies": { | ||
"bluebird": "^3.3.4", | ||
"js-base64": "^2.1.9", | ||
"request": "^2.69.0" | ||
}, | ||
"devDependencies": { | ||
"babel-cli": "^6.6.5", | ||
"babel-preset-es2015": "^6.6.0", | ||
"babel-preset-stage-0": "^6.5.0" | ||
"request-promise": "^2.0.1" | ||
} | ||
} |
155
README.md
@@ -1,34 +0,145 @@ | ||
# openwhisk | ||
![OpenWhisk](images/master.png) | ||
# openwhisk-client-js | ||
JavaScript client library for the [OpenWhisk](https://github.com/openwhisk/openwhisk) platform. | ||
Provides a wrapper around the [OpenWhisk APIs](https://new-console.ng.bluemix.net/apidocs/98#introduction). | ||
## Description | ||
Easily call OpenWhisk REST microservies. | ||
## installation | ||
``` | ||
$ npm install openwhisk | ||
``` | ||
## Install | ||
```sh | ||
$ npm install openwhisk --save | ||
## usage | ||
``` | ||
var openwhisk = require('openwhisk'); | ||
var ow = openwhisk({api: 'https://openwhisk.ng.bluemix.net/api/v1/', api_key: '...', namespace: 'default_namespace'}); | ||
``` | ||
_All methods return a Promise resolved asynchronously with the results. Failures are available through the catch method._ | ||
## Usage | ||
```js | ||
var OpenWhisk = require('openwhisk'); | ||
``` | ||
ow.resource.operation().then(function () { // success! }).catch(function (err) { // failed! }) | ||
``` | ||
### list resources | ||
// blocking mode | ||
OpenWhisk('org_name', 'space_name', 'action_name', 'key', payload) | ||
.then(function(){ | ||
console.log('The results of the invocation are now available.'); | ||
}); | ||
``` | ||
ow.actions.list() | ||
ow.activations.list() | ||
ow.triggers.list() | ||
ow.rules.list() | ||
ow.namespaces.list() | ||
ow.packages.list() | ||
``` | ||
// non-blocking | ||
OpenWhisk('org_name', 'space_name', 'action_name', 'key', payload, false) | ||
.then(function(){ | ||
console.log('The activation id is now available.'); | ||
}); | ||
Query parameters for the API calls are supported (e.g. limit, skip, etc.) by passing an object with the named parameters as the first argument. | ||
``` | ||
ow.actions.list({skip: 100, limit: 50}) | ||
``` | ||
The following optional parameters are supported: | ||
- `namespace` - set custom namespace for endpoint | ||
## License | ||
MIT © [Chyld Medford](https://github.com/chyld) | ||
### retrieve resource | ||
``` | ||
ow.actions.get({actionName: '...'}) | ||
ow.activations.get({activation: '...'}) | ||
ow.triggers.get({triggerName: '...'}) | ||
ow.rules.get({ruleName: '...'}) | ||
ow.namespaces.get({namespace: '...'}) | ||
ow.packages.get({packageName: '...'}) | ||
``` | ||
The following optional parameters are supported: | ||
- `namespace` - set custom namespace for endpoint | ||
### delete resource | ||
``` | ||
ow.actions.delete({actionName: '...'}) | ||
ow.triggers.delete({triggerName: '...'}) | ||
ow.rules.delete({ruleName: '...'}) | ||
ow.packages.delete({packageName: '...'}) | ||
``` | ||
The following optional parameters are supported: | ||
- `namespace` - set custom namespace for endpoint | ||
### invoke action | ||
``` | ||
ow.actions.invoke({actionName: '...'}) | ||
``` | ||
The following optional parameters are supported: | ||
- `blocking` - delay returning until action has finished executing (default: `false`) | ||
- `params` - JSON object containing parameters for the action being invoked (default: `{}`) | ||
- `namespace` - set custom namespace for endpoint | ||
### create & update action | ||
``` | ||
ow.actions.create({actionName: '...', action: 'function main() {};'}) | ||
ow.actions.update({actionName: '...', action: 'function main() {};'}) | ||
``` | ||
The following mandatory parameters are supported: | ||
- `actionName` - action identifier | ||
- `action` - String containing JS function source code or JSON object containing full parameters for the action body | ||
The following optional parameters are supported: | ||
- `namespace` - set custom namespace for endpoint | ||
### fire trigger | ||
``` | ||
ow.triggers.invoke({triggerName: '...'}) | ||
``` | ||
The following optional parameters are supported: | ||
- `params` - JSON object containing parameters for the trigger being fired (default: `{}`) | ||
- `namespace` - set custom namespace for endpoint | ||
### create & update trigger | ||
``` | ||
ow.triggers.create({triggerName: '...'}) | ||
ow.triggers.update({triggerName: '...'}) | ||
``` | ||
The following optional parameters are supported: | ||
- `trigger` - JSON object containing parameters for the trigger body (default: `{}`) | ||
- `namespace` - set custom namespace for endpoint | ||
### create & update packages | ||
``` | ||
ow.packages.create({packageName: '...'}) | ||
ow.packages.update({packageName: '...'}) | ||
``` | ||
The following optional parameters are supported: | ||
- `package` - JSON object containing parameters for the package body (default: `{}`) | ||
- `namespace` - set custom namespace for endpoint | ||
### create & update rule | ||
``` | ||
ow.rules.create({ruleName: '...', action: '...', trigger: '...'}) | ||
ow.rules.update({ruleName: '...', action: '...', trigger: '...'}) | ||
``` | ||
The following optional parameters are supported: | ||
- `namespace` - set custom namespace for endpoint | ||
### enable & disable rule | ||
``` | ||
ow.rules.enable({ruleName: '...'}) | ||
ow.rules.disable({ruleName: '...'}) | ||
``` | ||
The following optional parameters are supported: | ||
- `namespace` - set custom namespace for endpoint |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 3 instances 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
1
2
29
1983
146
97325
18
2
+ Addedrequest-promise@^2.0.1
+ Addedbluebird@2.11.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedrequest-promise@2.0.1(transitive)
- Removedbluebird@^3.3.4
- Removedjs-base64@^2.1.9
- Removedrequest@^2.69.0
- Removedbluebird@3.7.2(transitive)
- Removedjs-base64@2.6.4(transitive)