chore: fix yarn.lock conflicts
This commit is contained in:
@@ -3,6 +3,18 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.3.3](https://github.com/medusajs/medusa/compare/medusa-fulfillment-webshipper@1.3.2...medusa-fulfillment-webshipper@1.3.3) (2022-07-05)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **webshipper:** allow cancelling WS orders with error status ([#1755](https://github.com/medusajs/medusa/issues/1755)) ([1d3032d](https://github.com/medusajs/medusa/commit/1d3032dc671b477654afd13a218caa772454bde0))
|
||||
* **webshipper:** only add invoices if invoice generator produces a file ([#1749](https://github.com/medusajs/medusa/issues/1749)) ([c0e18d4](https://github.com/medusajs/medusa/commit/c0e18d473c050d143f67ed2c76fa9ec9414daf1a))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.3.2](https://github.com/medusajs/medusa/compare/medusa-fulfillment-webshipper@1.3.0...medusa-fulfillment-webshipper@1.3.2) (2022-06-19)
|
||||
|
||||
**Note:** Version bump only for package medusa-fulfillment-webshipper
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# medusa-fulfillment-webshipper
|
||||
|
||||
Adds Webshipper as a fulfilment provider in Medusa Commerce.
|
||||
Adds Webshipper as a fulfilment provider in Medusa Commerce.
|
||||
|
||||
On each new fulfillment an order is created in Webshipper. The plugin listens for shipment events and updated the shipment accordingly.
|
||||
A webhook listener is exposed at `/webshipper/shipments` to listen for shipment creations. You must create this webhook in Webshipper to have Medusa listen for shipment events.
|
||||
@@ -13,4 +13,5 @@ A webhook listener is exposed at `/webshipper/shipments` to listen for shipment
|
||||
order_channel_id: [the channel id to register orders on] (required)
|
||||
webhook_secret: [the webhook secret used to listen for shipments] (required)
|
||||
coo_countries: [an array of countries in which a Certificate of Origin will be attached] (default: "all")
|
||||
delete_on_cancel [determines whether Webshipper orders are deleted when a Medusa fulfillment is canceled] (default: false)
|
||||
```
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "medusa-fulfillment-webshipper",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.3",
|
||||
"description": "Webshipper Fulfillment provider for Medusa",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
@@ -18,7 +18,7 @@
|
||||
"@babel/plugin-transform-runtime": "^7.7.6",
|
||||
"@babel/preset-env": "^7.7.5",
|
||||
"@babel/runtime": "^7.9.6",
|
||||
"@medusajs/medusa": "^1.3.2",
|
||||
"@medusajs/medusa": "^1.3.3",
|
||||
"client-sessions": "^0.8.0",
|
||||
"cross-env": "^5.2.1",
|
||||
"eslint": "^6.8.0",
|
||||
|
||||
@@ -287,19 +287,21 @@ class WebshipperFulfillmentService extends FulfillmentService {
|
||||
fulfillmentItems
|
||||
)
|
||||
|
||||
invoice = await this.client_.documents
|
||||
.create({
|
||||
type: "documents",
|
||||
attributes: {
|
||||
document_size: this.options_.document_size || "A4",
|
||||
document_format: "PDF",
|
||||
base64: base64Invoice,
|
||||
document_type: "invoice",
|
||||
},
|
||||
})
|
||||
.catch((err) => {
|
||||
throw err
|
||||
})
|
||||
if (base64Invoice) {
|
||||
invoice = await this.client_.documents
|
||||
.create({
|
||||
type: "documents",
|
||||
attributes: {
|
||||
document_size: this.options_.document_size || "A4",
|
||||
document_format: "PDF",
|
||||
base64: base64Invoice,
|
||||
document_type: "invoice",
|
||||
},
|
||||
})
|
||||
.catch((err) => {
|
||||
throw err
|
||||
})
|
||||
}
|
||||
|
||||
const cooCountries = this.options_.coo_countries
|
||||
if (
|
||||
@@ -621,19 +623,17 @@ class WebshipperFulfillmentService extends FulfillmentService {
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
if (order) {
|
||||
if (
|
||||
order.data.attributes.status !== "pending" &&
|
||||
order.data.attributes.status !== "missing_rate"
|
||||
) {
|
||||
if (order.data.attributes.status === "cancelled") {
|
||||
return Promise.resolve(order)
|
||||
}
|
||||
throw new Error("Cannot cancel order")
|
||||
}
|
||||
if (this.options_.delete_on_cancel) {
|
||||
return await this.client_.orders.delete(data.id)
|
||||
}
|
||||
|
||||
return this.client_.orders.delete(data.id)
|
||||
return await this.client_.orders.update(data.id, {
|
||||
id: data.id,
|
||||
type: "orders",
|
||||
attributes: {
|
||||
status: "cancelled",
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,16 @@ class Webshipper {
|
||||
},
|
||||
}).then(({ data }) => data)
|
||||
},
|
||||
update: async (id, data) => {
|
||||
const path = `/v2/orders/${id}`
|
||||
return this.client_({
|
||||
method: "PATCH",
|
||||
url: path,
|
||||
data: {
|
||||
data,
|
||||
},
|
||||
}).then(({ data }) => data)
|
||||
},
|
||||
delete: async (id) => {
|
||||
const path = `/v2/orders/${id}`
|
||||
return this.client_({
|
||||
|
||||
Reference in New Issue
Block a user