Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Sebastian Rindom
2021-05-06 14:17:35 +02:00
15 changed files with 71 additions and 9 deletions
+2
View File
@@ -1,2 +1,4 @@
dist/ dist/
node_modules/ node_modules/
.env
+1
View File
@@ -3,3 +3,4 @@ src
.eslintrc .eslintrc
.gitignore .gitignore
.prettierrc .prettierrc
.env
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.8](https://github.com/medusajs/medusa/compare/@medusajs/medusa-cli@1.1.7...@medusajs/medusa-cli@1.1.8) (2021-05-05)
**Note:** Version bump only for package @medusajs/medusa-cli
## [1.1.7](https://github.com/medusajs/medusa/compare/@medusajs/medusa-cli@1.1.4...@medusajs/medusa-cli@1.1.7) (2021-04-28) ## [1.1.7](https://github.com/medusajs/medusa/compare/@medusajs/medusa-cli@1.1.4...@medusajs/medusa-cli@1.1.7) (2021-04-28)
**Note:** Version bump only for package @medusajs/medusa-cli **Note:** Version bump only for package @medusajs/medusa-cli
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "medusa-cli", "name": "medusa-cli",
"version": "1.1.7", "version": "1.1.8",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@medusajs/medusa-cli", "name": "@medusajs/medusa-cli",
"version": "1.1.7", "version": "1.1.8",
"description": "Command Line interface for Medusa Commerce", "description": "Command Line interface for Medusa Commerce",
"main": "dist/index.js", "main": "dist/index.js",
"bin": { "bin": {
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.13](https://github.com/medusajs/medusa/compare/medusa-fulfillment-webshipper@1.1.12...medusa-fulfillment-webshipper@1.1.13) (2021-05-05)
**Note:** Version bump only for package medusa-fulfillment-webshipper
## [1.1.12](https://github.com/medusajs/medusa/compare/medusa-fulfillment-webshipper@1.1.9...medusa-fulfillment-webshipper@1.1.12) (2021-04-28) ## [1.1.12](https://github.com/medusajs/medusa/compare/medusa-fulfillment-webshipper@1.1.9...medusa-fulfillment-webshipper@1.1.12) (2021-04-28)
**Note:** Version bump only for package medusa-fulfillment-webshipper **Note:** Version bump only for package medusa-fulfillment-webshipper
@@ -12,4 +12,5 @@ A webhook listener is exposed at `/webshipper/shipments` to listen for shipment
api_token: [a webshipper api token] (required) api_token: [a webshipper api token] (required)
order_channel_id: [the channel id to register orders on] (required) order_channel_id: [the channel id to register orders on] (required)
webhook_secret: [the webhook secret used to listen for shipments] (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")
``` ```
@@ -1,6 +1,6 @@
{ {
"name": "medusa-fulfillment-webshipper", "name": "medusa-fulfillment-webshipper",
"version": "1.1.12", "version": "1.1.13",
"description": "Webshipper Fulfillment provider for Medusa", "description": "Webshipper Fulfillment provider for Medusa",
"main": "index.js", "main": "index.js",
"repository": { "repository": {
@@ -9,6 +9,16 @@ class WebshipperFulfillmentService extends FulfillmentService {
this.options_ = options this.options_ = options
if (!options.coo_countries) {
this.options_.coo_countries = ["all"]
} else if (Array.isArray(options.coo_countries)) {
this.options_.coo_countries = options.coo_countries.map((c) =>
c.toLowerCase()
)
} else if (typeof options.coo_countries === "string") {
this.options_.coo_countries = [options.coo_countries]
}
/** @private @const {logger} */ /** @private @const {logger} */
this.logger_ = logger this.logger_ = logger
@@ -242,6 +252,8 @@ class WebshipperFulfillmentService extends FulfillmentService {
webshipperOrder = await this.client_.orders.retrieve(existing) webshipperOrder = await this.client_.orders.retrieve(existing)
} }
const { shipping_address } = fromOrder
if (!webshipperOrder) { if (!webshipperOrder) {
let invoice let invoice
let certificateOfOrigin let certificateOfOrigin
@@ -266,7 +278,14 @@ class WebshipperFulfillmentService extends FulfillmentService {
throw err throw err
}) })
if (this.invoiceGenerator_.createCertificateOfOrigin) { const cooCountries = this.options_.coo_countries
if (
(cooCountries.includes("all") ||
cooCountries.includes(
shipping_address.country_code.toLowerCase()
)) &&
this.invoiceGenerator_.createCertificateOfOrigin
) {
const base64Coo = await this.invoiceGenerator_.createCertificateOfOrigin( const base64Coo = await this.invoiceGenerator_.createCertificateOfOrigin(
fromOrder, fromOrder,
fulfillmentItems fulfillmentItems
@@ -297,7 +316,6 @@ class WebshipperFulfillmentService extends FulfillmentService {
visible_ref = `S-${fromOrder.display_id}` visible_ref = `S-${fromOrder.display_id}`
} }
const { shipping_address } = fromOrder
const newOrder = { const newOrder = {
type: "orders", type: "orders",
attributes: { attributes: {
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.0.13](https://github.com/medusajs/medusa/compare/medusa-payment-paypal@1.0.12...medusa-payment-paypal@1.0.13) (2021-04-29)
**Note:** Version bump only for package medusa-payment-paypal
## [1.0.12](https://github.com/medusajs/medusa/compare/medusa-payment-paypal@1.0.9...medusa-payment-paypal@1.0.12) (2021-04-28) ## [1.0.12](https://github.com/medusajs/medusa/compare/medusa-payment-paypal@1.0.9...medusa-payment-paypal@1.0.12) (2021-04-28)
**Note:** Version bump only for package medusa-payment-paypal **Note:** Version bump only for package medusa-payment-paypal
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "medusa-payment-paypal", "name": "medusa-payment-paypal",
"version": "1.0.12", "version": "1.0.13",
"description": "Paypal Payment provider for Meduas Commerce", "description": "Paypal Payment provider for Meduas Commerce",
"main": "index.js", "main": "index.js",
"repository": { "repository": {
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [0.0.7](https://github.com/medusajs/medusa/compare/medusa-plugin-restock-notification@0.0.6...medusa-plugin-restock-notification@0.0.7) (2021-04-29)
**Note:** Version bump only for package medusa-plugin-restock-notification
## [0.0.6](https://github.com/medusajs/medusa/compare/medusa-plugin-restock-notification@0.0.3...medusa-plugin-restock-notification@0.0.6) (2021-04-28) ## [0.0.6](https://github.com/medusajs/medusa/compare/medusa-plugin-restock-notification@0.0.3...medusa-plugin-restock-notification@0.0.6) (2021-04-28)
**Note:** Version bump only for package medusa-plugin-restock-notification **Note:** Version bump only for package medusa-plugin-restock-notification
@@ -1,6 +1,6 @@
{ {
"name": "medusa-plugin-restock-notification", "name": "medusa-plugin-restock-notification",
"version": "0.0.6", "version": "0.0.7",
"main": "index.js", "main": "index.js",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -14,7 +14,7 @@
"@babel/core": "^7.7.5", "@babel/core": "^7.7.5",
"@babel/plugin-transform-typescript": "^7.13.0", "@babel/plugin-transform-typescript": "^7.13.0",
"@babel/preset-typescript": "^7.12.7", "@babel/preset-typescript": "^7.12.7",
"@medusajs/medusa": "^1.1.22", "@medusajs/medusa": "^1.1.23",
"babel-preset-medusa-package": "^1.1.3", "babel-preset-medusa-package": "^1.1.3",
"cross-env": "^5.2.1", "cross-env": "^5.2.1",
"eslint": "^6.8.0", "eslint": "^6.8.0",
+8
View File
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file. All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [1.1.23](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.22...@medusajs/medusa@1.1.23) (2021-04-29)
**Note:** Version bump only for package @medusajs/medusa
## [1.1.22](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.19...@medusajs/medusa@1.1.22) (2021-04-28) ## [1.1.22](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.19...@medusajs/medusa@1.1.22) (2021-04-28)
**Note:** Version bump only for package @medusajs/medusa **Note:** Version bump only for package @medusajs/medusa
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "@medusajs/medusa", "name": "@medusajs/medusa",
"version": "1.1.22", "version": "1.1.23",
"description": "E-commerce for JAMstack", "description": "E-commerce for JAMstack",
"main": "dist/index.js", "main": "dist/index.js",
"repository": { "repository": {