Skip to content

Commit

Permalink
Merge pull request #79 from commercelayer/feature/78_plugin-user-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
pviti authored Nov 21, 2023
2 parents 7dd89b6 + b6f1775 commit 825b860
Show file tree
Hide file tree
Showing 121 changed files with 1,348 additions and 805 deletions.
24 changes: 24 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# .github/release.yaml

changelog:
exclude:
labels:
- ignore-for-release
authors:
- octocat
categories:
- title: 💥 Breaking Change
labels:
- breaking-change
- title: 🚀 Enhancement
labels:
- enhancement
- title: 🐛 Bug Fix
labels:
- bug
- title: 📝 Documentation
labels:
- documentation
- title: Other Changes
labels:
- "*"
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '16 10 * * 6'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v2

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
164 changes: 164 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,20 +136,27 @@ $ commercelayer plugins:install triggers
* [`commercelayer satispay_payment ID`](#commercelayer-satispay_payment-id)
* [`commercelayer satispay_payment:refresh ID`](#commercelayer-satispay_paymentrefresh-id)
* [`commercelayer shipment ID`](#commercelayer-shipment-id)
* [`commercelayer shipment:decrement_stock ID`](#commercelayer-shipmentdecrement_stock-id)
* [`commercelayer shipment:get_rates ID`](#commercelayer-shipmentget_rates-id)
* [`commercelayer shipment:on_hold ID`](#commercelayer-shipmenton_hold-id)
* [`commercelayer shipment:packing ID`](#commercelayer-shipmentpacking-id)
* [`commercelayer shipment:picking ID`](#commercelayer-shipmentpicking-id)
* [`commercelayer shipment:purchase ID`](#commercelayer-shipmentpurchase-id)
* [`commercelayer shipment:ready_to_ship ID`](#commercelayer-shipmentready_to_ship-id)
* [`commercelayer shipment:release_stock ID`](#commercelayer-shipmentrelease_stock-id)
* [`commercelayer shipment:reserve_stock ID`](#commercelayer-shipmentreserve_stock-id)
* [`commercelayer shipment:ship ID`](#commercelayer-shipmentship-id)
* [`commercelayer shipment:upcoming ID`](#commercelayer-shipmentupcoming-id)
* [`commercelayer shipping_method ID`](#commercelayer-shipping_method-id)
* [`commercelayer shipping_method:disable ID`](#commercelayer-shipping_methoddisable-id)
* [`commercelayer shipping_method:enable ID`](#commercelayer-shipping_methodenable-id)
* [`commercelayer stock_reservation ID`](#commercelayer-stock_reservation-id)
* [`commercelayer stock_reservation:pending ID`](#commercelayer-stock_reservationpending-id)
* [`commercelayer stock_transfer ID`](#commercelayer-stock_transfer-id)
* [`commercelayer stock_transfer:cancel ID`](#commercelayer-stock_transfercancel-id)
* [`commercelayer stock_transfer:complete ID`](#commercelayer-stock_transfercomplete-id)
* [`commercelayer stock_transfer:in_transit ID`](#commercelayer-stock_transferin_transit-id)
* [`commercelayer stock_transfer:on_hold ID`](#commercelayer-stock_transferon_hold-id)
* [`commercelayer stock_transfer:picking ID`](#commercelayer-stock_transferpicking-id)
* [`commercelayer stock_transfer:upcoming ID`](#commercelayer-stock_transferupcoming-id)
* [`commercelayer stripe_payment ID`](#commercelayer-stripe_payment-id)
Expand Down Expand Up @@ -2507,6 +2514,29 @@ DESCRIPTION

_See code: [src/commands/shipment/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/index.ts)_

### `commercelayer shipment:decrement_stock ID`

Send this attribute if you want to automatically decrement and release the stock for each of the associated stock line item. Can be done only when fulfillment is in progress.

```sh-session
USAGE
$ commercelayer shipment:decrement_stock ID [-u [-j -p]]

ARGUMENTS
ID the unique id of the resource

FLAGS
-j, --json print result in JSON format
-p, --print print out the modified resource
-u, --unformatted print JSON output without indentation

DESCRIPTION
Send this attribute if you want to automatically decrement and release the stock for each of the associated stock line
item. Can be done only when fulfillment is in progress.
```

_See code: [src/commands/shipment/decrement_stock.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/decrement_stock.ts)_

### `commercelayer shipment:get_rates ID`

Send this attribute if you want get the shipping rates from the associated carrier accounts.
Expand Down Expand Up @@ -2639,6 +2669,52 @@ DESCRIPTION

_See code: [src/commands/shipment/ready_to_ship.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/ready_to_ship.ts)_

### `commercelayer shipment:release_stock ID`

Send this attribute if you want to automatically release the stock for each of the associated stock line item. Can be done only when fulfillment is in progress.

```sh-session
USAGE
$ commercelayer shipment:release_stock ID [-u [-j -p]]

ARGUMENTS
ID the unique id of the resource

FLAGS
-j, --json print result in JSON format
-p, --print print out the modified resource
-u, --unformatted print JSON output without indentation

DESCRIPTION
Send this attribute if you want to automatically release the stock for each of the associated stock line item. Can be
done only when fulfillment is in progress.
```

_See code: [src/commands/shipment/release_stock.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/release_stock.ts)_

### `commercelayer shipment:reserve_stock ID`

Send this attribute if you want to automatically reserve the stock for each of the associated stock line item. Can be done only when fulfillment is in progress.

```sh-session
USAGE
$ commercelayer shipment:reserve_stock ID [-u [-j -p]]

ARGUMENTS
ID the unique id of the resource

FLAGS
-j, --json print result in JSON format
-p, --print print out the modified resource
-u, --unformatted print JSON output without indentation

DESCRIPTION
Send this attribute if you want to automatically reserve the stock for each of the associated stock line item. Can be
done only when fulfillment is in progress.
```

_See code: [src/commands/shipment/reserve_stock.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/reserve_stock.ts)_

### `commercelayer shipment:ship ID`

Send this attribute if you want to mark this shipment as shipped.
Expand All @@ -2661,6 +2737,28 @@ DESCRIPTION

_See code: [src/commands/shipment/ship.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/ship.ts)_

### `commercelayer shipment:upcoming ID`

Send this attribute if you want to mark this shipment as upcoming.

```sh-session
USAGE
$ commercelayer shipment:upcoming ID [-u [-j -p]]

ARGUMENTS
ID the unique id of the resource

FLAGS
-j, --json print result in JSON format
-p, --print print out the modified resource
-u, --unformatted print JSON output without indentation

DESCRIPTION
Send this attribute if you want to mark this shipment as upcoming.
```

_See code: [src/commands/shipment/upcoming.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipment/upcoming.ts)_

### `commercelayer shipping_method ID`

Execute an action on a resource of type shipping_methods.
Expand Down Expand Up @@ -2727,6 +2825,50 @@ DESCRIPTION

_See code: [src/commands/shipping_method/enable.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/shipping_method/enable.ts)_

### `commercelayer stock_reservation ID`

Execute an action on a resource of type stock_reservations.

```sh-session
USAGE
$ commercelayer stock_reservation ID [-u [-j -p]]

ARGUMENTS
ID the unique id of the resource

FLAGS
-j, --json print result in JSON format
-p, --print print out the modified resource
-u, --unformatted print JSON output without indentation

DESCRIPTION
execute an action on a resource of type stock_reservations
```

_See code: [src/commands/stock_reservation/index.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stock_reservation/index.ts)_

### `commercelayer stock_reservation:pending ID`

Send this attribute if you want to mark this stock reservation as pending.

```sh-session
USAGE
$ commercelayer stock_reservation:pending ID [-u [-j -p]]

ARGUMENTS
ID the unique id of the resource

FLAGS
-j, --json print result in JSON format
-p, --print print out the modified resource
-u, --unformatted print JSON output without indentation

DESCRIPTION
Send this attribute if you want to mark this stock reservation as pending.
```

_See code: [src/commands/stock_reservation/pending.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stock_reservation/pending.ts)_

### `commercelayer stock_transfer ID`

Execute an action on a resource of type stock_transfers.
Expand Down Expand Up @@ -2815,6 +2957,28 @@ DESCRIPTION

_See code: [src/commands/stock_transfer/in_transit.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stock_transfer/in_transit.ts)_

### `commercelayer stock_transfer:on_hold ID`

Send this attribute if you want to put this stock transfer on hold.

```sh-session
USAGE
$ commercelayer stock_transfer:on_hold ID [-u [-j -p]]

ARGUMENTS
ID the unique id of the resource

FLAGS
-j, --json print result in JSON format
-p, --print print out the modified resource
-u, --unformatted print JSON output without indentation

DESCRIPTION
Send this attribute if you want to put this stock transfer on hold.
```

_See code: [src/commands/stock_transfer/on_hold.ts](https://github.com/commercelayer/commercelayer-cli-plugin-triggers/blob/main/src/commands/stock_transfer/on_hold.ts)_

### `commercelayer stock_transfer:picking ID`

Send this attribute if you want to start picking this stock transfer.
Expand Down
4 changes: 2 additions & 2 deletions gen/templates/action.tpl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Command##__FLAGS_IMPORT__## from '../../base'
import exec from '../../exec'
import { triggers } from '../../triggers/##__RESOURCE_TYPE__##'
import { type ##__RESOURCE_CLASS__## } from '@commercelayer/sdk'


const TRIGGER = '##__ACTION_ID__##'
Expand All @@ -23,7 +23,7 @@ export default class ##__RESOURCE_CLASS__####__ACTION_NAME__## extends Command {
const { args, flags } = await this.parse(##__RESOURCE_CLASS__####__ACTION_NAME__##)

const res = await exec('##__RESOURCE_TYPE__##', args.id, TRIGGER, flags)
const res = await this.executeAction<##__RESOURCE_CLASS__##>('##__RESOURCE_TYPE__##', args.id, TRIGGER, flags)

if (flags.print) this.printOutput(res, flags)

Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@commercelayer/cli-plugin-triggers",
"description": "Commerce Layer CLI Triggers plugin",
"version": "3.14.0",
"version": "3.15.0",
"author": "Pierluigi Viti <[email protected]>",
"bugs": "https://github.com/commercelayer/commercelayer-cli-plugin-triggers/issues",
"engines": {
Expand Down Expand Up @@ -55,26 +55,26 @@
"types": "lib/index.d.ts",
"devDependencies": {
"@commercelayer/cli-dev": "^2.0.5",
"@commercelayer/eslint-config-ts": "^1.1.0",
"@commercelayer/eslint-config-ts": "^1.2.0",
"@oclif/plugin-help": "^5.2.20",
"@oclif/test": "^2.5.6",
"@types/chai": "^4.3.7",
"@types/inquirer": "^8.2.7",
"@types/lodash": "^4.14.199",
"@types/mocha": "^10.0.2",
"@types/node": "^20.8.4",
"@types/chai": "^4.3.10",
"@types/inquirer": "^8.2.10",
"@types/lodash": "^4.14.201",
"@types/mocha": "^10.0.4",
"@types/node": "^20.9.2",
"chai": "^4.3.10",
"eslint": "^8.51.0",
"eslint": "^8.54.0",
"inflector-js": "^1.0.1",
"lodash": "^4.17.21",
"mocha": "^10.2.0",
"nyc": "^15.1.0",
"ts-node": "^10.9.1",
"typescript": "5.0.4"
"typescript": "5.2.2"
},
"dependencies": {
"@commercelayer/cli-core": "^3.12.1",
"@commercelayer/sdk": "^5.16.0",
"@commercelayer/cli-core": "^4.3.3",
"@commercelayer/sdk": "^5.22.1",
"@oclif/core": "^2.15.0",
"inquirer": "^8.2.6",
"tslib": "^2.6.2"
Expand Down
Loading

0 comments on commit 825b860

Please sign in to comment.