{"id":14988066,"url":"https://github.com/apache/openwhisk-client-js","last_synced_at":"2026-01-15T22:20:42.633Z","repository":{"id":7832780,"uuid":"54548295","full_name":"apache/openwhisk-client-js","owner":"apache","description":"JavaScript client library for the Apache OpenWhisk platform","archived":false,"fork":false,"pushed_at":"2025-08-06T20:44:33.000Z","size":1056,"stargazers_count":82,"open_issues_count":20,"forks_count":53,"subscribers_count":37,"default_branch":"master","last_synced_at":"2026-01-13T03:35:51.966Z","etag":null,"topics":["apache","cloud","faas","functions-as-a-service","openwhisk","serverless","serverless-architectures","serverless-functions"],"latest_commit_sha":null,"homepage":"https://openwhisk.apache.org/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apache.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE.txt","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-03-23T09:46:16.000Z","updated_at":"2025-06-08T19:04:02.000Z","dependencies_parsed_at":"2024-01-23T17:27:48.869Z","dependency_job_id":"3b017eac-5e58-4eda-aa8c-637318d23865","html_url":"https://github.com/apache/openwhisk-client-js","commit_stats":{"total_commits":259,"total_committers":45,"mean_commits":"5.7555555555555555","dds":0.6332046332046333,"last_synced_commit":"6cbfef14cc05b6df5e55d6eb8354c9a43da2f247"},"previous_names":["openwhisk/openwhisk-client-js"],"tags_count":60,"template":false,"template_full_name":null,"purl":"pkg:github/apache/openwhisk-client-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fopenwhisk-client-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fopenwhisk-client-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fopenwhisk-client-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fopenwhisk-client-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apache","download_url":"https://codeload.github.com/apache/openwhisk-client-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apache%2Fopenwhisk-client-js/sbom","scorecard":{"id":201622,"data":{"date":"2025-08-11","repo":{"name":"github.com/apache/openwhisk-client-js","commit":"6cbfef14cc05b6df5e55d6eb8354c9a43da2f247"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":6,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":1,"reason":"dependency not pinned by hash detected -- score normalized to 1","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/apache/openwhisk-client-js/ci.yaml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yaml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/apache/openwhisk-client-js/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/apache/openwhisk-client-js/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:52: update your workflow using https://app.stepsecurity.io/secureworkflow/apache/openwhisk-client-js/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/apache/openwhisk-client-js/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/apache/openwhisk-client-js/ci.yaml/master?enable=pin","Warn: npmCommand not pinned by hash: tools/check_size.sh:36","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:77","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:78","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:79","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:80","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   1 out of   2 npmCommand dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Info: topLevel permissions set to 'read-all': .github/workflows/ci.yaml:31","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/apache/.github/.github/SECURITY.md:1","Info: Found linked content: github.com/apache/.github/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/apache/.github/.github/SECURITY.md:1","Info: Found text in security policy: github.com/apache/.github/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-16T22:55:57.581Z","repository_id":7832780,"created_at":"2025-08-16T22:55:57.582Z","updated_at":"2025-08-16T22:55:57.582Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28472626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T22:13:38.078Z","status":"ssl_error","status_checked_at":"2026-01-15T22:12:11.737Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apache","cloud","faas","functions-as-a-service","openwhisk","serverless","serverless-architectures","serverless-functions"],"created_at":"2024-09-24T14:16:02.168Z","updated_at":"2026-01-15T22:20:42.616Z","avatar_url":"https://github.com/apache.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!--\n#\n# Licensed to the Apache Software Foundation (ASF) under one or more\n# contributor license agreements.  See the NOTICE file distributed with\n# this work for additional information regarding copyright ownership.\n# The ASF licenses this file to You under the Apache License, Version 2.0\n# (the \"License\"); you may not use this file except in compliance with\n# the License.  You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n--\u003e\n# Apache OpenWhisk Client for JavaScript\n\n[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0)\n[![Continuous Integration](https://github.com/apache/openwhisk-client-js/actions/workflows/ci.yaml/badge.svg)](https://github.com/apache/openwhisk-client-js/actions/workflows/ci.yaml)\n[![codecov](https://codecov.io/gh/apache/openwhisk-client-js/branch/master/graph/badge.svg)](https://codecov.io/gh/apache/openwhisk-client-js)\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\nJavaScript client library for the [Apache OpenWhisk](https://github.com/apache/openwhisk) platform.\nProvides a wrapper around the [OpenWhisk APIs](https://github.com/apache/openwhisk/blob/fb001afa237476eda0c0f6494ee92702e5986538/core/controller/src/main/resources/apiv1swagger.json) (Swagger JSON).\n\n## installation\n\n```bash\n$ npm install openwhisk\n```\n\n## usage\n\n### within openwhisk platform\n\nThis client library can use environment parameters to automatically configure the authentication credentials, platform endpoint and namespace. These parameters are defined within the Node.js runtime environment in OpenWhisk. Unless you want to override these values, you can construct the client instance without further configuration.\n\n```javascript\nvar openwhisk = require('openwhisk');\n\nfunction action() {\n  var ow = openwhisk();\n  return ow.actions.invoke('sample')\n}\n\nexports.main = action\n```\n\n_All methods return a Promise resolved asynchronously with the results. Failures are available through the catch method._\n\n```javascript\now.resource.operation()\n  .then(function () { /* success! */ })\n  .catch(function (err) { /* failed! */ })\n```\n\nUsers can override default constructor parameters by passing in explicit options as shown in the example below.\n\n### outside openwhisk platform\n\n```javascript\nvar openwhisk = require('openwhisk');\nvar options = {apihost: 'openwhisk.ng.bluemix.net', api_key: '...'};\nvar ow = openwhisk(options);\now.actions.invoke('sample').then(result =\u003e console.log(result))\n```\n\n#### using 3rd party authentication handler\nYou can specify an authentication handler in `options.auth_handler` this is an object that provides a function `getAuthHeader` that returns a Promise resolving to a string to be used in the `Authorization` http header for every http request.\n```javascript\nconst authHandler = {\n  getAuthHeader: ()=\u003e{\n    return Promise.resolve('Basic user:password')\n  }\n}\nvar openwhisk = require('openwhisk');\nvar options = {\n  apihost: 'openwhisk.ng.bluemix.net',\n  auth_handler: authHandler\n}\nvar ow = openwhisk(options)\now.actions.invoke('sample').then(result =\u003e console.log(result))\n```\n\n\n### constructor options\n\n_Client constructor supports the following mandatory parameters:_\n\n- **apihost.** Hostname and optional port for openwhisk platform, e.g. `openwhisk.ng.bluemix.net` or `my_whisk_host:80`. Used with API URL template `${protocol}://${apihost}/api/v1/`. If port is missing or port value is 443 in the apihost string, protocol is HTTPS. Otherwise, protocol is HTTP.\n- **api_key.** Authorisation key for user account registered with OpenWhisk platform.\n\n*Client constructor supports the following optional parameters:*\n\n- **api.** Full API URL for OpenWhisk platform, e.g. `https://openwhisk.ng.bluemix.net/api/v1/`. This value overrides `apihost` if both are present.\n- **apiversion** Api version for the OpenWhisk platform, e.g. the `v1` in `https://openwhisk.ng.bluemix.net/api/v1/`, when used with `apihost` (and `api` is not set)\n- **namespace**. Namespace for resource requests, defaults to `_`.\n- **ignore_certs**. Turns off server SSL/TLS certificate verification. This allows the client to be used against local deployments of OpenWhisk with a self-signed certificate. Defaults to false.\n- **apigw_token**. API Gateway service authentication token. This is mandatory for using an external API Gateway service, rather than the built-in api gateway.\n- **apigw_space_guid**. API Gateway space identifier. This is optional when using an API gateway service, defaults to the authentication uuid.\n- **cert**. Client cert to use when connecting to the `apihost` (if `nginx_ssl_verify_client` is turned on in your apihost)\n- **key**. Client key to use when connecting to the `apihost` (if `nginx_ssl_verify_client` is turned on in your apihost)\n- **proxy.** HTTP(s) URI for proxy service to forwards requests through. Uses Needle's [built-in proxy support](https://github.com/tomas/needle#request-options).\n- **agent.** Provide custom [http.Agent](https://nodejs.org/api/http.html#http_class_http_agent) implementation.\n- **retry**. Provide a retry options to retry on errors, for example, `{ retries: 2 }`. By default, no retries will be done. Uses [async-retry options](https://github.com/vercel/async-retry#api). Default values are different from async-retry, please refer to the API doc.\n\n### environment variables\n\nClient constructor will read values for the `apihost`, `namespace`, `api_key`, `ignore_certs`, `apigw_token` and `apigw_space_guid` options from the environment if the following parameters are set. Explicit options have precedence over environment values.\n\n- *__OW_API_HOST*\n- *__OW_NAMESPACE*\n- *__OW_API_KEY*\n- *__OW_IGNORE_CERTS*\n- *__OW_APIGW_TOKEN*\n- *__OW_APIGW_SPACE_SUID*\n- *__OW_USER_AGENT*\n\n### User-Agent\n\nA User-Agent header may be specified to be passed along with all calls\nto OpenWhisk. This can be helpful, if you wish to discriminate client\ntraffic to your OpenWhisk backend. By default, the header will have\nthe value `openwhisk-client-js`. You may override this by passing\nalong a `'User-Agent'` field in the options structure of any API\ncalls; note that this is *not* a constructor argument, but rather an\noption to the API calls themselves. For example, one might specify a\n`myClient` user agent to an action invocation as follows:\n\n```javascript\now.actions.invoke({ 'User-Agent': 'myClient', name, params })\n```\n\nIn some cases, you may need to have *no* User-Agent header. To\noverride the default header behavior, you may pass `noUserAgent: true`\nin your options structure, e.g.\n\n```javascript\now.actions.invoke({ noUserAgent: true, name, params })\n```\n\n### Working with a Proxy\n\nIf you are working behind a firewall, HTTP(s) proxy details can be set by using the `proxy` option in the constructor parameters with the proxy service URI, e.g. `http://proxy-server.com:3128`. The proxy URI can also be set using the following environment parameters (to set a proxy without changing application code):\n\n - *proxy or PROXY*\n - *http_proxy or HTTP_PROXY*\n- *https_proxy or HTTPS_proxy*\n\nIf you need more advanced proxy behaviour, rather than using Needle's default [built-in HTTP agent](https://github.com/tomas/needle), the `agent` constructor parameter can be used to set a custom `http.Agent` implementation, e.g [proxy-agent](https://github.com/TooTallNate/node-proxy-agent \"proxy-agent Github page\")\n\n## Examples\n\n### invoke action, blocking for result\n\n```javascript\nconst name = 'reverseWords'\nconst blocking = true, result = true\nconst params = {msg: 'these are some words to reverse'}\n\now.actions.invoke({name, blocking, result, params}).then(result =\u003e {\n  console.log('here is the reversed string', result.reversed)\n}).catch(err =\u003e {\n  console.error('failed to invoke actions', err)\n})\n```\n\n### fire trigger\n\n```javascript\nconst name = 'eventTrigger'\nconst params = {msg: 'event trigger message string'}\now.triggers.invoke({name, params}).then(result =\u003e {\n  console.log('trigger fired!')\n}).catch(err =\u003e {\n  console.error('failed to fire trigger', err)\n})\n```\n\n### create action from source file\n\n```javascript\nconst name = 'reverseWords'\nconst action = fs.readFileSync('source.js', {encoding: 'utf8'})\n\now.actions.create({name, action}).then(result =\u003e {\n  console.log('action created!')\n}).catch(err =\u003e {\n  console.error('failed to create action', err)\n})\n```\n\n### create action from zip package\n\n```javascript\nconst name = 'reverseWords'\nconst action = fs.readFileSync('package.zip')\n\now.actions.create({name, action}).then(result =\u003e {\n  console.log('action created!')\n}).catch(err =\u003e {\n  console.error('failed to create action', err)\n})\n```\n\n### create sequence from another action\n\n```javascript\nconst actionName = '/mynamespace/reverseWords'\nconst name = 'reverse'\n\now.actions.create({ name, sequence: [ actionName ] })\n```\n\n### retrieve action resource\n\n```javascript\nconst name = 'reverseWords'\now.actions.get(name).then(action =\u003e {\n  console.log('action resource', action)\n}).catch(err =\u003e {\n  console.error('failed to retrieve action', err)\n})\n```\n\n### chaining calls\n\n```javascript\now.actions.list()\n  .then(actions =\u003e ow.actions.invoke(actions))\n  .then(result =\u003e { /* ... */ })\n```\n\n### list packages\n\n```javascript\now.packages.list().then(packages =\u003e {\n  packages.forEach(package =\u003e console.log(package.name))\n}).catch(err =\u003e {\n  console.error('failed to list packages', err)\n})\n```\n\n### update package parameters\n\n```javascript\nconst name = 'myPackage'\nconst package = {\n  parameters: [\n    {key: \"colour\", value: \"green\"},\n    {key: \"name\", value: \"Freya\"}\n  ]\n}\n\now.packages.update({name, package}).then(package =\u003e {\n  console.log('updated package:', package.name)\n}).catch(err =\u003e {\n  console.error('failed to update package', err)\n})\n```\n\n### bind a package from another namespace\n\n```javascript\nconst name = 'myBoundPackage'\nconst package = {\n  binding: {\n    namespace: \"othernamespace\", // namespace to bind from\n    name: \"otherpackage\" // package to bind from\n  }\n}\n\now.packages.update({name, package}).then(package =\u003e {\n  console.log('bound package:', package.name)\n}).catch(err =\u003e {\n  console.error('failed to bind package', err)\n})\n```\n\n### create trigger feed from alarm package\n\n```javascript\n// alarmTrigger MUST already exist in default namespace\nconst params = {cron: '*/8 * * * * *', trigger_payload: {name: 'James'}}\nconst name = '/whisk.system/alarms/alarm'\nconst trigger = 'alarmTrigger'\now.feeds.create({name, trigger, params}).then(package =\u003e {\n  console.log('alarm trigger feed created')\n}).catch(err =\u003e {\n  console.error('failed to create alarm trigger', err)\n})\n```\n\n\n\n## API Details\n\n### resource identifiers + namespaces\n\nWhen passing resource identifiers as parameters you can either use a short name, without an explicit namespace, or a fully-qualified identifier, including namespace and package details.\n\nIf the namespace is missing from the resource identifier, the client will use the namespace from configuration options following this ordering.\n\n- `namespace` from method parameter options OR\n- `namespace` from options passed into client constructor OR\n- `namespace` from environment variable (`__OW_NAMESPACE`) OR\n- default namespace: `_`\n\n### list resources\n\n```javascript\now.actions.list()\now.activations.list()\now.triggers.list()\now.rules.list()\now.namespaces.list()\now.packages.list()\n```\n\nQuery parameters for the API calls are supported (e.g. limit, skip, count etc.) by passing an object with the named parameters as the first argument.\n\n```javascript\now.actions.list({skip: 100, limit: 50})\n```\n\nTo count the number of resources without retrieving the resources you can use `count` query parameter.\n```javascript\now.actions.list({count:true})\n```\n\nThe following optional parameters are supported:\n- `namespace` - set custom namespace for endpoint\n\n### retrieve resource\n\n```javascript\now.actions.get({name: '...'})\now.activations.get({name: '...'})\now.triggers.get({name: '...'})\now.rules.get({name: '...'})\now.packages.get({name: '...'})\now.feeds.get({name: '...', trigger: '...'})\n```\n\nThe following optional parameters are supported for all resource retrievals:\n- `namespace` - set custom namespace for endpoint\n\nOptional parameters for action resource retrievals are shown below:\n- `code` - set to `true` or `false` depending on whether action code should be included or excluded respectively\n\nThis method also supports passing the `name` property directly without wrapping within an object.\n```javascript\nconst name = \"actionName\"\now.actions.get(name)\n```\n\nIf you pass in an array for the first parameter, the `get` call will be executed for each array item. The function returns a Promise which resolves with the results when all operations have finished.\n\n```javascript\now.actions.get([\"a\", {name: \"b\"}])\n```\n\n### delete resource\n\n```javascript\now.actions.delete({name: '...'})\now.triggers.delete({name: '...'})\now.rules.delete({name: '...'})\now.packages.delete({name: '...'})\now.feeds.delete({name: '...', trigger: '...'})\n```\n\nThe following optional parameters are supported:\n- `namespace` - set custom namespace for endpoint\n\nThis method also supports passing the `name` property directly without wrapping within an object.\n\n```javascript\nconst name = \"actionName\"\now.actions.delete(name)\n```\n\nIf you pass in an array for the first parameter, the `delete` call will be executed for each array item. The function returns a Promise which resolves with the results when all operations have finished.\n\n```javascript\now.actions.delete([\"a\", {name: \"b\"}])\n```\n\n### invoke action\n\n```javascript\now.actions.invoke({name: '...'})\n```\n\nThe `actionName` parameter supports the following formats: `actionName`, `package/actionName`, `/namespace/actionName`, `/namespace/package/actionName`.\n\nIf `actionName` includes a namespace, this overrides any other `namespace` properties.\n\nThe following optional parameters are supported:\n- `blocking` - delay returning until action has finished executing (default: `false`)\n- `result` - return function result (`obj.response.result`) rather than entire API result (default: `false`)\n- `params` - JSON object containing parameters for the action being invoked (default: `{}`)\n- `namespace` - set custom namespace for endpoint\n\nThis method also supports passing the `name` property directly without wrapping within an object.\n\n```javascript\nconst name = \"actionName\"\now.actions.invoke(name)\n```\n\nIf you pass in an array for the first parameter, the `invoke` call will be executed for each array item. The function returns a Promise which resolves with the results when all operations have finished.\n\n```javascript\now.actions.invoke([\"a\", {name: \"b\", blocking: true}])\n```\n\n### create \u0026 update action\n\n```javascript\now.actions.create({name: '...', action: 'function main() {};'})\now.actions.update({name: '...', action: 'function main() {};'})\n```\n\nThe following mandatory parameters are supported:\n- `name` - action identifier\n- `action` - String containing JS function source code, Buffer [containing package action zip file](https://github.com/openwhisk/openwhisk/blob/master/docs/actions.md#packaging-an-action-as-a-nodejs-module) or JSON object containing full parameters for the action body\n\nThe following optional parameters are supported:\n- `namespace` - set custom namespace for endpoint\n- `params` - object containing default parameters for the action (default: `{}`)\n- `annotations` - object containing annotations for the action (default: `{}`)\n- `limits` - object containing limits for the action (default: `{}`)\n- `kind` - runtime environment parameter, ignored when `action` is an object (default: `nodejs:default`)\n\nIf you pass in an array for the first parameter, the `create` call will be executed for each array item. The function returns a Promise which resolves with the results when all operations have finished.\n\n```javascript\now.actions.create([{...}, {...}])\n```\n\n### create \u0026 update action sequence\n\n```javascript\now.actions.create({name: '...', sequence: [\"action_name\", \"next_action\", ...]})\now.actions.update({name: '...', sequence: [\"action_name\", \"next_action\", ...]})\n```\n\nThe following mandatory parameters are supported:\n\n- `name` - action identifier\n- `sequence` - Array containing JS strings with action identifiers to use in sequence. This can be a full or relative action identifier (e.g. `action-name` or `/namespace/package/action-name`).\n\nThe following optional parameters are supported:\n\n- `namespace` - set custom namespace for endpoint\n- `params` - object containing default parameters for the action (default: `{}`)\n- `annotations` - object containing annotations for the action (default: `{}`)\n- `limits` - object containing limits for the action (default: `{}`)\n\nIf you pass in an array for the first parameter, the `create` call will be executed for each array item. The function returns a Promise which resolves with the results when all operations have finished.\n\n```javascript\now.actions.create([{...}, {...}])\n```\n\n### fire trigger\n\n```javascript\now.triggers.invoke({name: '...'})\n```\n\nThe following optional parameters are supported:\n- `params` - JSON object containing parameters for the trigger being fired (default: `{}`)\n- `namespace` - set custom namespace for endpoint\n\nThis method also supports passing the `name` property directly without wrapping within an object.\n\n```javascript\nconst name = \"actionName\"\now.triggers.invoke(name)\n```\n\nIf you pass in an array for the first parameter, the `invoke` call will be executed for each array item. The function returns a Promise which resolves with the results when all operations have finished.\n\n```javascript\now.triggers.invoke([\"a\", {name: \"b\", blocking: true}])\n```\n\n### create \u0026 update trigger\n\n```javascript\now.triggers.create({name: '...'})\now.triggers.update({name: '...'})\n```\n\nThe following optional parameters are supported:\n- `trigger` - JSON object containing parameters for the trigger body (default: `{}`)\n- `namespace` - set custom namespace for endpoint\n- `annotations` - object containing annotations for the trigger (default: `{}`)\n\n### create \u0026 update packages\n\n```javascript\now.packages.create({name: '...'})\now.packages.update({name: '...'})\n```\n\nThe following optional parameters are supported:\n- `package` - JSON object containing parameters for the package body (default: `{}`)\n- `namespace` - set custom namespace for endpoint\n- `annotations` - object containing annotations for the package (default: `{}`)\n\n### create \u0026 update rule\n\n```javascript\now.rules.create({name: '...', action: '...', trigger: '...'})\now.rules.update({name: '...', action: '...', trigger: '...'})\n```\n\n`trigger` and `action` identifiers will have the default namespace (`/_/`)\nappended in the request, unless a fully qualified name is passed in\n(`/custom_ns/action_or_trigger_name`).\n\nThe following optional parameters are supported:\n- `namespace` - set namespace for rule\n- `annotations` - object containing annotations for the rule (default: `{}`)\n\n### enable \u0026 disable rule\n\n```javascript\now.rules.enable({name: '...'})\now.rules.disable({name: '...'})\n```\n\nThe following optional parameters are supported:\n- `namespace` - set custom namespace for endpoint\n\n### create \u0026 update feeds\n\n```javascript\now.feeds.create({feedName: '...', trigger: '...'})\now.feeds.update({feedName: '...', trigger: '...'})\n```\n\nThe following optional parameters are supported:\n- `namespace` - set custom namespace for endpoint\n- `params` - JSON object containing parameters for the feed being invoked (default: `{}`)\n\n## api gateway\n\nOpenWhisk supports a [built-in API gateway service](https://github.com/apache/openwhisk/blob/master/docs/apigateway.md) and external third-party providers.\n\nThis client library defaults to using the platform service. If the `apigw_token` parameter is passed into the client constructor, the implementation will switch to the [IBM Bluemix API Gateway](https://console.ng.bluemix.net/docs/openwhisk/openwhisk_apigateway.html#openwhisk_apigateway).\n\n*The interface for managing routes through the library does not change between providers.*\n\n### retrieve route\n\n```javascript\now.routes.get({basepath: '...'})\now.routes.get({name: '...'})\n```\n\n*This method is a wrapper for the list method. It throws an error if the base path or name parameter is missing.*\n\n### list routes\n\n```javascript\now.routes.list()\n```\n\nThe following optional parameters are supported to filter the result set:\n- `relpath` - relative URI path for endpoints\n- `basepath` - base URI path for endpoints\n- `name` - identifier for API\n- `operation` - HTTP methods\n- `limit` - limit result set size\n- `skip` - skip results from index\n\n*`relpath` is only valid when `basepath` is also specified. `name` and `basepath` cannot be used together.*\n\n### delete routes\n\n```javascript\now.routes.delete({basepath: '...'})\now.routes.delete({name: '...'})\n```\n\nThe following optional parameters are supported to filter the result set:\n- `relpath` - relative URI path for endpoints\n- `operation` - HTTP methods\n\n### add route\n```javascript\now.routes.create({relpath: '...', operation: '...', action: '...'})\n```\n\n*`action` supports normal (actionName) and fully-qualified (/namespace/actionName) formats.*\n\nThe following optional parameters are supported:\n- `responsetype` - content type returned by web action, possible values: `html`, `http`, `json`, `text` and `svg` (default: `json`).\n- `basepath` - base URI path for endpoints (default: `/`)\n- `name` - identifier for API (default: `basepath`)\n- `secure_key` - auth key for secure web action\n\n### add route (swagger)\n\n```javascript\now.routes.create({swagger: '{...}'})\n```\n\nSwagger parameter must be a well-formed JSON string, containing a valid Swagger API definition, which follows the [OpenWhisk API Gateway route schema](https://github.com/apache/openwhisk-apigateway/blob/master/doc/v2/management_interface_v2.md#post-v2tenant_idapis).\n\n*No other parameters are supported when creating the route from a JSON Swagger document.*\n\n## Debugging\n\nSetting an environment parameter (`DEBUG=needle`) will dump the HTTP requests from the client library and responses received to `stderr`.\n\n```bash\nDEBUG=needle node script.js\n```\n\nThis parameter can also be set dynamically at runtime, provided this happens before the `openwhisk` module is required.\n\n```javascript\nprocess.env.DEBUG='needle';\nvar openwhisk = require('openwhisk');\n```\n\n## Development\n\n### unit tests\n\n```bash\n$ npm run test:unit\n```\n\n### integration tests\n\n*Please [see the instructions](https://github.com/openwhisk/openwhisk-client-js/tree/master/test/integration) for setting up the integration test environment prior to running these tests.*\n\n```bash\n$ npm run test:integration\n```\n\n**Note:** The test integration runs in secure mode by default, which means that all trusted signers must be present and available to the client process. If your local environment is using self-signed certificates, you can use the following command to start the script in insecure mode:\n\n`__OW_INSECURE=true npm run test-integration`\n\nThis will disable SSL/TLS verification for all SSL communication.\n\n### code coverage\n\nCode coverage data for the unit and integration tests can be created using the following commands:\n\n- `npm run coverage:unit`\n- `npm run coverage:integration`\n\n*Generated data in stored in the `.nyc_output` directory.*\n\nRunning the `npm run coverage:report` command will generate the output reports.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fopenwhisk-client-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapache%2Fopenwhisk-client-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapache%2Fopenwhisk-client-js/lists"}