diff --git a/packages/medusa-cli/.gitignore b/packages/medusa-cli/.gitignore index 1eae0cf670..41bdfcc44f 100644 --- a/packages/medusa-cli/.gitignore +++ b/packages/medusa-cli/.gitignore @@ -1,2 +1,4 @@ dist/ node_modules/ + +.env diff --git a/packages/medusa-cli/.npmignore b/packages/medusa-cli/.npmignore index b4f578ee4c..15ab14bd51 100644 --- a/packages/medusa-cli/.npmignore +++ b/packages/medusa-cli/.npmignore @@ -3,3 +3,4 @@ src .eslintrc .gitignore .prettierrc +.env diff --git a/packages/medusa-cli/CHANGELOG.md b/packages/medusa-cli/CHANGELOG.md index 80980cedb9..5ae8bc54f2 100644 --- a/packages/medusa-cli/CHANGELOG.md +++ b/packages/medusa-cli/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. 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) **Note:** Version bump only for package @medusajs/medusa-cli diff --git a/packages/medusa-cli/package-lock.json b/packages/medusa-cli/package-lock.json index 6f1dfa3fa5..4ab942d7eb 100644 --- a/packages/medusa-cli/package-lock.json +++ b/packages/medusa-cli/package-lock.json @@ -1,6 +1,6 @@ { "name": "medusa-cli", - "version": "1.1.7", + "version": "1.1.8", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/packages/medusa-cli/package.json b/packages/medusa-cli/package.json index 05743bc56a..7071b17b61 100644 --- a/packages/medusa-cli/package.json +++ b/packages/medusa-cli/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/medusa-cli", - "version": "1.1.7", + "version": "1.1.8", "description": "Command Line interface for Medusa Commerce", "main": "dist/index.js", "bin": { diff --git a/packages/medusa-fulfillment-webshipper/CHANGELOG.md b/packages/medusa-fulfillment-webshipper/CHANGELOG.md index c9be760993..c0a656a618 100644 --- a/packages/medusa-fulfillment-webshipper/CHANGELOG.md +++ b/packages/medusa-fulfillment-webshipper/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. 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) **Note:** Version bump only for package medusa-fulfillment-webshipper diff --git a/packages/medusa-fulfillment-webshipper/README.md b/packages/medusa-fulfillment-webshipper/README.md index 8055be0b42..5ec1d6ec1e 100644 --- a/packages/medusa-fulfillment-webshipper/README.md +++ b/packages/medusa-fulfillment-webshipper/README.md @@ -12,4 +12,5 @@ A webhook listener is exposed at `/webshipper/shipments` to listen for shipment api_token: [a webshipper api token] (required) 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") ``` diff --git a/packages/medusa-fulfillment-webshipper/package.json b/packages/medusa-fulfillment-webshipper/package.json index 497eb83bed..dde8f0abff 100644 --- a/packages/medusa-fulfillment-webshipper/package.json +++ b/packages/medusa-fulfillment-webshipper/package.json @@ -1,6 +1,6 @@ { "name": "medusa-fulfillment-webshipper", - "version": "1.1.12", + "version": "1.1.13", "description": "Webshipper Fulfillment provider for Medusa", "main": "index.js", "repository": { diff --git a/packages/medusa-fulfillment-webshipper/src/services/webshipper-fulfillment.js b/packages/medusa-fulfillment-webshipper/src/services/webshipper-fulfillment.js index 7348c422c5..308c1d4edb 100644 --- a/packages/medusa-fulfillment-webshipper/src/services/webshipper-fulfillment.js +++ b/packages/medusa-fulfillment-webshipper/src/services/webshipper-fulfillment.js @@ -9,6 +9,16 @@ class WebshipperFulfillmentService extends FulfillmentService { 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} */ this.logger_ = logger @@ -242,6 +252,8 @@ class WebshipperFulfillmentService extends FulfillmentService { webshipperOrder = await this.client_.orders.retrieve(existing) } + const { shipping_address } = fromOrder + if (!webshipperOrder) { let invoice let certificateOfOrigin @@ -266,7 +278,14 @@ class WebshipperFulfillmentService extends FulfillmentService { 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( fromOrder, fulfillmentItems @@ -297,7 +316,6 @@ class WebshipperFulfillmentService extends FulfillmentService { visible_ref = `S-${fromOrder.display_id}` } - const { shipping_address } = fromOrder const newOrder = { type: "orders", attributes: { diff --git a/packages/medusa-payment-paypal/CHANGELOG.md b/packages/medusa-payment-paypal/CHANGELOG.md index 921a32fc49..bd27ee3722 100644 --- a/packages/medusa-payment-paypal/CHANGELOG.md +++ b/packages/medusa-payment-paypal/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. 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) **Note:** Version bump only for package medusa-payment-paypal diff --git a/packages/medusa-payment-paypal/package.json b/packages/medusa-payment-paypal/package.json index 1c9a8ddb78..24ee838394 100644 --- a/packages/medusa-payment-paypal/package.json +++ b/packages/medusa-payment-paypal/package.json @@ -1,6 +1,6 @@ { "name": "medusa-payment-paypal", - "version": "1.0.12", + "version": "1.0.13", "description": "Paypal Payment provider for Meduas Commerce", "main": "index.js", "repository": { diff --git a/packages/medusa-plugin-restock-notification/CHANGELOG.md b/packages/medusa-plugin-restock-notification/CHANGELOG.md index 01f8f5434d..307646a2e0 100644 --- a/packages/medusa-plugin-restock-notification/CHANGELOG.md +++ b/packages/medusa-plugin-restock-notification/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. 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) **Note:** Version bump only for package medusa-plugin-restock-notification diff --git a/packages/medusa-plugin-restock-notification/package.json b/packages/medusa-plugin-restock-notification/package.json index ecb754ea41..176fbf5afb 100644 --- a/packages/medusa-plugin-restock-notification/package.json +++ b/packages/medusa-plugin-restock-notification/package.json @@ -1,6 +1,6 @@ { "name": "medusa-plugin-restock-notification", - "version": "0.0.6", + "version": "0.0.7", "main": "index.js", "repository": { "type": "git", @@ -14,7 +14,7 @@ "@babel/core": "^7.7.5", "@babel/plugin-transform-typescript": "^7.13.0", "@babel/preset-typescript": "^7.12.7", - "@medusajs/medusa": "^1.1.22", + "@medusajs/medusa": "^1.1.23", "babel-preset-medusa-package": "^1.1.3", "cross-env": "^5.2.1", "eslint": "^6.8.0", diff --git a/packages/medusa/CHANGELOG.md b/packages/medusa/CHANGELOG.md index 4353dede7f..09681517c4 100644 --- a/packages/medusa/CHANGELOG.md +++ b/packages/medusa/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. 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) **Note:** Version bump only for package @medusajs/medusa diff --git a/packages/medusa/package.json b/packages/medusa/package.json index fbcd41a926..da3c658607 100644 --- a/packages/medusa/package.json +++ b/packages/medusa/package.json @@ -1,6 +1,6 @@ { "name": "@medusajs/medusa", - "version": "1.1.22", + "version": "1.1.23", "description": "E-commerce for JAMstack", "main": "dist/index.js", "repository": {