https://github.com/commercelayer/commercelayer-cli-plugin-webhooks
https://github.com/commercelayer/commercelayer-cli-plugin-webhooks
commercelayer
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/commercelayer/commercelayer-cli-plugin-webhooks
- Owner: commercelayer
- License: mit
- Created: 2021-08-25T17:01:30.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2024-04-12T17:03:45.000Z (about 2 years ago)
- Last Synced: 2024-04-12T21:18:40.222Z (about 2 years ago)
- Topics: commercelayer
- Language: TypeScript
- Homepage:
- Size: 876 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# cli-plugin-webhooks
Commerce Layer CLI Webhooks plugin
[](https://oclif.io)
[](https://npmjs.org/package/@commercelayer/cli-plugin-webhooks)
[](https://npmjs.org/package/@commercelayer/cli-plugin-webhooks)
[](https://github.com/commercelayer/cli-plugin-webhooks/blob/master/package.json)
* [Usage](#usage)
* [Commands](#commands)
## Usage
```sh-session
commercelayer COMMAND
commercelayer [COMMAND] (--help | -h) for detailed information about plugin commands.
```
## Commands
* [`commercelayer webhooks [ID]`](#commercelayer-webhooks-id)
* [`commercelayer webhooks:create`](#commercelayer-webhookscreate)
* [`commercelayer webhooks:destroy ID`](#commercelayer-webhooksdestroy-id)
* [`commercelayer webhooks:details ID`](#commercelayer-webhooksdetails-id)
* [`commercelayer webhooks:disable ID`](#commercelayer-webhooksdisable-id)
* [`commercelayer webhooks:enable ID`](#commercelayer-webhooksenable-id)
* [`commercelayer webhooks:event ID`](#commercelayer-webhooksevent-id)
* [`commercelayer webhooks:events ID`](#commercelayer-webhooksevents-id)
* [`commercelayer webhooks:list`](#commercelayer-webhookslist)
* [`commercelayer webhooks:listen ID`](#commercelayer-webhookslisten-id)
* [`commercelayer webhooks:payload ID`](#commercelayer-webhookspayload-id)
* [`commercelayer webhooks:reset ID`](#commercelayer-webhooksreset-id)
* [`commercelayer webhooks:topics`](#commercelayer-webhookstopics)
* [`commercelayer webhooks:update ID`](#commercelayer-webhooksupdate-id)
### `commercelayer webhooks [ID]`
List all the registered webhooks or the details of a single webhook.
```sh-session
USAGE
$ commercelayer webhooks [ID] [-c open|closed] [-t ] [-H] [-e]
ARGUMENTS
ID unique id of the webhook to get a single webhook
FLAGS
-H, --hide-empty hide empty attributes
-c, --circuit= show only webhooks with circuit in the declared state
-e, --events show the last event callbacks associated to the webhook
-t, --topic= the event that triggered the webhook
DESCRIPTION
list all the registered webhooks or the details of a single webhook
```
_See code: [src/commands/webhooks/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-webhooks/blob/main/src/commands/webhooks/index.ts)_
### `commercelayer webhooks:create`
Create a new webhook.
```sh-session
USAGE
$ commercelayer webhooks:create -t -u [-i ...] [-n ]
FLAGS
-i, --include=... a comma separated list of related resources to be included
-n, --name= the webhook short name
-t, --topic= (required) the identifier of the event that will trigger the webhook
-u, --url= (required) the callback URL used to POST data
DESCRIPTION
create a new webhook
ALIASES
$ commercelayer wh:create
EXAMPLES
$ commercelayer webhooks:create -t customers.create -u https://callback.url.io
$ cl wh:create -t orders.place -u http://myurl.com
```
_See code: [src/commands/webhooks/create.ts](https://github.com/commercelayer/commercelayer-cli-plugin-webhooks/blob/main/src/commands/webhooks/create.ts)_
### `commercelayer webhooks:destroy ID`
Destroy an existing webhook.
```sh-session
USAGE
$ commercelayer webhooks:destroy ID
ARGUMENTS
ID unique id of the webhook
DESCRIPTION
destroy an existing webhook
ALIASES
$ commercelayer webhooks:delete
$ commercelayer wh:delete
$ commercelayer wh:destroy
EXAMPLES
$ commercelayer webhooks:destroy >
$ cl wh:destroy >
```
_See code: [src/commands/webhooks/destroy.ts](https://github.com/commercelayer/commercelayer-cli-plugin-webhooks/blob/main/src/commands/webhooks/destroy.ts)_
### `commercelayer webhooks:details ID`
Show the details of an existing webhook.
```sh-session
USAGE
$ commercelayer webhooks:details ID [-H] [-e]
ARGUMENTS
ID unique id of the webhook
FLAGS
-H, --hide-empty hide empty attributes
-e, --events show the last event callbacks associated to the webhook
DESCRIPTION
show the details of an existing webhook
ALIASES
$ commercelayer wh:details
EXAMPLES
$ commercelayer webhooks:details
$ cl webhooks:details -H
$ cl wh:details
```
_See code: [src/commands/webhooks/details.ts](https://github.com/commercelayer/commercelayer-cli-plugin-webhooks/blob/main/src/commands/webhooks/details.ts)_
### `commercelayer webhooks:disable ID`
Disable an enabled webhook.
```sh-session
USAGE
$ commercelayer webhooks:disable ID
ARGUMENTS
ID unique id of the webhook
DESCRIPTION
disable an enabled webhook
ALIASES
$ commercelayer wh:disable
EXAMPLES
$ commercelayer webhooks:disable
$ cl wh:disable
```
_See code: [src/commands/webhooks/disable.ts](https://github.com/commercelayer/commercelayer-cli-plugin-webhooks/blob/main/src/commands/webhooks/disable.ts)_
### `commercelayer webhooks:enable ID`
Enable a disabled webhook.
```sh-session
USAGE
$ commercelayer webhooks:enable ID
ARGUMENTS
ID unique id of the webhook
DESCRIPTION
enable a disabled webhook
ALIASES
$ commercelayer wh:enable
EXAMPLES
$ commercelayer webhooks:enable
$ cl wh:enable
```
_See code: [src/commands/webhooks/enable.ts](https://github.com/commercelayer/commercelayer-cli-plugin-webhooks/blob/main/src/commands/webhooks/enable.ts)_
### `commercelayer webhooks:event ID`
Show the details of a firedf webhook event.
```sh-session
USAGE
$ commercelayer webhooks:event ID [-f -p]
ARGUMENTS
ID unique id of the webhook
FLAGS
-f, --format format the payload output
-p, --payload show the event payload sent to the callback endpoint
DESCRIPTION
show the details of a firedf webhook event
ALIASES
$ commercelayer wh:event
EXAMPLES
$ commercelayer webhooks:event
$ cl wh:event -p
```
_See code: [src/commands/webhooks/event.ts](https://github.com/commercelayer/commercelayer-cli-plugin-webhooks/blob/main/src/commands/webhooks/event.ts)_
### `commercelayer webhooks:events ID`
List all the events associated to the webhook.
```sh-session
USAGE
$ commercelayer webhooks:events ID [-A | -l ]
ARGUMENTS
ID unique id of the webhook
FLAGS
-A, --all show all events instead of first 25 only
-l, --limit= limit number of events in output
DESCRIPTION
list all the events associated to the webhook
ALIASES
$ commercelayer wh:events
EXAMPLES
$ commercelayer webhooks:events
$ cl wh:events
```
_See code: [src/commands/webhooks/events.ts](https://github.com/commercelayer/commercelayer-cli-plugin-webhooks/blob/main/src/commands/webhooks/events.ts)_
### `commercelayer webhooks:list`
List all the registered webhooks.
```sh-session
USAGE
$ commercelayer webhooks:list [-c open|closed] [-t ]
FLAGS
-c, --circuit= show only webhooks with circuit in the declared state
-t, --topic= the event that triggered the webhook
DESCRIPTION
list all the registered webhooks
ALIASES
$ commercelayer wh:list
EXAMPLES
$ commercelayer webhooks
$ cl webhooks:list -c open
$ cl wh:list
```
_See code: [src/commands/webhooks/list.ts](https://github.com/commercelayer/commercelayer-cli-plugin-webhooks/blob/main/src/commands/webhooks/list.ts)_
### `commercelayer webhooks:listen ID`
Listen a webhook for outgoing callbacks.
```sh-session
USAGE
$ commercelayer webhooks:listen ID [-t ]
ARGUMENTS
ID unique id of the webhook
FLAGS
-t, --time= [default: 120] waiting time for the first event
DESCRIPTION
listen a webhook for outgoing callbacks
ALIASES
$ commercelayer wh:listen
EXAMPLES
$ commercelayer webhooks:listen
$ cl wh:listen
```
_See code: [src/commands/webhooks/listen.ts](https://github.com/commercelayer/commercelayer-cli-plugin-webhooks/blob/main/src/commands/webhooks/listen.ts)_
### `commercelayer webhooks:payload ID`
Show the payload associated to an event callback.
```sh-session
USAGE
$ commercelayer webhooks:payload ID [-f]
ARGUMENTS
ID unique id of the webhook
FLAGS
-f, --format format the payload output
DESCRIPTION
show the payload associated to an event callback
ALIASES
$ commercelayer wh:payload
EXAMPLES
$ commercelayer webhooks:payload
$ cl wh:payload -f
```
_See code: [src/commands/webhooks/payload.ts](https://github.com/commercelayer/commercelayer-cli-plugin-webhooks/blob/main/src/commands/webhooks/payload.ts)_
### `commercelayer webhooks:reset ID`
Reset the circuit breaker associated to the webhook.
```sh-session
USAGE
$ commercelayer webhooks:reset ID
ARGUMENTS
ID unique id of the webhook
DESCRIPTION
reset the circuit breaker associated to the webhook
ALIASES
$ commercelayer wh:reset
EXAMPLES
$ commercelayer webhooks:reset
$ cl wh:reset
```
_See code: [src/commands/webhooks/reset.ts](https://github.com/commercelayer/commercelayer-cli-plugin-webhooks/blob/main/src/commands/webhooks/reset.ts)_
### `commercelayer webhooks:topics`
Show online documentation for supported events.
```sh-session
USAGE
$ commercelayer webhooks:topics
DESCRIPTION
show online documentation for supported events
ALIASES
$ commercelayer wh:topics
EXAMPLES
$ commercelayer webhooks:topics
$ cl wh:topics
```
_See code: [src/commands/webhooks/topics.ts](https://github.com/commercelayer/commercelayer-cli-plugin-webhooks/blob/main/src/commands/webhooks/topics.ts)_
### `commercelayer webhooks:update ID`
Update an existing webhook.
```sh-session
USAGE
$ commercelayer webhooks:update ID [-t ] [-u ] [-i ...] [-n ]
ARGUMENTS
ID unique id of the webhook
FLAGS
-i, --include=... a comma separated list of related resources to be included
-n, --name= the webhook short name
-t, --topic= the identifier of the event that will trigger the webhook
-u, --url= the callback URL used to POST data
DESCRIPTION
update an existing webhook
ALIASES
$ commercelayer wh:update
EXAMPLES
$ commercelayer webhooks:update -t customers.create -u https://callback.url.io
$ cl wh:update -t orders.place -u http://myurl.com
```
_See code: [src/commands/webhooks/update.ts](https://github.com/commercelayer/commercelayer-cli-plugin-webhooks/blob/main/src/commands/webhooks/update.ts)_