From a610805917ee930d4cebde74905e541a468aa83b Mon Sep 17 00:00:00 2001 From: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com> Date: Thu, 24 Mar 2022 16:47:50 +0100 Subject: [PATCH] feat: Add DiscountConditions (#1230) * feat: Add DiscountCondition entity + Join table per relation (#1146) * feat: Convert DiscountService to TypeScript (#1149) * feat: Add DiscountRepository + bulk insert and remove (#1156) * feat: Add `conditions` to payload in `POST /discounts` and `POST /discounts/:id` (#1170) * feat: Add DiscountRuleCondition entity * fix relation * fix join key * Add discount rule condition repo * add join table per relation * Convert DiscountService to TypeScript * feat: Add DiscountConditionRepository * Add migration + remove use of valid_for * revert changes to files, not done yet * init work on create discount endpoint * Add conditions to create discount endpoint * Add conditions to update discount endpoint * Add unique constraint to discount condition * integration tests passing * fix imports of models * fix tests (excluding totals calculations) * Fix commented code * add unique constraint on discount condition * Add generic way of generating retrieve configs * Requested changes + ExactlyOne validator * Remove isLocal flag from error handler * Use postgres error constant * remove commented code * feat: Add `isValidForProduct` to check if Discount is valid for a given Product (#1172) * feat: Add `canApplyForCustomer` to check if Discount is valid for customer groups (#1212) * feat: Add `calculateDiscountForLineItem` (#1224) * feat: Adds discount condition test factory (#1228) * Remove use of valid_for * Tests passing * Remove valid_for form relations * Add integration tests for applying discounts to cart --- .../api/__tests__/admin/discount.js | 564 +++- integration-tests/api/__tests__/store/cart.js | 352 +++ .../api/factories/simple-cart-factory.ts | 34 +- .../api/factories/simple-customer-factory.ts | 46 + .../simple-customer-group-factory.ts | 31 + .../simple-discount-condition-factory.ts | 116 + .../api/factories/simple-discount-factory.ts | 21 +- .../api/factories/simple-product-factory.ts | 56 +- integration-tests/api/package.json | 6 +- integration-tests/api/yarn.lock | 2376 ++++++++--------- .../src/services/webshipper-fulfillment.js | 13 +- .../src/subscribers/order.js | 3 - .../src/services/sendgrid.js | 12 +- .../src/services/slack.js | 7 +- .../customer-groups/list-customer-groups.ts | 11 +- .../admin/discounts/__tests__/add-region.js | 2 +- .../discounts/__tests__/add-valid-product.js | 2 +- .../discounts/__tests__/create-discount.js | 43 + .../admin/discounts/__tests__/get-discount.js | 2 +- .../discounts/__tests__/remove-region.js | 2 +- .../__tests__/remove-valid-product.js | 2 +- .../routes/admin/discounts/create-discount.ts | 55 +- .../admin/discounts/create-dynamic-code.ts | 5 +- .../admin/discounts/delete-dynamic-code.ts | 4 +- .../src/api/routes/admin/discounts/index.ts | 4 +- .../routes/admin/discounts/list-discounts.ts | 33 +- .../routes/admin/discounts/update-discount.ts | 53 +- .../admin/draft-orders/register-payment.ts | 1 - .../admin/orders/__tests__/get-order.js | 1 - .../src/api/routes/admin/orders/index.ts | 8 +- .../admin/tax-rates/utils/get-query-config.ts | 8 +- .../src/api/routes/store/carts/index.ts | 24 +- .../src/api/routes/store/orders/index.ts | 2 - .../1646324713514-discount_conditions.ts | 245 ++ .../discount-condition-customer-group.ts | 66 + .../discount-condition-product-collection.ts | 66 + .../models/discount-condition-product-tag.ts | 66 + .../models/discount-condition-product-type.ts | 66 + .../src/models/discount-condition-product.ts | 66 + .../medusa/src/models/discount-condition.ts | 186 ++ packages/medusa/src/models/discount-rule.ts | 38 +- packages/medusa/src/models/discount.ts | 20 +- .../src/repositories/__mocks__/discount.js | 11 +- .../src/repositories/discount-condition.ts | 305 +++ .../medusa/src/services/__mocks__/discount.js | 21 +- .../medusa/src/services/__tests__/cart.js | 140 +- .../medusa/src/services/__tests__/discount.js | 317 ++- .../medusa/src/services/__tests__/order.js | 41 +- .../medusa/src/services/__tests__/totals.js | 391 ++- packages/medusa/src/services/cart.ts | 84 +- .../src/services/{discount.js => discount.ts} | 413 ++- packages/medusa/src/services/order.js | 28 +- packages/medusa/src/services/return.js | 11 +- packages/medusa/src/services/tax-rate.ts | 10 +- packages/medusa/src/services/totals.ts | 45 +- packages/medusa/src/subscribers/order.js | 18 +- packages/medusa/src/types/common.ts | 2 +- packages/medusa/src/types/discount.ts | 157 +- .../src/types/validators/exactly-one.ts | 31 + packages/medusa/src/utils/get-query-config.ts | 83 + 60 files changed, 4805 insertions(+), 2021 deletions(-) create mode 100644 integration-tests/api/factories/simple-customer-factory.ts create mode 100644 integration-tests/api/factories/simple-customer-group-factory.ts create mode 100644 integration-tests/api/factories/simple-discount-condition-factory.ts create mode 100644 packages/medusa/src/migrations/1646324713514-discount_conditions.ts create mode 100644 packages/medusa/src/models/discount-condition-customer-group.ts create mode 100644 packages/medusa/src/models/discount-condition-product-collection.ts create mode 100644 packages/medusa/src/models/discount-condition-product-tag.ts create mode 100644 packages/medusa/src/models/discount-condition-product-type.ts create mode 100644 packages/medusa/src/models/discount-condition-product.ts create mode 100644 packages/medusa/src/models/discount-condition.ts create mode 100644 packages/medusa/src/repositories/discount-condition.ts rename packages/medusa/src/services/{discount.js => discount.ts} (56%) create mode 100644 packages/medusa/src/types/validators/exactly-one.ts create mode 100644 packages/medusa/src/utils/get-query-config.ts diff --git a/integration-tests/api/__tests__/admin/discount.js b/integration-tests/api/__tests__/admin/discount.js index fcac4a9f4c..50e1077d8d 100644 --- a/integration-tests/api/__tests__/admin/discount.js +++ b/integration-tests/api/__tests__/admin/discount.js @@ -1,5 +1,11 @@ const path = require("path") -const { Region, DiscountRule, Discount } = require("@medusajs/medusa") +const { + Region, + DiscountRule, + Discount, + Customer, + CustomerGroup, +} = require("@medusajs/medusa") const setupServer = require("../../../helpers/setup-server") const { useApi } = require("../../../helpers/use-api") @@ -7,6 +13,10 @@ const { initDb, useDb } = require("../../../helpers/use-db") const adminSeeder = require("../../helpers/admin-seeder") const discountSeeder = require("../../helpers/discount-seeder") const { exportAllDeclaration } = require("@babel/types") +const { simpleProductFactory } = require("../../factories") +const { + simpleDiscountFactory, +} = require("../../factories/simple-discount-factory") jest.setTimeout(30000) @@ -26,6 +36,153 @@ describe("/admin/discounts", () => { medusaProcess.kill() }) + describe("GET /admin/discounts/:id", () => { + beforeEach(async () => { + const manager = dbConnection.manager + await adminSeeder(dbConnection) + + await manager.insert(DiscountRule, { + id: "test-discount-rule-fixed", + description: "Test discount rule", + type: "fixed", + value: 10, + allocation: "total", + }) + + const prod = await simpleProductFactory(dbConnection, { type: "pants" }) + + await simpleDiscountFactory(dbConnection, { + id: "test-discount", + code: "TEST", + rule: { + type: "percentage", + value: "10", + allocation: "total", + conditions: [ + { + type: "products", + operator: "in", + products: [prod.id], + }, + { + type: "product_types", + operator: "not_in", + product_types: [prod.type_id], + }, + ], + }, + }) + }) + + afterEach(async () => { + const db = useDb() + await db.teardown() + }) + + it("should retrieve discount with customer conditions created with factory", async () => { + const api = useApi() + + const group = await dbConnection.manager.insert(CustomerGroup, { + id: "customer-group-1", + name: "vip-customers", + }) + + await dbConnection.manager.insert(Customer, { + id: "cus_1234", + email: "oli@email.com", + groups: [group], + }) + + await simpleDiscountFactory(dbConnection, { + id: "test-discount", + code: "TEST", + rule: { + type: "percentage", + value: "10", + allocation: "total", + conditions: [ + { + type: "customer_groups", + operator: "in", + customer_groups: ["customer-group-1"], + }, + ], + }, + }) + + const response = await api + .get( + "/admin/discounts/test-discount?expand=rule,rule.conditions,rule.conditions.customer_groups", + { + headers: { + Authorization: "Bearer test_token", + }, + } + ) + .catch((err) => { + console.log(err) + }) + + const disc = response.data.discount + expect(response.status).toEqual(200) + expect(disc).toEqual( + expect.objectContaining({ + id: "test-discount", + code: "TEST", + }) + ) + expect(disc.rule.conditions).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + type: "customer_groups", + operator: "in", + discount_rule_id: disc.rule.id, + }), + ]) + ) + }) + + it("should retrieve discount with product conditions created with factory", async () => { + const api = useApi() + + const response = await api + .get( + "/admin/discounts/test-discount?expand=rule,rule.conditions,rule.conditions.products,rule.conditions.product_types", + { + headers: { + Authorization: "Bearer test_token", + }, + } + ) + .catch((err) => { + console.log(err) + }) + + const disc = response.data.discount + expect(response.status).toEqual(200) + expect(disc).toEqual( + expect.objectContaining({ + id: "test-discount", + code: "TEST", + }) + ) + expect(disc.rule.conditions).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + type: "products", + operator: "in", + discount_rule_id: disc.rule.id, + }), + expect.objectContaining({ + type: "product_types", + operator: "not_in", + discount_rule_id: disc.rule.id, + }), + ]) + ) + }) + }) + describe("GET /admin/discounts", () => { beforeEach(async () => { const manager = dbConnection.manager @@ -267,25 +424,398 @@ describe("/admin/discounts", () => { usage_limit: 10, }) ) + }) - const test = await api.get( - `/admin/discounts/${response.data.discount.id}`, - { headers: { Authorization: "Bearer test_token" } } - ) + it("creates a discount with conditions", async () => { + const api = useApi() - expect(test.status).toEqual(200) - expect(test.data.discount).toEqual( - expect.objectContaining({ - code: "HELLOWORLD", - usage_limit: 10, - rule: expect.objectContaining({ - value: 10, - type: "percentage", - description: "test", - allocation: "total", - }), + const product = await simpleProductFactory(dbConnection, { + type: "pants", + tags: ["ss22"], + }) + + const anotherProduct = await simpleProductFactory(dbConnection, { + type: "blouses", + tags: ["ss23"], + }) + + const response = await api + .post( + "/admin/discounts", + { + code: "HELLOWORLD", + rule: { + description: "test", + type: "percentage", + value: 10, + allocation: "total", + conditions: [ + { + products: [product.id], + operator: "in", + }, + { + products: [anotherProduct.id], + operator: "not_in", + }, + { + product_types: [product.type_id], + operator: "not_in", + }, + { + product_types: [anotherProduct.type_id], + operator: "in", + }, + { + product_tags: [product.tags[0].id], + operator: "not_in", + }, + { + product_tags: [anotherProduct.tags[0].id], + operator: "in", + }, + ], + }, + usage_limit: 10, + }, + { + headers: { + Authorization: "Bearer test_token", + }, + } + ) + .catch((err) => { + console.log(err) }) - ) + + expect(response.status).toEqual(200) + expect(response.data.discount.rule.conditions).toEqual([ + expect.objectContaining({ + type: "products", + operator: "in", + }), + expect.objectContaining({ + type: "products", + operator: "not_in", + }), + expect.objectContaining({ + type: "product_types", + operator: "not_in", + }), + expect.objectContaining({ + type: "product_types", + operator: "in", + }), + expect.objectContaining({ + type: "product_tags", + operator: "not_in", + }), + expect.objectContaining({ + type: "product_tags", + operator: "in", + }), + ]) + }) + + it("creates a discount with conditions and updates said conditions", async () => { + const api = useApi() + + const product = await simpleProductFactory(dbConnection, { + type: "pants", + }) + + const anotherProduct = await simpleProductFactory(dbConnection, { + type: "pants", + }) + + const response = await api + .post( + "/admin/discounts?expand=rule,rule.conditions", + { + code: "HELLOWORLD", + rule: { + description: "test", + type: "percentage", + value: 10, + allocation: "total", + conditions: [ + { + products: [product.id], + operator: "in", + }, + { + product_types: [product.type_id], + operator: "not_in", + }, + ], + }, + usage_limit: 10, + }, + { + headers: { + Authorization: "Bearer test_token", + }, + } + ) + .catch((err) => { + console.log(err) + }) + + expect(response.status).toEqual(200) + expect(response.data.discount.rule.conditions).toEqual([ + expect.objectContaining({ + type: "products", + operator: "in", + }), + expect.objectContaining({ + type: "product_types", + operator: "not_in", + }), + ]) + + const createdRule = response.data.discount.rule + const condsToUpdate = createdRule.conditions[0] + + const updated = await api + .post( + `/admin/discounts/${response.data.discount.id}?expand=rule,rule.conditions,rule.conditions.products`, + { + rule: { + id: createdRule.id, + type: createdRule.type, + value: createdRule.value, + allocation: createdRule.allocation, + conditions: [ + { + id: condsToUpdate.id, + products: [product.id, anotherProduct.id], + }, + ], + }, + }, + { + headers: { + Authorization: "Bearer test_token", + }, + } + ) + .catch((err) => { + console.log(err) + }) + + expect(updated.status).toEqual(200) + expect(updated.data.discount.rule.conditions).toEqual([ + expect.objectContaining({ + type: "products", + operator: "in", + products: expect.arrayContaining([ + expect.objectContaining({ + id: product.id, + }), + expect.objectContaining({ + id: anotherProduct.id, + }), + ]), + }), + expect.objectContaining({ + type: "product_types", + operator: "not_in", + }), + ]) + }) + + it("fails to add condition on rule with existing comb. of type and operator", async () => { + const api = useApi() + + const product = await simpleProductFactory(dbConnection, { + type: "pants", + }) + + const anotherProduct = await simpleProductFactory(dbConnection, { + type: "pants", + }) + + const response = await api + .post( + "/admin/discounts", + { + code: "HELLOWORLD", + rule: { + description: "test", + type: "percentage", + value: 10, + allocation: "total", + conditions: [ + { + products: [product.id], + operator: "in", + }, + ], + }, + usage_limit: 10, + }, + { + headers: { + Authorization: "Bearer test_token", + }, + } + ) + .catch((err) => { + console.log(err) + }) + + expect(response.status).toEqual(200) + + const createdRule = response.data.discount.rule + + try { + await api.post( + `/admin/discounts/${response.data.discount.id}?expand=rule,rule.conditions,rule.conditions.products`, + { + rule: { + id: createdRule.id, + type: createdRule.type, + value: createdRule.value, + allocation: createdRule.allocation, + conditions: [ + { + products: [anotherProduct.id], + operator: "in", + }, + ], + }, + }, + { + headers: { + Authorization: "Bearer test_token", + }, + } + ) + } catch (error) { + console.log(error) + expect(error.response.data.type).toEqual("duplicate_error") + expect(error.response.data.message).toEqual( + `Discount Condition with operator 'in' and type 'products' already exist on a Discount Rule` + ) + } + }) + + it("fails if multiple types of resources are provided on create", async () => { + const api = useApi() + + const product = await simpleProductFactory(dbConnection, { + type: "pants", + }) + + try { + await api.post( + "/admin/discounts", + { + code: "HELLOWORLD", + rule: { + description: "test", + type: "percentage", + value: 10, + allocation: "total", + conditions: [ + { + products: [product.id], + product_types: [product.type_id], + operator: "in", + }, + ], + }, + usage_limit: 10, + }, + { + headers: { + Authorization: "Bearer test_token", + }, + } + ) + } catch (error) { + expect(error.response.data.type).toEqual("invalid_data") + expect(error.response.data.message).toEqual( + "Only one of products, product_types is allowed, Only one of product_types, products is allowed" + ) + } + }) + + it("fails if multiple types of resources are provided on update", async () => { + const api = useApi() + + const product = await simpleProductFactory(dbConnection, { + type: "pants", + }) + + const anotherProduct = await simpleProductFactory(dbConnection, { + type: "pants", + }) + + const response = await api + .post( + "/admin/discounts", + { + code: "HELLOWORLD", + rule: { + description: "test", + type: "percentage", + value: 10, + allocation: "total", + conditions: [ + { + products: [product.id], + operator: "in", + }, + ], + }, + usage_limit: 10, + }, + { + headers: { + Authorization: "Bearer test_token", + }, + } + ) + .catch((err) => { + console.log(err) + }) + + expect(response.status).toEqual(200) + + const createdRule = response.data.discount.rule + + try { + await api.post( + `/admin/discounts/${response.data.discount.id}?expand=rule,rule.conditions,rule.conditions.products`, + { + rule: { + id: createdRule.id, + type: createdRule.type, + value: createdRule.value, + allocation: createdRule.allocation, + conditions: [ + { + products: [anotherProduct.id], + product_types: [product.type_id], + operator: "in", + }, + ], + }, + }, + { + headers: { + Authorization: "Bearer test_token", + }, + } + ) + } catch (error) { + console.log(error) + expect(error.response.data.type).toEqual("invalid_data") + expect(error.response.data.message).toEqual( + `Only one of products, product_types is allowed, Only one of product_types, products is allowed` + ) + } }) it("creates a discount and updates it", async () => { diff --git a/integration-tests/api/__tests__/store/cart.js b/integration-tests/api/__tests__/store/cart.js index f8206715e4..6bd49c222e 100644 --- a/integration-tests/api/__tests__/store/cart.js +++ b/integration-tests/api/__tests__/store/cart.js @@ -16,6 +16,16 @@ const { initDb, useDb } = require("../../../helpers/use-db") const cartSeeder = require("../../helpers/cart-seeder") const productSeeder = require("../../helpers/product-seeder") const swapSeeder = require("../../helpers/swap-seeder") +const { simpleCartFactory } = require("../../factories") +const { + simpleDiscountFactory, +} = require("../../factories/simple-discount-factory") +const { + simpleCustomerFactory, +} = require("../../factories/simple-customer-factory") +const { + simpleCustomerGroupFactory, +} = require("../../factories/simple-customer-group-factory") jest.setTimeout(30000) @@ -354,6 +364,348 @@ describe("/store/carts", () => { }) }) + it("successfully passes customer conditions with `in` operator and applies discount", async () => { + const api = useApi() + + await simpleCustomerFactory(dbConnection, { + id: "cus_1234", + email: "oli@medusajs.com", + groups: [ + { + id: "customer-group-1", + name: "VIP Customer", + }, + ], + }) + + await simpleCustomerGroupFactory(dbConnection, { + id: "customer-group-2", + name: "Loyal", + }) + + await simpleCartFactory( + dbConnection, + { + id: "test-customer-discount", + region: { + id: "test-region", + name: "Test region", + tax_rate: 12, + }, + customer: "cus_1234", + line_items: [ + { + variant_id: "test-variant", + unit_price: 100, + }, + ], + }, + 100 + ) + + await simpleDiscountFactory(dbConnection, { + id: "test-discount", + code: "TEST", + regions: ["test-region"], + rule: { + type: "percentage", + value: "10", + allocation: "total", + conditions: [ + { + type: "customer_groups", + operator: "in", + customer_groups: ["customer-group-1", "customer-group-2"], + }, + ], + }, + }) + + const response = await api.post("/store/carts/test-customer-discount", { + discounts: [{ code: "TEST" }], + }) + + const cartRes = response.data.cart + expect(cartRes.discounts).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + code: "TEST", + }), + ]) + ) + expect(response.status).toEqual(200) + }) + + it("successfully passes customer conditions with `not_in` operator and applies discount", async () => { + const api = useApi() + + await simpleCustomerFactory(dbConnection, { + id: "cus_1234", + email: "oli@medusajs.com", + groups: [ + { + id: "customer-group-2", + name: "VIP Customer", + }, + ], + }) + + await simpleCustomerGroupFactory(dbConnection, { + id: "customer-group-1", + name: "Customer group 1", + }) + + await simpleCustomerGroupFactory(dbConnection, { + id: "customer-group-3", + name: "Customer group 3", + }) + + await simpleCartFactory( + dbConnection, + { + id: "test-customer-discount", + region: { + id: "test-region", + name: "Test region", + tax_rate: 12, + }, + customer: "cus_1234", + line_items: [ + { + variant_id: "test-variant", + unit_price: 100, + }, + ], + }, + 100 + ) + + await simpleDiscountFactory(dbConnection, { + id: "test-discount", + code: "TEST", + regions: ["test-region"], + rule: { + type: "percentage", + value: "10", + allocation: "total", + conditions: [ + { + type: "customer_groups", + operator: "not_in", + customer_groups: ["customer-group-1", "customer-group-3"], + }, + ], + }, + }) + + const response = await api.post("/store/carts/test-customer-discount", { + discounts: [{ code: "TEST" }], + }) + + const cartRes = response.data.cart + expect(cartRes.discounts).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + code: "TEST", + }), + ]) + ) + expect(response.status).toEqual(200) + }) + + it("successfully applies discount in case no conditions is defined for group", async () => { + const api = useApi() + + await simpleCustomerFactory(dbConnection, { + id: "cus_1234", + email: "oli@medusajs.com", + groups: [ + { + id: "customer-group-1", + name: "VIP Customer", + }, + ], + }) + + await simpleCartFactory( + dbConnection, + { + id: "test-customer-discount", + region: { + id: "test-region", + name: "Test region", + tax_rate: 12, + }, + customer: "cus_1234", + line_items: [ + { + variant_id: "test-variant", + unit_price: 100, + }, + ], + }, + 100 + ) + + await simpleDiscountFactory(dbConnection, { + id: "test-discount", + code: "TEST", + regions: ["test-region"], + rule: { + type: "percentage", + value: "10", + allocation: "total", + }, + }) + + const response = await api.post("/store/carts/test-customer-discount", { + discounts: [{ code: "TEST" }], + }) + + const cartRes = response.data.cart + expect(cartRes.discounts).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + code: "TEST", + }), + ]) + ) + expect(response.status).toEqual(200) + }) + + it("fails to apply discount if customer group is part of `not_in` conditions", async () => { + const api = useApi() + + await simpleCustomerFactory(dbConnection, { + id: "cus_1234", + email: "oli@medusajs.com", + groups: [ + { + id: "customer-group-1", + name: "VIP Customer", + }, + ], + }) + + await simpleCartFactory( + dbConnection, + { + id: "test-customer-discount", + region: { + id: "test-region", + name: "Test region", + tax_rate: 12, + }, + customer: "cus_1234", + line_items: [ + { + variant_id: "test-variant", + unit_price: 100, + }, + ], + }, + 100 + ) + + await simpleDiscountFactory(dbConnection, { + id: "test-discount", + code: "TEST", + regions: ["test-region"], + rule: { + type: "percentage", + value: "10", + allocation: "total", + conditions: [ + { + type: "customer_groups", + operator: "not_in", + customer_groups: ["customer-group-1"], + }, + ], + }, + }) + + try { + await api.post("/store/carts/test-customer-discount", { + discounts: [{ code: "TEST" }], + }) + } catch (error) { + expect(error.response.status).toEqual(400) + expect(error.response.data.message).toEqual( + "Discount is not valid for customer" + ) + } + }) + + it("fails to apply discount if customer group is not part of `in` conditions", async () => { + const api = useApi() + + await simpleCustomerFactory(dbConnection, { + id: "cus_1234", + email: "oli@medusajs.com", + groups: [ + { + id: "customer-group-2", + name: "VIP Customer", + }, + ], + }) + + await simpleCustomerGroupFactory(dbConnection, { + id: "customer-group-1", + name: "Customer group 1", + }) + + await simpleCartFactory( + dbConnection, + { + id: "test-customer-discount", + region: { + id: "test-region", + name: "Test region", + tax_rate: 12, + }, + customer: "cus_1234", + line_items: [ + { + variant_id: "test-variant", + unit_price: 100, + }, + ], + }, + 100 + ) + + await simpleDiscountFactory(dbConnection, { + id: "test-discount", + code: "TEST", + regions: ["test-region"], + rule: { + type: "percentage", + value: "10", + allocation: "total", + conditions: [ + { + type: "customer_groups", + operator: "in", + customer_groups: ["customer-group-1"], + }, + ], + }, + }) + + try { + await api.post("/store/carts/test-customer-discount", { + discounts: [{ code: "TEST" }], + }) + } catch (error) { + expect(error.response.status).toEqual(400) + expect(error.response.data.message).toEqual( + "Discount is not valid for customer" + ) + } + }) + it("fails to apply expired discount", async () => { expect.assertions(2) const api = useApi() diff --git a/integration-tests/api/factories/simple-cart-factory.ts b/integration-tests/api/factories/simple-cart-factory.ts index 33a10cff75..61cee1a2cf 100644 --- a/integration-tests/api/factories/simple-cart-factory.ts +++ b/integration-tests/api/factories/simple-cart-factory.ts @@ -1,16 +1,16 @@ -import { Connection } from "typeorm" -import faker from "faker" import { Cart } from "@medusajs/medusa" - -import { RegionFactoryData, simpleRegionFactory } from "./simple-region-factory" -import { - LineItemFactoryData, - simpleLineItemFactory, -} from "./simple-line-item-factory" +import faker from "faker" +import { Connection } from "typeorm" import { AddressFactoryData, simpleAddressFactory, } from "./simple-address-factory" +import { simpleCustomerFactory } from "./simple-customer-factory" +import { + LineItemFactoryData, + simpleLineItemFactory, +} from "./simple-line-item-factory" +import { RegionFactoryData, simpleRegionFactory } from "./simple-region-factory" import { ShippingMethodFactoryData, simpleShippingMethodFactory, @@ -18,6 +18,7 @@ import { export type CartFactoryData = { id?: string + customer?: string | { email: string } region?: RegionFactoryData | string email?: string | null line_items?: LineItemFactoryData[] @@ -43,6 +44,22 @@ export const simpleCartFactory = async ( const region = await simpleRegionFactory(connection, data.region) regionId = region.id } + + let customerId: string + if (typeof data.customer === "string") { + customerId = data.customer + } else { + if (data?.customer?.email) { + const customer = await simpleCustomerFactory(connection, data.customer) + customerId = customer.id + } else if (data.email) { + const customer = await simpleCustomerFactory(connection, { + email: data.email, + }) + customerId = customer.id + } + } + const address = await simpleAddressFactory(connection, data.shipping_address) const id = data.id || `simple-cart-${Math.random() * 1000}` @@ -51,6 +68,7 @@ export const simpleCartFactory = async ( email: typeof data.email !== "undefined" ? data.email : faker.internet.email(), region_id: regionId, + customer_id: customerId, shipping_address_id: address.id, }) diff --git a/integration-tests/api/factories/simple-customer-factory.ts b/integration-tests/api/factories/simple-customer-factory.ts new file mode 100644 index 0000000000..2fd48c02f6 --- /dev/null +++ b/integration-tests/api/factories/simple-customer-factory.ts @@ -0,0 +1,46 @@ +import { Customer } from "@medusajs/medusa" +import faker from "faker" +import { Connection } from "typeorm" +import { + CustomerGroupFactoryData, + simpleCustomerGroupFactory, +} from "./simple-customer-group-factory" + +export type CustomerFactoryData = { + id?: string + email?: string + groups?: CustomerGroupFactoryData[] +} + +export const simpleCustomerFactory = async ( + connection: Connection, + data: CustomerFactoryData = {}, + seed?: number +): Promise => { + if (typeof seed !== "undefined") { + faker.seed(seed) + } + + const manager = connection.manager + + const customerId = data.id || `simple-customer-${Math.random() * 1000}` + const c = manager.create(Customer, { + id: customerId, + email: data.email, + }) + + const customer = await manager.save(c) + + if (data.groups) { + const groups = [] + for (const g of data.groups) { + const created = await simpleCustomerGroupFactory(connection, g) + groups.push(created) + } + + customer.groups = groups + await manager.save(customer) + } + + return customer +} diff --git a/integration-tests/api/factories/simple-customer-group-factory.ts b/integration-tests/api/factories/simple-customer-group-factory.ts new file mode 100644 index 0000000000..7afa566ff9 --- /dev/null +++ b/integration-tests/api/factories/simple-customer-group-factory.ts @@ -0,0 +1,31 @@ +import { CustomerGroup } from "@medusajs/medusa" +import faker from "faker" +import { Connection } from "typeorm" + +export type CustomerGroupFactoryData = { + id?: string + name?: string +} + +export const simpleCustomerGroupFactory = async ( + connection: Connection, + data: CustomerGroupFactoryData = {}, + seed?: number +): Promise => { + if (typeof seed !== "undefined") { + faker.seed(seed) + } + + const manager = connection.manager + + const customerGroupId = + data.id || `simple-customer-group-${Math.random() * 1000}` + const c = manager.create(CustomerGroup, { + id: customerGroupId, + name: data.name, + }) + + const group = await manager.save(c) + + return group +} diff --git a/integration-tests/api/factories/simple-discount-condition-factory.ts b/integration-tests/api/factories/simple-discount-condition-factory.ts new file mode 100644 index 0000000000..ad3582cc66 --- /dev/null +++ b/integration-tests/api/factories/simple-discount-condition-factory.ts @@ -0,0 +1,116 @@ +import { + DiscountCondition, + DiscountConditionOperator, + DiscountConditionType, +} from "@medusajs/medusa/dist/models/discount-condition" +import { DiscountConditionCustomerGroup } from "@medusajs/medusa/dist/models/discount-condition-customer-group" +import { DiscountConditionProduct } from "@medusajs/medusa/dist/models/discount-condition-product" +import { DiscountConditionProductCollection } from "@medusajs/medusa/dist/models/discount-condition-product-collection" +import { DiscountConditionProductTag } from "@medusajs/medusa/dist/models/discount-condition-product-tag" +import { DiscountConditionProductType } from "@medusajs/medusa/dist/models/discount-condition-product-type" +import { DiscountConditionJoinTableForeignKey } from "@medusajs/medusa/dist/repositories/discount-condition" +import faker from "faker" +import { Connection } from "typeorm" + +export type DiscuntConditionFactoryData = { + rule_id: string + type: DiscountConditionType + operator: DiscountConditionOperator + products: string[] + product_collections: string[] + product_types: string[] + product_tags: string[] + customer_groups: string[] +} + +const getJoinTableResourceIdentifiers = (type: string) => { + let conditionTable: any + let resourceKey + + switch (type) { + case DiscountConditionType.PRODUCTS: { + resourceKey = DiscountConditionJoinTableForeignKey.PRODUCT_ID + conditionTable = DiscountConditionProduct + break + } + case DiscountConditionType.PRODUCT_TYPES: { + resourceKey = DiscountConditionJoinTableForeignKey.PRODUCT_TYPE_ID + conditionTable = DiscountConditionProductType + break + } + case DiscountConditionType.PRODUCT_COLLECTIONS: { + resourceKey = DiscountConditionJoinTableForeignKey.PRODUCT_COLLECTION_ID + conditionTable = DiscountConditionProductCollection + break + } + case DiscountConditionType.PRODUCT_TAGS: { + resourceKey = DiscountConditionJoinTableForeignKey.PRODUCT_TAG_ID + + conditionTable = DiscountConditionProductTag + break + } + case DiscountConditionType.CUSTOMER_GROUPS: { + resourceKey = DiscountConditionJoinTableForeignKey.CUSTOMER_GROUP_ID + conditionTable = DiscountConditionCustomerGroup + break + } + default: + break + } + + return { + resourceKey, + conditionTable, + } +} + +export const simpleDiscountConditionFactory = async ( + connection: Connection, + data: DiscuntConditionFactoryData, + seed?: number +): Promise => { + if (typeof seed !== "undefined") { + faker.seed(seed) + } + + const manager = connection.manager + + let resources = [] + + if (data.products) { + resources = data.products + } + if (data.product_collections) { + resources = data.product_collections + } + if (data.product_types) { + resources = data.product_types + } + if (data.product_tags) { + resources = data.product_tags + } + if (data.customer_groups) { + resources = data.customer_groups + } + + const condToSave = manager.create(DiscountCondition, { + type: data.type, + operator: data.operator, + discount_rule_id: data.rule_id, + }) + + const { conditionTable, resourceKey } = getJoinTableResourceIdentifiers( + data.type + ) + + const condition = await manager.save(condToSave) + + for (const resourceCond of resources) { + const toSave = manager.create(conditionTable, { + [resourceKey]: resourceCond, + condition_id: condition.id, + }) + + await manager.save(toSave) + } +} diff --git a/integration-tests/api/factories/simple-discount-factory.ts b/integration-tests/api/factories/simple-discount-factory.ts index 8fbb13cd28..d8066c6b45 100644 --- a/integration-tests/api/factories/simple-discount-factory.ts +++ b/integration-tests/api/factories/simple-discount-factory.ts @@ -1,16 +1,21 @@ -import { Connection } from "typeorm" -import faker from "faker" import { + AllocationType, Discount, DiscountRule, DiscountRuleType, - AllocationType, } from "@medusajs/medusa" +import faker from "faker" +import { Connection } from "typeorm" +import { + DiscuntConditionFactoryData, + simpleDiscountConditionFactory, +} from "./simple-discount-condition-factory" export type DiscountRuleFactoryData = { type?: DiscountRuleType value?: number allocation?: AllocationType + conditions: DiscuntConditionFactoryData[] } export type DiscountFactoryData = { @@ -41,6 +46,16 @@ export const simpleDiscountFactory = async ( const dRule = await manager.save(ruleToSave) + if (data?.rule?.conditions) { + for (const condition of data.rule.conditions) { + await simpleDiscountConditionFactory( + connection, + { ...condition, rule_id: dRule.id }, + 1 + ) + } + } + const toSave = manager.create(Discount, { id: data.id, is_dynamic: data.is_dynamic ?? false, diff --git a/integration-tests/api/factories/simple-product-factory.ts b/integration-tests/api/factories/simple-product-factory.ts index fda928efe3..642a25d063 100644 --- a/integration-tests/api/factories/simple-product-factory.ts +++ b/integration-tests/api/factories/simple-product-factory.ts @@ -1,16 +1,16 @@ -import { Connection } from "typeorm" -import faker from "faker" import { - ShippingProfileType, - ShippingProfile, Product, - ProductType, ProductOption, + ProductTag, + ProductType, + ShippingProfile, + ShippingProfileType, } from "@medusajs/medusa" - +import faker from "faker" +import { Connection } from "typeorm" import { - simpleProductVariantFactory, ProductVariantFactoryData, + simpleProductVariantFactory, } from "./simple-product-variant-factory" export type ProductFactoryData = { @@ -19,6 +19,7 @@ export type ProductFactoryData = { status?: string title?: string type?: string + tags?: string[] options?: { id: string; title: string }[] variants?: ProductVariantFactoryData[] } @@ -42,27 +43,40 @@ export const simpleProductFactory = async ( type: ShippingProfileType.GIFT_CARD, }) - let typeId: string + const prodId = data.id || `simple-product-${Math.random() * 1000}` + const productToCreate = { + id: prodId, + title: data.title || faker.commerce.productName(), + is_giftcard: data.is_giftcard || false, + discountable: !data.is_giftcard, + tags: [], + profile_id: data.is_giftcard ? gcProfile.id : defaultProfile.id, + } + + if (typeof data.tags !== "undefined") { + for (let i = 0; i < data.tags.length; i++) { + const createdTag = manager.create(ProductTag, { + id: `tag-${Math.random() * 1000}`, + value: data.tags[i], + }) + + const tagRes = await manager.save(createdTag) + + productToCreate.tags.push(tagRes) + } + } + if (typeof data.type !== "undefined") { const toSave = manager.create(ProductType, { value: data.type, }) const res = await manager.save(toSave) - typeId = res.id + productToCreate["type_id"] = res.id } - const prodId = data.id || `simple-product-${Math.random() * 1000}` - const toSave = manager.create(Product, { - id: prodId, - type_id: typeId, - status: data.status, - title: data.title || faker.commerce.productName(), - is_giftcard: data.is_giftcard || false, - discountable: !data.is_giftcard, - profile_id: data.is_giftcard ? gcProfile.id : defaultProfile.id, - }) + const toSave = manager.create(Product, productToCreate) - const product = await manager.save(toSave) + await manager.save(toSave) const optionId = `${prodId}-option` const options = data.options || [{ id: optionId, title: "Size" }] @@ -97,5 +111,5 @@ export const simpleProductFactory = async ( await simpleProductVariantFactory(connection, factoryData) } - return product + return await manager.findOne(Product, { id: prodId }, { relations: ["tags"] }) } diff --git a/integration-tests/api/package.json b/integration-tests/api/package.json index 4b0b8d3704..cee84a9ad6 100644 --- a/integration-tests/api/package.json +++ b/integration-tests/api/package.json @@ -8,16 +8,16 @@ "build": "babel src -d dist --extensions \".ts,.js\"" }, "dependencies": { - "@medusajs/medusa": "1.2.0-dev-1647336201011", + "@medusajs/medusa": "1.2.1-dev-1648026403166", "faker": "^5.5.3", - "medusa-interfaces": "1.2.0-dev-1647336201011", + "medusa-interfaces": "1.2.1-dev-1648026403166", "typeorm": "^0.2.31" }, "devDependencies": { "@babel/cli": "^7.12.10", "@babel/core": "^7.12.10", "@babel/node": "^7.12.10", - "babel-preset-medusa-package": "1.1.19-dev-1647336201011", + "babel-preset-medusa-package": "1.1.19-dev-1648026403166", "jest": "^26.6.3" } } diff --git a/integration-tests/api/yarn.lock b/integration-tests/api/yarn.lock index e72fa6dcf6..16c21ac523 100644 --- a/integration-tests/api/yarn.lock +++ b/integration-tests/api/yarn.lock @@ -2,11 +2,19 @@ # yarn lockfile v1 -"@babel/cli@^7.12.10": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.16.0.tgz#a729b7a48eb80b49f48a339529fc4129fd7bcef3" - integrity sha512-WLrM42vKX/4atIoQB+eb0ovUof53UUvecb4qGjU2PDDWRiZr50ZpiV8NpcLo7iSxeGYrRG0Mqembsa+UrTAV6Q== +"@ampproject/remapping@^2.1.0": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.1.2.tgz#4edca94973ded9630d20101cd8559cedb8d8bd34" + integrity sha512-hoyByceqwKirw7w3Z7gnIIZC3Wx3J484Y3L/cMpXFbr7d9ZQj2mODrirNzcJa+SM3UlpWXYvKV4RlRpFXlWgXg== dependencies: + "@jridgewell/trace-mapping" "^0.3.0" + +"@babel/cli@^7.12.10": + version "7.17.6" + resolved "https://registry.yarnpkg.com/@babel/cli/-/cli-7.17.6.tgz#169e5935f1795f0b62ded5a2accafeedfe5c5363" + integrity sha512-l4w608nsDNlxZhiJ5tE3DbNmr61fIKMZ6fTBo171VEFuFMIYuJ3mHRhTLEkKKyvx2Mizkkv/0a8OJOnZqkKYNA== + dependencies: + "@jridgewell/trace-mapping" "^0.3.4" commander "^4.0.1" convert-source-map "^1.1.0" fs-readdir-recursive "^1.1.0" @@ -18,97 +26,98 @@ "@nicolo-ribaudo/chokidar-2" "2.1.8-no-fsevents.3" chokidar "^3.4.0" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.0.tgz#0dfc80309beec8411e65e706461c408b0bb9b431" - integrity sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" + integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== dependencies: - "@babel/highlight" "^7.16.0" + "@babel/highlight" "^7.16.7" -"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.16.0.tgz#ea269d7f78deb3a7826c39a4048eecda541ebdaa" - integrity sha512-DGjt2QZse5SGd9nfOSqO4WLJ8NN/oHkijbXbPrxuoJO3oIPJL3TciZs9FX+cOHNiY9E9l0opL8g7BmLe3T+9ew== +"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.16.8", "@babel/compat-data@^7.17.0", "@babel/compat-data@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.7.tgz#078d8b833fbbcc95286613be8c716cef2b519fa2" + integrity sha512-p8pdE6j0a29TNGebNm7NzYZWB3xVZJBZ7XGs42uAKzQo8VQ3F0By/cQCtUEABwIqw5zo6WA4NbmxsfzADzMKnQ== "@babel/core@^7.1.0", "@babel/core@^7.12.10", "@babel/core@^7.12.3", "@babel/core@^7.7.5": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.16.0.tgz#c4ff44046f5fe310525cc9eb4ef5147f0c5374d4" - integrity sha512-mYZEvshBRHGsIAiyH5PzCFTCfbWfoYbO/jcSdXQSUQu1/pW0xDZAUP7KEc32heqWTAfAHhV9j1vH8Sav7l+JNQ== + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.8.tgz#3dac27c190ebc3a4381110d46c80e77efe172e1a" + integrity sha512-OdQDV/7cRBtJHLSOBqqbYNkOcydOgnX59TZx4puf41fzcVtN3e/4yqY8lMQsK+5X2lJtAdmA+6OHqsj1hBJ4IQ== dependencies: - "@babel/code-frame" "^7.16.0" - "@babel/generator" "^7.16.0" - "@babel/helper-compilation-targets" "^7.16.0" - "@babel/helper-module-transforms" "^7.16.0" - "@babel/helpers" "^7.16.0" - "@babel/parser" "^7.16.0" - "@babel/template" "^7.16.0" - "@babel/traverse" "^7.16.0" - "@babel/types" "^7.16.0" + "@ampproject/remapping" "^2.1.0" + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.17.7" + "@babel/helper-compilation-targets" "^7.17.7" + "@babel/helper-module-transforms" "^7.17.7" + "@babel/helpers" "^7.17.8" + "@babel/parser" "^7.17.8" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.17.3" + "@babel/types" "^7.17.0" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" json5 "^2.1.2" semver "^6.3.0" - source-map "^0.5.0" -"@babel/generator@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.16.0.tgz#d40f3d1d5075e62d3500bccb67f3daa8a95265b2" - integrity sha512-RR8hUCfRQn9j9RPKEVXo9LiwoxLPYn6hNZlvUOR8tSnaxlD0p0+la00ZP9/SnRt6HchKr+X0fO2r8vrETiJGew== +"@babel/generator@^7.17.3", "@babel/generator@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.7.tgz#8da2599beb4a86194a3b24df6c085931d9ee45ad" + integrity sha512-oLcVCTeIFadUoArDTwpluncplrYBmTCCZZgXCbgNGvOBBiSDDK3eWO4b/+eOTli5tKv1lg+a5/NAXg+nTcei1w== dependencies: - "@babel/types" "^7.16.0" + "@babel/types" "^7.17.0" jsesc "^2.5.1" source-map "^0.5.0" -"@babel/helper-annotate-as-pure@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.0.tgz#9a1f0ebcda53d9a2d00108c4ceace6a5d5f1f08d" - integrity sha512-ItmYF9vR4zA8cByDocY05o0LGUkp1zhbTQOH1NFyl5xXEqlTJQCEJjieriw+aFpxo16swMxUnUiKS7a/r4vtHg== +"@babel/helper-annotate-as-pure@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz#bb2339a7534a9c128e3102024c60760a3a7f3862" + integrity sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw== dependencies: - "@babel/types" "^7.16.0" + "@babel/types" "^7.16.7" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.0.tgz#f1a686b92da794020c26582eb852e9accd0d7882" - integrity sha512-9KuleLT0e77wFUku6TUkqZzCEymBdtuQQ27MhEKzf9UOOJu3cYj98kyaDAzxpC7lV6DGiZFuC8XqDsq8/Kl6aQ== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.7.tgz#38d138561ea207f0f69eb1626a418e4f7e6a580b" + integrity sha512-C6FdbRaxYjwVu/geKW4ZeQ0Q31AftgRcdSnZ5/jsH6BzCJbtvXvhpfkbkThYSuutZA7nCXpPR6AD9zd1dprMkA== dependencies: - "@babel/helper-explode-assignable-expression" "^7.16.0" - "@babel/types" "^7.16.0" + "@babel/helper-explode-assignable-expression" "^7.16.7" + "@babel/types" "^7.16.7" -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.0.tgz#01d615762e796c17952c29e3ede9d6de07d235a8" - integrity sha512-S7iaOT1SYlqK0sQaCi21RX4+13hmdmnxIEAnQUB/eh7GeAnRjOUgTYpLkUOiRXzD+yog1JxP0qyAQZ7ZxVxLVg== +"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.16.7", "@babel/helper-compilation-targets@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.7.tgz#a3c2924f5e5f0379b356d4cfb313d1414dc30e46" + integrity sha512-UFzlz2jjd8kroj0hmCFV5zr+tQPi1dpC2cRsDV/3IEW8bJfCPrPpmcSN6ZS8RqIq4LXcmpipCQFPddyFA5Yc7w== dependencies: - "@babel/compat-data" "^7.16.0" - "@babel/helper-validator-option" "^7.14.5" - browserslist "^4.16.6" + "@babel/compat-data" "^7.17.7" + "@babel/helper-validator-option" "^7.16.7" + browserslist "^4.17.5" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.16.0.tgz#090d4d166b342a03a9fec37ef4fd5aeb9c7c6a4b" - integrity sha512-XLwWvqEaq19zFlF5PTgOod4bUA+XbkR4WLQBct1bkzmxJGB0ZEJaoKF4c8cgH9oBtCDuYJ8BP5NB9uFiEgO5QA== +"@babel/helper-create-class-features-plugin@^7.16.10", "@babel/helper-create-class-features-plugin@^7.16.7", "@babel/helper-create-class-features-plugin@^7.17.6": + version "7.17.6" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.17.6.tgz#3778c1ed09a7f3e65e6d6e0f6fbfcc53809d92c9" + integrity sha512-SogLLSxXm2OkBbSsHZMM4tUi8fUzjs63AT/d0YQIzr6GSd8Hxsbk2KYDX0k0DweAzGMj/YWeiCsorIdtdcW8Eg== dependencies: - "@babel/helper-annotate-as-pure" "^7.16.0" - "@babel/helper-function-name" "^7.16.0" - "@babel/helper-member-expression-to-functions" "^7.16.0" - "@babel/helper-optimise-call-expression" "^7.16.0" - "@babel/helper-replace-supers" "^7.16.0" - "@babel/helper-split-export-declaration" "^7.16.0" + "@babel/helper-annotate-as-pure" "^7.16.7" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-member-expression-to-functions" "^7.16.7" + "@babel/helper-optimise-call-expression" "^7.16.7" + "@babel/helper-replace-supers" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" -"@babel/helper-create-regexp-features-plugin@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.16.0.tgz#06b2348ce37fccc4f5e18dcd8d75053f2a7c44ff" - integrity sha512-3DyG0zAFAZKcOp7aVr33ddwkxJ0Z0Jr5V99y3I690eYLpukJsJvAbzTy1ewoCqsML8SbIrjH14Jc/nSQ4TvNPA== +"@babel/helper-create-regexp-features-plugin@^7.16.7": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.17.0.tgz#1dcc7d40ba0c6b6b25618997c5dbfd310f186fe1" + integrity sha512-awO2So99wG6KnlE+TPs6rn83gCz5WlEePJDTnLEqbchMVrBeAujURVphRdigsk094VhvZehFoNOihSlcBjwsXA== dependencies: - "@babel/helper-annotate-as-pure" "^7.16.0" - regexpu-core "^4.7.1" + "@babel/helper-annotate-as-pure" "^7.16.7" + regexpu-core "^5.0.1" -"@babel/helper-define-polyfill-provider@^0.2.4": - version "0.2.4" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.2.4.tgz#8867aed79d3ea6cade40f801efb7ac5c66916b10" - integrity sha512-OrpPZ97s+aPi6h2n1OXzdhVis1SGSsMU2aMHgLcOKfsp4/v1NWpx3CWT3lBj5eeBq9cDkPkh+YCfdF7O12uNDQ== +"@babel/helper-define-polyfill-provider@^0.3.1": + version "0.3.1" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz#52411b445bdb2e676869e5a74960d2d3826d2665" + integrity sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA== dependencies: "@babel/helper-compilation-targets" "^7.13.0" "@babel/helper-module-imports" "^7.12.13" @@ -119,101 +128,109 @@ resolve "^1.14.2" semver "^6.1.2" -"@babel/helper-explode-assignable-expression@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.0.tgz#753017337a15f46f9c09f674cff10cee9b9d7778" - integrity sha512-Hk2SLxC9ZbcOhLpg/yMznzJ11W++lg5GMbxt1ev6TXUiJB0N42KPC+7w8a+eWGuqDnUYuwStJoZHM7RgmIOaGQ== +"@babel/helper-environment-visitor@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz#ff484094a839bde9d89cd63cba017d7aae80ecd7" + integrity sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag== dependencies: - "@babel/types" "^7.16.0" + "@babel/types" "^7.16.7" -"@babel/helper-function-name@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.0.tgz#b7dd0797d00bbfee4f07e9c4ea5b0e30c8bb1481" - integrity sha512-BZh4mEk1xi2h4HFjWUXRQX5AEx4rvaZxHgax9gcjdLWdkjsY7MKt5p0otjsg5noXw+pB+clMCjw+aEVYADMjog== +"@babel/helper-explode-assignable-expression@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.7.tgz#12a6d8522fdd834f194e868af6354e8650242b7a" + integrity sha512-KyUenhWMC8VrxzkGP0Jizjo4/Zx+1nNZhgocs+gLzyZyB8SHidhoq9KK/8Ato4anhwsivfkBLftky7gvzbZMtQ== dependencies: - "@babel/helper-get-function-arity" "^7.16.0" - "@babel/template" "^7.16.0" - "@babel/types" "^7.16.0" + "@babel/types" "^7.16.7" -"@babel/helper-get-function-arity@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.0.tgz#0088c7486b29a9cb5d948b1a1de46db66e089cfa" - integrity sha512-ASCquNcywC1NkYh/z7Cgp3w31YW8aojjYIlNg4VeJiHkqyP4AzIvr4qx7pYDb4/s8YcsZWqqOSxgkvjUz1kpDQ== +"@babel/helper-function-name@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz#f1ec51551fb1c8956bc8dd95f38523b6cf375f8f" + integrity sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA== dependencies: - "@babel/types" "^7.16.0" + "@babel/helper-get-function-arity" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/types" "^7.16.7" -"@babel/helper-hoist-variables@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.0.tgz#4c9023c2f1def7e28ff46fc1dbcd36a39beaa81a" - integrity sha512-1AZlpazjUR0EQZQv3sgRNfM9mEVWPK3M6vlalczA+EECcPz3XPh6VplbErL5UoMpChhSck5wAJHthlj1bYpcmg== +"@babel/helper-get-function-arity@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz#ea08ac753117a669f1508ba06ebcc49156387419" + integrity sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw== dependencies: - "@babel/types" "^7.16.0" + "@babel/types" "^7.16.7" -"@babel/helper-member-expression-to-functions@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.16.0.tgz#29287040efd197c77636ef75188e81da8bccd5a4" - integrity sha512-bsjlBFPuWT6IWhl28EdrQ+gTvSvj5tqVP5Xeftp07SEuz5pLnsXZuDkDD3Rfcxy0IsHmbZ+7B2/9SHzxO0T+sQ== +"@babel/helper-hoist-variables@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" + integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== dependencies: - "@babel/types" "^7.16.0" + "@babel/types" "^7.16.7" -"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.0.tgz#90538e60b672ecf1b448f5f4f5433d37e79a3ec3" - integrity sha512-kkH7sWzKPq0xt3H1n+ghb4xEMP8k0U7XV3kkB+ZGy69kDk2ySFW1qPi06sjKzFY3t1j6XbJSqr4mF9L7CYVyhg== +"@babel/helper-member-expression-to-functions@^7.16.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.17.7.tgz#a34013b57d8542a8c4ff8ba3f747c02452a4d8c4" + integrity sha512-thxXgnQ8qQ11W2wVUObIqDL4p148VMxkt5T/qpN5k2fboRyzFGFmKsTGViquyM5QHKUy48OZoca8kw4ajaDPyw== dependencies: - "@babel/types" "^7.16.0" + "@babel/types" "^7.17.0" -"@babel/helper-module-transforms@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.0.tgz#1c82a8dd4cb34577502ebd2909699b194c3e9bb5" - integrity sha512-My4cr9ATcaBbmaEa8M0dZNA74cfI6gitvUAskgDtAFmAqyFKDSHQo5YstxPbN+lzHl2D9l/YOEFqb2mtUh4gfA== +"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz#25612a8091a999704461c8a222d0efec5d091437" + integrity sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg== dependencies: - "@babel/helper-module-imports" "^7.16.0" - "@babel/helper-replace-supers" "^7.16.0" - "@babel/helper-simple-access" "^7.16.0" - "@babel/helper-split-export-declaration" "^7.16.0" - "@babel/helper-validator-identifier" "^7.15.7" - "@babel/template" "^7.16.0" - "@babel/traverse" "^7.16.0" - "@babel/types" "^7.16.0" + "@babel/types" "^7.16.7" -"@babel/helper-optimise-call-expression@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.0.tgz#cecdb145d70c54096b1564f8e9f10cd7d193b338" - integrity sha512-SuI467Gi2V8fkofm2JPnZzB/SUuXoJA5zXe/xzyPP2M04686RzFKFHPK6HDVN6JvWBIEW8tt9hPR7fXdn2Lgpw== +"@babel/helper-module-transforms@^7.16.7", "@babel/helper-module-transforms@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz#3943c7f777139e7954a5355c815263741a9c1cbd" + integrity sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw== dependencies: - "@babel/types" "^7.16.0" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-module-imports" "^7.16.7" + "@babel/helper-simple-access" "^7.17.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/helper-validator-identifier" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.17.3" + "@babel/types" "^7.17.0" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.14.5.tgz#5ac822ce97eec46741ab70a517971e443a70c5a9" - integrity sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ== - -"@babel/helper-remap-async-to-generator@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.0.tgz#d5aa3b086e13a5fe05238ff40c3a5a0c2dab3ead" - integrity sha512-MLM1IOMe9aQBqMWxcRw8dcb9jlM86NIw7KA0Wri91Xkfied+dE0QuBFSBjMNvqzmS0OSIDsMNC24dBEkPUi7ew== +"@babel/helper-optimise-call-expression@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz#a34e3560605abbd31a18546bd2aad3e6d9a174f2" + integrity sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w== dependencies: - "@babel/helper-annotate-as-pure" "^7.16.0" - "@babel/helper-wrap-function" "^7.16.0" - "@babel/types" "^7.16.0" + "@babel/types" "^7.16.7" -"@babel/helper-replace-supers@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.0.tgz#73055e8d3cf9bcba8ddb55cad93fedc860f68f17" - integrity sha512-TQxuQfSCdoha7cpRNJvfaYxxxzmbxXw/+6cS7V02eeDYyhxderSoMVALvwupA54/pZcOTtVeJ0xccp1nGWladA== - dependencies: - "@babel/helper-member-expression-to-functions" "^7.16.0" - "@babel/helper-optimise-call-expression" "^7.16.0" - "@babel/traverse" "^7.16.0" - "@babel/types" "^7.16.0" +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz#aa3a8ab4c3cceff8e65eb9e73d87dc4ff320b2f5" + integrity sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA== -"@babel/helper-simple-access@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.0.tgz#21d6a27620e383e37534cf6c10bba019a6f90517" - integrity sha512-o1rjBT/gppAqKsYfUdfHq5Rk03lMQrkPHG1OWzHWpLgVXRH4HnMM9Et9CVdIqwkCQlobnGHEJMsgWP/jE1zUiw== +"@babel/helper-remap-async-to-generator@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz#29ffaade68a367e2ed09c90901986918d25e57e3" + integrity sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw== dependencies: - "@babel/types" "^7.16.0" + "@babel/helper-annotate-as-pure" "^7.16.7" + "@babel/helper-wrap-function" "^7.16.8" + "@babel/types" "^7.16.8" + +"@babel/helper-replace-supers@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.16.7.tgz#e9f5f5f32ac90429c1a4bdec0f231ef0c2838ab1" + integrity sha512-y9vsWilTNaVnVh6xiJfABzsNpgDPKev9HnAgz6Gb1p6UUwf9NepdlsV7VXGCftJM+jqD5f7JIEubcpLjZj5dBw== + dependencies: + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-member-expression-to-functions" "^7.16.7" + "@babel/helper-optimise-call-expression" "^7.16.7" + "@babel/traverse" "^7.16.7" + "@babel/types" "^7.16.7" + +"@babel/helper-simple-access@^7.17.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz#aaa473de92b7987c6dfa7ce9a7d9674724823367" + integrity sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA== + dependencies: + "@babel/types" "^7.17.0" "@babel/helper-skip-transparent-expression-wrappers@^7.16.0": version "7.16.0" @@ -222,220 +239,222 @@ dependencies: "@babel/types" "^7.16.0" -"@babel/helper-split-export-declaration@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.0.tgz#29672f43663e936df370aaeb22beddb3baec7438" - integrity sha512-0YMMRpuDFNGTHNRiiqJX19GjNXA4H0E8jZ2ibccfSxaCogbm3am5WN/2nQNj0YnQwGWM1J06GOcQ2qnh3+0paw== +"@babel/helper-split-export-declaration@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" + integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw== dependencies: - "@babel/types" "^7.16.0" + "@babel/types" "^7.16.7" -"@babel/helper-validator-identifier@^7.15.7": - version "7.15.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389" - integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w== +"@babel/helper-validator-identifier@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" + integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== -"@babel/helper-validator-option@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.14.5.tgz#6e72a1fff18d5dfcb878e1e62f1a021c4b72d5a3" - integrity sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow== +"@babel/helper-validator-option@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" + integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== -"@babel/helper-wrap-function@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.16.0.tgz#b3cf318afce774dfe75b86767cd6d68f3482e57c" - integrity sha512-VVMGzYY3vkWgCJML+qVLvGIam902mJW0FvT7Avj1zEe0Gn7D93aWdLblYARTxEw+6DhZmtzhBM2zv0ekE5zg1g== +"@babel/helper-wrap-function@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz#58afda087c4cd235de92f7ceedebca2c41274200" + integrity sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw== dependencies: - "@babel/helper-function-name" "^7.16.0" - "@babel/template" "^7.16.0" - "@babel/traverse" "^7.16.0" - "@babel/types" "^7.16.0" + "@babel/helper-function-name" "^7.16.7" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.16.8" + "@babel/types" "^7.16.8" -"@babel/helpers@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.16.0.tgz#875519c979c232f41adfbd43a3b0398c2e388183" - integrity sha512-dVRM0StFMdKlkt7cVcGgwD8UMaBfWJHl3A83Yfs8GQ3MO0LHIIIMvK7Fa0RGOGUQ10qikLaX6D7o5htcQWgTMQ== +"@babel/helpers@^7.17.8": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.8.tgz#288450be8c6ac7e4e44df37bcc53d345e07bc106" + integrity sha512-QcL86FGxpfSJwGtAvv4iG93UL6bmqBdmoVY0CMCU2g+oD2ezQse3PT5Pa+jiD6LJndBQi0EDlpzOWNlLuhz5gw== dependencies: - "@babel/template" "^7.16.0" - "@babel/traverse" "^7.16.0" - "@babel/types" "^7.16.0" + "@babel/template" "^7.16.7" + "@babel/traverse" "^7.17.3" + "@babel/types" "^7.17.0" -"@babel/highlight@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.0.tgz#6ceb32b2ca4b8f5f361fb7fd821e3fddf4a1725a" - integrity sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g== +"@babel/highlight@^7.16.7": + version "7.16.10" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" + integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw== dependencies: - "@babel/helper-validator-identifier" "^7.15.7" + "@babel/helper-validator-identifier" "^7.16.7" chalk "^2.0.0" js-tokens "^4.0.0" "@babel/node@^7.12.10": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/node/-/node-7.16.0.tgz#855e783ba4cbca88dbdebf4b01c2d95844c4afdf" - integrity sha512-eFUU2RHkgMW0X1lHVVOWJYlaDTwCX2LduQQLfehAfID5VhAjNnBhGZ/r0zk3FSQfFn6enJ2aXyRCiZ829bYVeA== + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/node/-/node-7.16.8.tgz#57ba1dfa63dbcc72d477f05597ce07f1c4f8b558" + integrity sha512-V2dopEtPUL4LD+e8UtMIZB6BbsmMsS/7E1ZAvWNINzBfi7Cf3X9MLCpzHVZT4HeeF1lQl72IRtqqVt2RUImwyA== dependencies: - "@babel/register" "^7.16.0" + "@babel/register" "^7.16.8" commander "^4.0.1" - core-js "^3.19.0" + core-js "^3.20.2" node-environment-flags "^1.0.5" regenerator-runtime "^0.13.4" v8flags "^3.1.1" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.0": - version "7.16.2" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.16.2.tgz#3723cd5c8d8773eef96ce57ea1d9b7faaccd12ac" - integrity sha512-RUVpT0G2h6rOZwqLDTrKk7ksNv7YpAilTnYe1/Q+eDjxEceRMKVWbCsX7t8h6C1qCFi/1Y8WZjcEPBAFG27GPw== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.3", "@babel/parser@^7.17.8": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.8.tgz#2817fb9d885dd8132ea0f8eb615a6388cca1c240" + integrity sha512-BoHhDJrJXqcg+ZL16Xv39H9n+AqJ4pcDrQBGZN+wHxIysrLZ3/ECwCBUch/1zUNhnsXULcONU3Ei5Hmkfk6kiQ== -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.0": - version "7.16.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.2.tgz#2977fca9b212db153c195674e57cfab807733183" - integrity sha512-h37CvpLSf8gb2lIJ2CgC3t+EjFbi0t8qS7LCS1xcJIlEXE4czlofwaW7W1HA8zpgOCzI9C1nmoqNR1zWkk0pQg== +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.16.7.tgz#4eda6d6c2a0aa79c70fa7b6da67763dfe2141050" + integrity sha512-anv/DObl7waiGEnC24O9zqL0pSuI9hljihqiDuFHC8d7/bjr/4RLGPWuc8rYOff/QPzbEPSkzG8wGG9aDuhHRg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.0.tgz#358972eaab006f5eb0826183b0c93cbcaf13e1e2" - integrity sha512-4tcFwwicpWTrpl9qjf7UsoosaArgImF85AxqCRZlgc3IQDvkUHjJpruXAL58Wmj+T6fypWTC/BakfEkwIL/pwA== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.16.7.tgz#cc001234dfc139ac45f6bcf801866198c8c72ff9" + integrity sha512-di8vUHRdf+4aJ7ltXhaDbPoszdkh59AQtJM5soLsuHpQJdFQZOA4uGj0V2u/CZ8bJ/u8ULDL5yq6FO/bCXnKHw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" - "@babel/plugin-proposal-optional-chaining" "^7.16.0" + "@babel/plugin-proposal-optional-chaining" "^7.16.7" -"@babel/plugin-proposal-async-generator-functions@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.0.tgz#11425d47a60364352f668ad5fbc1d6596b2c5caf" - integrity sha512-nyYmIo7ZqKsY6P4lnVmBlxp9B3a96CscbLotlsNuktMHahkDwoPYEjXrZHU0Tj844Z9f1IthVxQln57mhkcExw== +"@babel/plugin-proposal-async-generator-functions@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.16.8.tgz#3bdd1ebbe620804ea9416706cd67d60787504bc8" + integrity sha512-71YHIvMuiuqWJQkebWJtdhQTfd4Q4mF76q2IX37uZPkG9+olBxsX+rH1vkhFto4UeJZ9dPY2s+mDvhDm1u2BGQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.16.0" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-remap-async-to-generator" "^7.16.8" "@babel/plugin-syntax-async-generators" "^7.8.4" -"@babel/plugin-proposal-class-properties@^7.12.1", "@babel/plugin-proposal-class-properties@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.0.tgz#c029618267ddebc7280fa286e0f8ca2a278a2d1a" - integrity sha512-mCF3HcuZSY9Fcx56Lbn+CGdT44ioBMMvjNVldpKtj8tpniETdLjnxdHI1+sDWXIM1nNt+EanJOZ3IG9lzVjs7A== +"@babel/plugin-proposal-class-properties@^7.12.1", "@babel/plugin-proposal-class-properties@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.16.7.tgz#925cad7b3b1a2fcea7e59ecc8eb5954f961f91b0" + integrity sha512-IobU0Xme31ewjYOShSIqd/ZGM/r/cuOz2z0MDbNrhF5FW+ZVgi0f2lyeoj9KFPDOAqsYxmLWZte1WOwlvY9aww== dependencies: - "@babel/helper-create-class-features-plugin" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-proposal-class-static-block@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.16.0.tgz#5296942c564d8144c83eea347d0aa8a0b89170e7" - integrity sha512-mAy3sdcY9sKAkf3lQbDiv3olOfiLqI51c9DR9b19uMoR2Z6r5pmGl7dfNFqEvqOyqbf1ta4lknK4gc5PJn3mfA== +"@babel/plugin-proposal-class-static-block@^7.16.7": + version "7.17.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.17.6.tgz#164e8fd25f0d80fa48c5a4d1438a6629325ad83c" + integrity sha512-X/tididvL2zbs7jZCeeRJ8167U/+Ac135AM6jCAx6gYXDUviZV5Ku9UDvWS2NCuWlFjIRXklYhwo6HhAC7ETnA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.17.6" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-proposal-decorators@^7.12.1": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.16.0.tgz#515db5f6891611c0d176b63ede0844fbd9be797b" - integrity sha512-ttvhKuVnQwoNQrcTd1oe6o49ahaZ1kns1fsJKzTVOaS/FJDJoK4qzgVS68xzJhYUMgTnbXW6z/T6rlP3lL7tJw== + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.17.8.tgz#4f0444e896bee85d35cf714a006fc5418f87ff00" + integrity sha512-U69odN4Umyyx1xO1rTII0IDkAEC+RNlcKXtqOblfpzqy1C+aOplb76BQNq0+XdpVkOaPlpEDwd++joY8FNFJKA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-decorators" "^7.16.0" + "@babel/helper-create-class-features-plugin" "^7.17.6" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-replace-supers" "^7.16.7" + "@babel/plugin-syntax-decorators" "^7.17.0" + charcodes "^0.2.0" -"@babel/plugin-proposal-dynamic-import@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.0.tgz#783eca61d50526202f9b296095453977e88659f1" - integrity sha512-QGSA6ExWk95jFQgwz5GQ2Dr95cf7eI7TKutIXXTb7B1gCLTCz5hTjFTQGfLFBBiC5WSNi7udNwWsqbbMh1c4yQ== +"@babel/plugin-proposal-dynamic-import@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.7.tgz#c19c897eaa46b27634a00fee9fb7d829158704b2" + integrity sha512-I8SW9Ho3/8DRSdmDdH3gORdyUuYnk1m4cMxUAdu5oy4n3OfN8flDEH+d60iG7dUfi0KkYwSvoalHzzdRzpWHTg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-proposal-export-namespace-from@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.0.tgz#9c01dee40b9d6b847b656aaf4a3976a71740f222" - integrity sha512-CjI4nxM/D+5wCnhD11MHB1AwRSAYeDT+h8gCdcVJZ/OK7+wRzFsf7PFPWVpVpNRkHMmMkQWAHpTq+15IXQ1diA== +"@babel/plugin-proposal-export-namespace-from@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.16.7.tgz#09de09df18445a5786a305681423ae63507a6163" + integrity sha512-ZxdtqDXLRGBL64ocZcs7ovt71L3jhC1RGSyR996svrCi3PYqHNkb3SwPJCs8RIzD86s+WPpt2S73+EHCGO+NUA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.0.tgz#cae35a95ed1d2a7fa29c4dc41540b84a72e9ab25" - integrity sha512-kouIPuiv8mSi5JkEhzApg5Gn6hFyKPnlkO0a9YSzqRurH8wYzSlf6RJdzluAsbqecdW5pBvDJDfyDIUR/vLxvg== +"@babel/plugin-proposal-json-strings@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.16.7.tgz#9732cb1d17d9a2626a08c5be25186c195b6fa6e8" + integrity sha512-lNZ3EEggsGY78JavgbHsK9u5P3pQaW7k4axlgFLYkMd7UBsiNahCITShLjNQschPyjtO6dADrL24757IdhBrsQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-logical-assignment-operators@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.0.tgz#a711b8ceb3ffddd3ef88d3a49e86dbd3cc7db3fd" - integrity sha512-pbW0fE30sVTYXXm9lpVQQ/Vc+iTeQKiXlaNRZPPN2A2VdlWyAtsUrsQ3xydSlDW00TFMK7a8m3cDTkBF5WnV3Q== +"@babel/plugin-proposal-logical-assignment-operators@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.16.7.tgz#be23c0ba74deec1922e639832904be0bea73cdea" + integrity sha512-K3XzyZJGQCr00+EtYtrDjmwX7o7PLK6U9bi1nCwkQioRFVUv6dJoxbQjtWVtP+bCPy82bONBKG8NPyQ4+i6yjg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.0.tgz#44e1cce08fe2427482cf446a91bb451528ed0596" - integrity sha512-3bnHA8CAFm7cG93v8loghDYyQ8r97Qydf63BeYiGgYbjKKB/XP53W15wfRC7dvKfoiJ34f6Rbyyx2btExc8XsQ== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.16.7.tgz#141fc20b6857e59459d430c850a0011e36561d99" + integrity sha512-aUOrYU3EVtjf62jQrCj63pYZ7k6vns2h/DQvHPWGmsJRYzWXZ6/AsfgpiRy6XiuIDADhJzP2Q9MwSMKauBQ+UQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-proposal-numeric-separator@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.0.tgz#5d418e4fbbf8b9b7d03125d3a52730433a373734" - integrity sha512-FAhE2I6mjispy+vwwd6xWPyEx3NYFS13pikDBWUAFGZvq6POGs5eNchw8+1CYoEgBl9n11I3NkzD7ghn25PQ9Q== +"@babel/plugin-proposal-numeric-separator@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.7.tgz#d6b69f4af63fb38b6ca2558442a7fb191236eba9" + integrity sha512-vQgPMknOIgiuVqbokToyXbkY/OmmjAzr/0lhSIbG/KmnzXPGwW/AdhdKpi+O4X/VkWiWjnkKOBiqJrTaC98VKw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-numeric-separator" "^7.10.4" -"@babel/plugin-proposal-object-rest-spread@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.16.0.tgz#5fb32f6d924d6e6712810362a60e12a2609872e6" - integrity sha512-LU/+jp89efe5HuWJLmMmFG0+xbz+I2rSI7iLc1AlaeSMDMOGzWlc5yJrMN1d04osXN4sSfpo4O+azkBNBes0jg== +"@babel/plugin-proposal-object-rest-spread@^7.16.7": + version "7.17.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.17.3.tgz#d9eb649a54628a51701aef7e0ea3d17e2b9dd390" + integrity sha512-yuL5iQA/TbZn+RGAfxQXfi7CNLmKi1f8zInn4IgobuCWcAb7i+zj4TYzQ9l8cEzVyJ89PDGuqxK1xZpUDISesw== dependencies: - "@babel/compat-data" "^7.16.0" - "@babel/helper-compilation-targets" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/compat-data" "^7.17.0" + "@babel/helper-compilation-targets" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.16.0" + "@babel/plugin-transform-parameters" "^7.16.7" -"@babel/plugin-proposal-optional-catch-binding@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.0.tgz#5910085811ab4c28b00d6ebffa4ab0274d1e5f16" - integrity sha512-kicDo0A/5J0nrsCPbn89mTG3Bm4XgYi0CZtvex9Oyw7gGZE3HXGD0zpQNH+mo+tEfbo8wbmMvJftOwpmPy7aVw== +"@babel/plugin-proposal-optional-catch-binding@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.7.tgz#c623a430674ffc4ab732fd0a0ae7722b67cb74cf" + integrity sha512-eMOH/L4OvWSZAE1VkHbr1vckLG1WUcHGJSLqqQwl2GaUqG6QjddvrOaTUMNYiv77H5IKPMZ9U9P7EaHwvAShfA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.14.2", "@babel/plugin-proposal-optional-chaining@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.0.tgz#56dbc3970825683608e9efb55ea82c2a2d6c8dc0" - integrity sha512-Y4rFpkZODfHrVo70Uaj6cC1JJOt3Pp0MdWSwIKtb8z1/lsjl9AmnB7ErRFV+QNGIfcY1Eruc2UMx5KaRnXjMyg== +"@babel/plugin-proposal-optional-chaining@^7.14.2", "@babel/plugin-proposal-optional-chaining@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.16.7.tgz#7cd629564724816c0e8a969535551f943c64c39a" + integrity sha512-eC3xy+ZrUcBtP7x+sq62Q/HYd674pPTb/77XZMb5wbDPGWIdUbSr4Agr052+zaUPSb+gGRnjxXfKFvx5iMJ+DA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-proposal-private-methods@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.0.tgz#b4dafb9c717e4301c5776b30d080d6383c89aff6" - integrity sha512-IvHmcTHDFztQGnn6aWq4t12QaBXTKr1whF/dgp9kz84X6GUcwq9utj7z2wFCUfeOup/QKnOlt2k0zxkGFx9ubg== +"@babel/plugin-proposal-private-methods@^7.16.11": + version "7.16.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.16.11.tgz#e8df108288555ff259f4527dbe84813aac3a1c50" + integrity sha512-F/2uAkPlXDr8+BHpZvo19w3hLFKge+k75XUprE6jaqKxjGkSYcK+4c+bup5PdW/7W/Rpjwql7FTVEDW+fRAQsw== dependencies: - "@babel/helper-create-class-features-plugin" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-class-features-plugin" "^7.16.10" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-proposal-private-property-in-object@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.0.tgz#69e935b2c5c79d2488112d886f0c4e2790fee76f" - integrity sha512-3jQUr/HBbMVZmi72LpjQwlZ55i1queL8KcDTQEkAHihttJnAPrcvG9ZNXIfsd2ugpizZo595egYV6xy+pv4Ofw== +"@babel/plugin-proposal-private-property-in-object@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.16.7.tgz#b0b8cef543c2c3d57e59e2c611994861d46a3fce" + integrity sha512-rMQkjcOFbm+ufe3bTZLyOfsOUOxyvLXZJCTARhJr+8UMSoZmqTe1K1BgkFcrW37rAchWg57yI69ORxiWvUINuQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.16.0" - "@babel/helper-create-class-features-plugin" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-annotate-as-pure" "^7.16.7" + "@babel/helper-create-class-features-plugin" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" -"@babel/plugin-proposal-unicode-property-regex@^7.16.0", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.0.tgz#890482dfc5ea378e42e19a71e709728cabf18612" - integrity sha512-ti7IdM54NXv29cA4+bNNKEMS4jLMCbJgl+Drv+FgYy0erJLAxNAIXcNjNjrRZEcWq0xJHsNVwQezskMFpF8N9g== +"@babel/plugin-proposal-unicode-property-regex@^7.16.7", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.16.7.tgz#635d18eb10c6214210ffc5ff4932552de08188a2" + integrity sha512-QRK0YI/40VLhNVGIjRNAAQkEHws0cswSdFFjpFyt943YmJIU1da9uW63Iu6NFV6CxTZW5eTDCrwZUstBWgp/Rg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -465,12 +484,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-decorators@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.16.0.tgz#eb8d811cdd1060f6ac3c00956bf3f6335505a32f" - integrity sha512-nxnnngZClvlY13nHJAIDow0S7Qzhq64fQ/NlqS+VER3kjW/4F0jLhXjeL8jcwSwz6Ca3rotT5NJD2T9I7lcv7g== +"@babel/plugin-syntax-decorators@^7.17.0": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-decorators/-/plugin-syntax-decorators-7.17.0.tgz#a2be3b2c9fe7d78bd4994e790896bc411e2f166d" + integrity sha512-qWe85yCXsvDEluNP0OyeQjH63DlhAR3W7K9BxxU1MvbDb48tgBG+Ao6IJJ6smPDrrVzSQZrbF6donpkFBMcs3A== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-syntax-dynamic-import@^7.8.3": version "7.8.3" @@ -556,288 +575,290 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.16.0": - version "7.16.0" - resolved "http://localhost:4873/@babel%2fplugin-syntax-typescript/-/plugin-syntax-typescript-7.16.0.tgz#2feeb13d9334cc582ea9111d3506f773174179bb" - integrity sha512-Xv6mEXqVdaqCBfJFyeab0fH2DnUoMsDmhamxsSi4j8nLd4Vtw213WMJr55xxqipC/YVWyPY3K0blJncPYji+dQ== +"@babel/plugin-syntax-typescript@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz#39c9b55ee153151990fb038651d58d3fd03f98f8" + integrity sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-arrow-functions@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.0.tgz#951706f8b449c834ed07bd474c0924c944b95a8e" - integrity sha512-vIFb5250Rbh7roWARvCLvIJ/PtAU5Lhv7BtZ1u24COwpI9Ypjsh+bZcKk6rlIyalK+r0jOc1XQ8I4ovNxNrWrA== +"@babel/plugin-transform-arrow-functions@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.16.7.tgz#44125e653d94b98db76369de9c396dc14bef4154" + integrity sha512-9ffkFFMbvzTvv+7dTp/66xvZAWASuPD5Tl9LK3Z9vhOmANo6j94rik+5YMBt4CwHVMWLWpMsriIc2zsa3WW3xQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-async-to-generator@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.0.tgz#df12637f9630ddfa0ef9d7a11bc414d629d38604" - integrity sha512-PbIr7G9kR8tdH6g8Wouir5uVjklETk91GMVSUq+VaOgiinbCkBP6Q7NN/suM/QutZkMJMvcyAriogcYAdhg8Gw== +"@babel/plugin-transform-async-to-generator@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.16.8.tgz#b83dff4b970cf41f1b819f8b49cc0cfbaa53a808" + integrity sha512-MtmUmTJQHCnyJVrScNzNlofQJ3dLFuobYn3mwOTKHnSCMtbNsqvF71GQmJfFjdrXSsAA7iysFmYWw4bXZ20hOg== dependencies: - "@babel/helper-module-imports" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-remap-async-to-generator" "^7.16.0" + "@babel/helper-module-imports" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-remap-async-to-generator" "^7.16.8" -"@babel/plugin-transform-block-scoped-functions@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.0.tgz#c618763233ad02847805abcac4c345ce9de7145d" - integrity sha512-V14As3haUOP4ZWrLJ3VVx5rCnrYhMSHN/jX7z6FAt5hjRkLsb0snPCmJwSOML5oxkKO4FNoNv7V5hw/y2bjuvg== +"@babel/plugin-transform-block-scoped-functions@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz#4d0d57d9632ef6062cdf354bb717102ee042a620" + integrity sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-block-scoping@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.0.tgz#bcf433fb482fe8c3d3b4e8a66b1c4a8e77d37c16" - integrity sha512-27n3l67/R3UrXfizlvHGuTwsRIFyce3D/6a37GRxn28iyTPvNXaW4XvznexRh1zUNLPjbLL22Id0XQElV94ruw== +"@babel/plugin-transform-block-scoping@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.16.7.tgz#f50664ab99ddeaee5bc681b8f3a6ea9d72ab4f87" + integrity sha512-ObZev2nxVAYA4bhyusELdo9hb3H+A56bxH3FZMbEImZFiEDYVHXQSJ1hQKFlDnlt8G9bBrCZ5ZpURZUrV4G5qQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-classes@^7.12.1", "@babel/plugin-transform-classes@^7.16.0", "@babel/plugin-transform-classes@^7.9.5": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.0.tgz#54cf5ff0b2242c6573d753cd4bfc7077a8b282f5" - integrity sha512-HUxMvy6GtAdd+GKBNYDWCIA776byUQH8zjnfjxwT1P1ARv/wFu8eBDpmXQcLS/IwRtrxIReGiplOwMeyO7nsDQ== +"@babel/plugin-transform-classes@^7.12.1", "@babel/plugin-transform-classes@^7.16.7", "@babel/plugin-transform-classes@^7.9.5": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.16.7.tgz#8f4b9562850cd973de3b498f1218796eb181ce00" + integrity sha512-WY7og38SFAGYRe64BrjKf8OrE6ulEHtr5jEYaZMwox9KebgqPi67Zqz8K53EKk1fFEJgm96r32rkKZ3qA2nCWQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.16.0" - "@babel/helper-function-name" "^7.16.0" - "@babel/helper-optimise-call-expression" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.16.0" - "@babel/helper-split-export-declaration" "^7.16.0" + "@babel/helper-annotate-as-pure" "^7.16.7" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-optimise-call-expression" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-replace-supers" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.0.tgz#e0c385507d21e1b0b076d66bed6d5231b85110b7" - integrity sha512-63l1dRXday6S8V3WFY5mXJwcRAnPYxvFfTlt67bwV1rTyVTM5zrp0DBBb13Kl7+ehkCVwIZPumPpFP/4u70+Tw== +"@babel/plugin-transform-computed-properties@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.16.7.tgz#66dee12e46f61d2aae7a73710f591eb3df616470" + integrity sha512-gN72G9bcmenVILj//sv1zLNaPyYcOzUho2lIJBMh/iakJ9ygCo/hEF9cpGb61SCMEDxbbyBoVQxrt+bWKu5KGw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-destructuring@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.16.0.tgz#ad3d7e74584ad5ea4eadb1e6642146c590dee33c" - integrity sha512-Q7tBUwjxLTsHEoqktemHBMtb3NYwyJPTJdM+wDwb0g8PZ3kQUIzNvwD5lPaqW/p54TXBc/MXZu9Jr7tbUEUM8Q== +"@babel/plugin-transform-destructuring@^7.16.7": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.17.7.tgz#49dc2675a7afa9a5e4c6bdee636061136c3408d1" + integrity sha512-XVh0r5yq9sLR4vZ6eVZe8FKfIcSgaTBxVBRSYokRj2qksf6QerYnTxz9/GTuKTH/n/HwLP7t6gtlybHetJ/6hQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-dotall-regex@^7.16.0", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.0.tgz#50bab00c1084b6162d0a58a818031cf57798e06f" - integrity sha512-FXlDZfQeLILfJlC6I1qyEwcHK5UpRCFkaoVyA1nk9A1L1Yu583YO4un2KsLBsu3IJb4CUbctZks8tD9xPQubLw== +"@babel/plugin-transform-dotall-regex@^7.16.7", "@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz#6b2d67686fab15fb6a7fd4bd895d5982cfc81241" + integrity sha512-Lyttaao2SjZF6Pf4vk1dVKv8YypMpomAbygW+mU5cYP3S5cWTfCJjG8xV6CFdzGFlfWK81IjL9viiTvpb6G7gQ== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-duplicate-keys@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.0.tgz#8bc2e21813e3e89e5e5bf3b60aa5fc458575a176" - integrity sha512-LIe2kcHKAZOJDNxujvmp6z3mfN6V9lJxubU4fJIGoQCkKe3Ec2OcbdlYP+vW++4MpxwG0d1wSDOJtQW5kLnkZQ== +"@babel/plugin-transform-duplicate-keys@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.16.7.tgz#2207e9ca8f82a0d36a5a67b6536e7ef8b08823c9" + integrity sha512-03DvpbRfvWIXyK0/6QiR1KMTWeT6OcQ7tbhjrXyFS02kjuX/mu5Bvnh5SDSWHxyawit2g5aWhKwI86EE7GUnTw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-exponentiation-operator@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.0.tgz#a180cd2881e3533cef9d3901e48dad0fbeff4be4" - integrity sha512-OwYEvzFI38hXklsrbNivzpO3fh87skzx8Pnqi4LoSYeav0xHlueSoCJrSgTPfnbyzopo5b3YVAJkFIcUpK2wsw== +"@babel/plugin-transform-exponentiation-operator@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.7.tgz#efa9862ef97e9e9e5f653f6ddc7b665e8536fe9b" + integrity sha512-8UYLSlyLgRixQvlYH3J2ekXFHDFLQutdy7FfFAMm3CPZ6q9wHCwnUyiXpQCe3gVVnQlHc5nsuiEVziteRNTXEA== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-for-of@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.0.tgz#f7abaced155260e2461359bbc7c7248aca5e6bd2" - integrity sha512-5QKUw2kO+GVmKr2wMYSATCTTnHyscl6sxFRAY+rvN7h7WB0lcG0o4NoV6ZQU32OZGVsYUsfLGgPQpDFdkfjlJQ== +"@babel/plugin-transform-for-of@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.16.7.tgz#649d639d4617dff502a9a158c479b3b556728d8c" + integrity sha512-/QZm9W92Ptpw7sjI9Nx1mbcsWz33+l8kuMIQnDwgQBG5s3fAfQvkRjQ7NqXhtNcKOnPkdICmUHyCaWW06HCsqg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-function-name@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.0.tgz#02e3699c284c6262236599f751065c5d5f1f400e" - integrity sha512-lBzMle9jcOXtSOXUpc7tvvTpENu/NuekNJVova5lCCWCV9/U1ho2HH2y0p6mBg8fPm/syEAbfaaemYGOHCY3mg== +"@babel/plugin-transform-function-name@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz#5ab34375c64d61d083d7d2f05c38d90b97ec65cf" + integrity sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA== dependencies: - "@babel/helper-function-name" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-compilation-targets" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-instanceof@^7.12.1": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-instanceof/-/plugin-transform-instanceof-7.16.0.tgz#2dead81e9ba3e11d6378172ff3fab9967bd2307d" - integrity sha512-12b9/GJI9qisUpZtWlR5bf+ZD1DeNUzM6J4CbQTP7Zega6brRKHRSGDuQc5eJywGHni6Ib/l3RumF9vQ6CD6EQ== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-instanceof/-/plugin-transform-instanceof-7.16.7.tgz#cedb7fb33e9fa25ace9cc2b020d2bb07bc584f11" + integrity sha512-DhH2rWEmDc+i9v3sVa4VIIFyKlMu3jPuJdwrq2Xcv9B+PxGkhdpyyNLJiBzZMyf3VVNN/voti03KY+C8lPh+Nw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-literals@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.0.tgz#79711e670ffceb31bd298229d50f3621f7980cac" - integrity sha512-gQDlsSF1iv9RU04clgXqRjrPyyoJMTclFt3K1cjLmTKikc0s/6vE3hlDeEVC71wLTRu72Fq7650kABrdTc2wMQ== +"@babel/plugin-transform-literals@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.16.7.tgz#254c9618c5ff749e87cb0c0cef1a0a050c0bdab1" + integrity sha512-6tH8RTpTWI0s2sV6uq3e/C9wPo4PTqqZps4uF0kzQ9/xPLFQtipynvmT1g/dOfEJ+0EQsHhkQ/zyRId8J2b8zQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-member-expression-literals@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.0.tgz#5251b4cce01eaf8314403d21aedb269d79f5e64b" - integrity sha512-WRpw5HL4Jhnxw8QARzRvwojp9MIE7Tdk3ez6vRyUk1MwgjJN0aNpRoXainLR5SgxmoXx/vsXGZ6OthP6t/RbUg== +"@babel/plugin-transform-member-expression-literals@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.7.tgz#6e5dcf906ef8a098e630149d14c867dd28f92384" + integrity sha512-mBruRMbktKQwbxaJof32LT9KLy2f3gH+27a5XSuXo6h7R3vqltl0PgZ80C8ZMKw98Bf8bqt6BEVi3svOh2PzMw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-modules-amd@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.0.tgz#09abd41e18dcf4fd479c598c1cef7bd39eb1337e" - integrity sha512-rWFhWbCJ9Wdmzln1NmSCqn7P0RAD+ogXG/bd9Kg5c7PKWkJtkiXmYsMBeXjDlzHpVTJ4I/hnjs45zX4dEv81xw== +"@babel/plugin-transform-modules-amd@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.16.7.tgz#b28d323016a7daaae8609781d1f8c9da42b13186" + integrity sha512-KaaEtgBL7FKYwjJ/teH63oAmE3lP34N3kshz8mm4VMAw7U3PxjVwwUmxEFksbgsNUaO3wId9R2AVQYSEGRa2+g== dependencies: - "@babel/helper-module-transforms" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-module-transforms" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.16.0.tgz#add58e638c8ddc4875bd9a9ecb5c594613f6c922" - integrity sha512-Dzi+NWqyEotgzk/sb7kgQPJQf7AJkQBWsVp1N6JWc1lBVo0vkElUnGdr1PzUBmfsCCN5OOFya3RtpeHk15oLKQ== +"@babel/plugin-transform-modules-commonjs@^7.16.8": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.17.7.tgz#d86b217c8e45bb5f2dbc11eefc8eab62cf980d19" + integrity sha512-ITPmR2V7MqioMJyrxUo2onHNC3e+MvfFiFIR0RP21d3PtlVb6sfzoxNKiphSZUOM9hEIdzCcZe83ieX3yoqjUA== dependencies: - "@babel/helper-module-transforms" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-simple-access" "^7.16.0" + "@babel/helper-module-transforms" "^7.17.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-simple-access" "^7.17.7" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-systemjs@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.16.0.tgz#a92cf240afeb605f4ca16670453024425e421ea4" - integrity sha512-yuGBaHS3lF1m/5R+6fjIke64ii5luRUg97N2wr+z1sF0V+sNSXPxXDdEEL/iYLszsN5VKxVB1IPfEqhzVpiqvg== +"@babel/plugin-transform-modules-systemjs@^7.16.7": + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.17.8.tgz#81fd834024fae14ea78fbe34168b042f38703859" + integrity sha512-39reIkMTUVagzgA5x88zDYXPCMT6lcaRKs1+S9K6NKBPErbgO/w/kP8GlNQTC87b412ZTlmNgr3k2JrWgHH+Bw== dependencies: - "@babel/helper-hoist-variables" "^7.16.0" - "@babel/helper-module-transforms" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-identifier" "^7.15.7" + "@babel/helper-hoist-variables" "^7.16.7" + "@babel/helper-module-transforms" "^7.17.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-validator-identifier" "^7.16.7" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-umd@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.0.tgz#195f26c2ad6d6a391b70880effce18ce625e06a7" - integrity sha512-nx4f6no57himWiHhxDM5pjwhae5vLpTK2zCnDH8+wNLJy0TVER/LJRHl2bkt6w9Aad2sPD5iNNoUpY3X9sTGDg== +"@babel/plugin-transform-modules-umd@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.16.7.tgz#23dad479fa585283dbd22215bff12719171e7618" + integrity sha512-EMh7uolsC8O4xhudF2F6wedbSHm1HHZ0C6aJ7K67zcDNidMzVcxWdGr+htW9n21klm+bOn+Rx4CBsAntZd3rEQ== dependencies: - "@babel/helper-module-transforms" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-module-transforms" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-named-capturing-groups-regex@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.0.tgz#d3db61cc5d5b97986559967cd5ea83e5c32096ca" - integrity sha512-LogN88uO+7EhxWc8WZuQ8vxdSyVGxhkh8WTC3tzlT8LccMuQdA81e9SGV6zY7kY2LjDhhDOFdQVxdGwPyBCnvg== +"@babel/plugin-transform-named-capturing-groups-regex@^7.16.8": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.16.8.tgz#7f860e0e40d844a02c9dcf9d84965e7dfd666252" + integrity sha512-j3Jw+n5PvpmhRR+mrgIh04puSANCk/T/UA3m3P1MjJkhlK906+ApHhDIqBQDdOgL/r1UYpz4GNclTXxyZrYGSw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.16.0" + "@babel/helper-create-regexp-features-plugin" "^7.16.7" -"@babel/plugin-transform-new-target@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.0.tgz#af823ab576f752215a49937779a41ca65825ab35" - integrity sha512-fhjrDEYv2DBsGN/P6rlqakwRwIp7rBGLPbrKxwh7oVt5NNkIhZVOY2GRV+ULLsQri1bDqwDWnU3vhlmx5B2aCw== +"@babel/plugin-transform-new-target@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.16.7.tgz#9967d89a5c243818e0800fdad89db22c5f514244" + integrity sha512-xiLDzWNMfKoGOpc6t3U+etCE2yRnn3SM09BXqWPIZOBpL2gvVrBWUKnsJx0K/ADi5F5YC5f8APFfWrz25TdlGg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-object-super@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.0.tgz#fb20d5806dc6491a06296ac14ea8e8d6fedda72b" - integrity sha512-fds+puedQHn4cPLshoHcR1DTMN0q1V9ou0mUjm8whx9pGcNvDrVVrgw+KJzzCaiTdaYhldtrUps8DWVMgrSEyg== +"@babel/plugin-transform-object-super@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz#ac359cf8d32cf4354d27a46867999490b6c32a94" + integrity sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-replace-supers" "^7.16.0" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-replace-supers" "^7.16.7" -"@babel/plugin-transform-parameters@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.0.tgz#1b50765fc421c229819dc4c7cdb8911660b3c2d7" - integrity sha512-XgnQEm1CevKROPx+udOi/8f8TiGhrUWiHiaUCIp47tE0tpFDjzXNTZc9E5CmCwxNjXTWEVqvRfWZYOTFvMa/ZQ== +"@babel/plugin-transform-parameters@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.16.7.tgz#a1721f55b99b736511cb7e0152f61f17688f331f" + integrity sha512-AT3MufQ7zZEhU2hwOA11axBnExW0Lszu4RL/tAlUJBuNoRak+wehQW8h6KcXOcgjY42fHtDxswuMhMjFEuv/aw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-property-literals@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.0.tgz#a95c552189a96a00059f6776dc4e00e3690c78d1" - integrity sha512-XLldD4V8+pOqX2hwfWhgwXzGdnDOThxaNTgqagOcpBgIxbUvpgU2FMvo5E1RyHbk756WYgdbS0T8y0Cj9FKkWQ== +"@babel/plugin-transform-property-literals@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.7.tgz#2dadac85155436f22c696c4827730e0fe1057a55" + integrity sha512-z4FGr9NMGdoIl1RqavCqGG+ZuYjfZ/hkCIeuH6Do7tXmSm0ls11nYVSJqFEUOSJbDab5wC6lRE/w6YjVcr6Hqw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-regenerator@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.0.tgz#eaee422c84b0232d03aea7db99c97deeaf6125a4" - integrity sha512-JAvGxgKuwS2PihiSFaDrp94XOzzTUeDeOQlcKzVAyaPap7BnZXK/lvMDiubkPTdotPKOIZq9xWXWnggUMYiExg== +"@babel/plugin-transform-regenerator@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.16.7.tgz#9e7576dc476cb89ccc5096fff7af659243b4adeb" + integrity sha512-mF7jOgGYCkSJagJ6XCujSQg+6xC1M77/03K2oBmVJWoFGNUtnVJO4WHKJk3dnPC8HCcj4xBQP1Egm8DWh3Pb3Q== dependencies: regenerator-transform "^0.14.2" -"@babel/plugin-transform-reserved-words@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.0.tgz#fff4b9dcb19e12619394bda172d14f2d04c0379c" - integrity sha512-Dgs8NNCehHSvXdhEhln8u/TtJxfVwGYCgP2OOr5Z3Ar+B+zXicEOKNTyc+eca2cuEOMtjW6m9P9ijOt8QdqWkg== +"@babel/plugin-transform-reserved-words@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.16.7.tgz#1d798e078f7c5958eec952059c460b220a63f586" + integrity sha512-KQzzDnZ9hWQBjwi5lpY5v9shmm6IVG0U9pB18zvMu2i4H90xpT4gmqwPYsn8rObiadYe2M0gmgsiOIF5A/2rtg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/plugin-transform-runtime@^7.12.1": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.16.0.tgz#3fe0da36c2f0834bef7c4d3e7f2b2db0ee0c8909" - integrity sha512-zlPf1/XFn5+vWdve3AAhf+Sxl+MVa5VlwTwWgnLx23u4GlatSRQJ3Eoo9vllf0a9il3woQsT4SK+5Z7c06h8ag== + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.17.0.tgz#0a2e08b5e2b2d95c4b1d3b3371a2180617455b70" + integrity sha512-fr7zPWnKXNc1xoHfrIU9mN/4XKX4VLZ45Q+oMhfsYIaHvg7mHgmhfOy/ckRWqDK7XF3QDigRpkh5DKq6+clE8A== dependencies: - "@babel/helper-module-imports" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" - babel-plugin-polyfill-corejs2 "^0.2.3" - babel-plugin-polyfill-corejs3 "^0.3.0" - babel-plugin-polyfill-regenerator "^0.2.3" + "@babel/helper-module-imports" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + babel-plugin-polyfill-corejs2 "^0.3.0" + babel-plugin-polyfill-corejs3 "^0.5.0" + babel-plugin-polyfill-regenerator "^0.3.0" semver "^6.3.0" -"@babel/plugin-transform-shorthand-properties@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.0.tgz#090372e3141f7cc324ed70b3daf5379df2fa384d" - integrity sha512-iVb1mTcD8fuhSv3k99+5tlXu5N0v8/DPm2mO3WACLG6al1CGZH7v09HJyUb1TtYl/Z+KrM6pHSIJdZxP5A+xow== +"@babel/plugin-transform-shorthand-properties@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz#e8549ae4afcf8382f711794c0c7b6b934c5fbd2a" + integrity sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-spread@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.0.tgz#d21ca099bbd53ab307a8621e019a7bd0f40cdcfb" - integrity sha512-Ao4MSYRaLAQczZVp9/7E7QHsCuK92yHRrmVNRe/SlEJjhzivq0BSn8mEraimL8wizHZ3fuaHxKH0iwzI13GyGg== +"@babel/plugin-transform-spread@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.16.7.tgz#a303e2122f9f12e0105daeedd0f30fb197d8ff44" + integrity sha512-+pjJpgAngb53L0iaA5gU/1MLXJIfXcYepLgXB3esVRf4fqmj8f2cxM3/FKaHsZms08hFQJkFccEWuIpm429TXg== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" -"@babel/plugin-transform-sticky-regex@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.0.tgz#c35ea31a02d86be485f6aa510184b677a91738fd" - integrity sha512-/ntT2NljR9foobKk4E/YyOSwcGUXtYWv5tinMK/3RkypyNBNdhHUaq6Orw5DWq9ZcNlS03BIlEALFeQgeVAo4Q== +"@babel/plugin-transform-sticky-regex@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.7.tgz#c84741d4f4a38072b9a1e2e3fd56d359552e8660" + integrity sha512-NJa0Bd/87QV5NZZzTuZG5BPJjLYadeSZ9fO6oOUoL4iQx+9EEuw/eEM92SrsT19Yc2jgB1u1hsjqDtH02c3Drw== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-template-literals@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.0.tgz#a8eced3a8e7b8e2d40ec4ec4548a45912630d302" - integrity sha512-Rd4Ic89hA/f7xUSJQk5PnC+4so50vBoBfxjdQAdvngwidM8jYIBVxBZ/sARxD4e0yMXRbJVDrYf7dyRtIIKT6Q== +"@babel/plugin-transform-template-literals@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.16.7.tgz#f3d1c45d28967c8e80f53666fc9c3e50618217ab" + integrity sha512-VwbkDDUeenlIjmfNeDX/V0aWrQH2QiVyJtwymVQSzItFDTpxfyJh3EVaQiS0rIN/CqbLGr0VcGmuwyTdZtdIsA== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-typeof-symbol@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.0.tgz#8b19a244c6f8c9d668dca6a6f754ad6ead1128f2" - integrity sha512-++V2L8Bdf4vcaHi2raILnptTBjGEFxn5315YU+e8+EqXIucA+q349qWngCLpUYqqv233suJ6NOienIVUpS9cqg== +"@babel/plugin-transform-typeof-symbol@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.16.7.tgz#9cdbe622582c21368bd482b660ba87d5545d4f7e" + integrity sha512-p2rOixCKRJzpg9JB4gjnG4gjWkWa89ZoYUnl9snJ1cWIcTH/hvxZqfO+WjG6T8DRBpctEol5jw1O5rA8gkCokQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-typescript@^7.16.0": - version "7.16.1" - resolved "http://localhost:4873/@babel%2fplugin-transform-typescript/-/plugin-transform-typescript-7.16.1.tgz#cc0670b2822b0338355bc1b3d2246a42b8166409" - integrity sha512-NO4XoryBng06jjw/qWEU2LhcLJr1tWkhpMam/H4eas/CDKMX/b2/Ylb6EI256Y7+FVPCawwSM1rrJNOpDiz+Lg== +"@babel/plugin-transform-typescript@^7.16.7": + version "7.16.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.16.8.tgz#591ce9b6b83504903fa9dd3652c357c2ba7a1ee0" + integrity sha512-bHdQ9k7YpBDO2d0NVfkj51DpQcvwIzIusJ7mEUaMlbZq3Kt/U47j24inXZHQ5MDiYpCs+oZiwnXyKedE8+q7AQ== dependencies: - "@babel/helper-create-class-features-plugin" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/plugin-syntax-typescript" "^7.16.0" + "@babel/helper-create-class-features-plugin" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/plugin-syntax-typescript" "^7.16.7" -"@babel/plugin-transform-unicode-escapes@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.0.tgz#1a354064b4c45663a32334f46fa0cf6100b5b1f3" - integrity sha512-VFi4dhgJM7Bpk8lRc5CMaRGlKZ29W9C3geZjt9beuzSUrlJxsNwX7ReLwaL6WEvsOf2EQkyIJEPtF8EXjB/g2A== +"@babel/plugin-transform-unicode-escapes@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.7.tgz#da8717de7b3287a2c6d659750c964f302b31ece3" + integrity sha512-TAV5IGahIz3yZ9/Hfv35TV2xEm+kaBDaZQCn2S/hG9/CZ0DktxJv9eKfPc7yYCvOYR4JGx1h8C+jcSOvgaaI/Q== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-plugin-utils" "^7.16.7" -"@babel/plugin-transform-unicode-regex@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.0.tgz#293b80950177c8c85aede87cef280259fb995402" - integrity sha512-jHLK4LxhHjvCeZDWyA9c+P9XH1sOxRd1RO9xMtDVRAOND/PczPqizEtVdx4TQF/wyPaewqpT+tgQFYMnN/P94A== +"@babel/plugin-transform-unicode-regex@^7.16.7": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.7.tgz#0f7aa4a501198976e25e82702574c34cfebe9ef2" + integrity sha512-oC5tYYKw56HO75KZVLQ+R/Nl3Hro9kf8iG0hXoaHP7tjAyCpvqBiSNe6vGrZni1Z6MggmUOC6A7VP7AVmw225Q== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" + "@babel/helper-create-regexp-features-plugin" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" "@babel/polyfill@^7.8.7": version "7.12.1" @@ -848,31 +869,31 @@ regenerator-runtime "^0.13.4" "@babel/preset-env@^7.12.7": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.16.0.tgz#97228393d217560d6a1c6c56f0adb9d12bca67f5" - integrity sha512-cdTu/W0IrviamtnZiTfixPfIncr2M1VqRrkjzZWlr1B4TVYimCFK5jkyOdP4qw2MrlKHi+b3ORj6x8GoCew8Dg== + version "7.16.11" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.16.11.tgz#5dd88fd885fae36f88fd7c8342475c9f0abe2982" + integrity sha512-qcmWG8R7ZW6WBRPZK//y+E3Cli151B20W1Rv7ln27vuPaXU/8TKms6jFdiJtF7UDTxcrb7mZd88tAeK9LjdT8g== dependencies: - "@babel/compat-data" "^7.16.0" - "@babel/helper-compilation-targets" "^7.16.0" - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.16.0" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.16.0" - "@babel/plugin-proposal-async-generator-functions" "^7.16.0" - "@babel/plugin-proposal-class-properties" "^7.16.0" - "@babel/plugin-proposal-class-static-block" "^7.16.0" - "@babel/plugin-proposal-dynamic-import" "^7.16.0" - "@babel/plugin-proposal-export-namespace-from" "^7.16.0" - "@babel/plugin-proposal-json-strings" "^7.16.0" - "@babel/plugin-proposal-logical-assignment-operators" "^7.16.0" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.16.0" - "@babel/plugin-proposal-numeric-separator" "^7.16.0" - "@babel/plugin-proposal-object-rest-spread" "^7.16.0" - "@babel/plugin-proposal-optional-catch-binding" "^7.16.0" - "@babel/plugin-proposal-optional-chaining" "^7.16.0" - "@babel/plugin-proposal-private-methods" "^7.16.0" - "@babel/plugin-proposal-private-property-in-object" "^7.16.0" - "@babel/plugin-proposal-unicode-property-regex" "^7.16.0" + "@babel/compat-data" "^7.16.8" + "@babel/helper-compilation-targets" "^7.16.7" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-validator-option" "^7.16.7" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.16.7" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.16.7" + "@babel/plugin-proposal-async-generator-functions" "^7.16.8" + "@babel/plugin-proposal-class-properties" "^7.16.7" + "@babel/plugin-proposal-class-static-block" "^7.16.7" + "@babel/plugin-proposal-dynamic-import" "^7.16.7" + "@babel/plugin-proposal-export-namespace-from" "^7.16.7" + "@babel/plugin-proposal-json-strings" "^7.16.7" + "@babel/plugin-proposal-logical-assignment-operators" "^7.16.7" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.16.7" + "@babel/plugin-proposal-numeric-separator" "^7.16.7" + "@babel/plugin-proposal-object-rest-spread" "^7.16.7" + "@babel/plugin-proposal-optional-catch-binding" "^7.16.7" + "@babel/plugin-proposal-optional-chaining" "^7.16.7" + "@babel/plugin-proposal-private-methods" "^7.16.11" + "@babel/plugin-proposal-private-property-in-object" "^7.16.7" + "@babel/plugin-proposal-unicode-property-regex" "^7.16.7" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-class-properties" "^7.12.13" "@babel/plugin-syntax-class-static-block" "^7.14.5" @@ -887,44 +908,44 @@ "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.16.0" - "@babel/plugin-transform-async-to-generator" "^7.16.0" - "@babel/plugin-transform-block-scoped-functions" "^7.16.0" - "@babel/plugin-transform-block-scoping" "^7.16.0" - "@babel/plugin-transform-classes" "^7.16.0" - "@babel/plugin-transform-computed-properties" "^7.16.0" - "@babel/plugin-transform-destructuring" "^7.16.0" - "@babel/plugin-transform-dotall-regex" "^7.16.0" - "@babel/plugin-transform-duplicate-keys" "^7.16.0" - "@babel/plugin-transform-exponentiation-operator" "^7.16.0" - "@babel/plugin-transform-for-of" "^7.16.0" - "@babel/plugin-transform-function-name" "^7.16.0" - "@babel/plugin-transform-literals" "^7.16.0" - "@babel/plugin-transform-member-expression-literals" "^7.16.0" - "@babel/plugin-transform-modules-amd" "^7.16.0" - "@babel/plugin-transform-modules-commonjs" "^7.16.0" - "@babel/plugin-transform-modules-systemjs" "^7.16.0" - "@babel/plugin-transform-modules-umd" "^7.16.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.16.0" - "@babel/plugin-transform-new-target" "^7.16.0" - "@babel/plugin-transform-object-super" "^7.16.0" - "@babel/plugin-transform-parameters" "^7.16.0" - "@babel/plugin-transform-property-literals" "^7.16.0" - "@babel/plugin-transform-regenerator" "^7.16.0" - "@babel/plugin-transform-reserved-words" "^7.16.0" - "@babel/plugin-transform-shorthand-properties" "^7.16.0" - "@babel/plugin-transform-spread" "^7.16.0" - "@babel/plugin-transform-sticky-regex" "^7.16.0" - "@babel/plugin-transform-template-literals" "^7.16.0" - "@babel/plugin-transform-typeof-symbol" "^7.16.0" - "@babel/plugin-transform-unicode-escapes" "^7.16.0" - "@babel/plugin-transform-unicode-regex" "^7.16.0" + "@babel/plugin-transform-arrow-functions" "^7.16.7" + "@babel/plugin-transform-async-to-generator" "^7.16.8" + "@babel/plugin-transform-block-scoped-functions" "^7.16.7" + "@babel/plugin-transform-block-scoping" "^7.16.7" + "@babel/plugin-transform-classes" "^7.16.7" + "@babel/plugin-transform-computed-properties" "^7.16.7" + "@babel/plugin-transform-destructuring" "^7.16.7" + "@babel/plugin-transform-dotall-regex" "^7.16.7" + "@babel/plugin-transform-duplicate-keys" "^7.16.7" + "@babel/plugin-transform-exponentiation-operator" "^7.16.7" + "@babel/plugin-transform-for-of" "^7.16.7" + "@babel/plugin-transform-function-name" "^7.16.7" + "@babel/plugin-transform-literals" "^7.16.7" + "@babel/plugin-transform-member-expression-literals" "^7.16.7" + "@babel/plugin-transform-modules-amd" "^7.16.7" + "@babel/plugin-transform-modules-commonjs" "^7.16.8" + "@babel/plugin-transform-modules-systemjs" "^7.16.7" + "@babel/plugin-transform-modules-umd" "^7.16.7" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.16.8" + "@babel/plugin-transform-new-target" "^7.16.7" + "@babel/plugin-transform-object-super" "^7.16.7" + "@babel/plugin-transform-parameters" "^7.16.7" + "@babel/plugin-transform-property-literals" "^7.16.7" + "@babel/plugin-transform-regenerator" "^7.16.7" + "@babel/plugin-transform-reserved-words" "^7.16.7" + "@babel/plugin-transform-shorthand-properties" "^7.16.7" + "@babel/plugin-transform-spread" "^7.16.7" + "@babel/plugin-transform-sticky-regex" "^7.16.7" + "@babel/plugin-transform-template-literals" "^7.16.7" + "@babel/plugin-transform-typeof-symbol" "^7.16.7" + "@babel/plugin-transform-unicode-escapes" "^7.16.7" + "@babel/plugin-transform-unicode-regex" "^7.16.7" "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.16.0" - babel-plugin-polyfill-corejs2 "^0.2.3" - babel-plugin-polyfill-corejs3 "^0.3.0" - babel-plugin-polyfill-regenerator "^0.2.3" - core-js-compat "^3.19.0" + "@babel/types" "^7.16.8" + babel-plugin-polyfill-corejs2 "^0.3.0" + babel-plugin-polyfill-corejs3 "^0.5.0" + babel-plugin-polyfill-regenerator "^0.3.0" + core-js-compat "^3.20.2" semver "^6.3.0" "@babel/preset-modules@^0.1.5": @@ -939,62 +960,63 @@ esutils "^2.0.2" "@babel/preset-typescript@^7.16.0": - version "7.16.0" - resolved "http://localhost:4873/@babel%2fpreset-typescript/-/preset-typescript-7.16.0.tgz#b0b4f105b855fb3d631ec036cdc9d1ffd1fa5eac" - integrity sha512-txegdrZYgO9DlPbv+9QOVpMnKbOtezsLHWsnsRF4AjbSIsVaujrq1qg8HK0mxQpWv0jnejt0yEoW1uWpvbrDTg== + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.16.7.tgz#ab114d68bb2020afc069cd51b37ff98a046a70b9" + integrity sha512-WbVEmgXdIyvzB77AQjGBEyYPZx+8tTsO50XtfozQrkW8QB2rLJpH2lgx0TRw5EJrBxOZQ+wCcyPVQvS8tjEHpQ== dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - "@babel/helper-validator-option" "^7.14.5" - "@babel/plugin-transform-typescript" "^7.16.0" + "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-validator-option" "^7.16.7" + "@babel/plugin-transform-typescript" "^7.16.7" -"@babel/register@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.16.0.tgz#f5d2aa14df37cf7146b9759f7c53818360f24ec6" - integrity sha512-lzl4yfs0zVXnooeLE0AAfYaT7F3SPA8yB2Bj4W1BiZwLbMS3MZH35ZvCWSRHvneUugwuM+Wsnrj7h0F7UmU3NQ== +"@babel/register@^7.16.8": + version "7.17.7" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.17.7.tgz#5eef3e0f4afc07e25e847720e7b987ae33f08d0b" + integrity sha512-fg56SwvXRifootQEDQAu1mKdjh5uthPzdO0N6t358FktfL4XjAVXuH58ULoiW8mesxiOgNIrxiImqEwv0+hRRA== dependencies: clone-deep "^4.0.1" find-cache-dir "^2.0.0" make-dir "^2.1.0" - pirates "^4.0.0" + pirates "^4.0.5" source-map-support "^0.5.16" "@babel/runtime@^7.15.4", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.6": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.0.tgz#e27b977f2e2088ba24748bf99b5e1dece64e4f0b" - integrity sha512-Nht8L0O8YCktmsDV6FqFue7vQLRx3Hb0B37lS5y0jDRqRxlBG4wIJHnf9/bgSE2UyipKFA01YtS+npRdTWBUyw== + version "7.17.8" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.17.8.tgz#3e56e4aff81befa55ac3ac6a0967349fd1c5bca2" + integrity sha512-dQpEpK0O9o6lj6oPu0gRDbbnk+4LeHlNcBpspf6Olzt3GIX4P1lWF1gS+pHLDFlaJvbR6q7jCfQ08zA4QJBnmA== dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.16.0", "@babel/template@^7.3.3": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.0.tgz#d16a35ebf4cd74e202083356fab21dd89363ddd6" - integrity sha512-MnZdpFD/ZdYhXwiunMqqgyZyucaYsbL0IrjoGjaVhGilz+x8YB++kRfygSOIj1yOtWKPlx7NBp+9I1RQSgsd5A== +"@babel/template@^7.16.7", "@babel/template@^7.3.3": + version "7.16.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" + integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== dependencies: - "@babel/code-frame" "^7.16.0" - "@babel/parser" "^7.16.0" - "@babel/types" "^7.16.0" + "@babel/code-frame" "^7.16.7" + "@babel/parser" "^7.16.7" + "@babel/types" "^7.16.7" -"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.16.0.tgz#965df6c6bfc0a958c1e739284d3c9fa4a6e3c45b" - integrity sha512-qQ84jIs1aRQxaGaxSysII9TuDaguZ5yVrEuC0BN2vcPlalwfLovVmCjbFDPECPXcYM/wLvNFfp8uDOliLxIoUQ== +"@babel/traverse@^7.1.0", "@babel/traverse@^7.13.0", "@babel/traverse@^7.16.7", "@babel/traverse@^7.16.8", "@babel/traverse@^7.17.3": + version "7.17.3" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.3.tgz#0ae0f15b27d9a92ba1f2263358ea7c4e7db47b57" + integrity sha512-5irClVky7TxRWIRtxlh2WPUUOLhcPN06AGgaQSB8AEwuyEBgJVuJ5imdHm5zxk8w0QS5T+tDfnDxAlhWjpb7cw== dependencies: - "@babel/code-frame" "^7.16.0" - "@babel/generator" "^7.16.0" - "@babel/helper-function-name" "^7.16.0" - "@babel/helper-hoist-variables" "^7.16.0" - "@babel/helper-split-export-declaration" "^7.16.0" - "@babel/parser" "^7.16.0" - "@babel/types" "^7.16.0" + "@babel/code-frame" "^7.16.7" + "@babel/generator" "^7.17.3" + "@babel/helper-environment-visitor" "^7.16.7" + "@babel/helper-function-name" "^7.16.7" + "@babel/helper-hoist-variables" "^7.16.7" + "@babel/helper-split-export-declaration" "^7.16.7" + "@babel/parser" "^7.17.3" + "@babel/types" "^7.17.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.16.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.0.tgz#db3b313804f96aadd0b776c4823e127ad67289ba" - integrity sha512-PJgg/k3SdLsGb3hhisFvtLOw5ts113klrpLuIPtCJIU+BB24fqq6lf8RWqKJEjzqXR9AEH1rIb5XTqwBHB+kQg== +"@babel/types@^7.0.0", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8", "@babel/types@^7.17.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": + version "7.17.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.0.tgz#a826e368bccb6b3d84acd76acad5c0d87342390b" + integrity sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw== dependencies: - "@babel/helper-validator-identifier" "^7.15.7" + "@babel/helper-validator-identifier" "^7.16.7" to-fast-properties "^2.0.0" "@bcoe/v8-coverage@^0.2.3": @@ -1010,10 +1032,15 @@ exec-sh "^0.3.2" minimist "^1.2.0" +"@colors/colors@1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" + integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== + "@dabh/diagnostics@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.2.tgz#290d08f7b381b8f94607dc8f471a12c675f9db31" - integrity sha512-+A1YivoVDNNVCdfozHSR8v/jyuuLTMXwjWuxPFlFlUapXoGc+Gj9mDlTDDfrwl7rXCl2tNZ0kE8sIBO6YOn96Q== + version "2.0.3" + resolved "https://registry.yarnpkg.com/@dabh/diagnostics/-/diagnostics-2.0.3.tgz#7f7e97ee9a725dffc7808d93668cc984e1dc477a" + integrity sha512-hrlQOIi7hAfzsMqlGSFyVucrx38O+j6wiGOf//H2ecvIEqYN4ADBSS2iLMh5UFyDunCNniUIPk/q3riFv45xRA== dependencies: colorspace "1.1.x" enabled "2.0.x" @@ -1256,10 +1283,28 @@ "@types/yargs" "^15.0.0" chalk "^4.0.0" -"@medusajs/medusa-cli@1.2.0-dev-1647336201011": - version "1.2.0-dev-1647336201011" - resolved "http://localhost:4873/@medusajs%2fmedusa-cli/-/medusa-cli-1.2.0-dev-1647336201011.tgz#9842f8d2f53d5a7d2207ec23d7d4b18a33e65c54" - integrity sha512-wVqcWMh0+8ko/Db66GDrp68XpaVkvPrjrc4mn7KdfD9DnIgFCOoFakuYsQUxHDNak9EA96idZSF8/hsHALlOqg== +"@jridgewell/resolve-uri@^3.0.3": + version "3.0.5" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz#68eb521368db76d040a6315cdb24bf2483037b9c" + integrity sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew== + +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.11" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz#771a1d8d744eeb71b6adb35808e1a6c7b9b8c8ec" + integrity sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg== + +"@jridgewell/trace-mapping@^0.3.0", "@jridgewell/trace-mapping@^0.3.4": + version "0.3.4" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz#f6a0832dffd5b8a6aaa633b7d9f8e8e94c83a0c3" + integrity sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@medusajs/medusa-cli@1.2.1-dev-1648026403166": + version "1.2.1-dev-1648026403166" + resolved "http://localhost:4873/@medusajs%2fmedusa-cli/-/medusa-cli-1.2.1-dev-1648026403166.tgz#1dc2ad62ba11421d43357596c61eb0b76d3bc69e" + integrity sha512-TScUnBuxI5V5cB6gAAGeGOZU8lXYHIhozpelDcYibZqaHEIwMNs1ekzRYhfMjYowSFCMLlzCsHFUh+gqU/6WSw== dependencies: "@babel/polyfill" "^7.8.7" "@babel/runtime" "^7.9.6" @@ -1277,8 +1322,8 @@ is-valid-path "^0.1.1" joi-objectid "^3.0.1" meant "^1.0.1" - medusa-core-utils "1.1.31-dev-1647336201011" - medusa-telemetry "0.0.11-dev-1647336201011" + medusa-core-utils "1.1.31-dev-1648026403166" + medusa-telemetry "0.0.11-dev-1648026403166" netrc-parser "^3.1.6" open "^8.0.6" ora "^5.4.1" @@ -1292,13 +1337,13 @@ winston "^3.3.3" yargs "^15.3.1" -"@medusajs/medusa@1.2.0-dev-1647336201011": - version "1.2.0-dev-1647336201011" - resolved "http://localhost:4873/@medusajs%2fmedusa/-/medusa-1.2.0-dev-1647336201011.tgz#76c0c3b93adf55b463ec091d2e144616dc1293bf" - integrity sha512-t0eWo60Y5KsyN4ucWDjPyuI+4oOHrwqlrzegg4oogGiAfvq2rLDQFwxrfvzKlhgYtJUA58dvxMpZqG5n1NOJLQ== +"@medusajs/medusa@1.2.1-dev-1648026403166": + version "1.2.1-dev-1648026403166" + resolved "http://localhost:4873/@medusajs%2fmedusa/-/medusa-1.2.1-dev-1648026403166.tgz#f6e8fab09ac73b38ed79e15d2080e7ecad80fd99" + integrity sha512-ufYVgcKo+bsAzSnZA3FVLmxseDwnSKkSbIdktQUSZGMJTRvN/+Wcqnjdf59oH11jqqBApJ8T77Nvd/ABasjTWw== dependencies: "@hapi/joi" "^16.1.8" - "@medusajs/medusa-cli" "1.2.0-dev-1647336201011" + "@medusajs/medusa-cli" "1.2.1-dev-1648026403166" "@types/lodash" "^4.14.168" awilix "^4.2.3" body-parser "^1.19.0" @@ -1322,8 +1367,8 @@ joi "^17.3.0" joi-objectid "^3.0.1" jsonwebtoken "^8.5.1" - medusa-core-utils "1.1.31-dev-1647336201011" - medusa-test-utils "1.1.37-dev-1647336201011" + medusa-core-utils "1.1.31-dev-1648026403166" + medusa-test-utils "1.1.37-dev-1648026403166" morgan "^1.9.1" multer "^1.4.2" passport "^0.4.0" @@ -1368,22 +1413,22 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@oclif/command@^1", "@oclif/command@^1.5.20", "@oclif/command@^1.6.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.8.0.tgz#c1a499b10d26e9d1a611190a81005589accbb339" - integrity sha512-5vwpq6kbvwkQwKqAoOU3L72GZ3Ta8RRrewKj9OJRolx28KLJJ8Dg9Rf7obRwt5jQA9bkYd8gqzMTrI7H3xLfaw== +"@oclif/command@^1", "@oclif/command@^1.8.15": + version "1.8.16" + resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.8.16.tgz#bea46f81b2061b47e1cda318a0b923e62ca4cc0c" + integrity sha512-rmVKYEsKzurfRU0xJz+iHelbi1LGlihIWZ7Qvmb/CBz1EkhL7nOkW4SVXmG2dA5Ce0si2gr88i6q4eBOMRNJ1w== dependencies: - "@oclif/config" "^1.15.1" - "@oclif/errors" "^1.3.3" - "@oclif/parser" "^3.8.3" - "@oclif/plugin-help" "^3" + "@oclif/config" "^1.18.2" + "@oclif/errors" "^1.3.5" + "@oclif/help" "^1.0.1" + "@oclif/parser" "^3.8.6" debug "^4.1.1" semver "^7.3.2" -"@oclif/config@^1", "@oclif/config@^1.15.1": - version "1.17.0" - resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.17.0.tgz#ba8639118633102a7e481760c50054623d09fcab" - integrity sha512-Lmfuf6ubjQ4ifC/9bz1fSCHc6F6E653oyaRXxg+lgT4+bYf9bk+nqrUpAbrXyABkCqgIBiFr3J4zR/kiFdE1PA== +"@oclif/config@1.18.2": + version "1.18.2" + resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.18.2.tgz#5bfe74a9ba6a8ca3dceb314a81bd9ce2e15ebbfe" + integrity sha512-cE3qfHWv8hGRCP31j7fIS7BfCflm/BNZ2HNqHexH+fDrdF2f1D5S8VmXWLC77ffv3oDvWyvE9AZeR0RfmHCCaA== dependencies: "@oclif/errors" "^1.3.3" "@oclif/parser" "^3.8.0" @@ -1392,7 +1437,19 @@ is-wsl "^2.1.1" tslib "^2.0.0" -"@oclif/errors@^1.2.1", "@oclif/errors@^1.2.2", "@oclif/errors@^1.3.3": +"@oclif/config@^1", "@oclif/config@^1.18.2": + version "1.18.3" + resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.18.3.tgz#ddfc144fdab66b1658c2f1b3478fa7fbfd317e79" + integrity sha512-sBpko86IrTscc39EvHUhL+c++81BVTsIZ3ETu/vG+cCdi0N6vb2DoahR67A9FI2CGnxRRHjnTfa3m6LulwNATA== + dependencies: + "@oclif/errors" "^1.3.5" + "@oclif/parser" "^3.8.0" + debug "^4.1.1" + globby "^11.0.1" + is-wsl "^2.1.1" + tslib "^2.3.1" + +"@oclif/errors@1.3.5", "@oclif/errors@^1.3.3", "@oclif/errors@^1.3.5": version "1.3.5" resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.3.5.tgz#a1e9694dbeccab10fe2fe15acb7113991bed636c" integrity sha512-OivucXPH/eLLlOT7FkCMoZXiaVYf8I/w1eTAM1+gKzfhALwWTusxEx7wBmW0uzvkSg/9ovWLycPaBgJbM3LOCQ== @@ -1403,46 +1460,62 @@ strip-ansi "^6.0.0" wrap-ansi "^7.0.0" -"@oclif/linewrap@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@oclif/linewrap/-/linewrap-1.0.0.tgz#aedcb64b479d4db7be24196384897b5000901d91" - integrity sha512-Ups2dShK52xXa8w6iBWLgcjPJWjais6KPJQq3gQ/88AY6BXoTX+MIGFPrWQO1KLMiQfoTpcLnUwloN4brrVUHw== - -"@oclif/parser@^3.8.0", "@oclif/parser@^3.8.3": - version "3.8.5" - resolved "https://registry.yarnpkg.com/@oclif/parser/-/parser-3.8.5.tgz#c5161766a1efca7343e1f25d769efbefe09f639b" - integrity sha512-yojzeEfmSxjjkAvMRj0KzspXlMjCfBzNRPkWw8ZwOSoNWoJn+OCS/m/S+yfV6BvAM4u2lTzX9Y5rCbrFIgkJLg== +"@oclif/help@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@oclif/help/-/help-1.0.1.tgz#fd96a3dd9fb2314479e6c8584c91b63754a7dff5" + integrity sha512-8rsl4RHL5+vBUAKBL6PFI3mj58hjPCp2VYyXD4TAa7IMStikFfOH2gtWmqLzIlxAED2EpD0dfYwo9JJxYsH7Aw== dependencies: - "@oclif/errors" "^1.2.2" - "@oclif/linewrap" "^1.0.0" - chalk "^2.4.2" - tslib "^1.9.3" - -"@oclif/plugin-help@^3": - version "3.2.4" - resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-3.2.4.tgz#100e0e09d806e20595096609f2220d009ee096e2" - integrity sha512-kMSfFbv11S7CKFlbWTKDdAe/gC7P2zCFZEDq6BAHjJdA0htHT8FvBhnyoppR0O2jOTjX80wHjU+ItPpjanfuag== - dependencies: - "@oclif/command" "^1.5.20" - "@oclif/config" "^1.15.1" - "@oclif/errors" "^1.2.2" - chalk "^4.1.0" + "@oclif/config" "1.18.2" + "@oclif/errors" "1.3.5" + chalk "^4.1.2" indent-string "^4.0.0" lodash "^4.17.21" string-width "^4.2.0" strip-ansi "^6.0.0" widest-line "^3.1.0" - wrap-ansi "^4.0.0" + wrap-ansi "^6.2.0" -"@oclif/screen@^1.0.3": +"@oclif/linewrap@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@oclif/linewrap/-/linewrap-1.0.0.tgz#aedcb64b479d4db7be24196384897b5000901d91" + integrity sha512-Ups2dShK52xXa8w6iBWLgcjPJWjais6KPJQq3gQ/88AY6BXoTX+MIGFPrWQO1KLMiQfoTpcLnUwloN4brrVUHw== + +"@oclif/parser@^3.8.0", "@oclif/parser@^3.8.6": + version "3.8.7" + resolved "https://registry.yarnpkg.com/@oclif/parser/-/parser-3.8.7.tgz#236d48db05d0b00157d3b42d31f9dac7550d2a7c" + integrity sha512-b11xBmIUK+LuuwVGJpFs4LwQN2xj2cBWj2c4z1FtiXGrJ85h9xV6q+k136Hw0tGg1jQoRXuvuBnqQ7es7vO9/Q== + dependencies: + "@oclif/errors" "^1.3.5" + "@oclif/linewrap" "^1.0.0" + chalk "^4.1.0" + tslib "^2.3.1" + +"@oclif/plugin-help@^3": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-3.3.1.tgz#36adb4e0173f741df409bb4b69036d24a53bfb24" + integrity sha512-QuSiseNRJygaqAdABYFWn/H1CwIZCp9zp/PLid6yXvy6VcQV7OenEFF5XuYaCvSARe2Tg9r8Jqls5+fw1A9CbQ== + dependencies: + "@oclif/command" "^1.8.15" + "@oclif/config" "1.18.2" + "@oclif/errors" "1.3.5" + "@oclif/help" "^1.0.1" + chalk "^4.1.2" + indent-string "^4.0.0" + lodash "^4.17.21" + string-width "^4.2.0" + strip-ansi "^6.0.0" + widest-line "^3.1.0" + wrap-ansi "^6.2.0" + +"@oclif/screen@^1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-1.0.4.tgz#b740f68609dfae8aa71c3a6cab15d816407ba493" integrity sha512-60CHpq+eqnTxLZQ4PGHYNwUX572hgpMHGPtTWMjdTMsAvlm69lZV/4ly6O3sAYkomo4NggGcomrDpBe34rxUqw== -"@sideway/address@^4.1.0": - version "4.1.2" - resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.2.tgz#811b84333a335739d3969cfc434736268170cad1" - integrity sha512-idTz8ibqWFrPU8kMirL0CoPH/A29XOzzAzpyN3zQ4kAWnzmNfFmRaoMNN6VI8ske5M73HZyhIaW4OuSFIdM4oA== +"@sideway/address@^4.1.3": + version "4.1.3" + resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.3.tgz#d93cce5d45c5daec92ad76db492cc2ee3c64ab27" + integrity sha512-8ncEUtmnTsMmL7z1YPB47kPUq7LpKWJNFPsRzHiIajGC5uXlWGn+AmkYPcHNl8S4tcEGx+cnORnNYaw2wvL+LQ== dependencies: "@hapi/hoek" "^9.0.0" @@ -1481,9 +1554,9 @@ integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== "@types/babel__core@^7.0.0", "@types/babel__core@^7.1.7": - version "7.1.16" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.16.tgz#bc12c74b7d65e82d29876b5d0baf5c625ac58702" - integrity sha512-EAEHtisTMM+KaKwfWdC3oyllIqswlznXCIVCt7/oRNrh+DhgT4UEBNC/jlADNjvw7UnfbcdkGQcPVZ1xYiLcrQ== + version "7.1.19" + resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.19.tgz#7b497495b7d1b4812bdb9d02804d0576f43ee460" + integrity sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw== dependencies: "@babel/parser" "^7.1.0" "@babel/types" "^7.0.0" @@ -1492,9 +1565,9 @@ "@types/babel__traverse" "*" "@types/babel__generator@*": - version "7.6.3" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.3.tgz#f456b4b2ce79137f768aa130d2423d2f0ccfaba5" - integrity sha512-/GWCmzJWqV7diQW54smJZzWbSFf4QYtF71WCKhcx6Ru/tFyQIY2eiiITcCAeuPbNSvT9YCGkVMqqvSk2Z0mXiA== + version "7.6.4" + resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7" + integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg== dependencies: "@babel/types" "^7.0.0" @@ -1521,9 +1594,9 @@ "@types/node" "*" "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz#4ba8ddb720221f432e443bd5f9117fd22cfd4762" - integrity sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw== + version "2.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" + integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== "@types/istanbul-lib-report@*": version "3.0.0" @@ -1540,14 +1613,14 @@ "@types/istanbul-lib-report" "*" "@types/lodash@^4.14.168": - version "4.14.176" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.176.tgz#641150fc1cda36fbfa329de603bbb175d7ee20c0" - integrity sha512-xZmuPTa3rlZoIbtDUyJKZQimJV3bxCmzMIO2c9Pz9afyDro6kr7R79GwcB6mRhuoPmV2p1Vb66WOJH7F886WKQ== + version "4.14.180" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.180.tgz#4ab7c9ddfc92ec4a887886483bc14c79fb380670" + integrity sha512-XOKXa1KIxtNXgASAnwj7cnttJxS4fksBRywK/9LzRV5YxrF80BXZIGeQSuoESQ/VkUj30Ae0+YcuHc15wJCB2g== "@types/node@*": - version "16.11.7" - resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.7.tgz#36820945061326978c42a01e56b61cd223dfdc42" - integrity sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw== + version "17.0.22" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.22.tgz#38b6c4b9b2f3ed9f2e376cce42a298fb2375251e" + integrity sha512-8FwbVoG4fy+ykY86XCAclKZDORttqE5/s7dyWZKLXTdv3vRy5HozBEinG5IqhvPXXzIZEcTVbuHlQEI6iuwcmw== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -1555,9 +1628,9 @@ integrity sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw== "@types/prettier@^2.0.0": - version "2.4.1" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.1.tgz#e1303048d5389563e130f5bdd89d37a99acb75eb" - integrity sha512-Fo79ojj3vdEZOHg3wR9ksAMRz4P3S5fDB5e/YWZiFnyFQI1WY2Vftu9XoXVVtJfxB7Bpce/QTqWSSntkz2Znrw== + version "2.4.4" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.4.tgz#5d9b63132df54d8909fce1c3f8ca260fdd693e17" + integrity sha512-ReVR2rLTV1kvtlWFyuot+d1pkpG2Fw/XKE3PDAdj57rbM97ttSp9JZ2UsP+2EHTylra9cUf6JA7tGwW1INzUrA== "@types/stack-utils@^2.0.0": version "2.0.1" @@ -1565,9 +1638,9 @@ integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== "@types/yargs-parser@*": - version "20.2.1" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" - integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== + version "21.0.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" + integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== "@types/yargs@^15.0.0": version "15.0.14" @@ -1591,13 +1664,13 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -accepts@~1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== +accepts@~1.3.8: + version "1.3.8" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" + integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" + mime-types "~2.1.34" + negotiator "0.6.3" acorn-globals@^6.0.0: version "6.0.0" @@ -1618,9 +1691,9 @@ acorn@^7.1.1: integrity sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A== acorn@^8.2.4: - version "8.5.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.5.0.tgz#4512ccb99b3698c752591e9bb4472e38ad43cee2" - integrity sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q== + version "8.7.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" + integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== agent-base@6: version "6.0.2" @@ -1663,22 +1736,12 @@ ansi-regex@^2.0.0: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= -ansi-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" - integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= - ansi-regex@^5.0.0, ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= - -ansi-styles@^3.2.0, ansi-styles@^3.2.1: +ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== @@ -1800,10 +1863,10 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -async@^3.1.0: - version "3.2.2" - resolved "https://registry.yarnpkg.com/async/-/async-3.2.2.tgz#2eb7671034bb2194d45d30e31e24ec7e7f9670cd" - integrity sha512-H0E+qZaDEfx/FY4t7iLRv1W2fFI6+pyCeTw1uN20AQPiwqwM6ojPxHxdLv4z8hi2DtnW9BOckSspLucW7pIE5g== +async@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/async/-/async-3.2.3.tgz#ac53dafd3f4720ee9e8a160628f18ea91df196c9" + integrity sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g== asynckit@^0.4.0: version "0.4.0" @@ -1890,29 +1953,29 @@ babel-plugin-jest-hoist@^26.6.2: "@types/babel__core" "^7.0.0" "@types/babel__traverse" "^7.0.6" -babel-plugin-polyfill-corejs2@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.2.3.tgz#6ed8e30981b062f8fe6aca8873a37ebcc8cc1c0f" - integrity sha512-NDZ0auNRzmAfE1oDDPW2JhzIMXUk+FFe2ICejmt5T4ocKgiQx3e0VCRx9NCAidcMtL2RUZaWtXnmjTCkx0tcbA== +babel-plugin-polyfill-corejs2@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.1.tgz#440f1b70ccfaabc6b676d196239b138f8a2cfba5" + integrity sha512-v7/T6EQcNfVLfcN2X8Lulb7DjprieyLWJK/zOWH5DUYcAgex9sP3h25Q+DLsX9TloXe3y1O8l2q2Jv9q8UVB9w== dependencies: "@babel/compat-data" "^7.13.11" - "@babel/helper-define-polyfill-provider" "^0.2.4" + "@babel/helper-define-polyfill-provider" "^0.3.1" semver "^6.1.1" -babel-plugin-polyfill-corejs3@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.3.0.tgz#fa7ca3d1ee9ddc6193600ffb632c9785d54918af" - integrity sha512-JLwi9vloVdXLjzACL80j24bG6/T1gYxwowG44dg6HN/7aTPdyPbJJidf6ajoA3RPHHtW0j9KMrSOLpIZpAnPpg== +babel-plugin-polyfill-corejs3@^0.5.0: + version "0.5.2" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz#aabe4b2fa04a6e038b688c5e55d44e78cd3a5f72" + integrity sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.4" - core-js-compat "^3.18.0" + "@babel/helper-define-polyfill-provider" "^0.3.1" + core-js-compat "^3.21.0" -babel-plugin-polyfill-regenerator@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.2.3.tgz#2e9808f5027c4336c994992b48a4262580cb8d6d" - integrity sha512-JVE78oRZPKFIeUqFGrSORNzQnrDwZR16oiWeGM8ZyjBn2XAT5OjP+wXx5ESuo33nUsFUEJYjtklnsKbxW5L+7g== +babel-plugin-polyfill-regenerator@^0.3.0: + version "0.3.1" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz#2c0678ea47c75c8cc2fbb1852278d8fb68233990" + integrity sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A== dependencies: - "@babel/helper-define-polyfill-provider" "^0.2.4" + "@babel/helper-define-polyfill-provider" "^0.3.1" babel-plugin-transform-typescript-metadata@^0.3.1: version "0.3.2" @@ -1947,10 +2010,10 @@ babel-preset-jest@^26.6.2: babel-plugin-jest-hoist "^26.6.2" babel-preset-current-node-syntax "^1.0.0" -babel-preset-medusa-package@1.1.19-dev-1647336201011: - version "1.1.19-dev-1647336201011" - resolved "http://localhost:4873/babel-preset-medusa-package/-/babel-preset-medusa-package-1.1.19-dev-1647336201011.tgz#52a3e7ad80f216cdcae3732c22d9edb3d2504a92" - integrity sha512-oYbWdvcXHvGc14p6N4vyGjPK0gs/zO4gVMahrDHPcMGfmGOajkVBMnuMfiEzOaDHaiBchIsWCv9LYLFLcv8JjA== +babel-preset-medusa-package@1.1.19-dev-1648026403166: + version "1.1.19-dev-1648026403166" + resolved "http://localhost:4873/babel-preset-medusa-package/-/babel-preset-medusa-package-1.1.19-dev-1648026403166.tgz#e834a06c2283d5b8709d45de1e4ff559dfd23944" + integrity sha512-HjbSvyeLU9ez0dgBv4+SDX2/nXaskN5Bip7nF36F/fnufw/5FtJ28Lyw30VWz6i5Ci991Zmadfq6TNUZnKgNHw== dependencies: "@babel/plugin-proposal-class-properties" "^7.12.1" "@babel/plugin-proposal-decorators" "^7.12.1" @@ -2021,21 +2084,21 @@ block-stream@*: dependencies: inherits "~2.0.0" -body-parser@1.19.0, body-parser@^1.19.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== +body-parser@1.19.2, body-parser@^1.19.0: + version "1.19.2" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.2.tgz#4714ccd9c157d44797b8b5607d72c0b89952f26e" + integrity sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw== dependencies: - bytes "3.1.0" + bytes "3.1.2" content-type "~1.0.4" debug "2.6.9" depd "~1.1.2" - http-errors "1.7.2" + http-errors "1.8.1" iconv-lite "0.4.24" on-finished "~2.3.0" - qs "6.7.0" - raw-body "2.4.0" - type-is "~1.6.17" + qs "6.9.7" + raw-body "2.4.3" + type-is "~1.6.18" boxen@^5.0.1: version "5.1.2" @@ -2087,15 +2150,15 @@ browser-process-hrtime@^1.0.0: resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626" integrity sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow== -browserslist@^4.16.6, browserslist@^4.17.6: - version "4.17.6" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.17.6.tgz#c76be33e7786b497f66cad25a73756c8b938985d" - integrity sha512-uPgz3vyRTlEiCv4ee9KlsKgo2V6qPk7Jsn0KAn2OBqbqKo3iNcPEC1Ti6J4dwnz+aIRfEEEuOzC9IBk8tXUomw== +browserslist@^4.17.5, browserslist@^4.19.1: + version "4.20.2" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.2.tgz#567b41508757ecd904dab4d1c646c612cd3d4f88" + integrity sha512-CQOBCqp/9pDvDbx3xfMi+86pr4KXIf2FDkTTdeuYw8OxS9t898LA1Khq57gtufFILXpfgsSx5woNgsBgvGjpsA== dependencies: - caniuse-lite "^1.0.30001274" - electron-to-chromium "^1.3.886" + caniuse-lite "^1.0.30001317" + electron-to-chromium "^1.4.84" escalade "^3.1.1" - node-releases "^2.0.1" + node-releases "^2.0.2" picocolors "^1.0.0" bser@2.1.1: @@ -2160,10 +2223,10 @@ busboy@^0.2.11: dicer "0.2.5" readable-stream "1.1.x" -bytes@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== cache-base@^1.0.1: version "1.0.1" @@ -2207,14 +2270,14 @@ camelcase@^5.0.0, camelcase@^5.3.1: integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== camelcase@^6.0.0, camelcase@^6.2.0: - version "6.2.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" - integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== + version "6.3.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" + integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001274: - version "1.0.30001279" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001279.tgz#eb06818da481ef5096a3b3760f43e5382ed6b0ce" - integrity sha512-VfEHpzHEXj6/CxggTwSFoZBBYGQfQv9Cf42KPlO79sWXCD1QNKWKsKzFeWL7QpZHJQYAvocqV6Rty1yJMkqWLQ== +caniuse-lite@^1.0.30001317: + version "1.0.30001319" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001319.tgz#eb4da4eb3ecdd409f7ba1907820061d56096e88f" + integrity sha512-xjlIAFHucBRSMUo1kb5D4LYgcN1M45qdKP++lhqowDpwJwGkpIRTt5qQqnhxjj1vHcI7nrJxWhCC1ATrCEBTcw== capture-exit@^2.0.0: version "2.0.0" @@ -2236,18 +2299,7 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -chalk@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -chalk@^2.0.0, chalk@^2.4.2: +chalk@^2.0.0: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -2256,7 +2308,7 @@ chalk@^2.0.0, chalk@^2.4.2: escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1: +chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -2269,15 +2321,20 @@ char-regex@^1.0.2: resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== +charcodes@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/charcodes/-/charcodes-0.2.0.tgz#5208d327e6cc05f99eb80ffc814707572d1f14e4" + integrity sha512-Y4kiDb+AM4Ecy58YkuZrrSRJBDQdQ2L+NyS1vHHFtNtUjgutcZfx3yp1dAONI/oPaPmyGfCLx5CxL+zauIMyKQ== + chardet@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== chokidar@^3.4.0, chokidar@^3.4.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" - integrity sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ== + version "3.5.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== dependencies: anymatch "~3.1.2" braces "~3.0.2" @@ -2300,9 +2357,9 @@ ci-info@^2.0.0: integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== ci-info@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.2.0.tgz#2876cb948a498797b5236f0095bc057d0dca38b6" - integrity sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A== + version "3.3.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.0.tgz#b4ed1fb6818dea4803a55c623041f9165d2066b2" + integrity sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw== cjs-module-lexer@^0.6.0: version "0.6.0" @@ -2311,7 +2368,7 @@ cjs-module-lexer@^0.6.0: class-transformer@^0.5.1: version "0.5.1" - resolved "http://localhost:4873/class-transformer/-/class-transformer-0.5.1.tgz#24147d5dffd2a6cea930a3250a677addf96ab336" + resolved "https://registry.yarnpkg.com/class-transformer/-/class-transformer-0.5.1.tgz#24147d5dffd2a6cea930a3250a677addf96ab336" integrity sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw== class-utils@^0.3.5: @@ -2326,7 +2383,7 @@ class-utils@^0.3.5: class-validator@^0.13.1: version "0.13.2" - resolved "http://localhost:4873/class-validator/-/class-validator-0.13.2.tgz#64b031e9f3f81a1e1dcd04a5d604734608b24143" + resolved "https://registry.yarnpkg.com/class-validator/-/class-validator-0.13.2.tgz#64b031e9f3f81a1e1dcd04a5d604734608b24143" integrity sha512-yBUcQy07FPlGzUjoLuUfIOXzgynnQPPruyK1Ge2B74k9ROwnle1E+NxLWnUv5OLU8hA/qL5leAE9XnXq3byaBw== dependencies: libphonenumber-js "^1.9.43" @@ -2364,11 +2421,10 @@ cli-highlight@^2.1.11: yargs "^16.0.0" cli-progress@^3.4.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/cli-progress/-/cli-progress-3.9.1.tgz#a22eba6a20f53289fdd05d5ee8cb2cc8c28f866e" - integrity sha512-AXxiCe2a0Lm0VN+9L0jzmfQSkcZm5EYspfqXKaSIQKqIk+0hnkZ3/v1E9B39mkD6vYhKih3c/RPsJBSwq9O99Q== + version "3.10.0" + resolved "https://registry.yarnpkg.com/cli-progress/-/cli-progress-3.10.0.tgz#63fd9d6343c598c93542fdfa3563a8b59887d78a" + integrity sha512-kLORQrhYCAtUPLZxqsAt2YJGOvRdt34+O6jl5cQGb7iF3dM55FQZlTR+rQyIK9JUcO9bBMwZsTlND+3dmFU2Cw== dependencies: - colors "^1.1.2" string-width "^4.2.0" cli-spinners@^2.5.0: @@ -2377,14 +2433,14 @@ cli-spinners@^2.5.0: integrity sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g== cli-ux@^5.4.9: - version "5.6.3" - resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-5.6.3.tgz#eecdb2e0261171f2b28f2be6b18c490291c3a287" - integrity sha512-/oDU4v8BiDjX2OKcSunGH0iGDiEtj2rZaGyqNuv9IT4CgcSMyVWAMfn0+rEHaOc4n9ka78B0wo1+N1QX89f7mw== + version "5.6.7" + resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-5.6.7.tgz#32ef9e6cb2b457be834280cc799028a11c8235a8" + integrity sha512-dsKAurMNyFDnO6X1TiiRNiVbL90XReLKcvIq4H777NMqXGBxBws23ag8ubCJE97vVZEgWG2eSUhsyLf63Jv8+g== dependencies: - "@oclif/command" "^1.6.0" - "@oclif/errors" "^1.2.1" + "@oclif/command" "^1.8.15" + "@oclif/errors" "^1.3.5" "@oclif/linewrap" "^1.0.0" - "@oclif/screen" "^1.0.3" + "@oclif/screen" "^1.0.4" ansi-escapes "^4.3.0" ansi-styles "^4.2.0" cardinal "^2.1.1" @@ -2397,7 +2453,7 @@ cli-ux@^5.4.9: indent-string "^4.0.0" is-wsl "^2.2.0" js-yaml "^3.13.1" - lodash "^4.17.11" + lodash "^4.17.21" natural-orderby "^2.0.1" object-treeify "^1.1.4" password-prompt "^1.1.2" @@ -2498,9 +2554,9 @@ color-name@^1.0.0, color-name@~1.1.4: integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== color-string@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.6.0.tgz#c3915f61fe267672cb7e1e064c9d692219f6c312" - integrity sha512-c/hGS+kRWJutUBEngKKmk4iH3sD59MBkoxVapS/0wgpCz2u7XsNloxknyvBhzwEs1IbV36D9PwqLPJ2DTu3vMA== + version "1.9.0" + resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.9.0.tgz#63b6ebd1bec11999d1df3a79a7569451ac2be8aa" + integrity sha512-9Mrz2AQLefkH1UvASKj6v6hj/7eWgjnT/cVsR8CumieLoT+g900exWeNogqtweI8dxloXN9BDQTYro1oWu/5CQ== dependencies: color-name "^1.0.0" simple-swizzle "^0.2.2" @@ -2513,11 +2569,6 @@ color@^3.1.3: color-convert "^1.9.3" color-string "^1.6.0" -colors@^1.1.2, colors@^1.2.1: - version "1.4.0" - resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" - integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== - colorspace@1.1.x: version "1.1.4" resolved "https://registry.yarnpkg.com/colorspace/-/colorspace-1.1.4.tgz#8d442d1186152f60453bf8070cd66eb364e59243" @@ -2585,12 +2636,12 @@ console-control-strings@^1.0.0, console-control-strings@~1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= -content-disposition@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== +content-disposition@0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" + integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== dependencies: - safe-buffer "5.1.2" + safe-buffer "5.2.1" content-type@~1.0.4: version "1.0.4" @@ -2605,11 +2656,11 @@ convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.6.0, safe-buffer "~5.1.1" cookie-parser@^1.4.4: - version "1.4.5" - resolved "https://registry.yarnpkg.com/cookie-parser/-/cookie-parser-1.4.5.tgz#3e572d4b7c0c80f9c61daf604e4336831b5d1d49" - integrity sha512-f13bPUj/gG/5mDr+xLmSxxDsB9DQiTIfhJS/sqjrmfAWiAN+x2O4i/XguTL9yDZ+/IFDanJ+5x7hC4CXT9Tdzw== + version "1.4.6" + resolved "https://registry.yarnpkg.com/cookie-parser/-/cookie-parser-1.4.6.tgz#3ac3a7d35a7a03bbc7e365073a26074824214594" + integrity sha512-z3IzaNjdwUC2olLIB5/ITd0/setiaFMLYiZJle7xg5Fe9KWAceil7xszYfHHBtDFYLSgJduS2Ty0P1uJdPDJeA== dependencies: - cookie "0.4.0" + cookie "0.4.1" cookie-signature "1.0.6" cookie-signature@1.0.6: @@ -2617,27 +2668,27 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= -cookie@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== - cookie@0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== +cookie@0.4.2: + version "0.4.2" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.2.tgz#0e41f24de5ecf317947c82fc789e06a884824432" + integrity sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA== + copy-descriptor@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= -core-js-compat@^3.18.0, core-js-compat@^3.19.0: - version "3.19.1" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.19.1.tgz#fe598f1a9bf37310d77c3813968e9f7c7bb99476" - integrity sha512-Q/VJ7jAF/y68+aUsQJ/afPOewdsGkDtcMb40J8MbuWKlK3Y+wtHq8bTHKPj2WKWLIqmS5JhHs4CzHtz6pT2W6g== +core-js-compat@^3.20.2, core-js-compat@^3.21.0: + version "3.21.1" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.21.1.tgz#cac369f67c8d134ff8f9bd1623e3bc2c42068c82" + integrity sha512-gbgX5AUvMb8gwxC7FLVWYT7Kkgu/y7+h/h1X43yJkNqhlK2fuYyQimqvKGNZFAY6CKii/GFKJ2cp/1/42TN36g== dependencies: - browserslist "^4.17.6" + browserslist "^4.19.1" semver "7.0.0" core-js@^2.6.5: @@ -2645,10 +2696,10 @@ core-js@^2.6.5: resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== -core-js@^3.19.0, core-js@^3.6.5, core-js@^3.7.0: - version "3.19.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.19.1.tgz#f6f173cae23e73a7d88fa23b6e9da329276c6641" - integrity sha512-Tnc7E9iKd/b/ff7GFbhwPVzJzPztGrChB8X8GLqoYGdEOG8IpLnK1xPyo3ZoO3HsK6TodJS58VGPOxA+hLHQMg== +core-js@^3.20.2, core-js@^3.6.5, core-js@^3.7.0: + version "3.21.1" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.21.1.tgz#f2e0ddc1fc43da6f904706e8e955bc19d06a0d94" + integrity sha512-FRq5b/VMrWlrmCzwRrpDYNxyHP9BcAZC+xHJaqTgIE5091ZV1NTmyh0sGOg5XqpnHvR0svdy0sv1gWA1zmhxig== core-util-is@1.0.2: version "1.0.2" @@ -2742,9 +2793,9 @@ debug@2.6.9, debug@^2.2.0, debug@^2.3.3: ms "2.0.0" debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" - integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== dependencies: ms "2.1.2" @@ -2935,10 +2986,10 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -electron-to-chromium@^1.3.886: - version "1.3.892" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.892.tgz#0e3f5bb1de577e2e5a6dffd5a4b278c4a735cd39" - integrity sha512-YDW4yIjdfMnbRoBjRZ/aNQYmT6JgQFLwmTSDRJMQdrY4MByEzppdXp3rnJ0g4LBWcsYTUvwKKClYN1ofZ0COOQ== +electron-to-chromium@^1.4.84: + version "1.4.89" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.89.tgz#33c06592812a17a7131873f4596579084ce33ff8" + integrity sha512-z1Axg0Fu54fse8wN4fd+GAINdU5mJmLtcl6bqIcYyzNVGONcfHAeeJi88KYMQVKalhXlYuVPzKkFIU5VD0raUw== emittery@^0.7.1: version "0.7.2" @@ -3024,7 +3075,7 @@ escape-string-regexp@4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: +escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= @@ -3172,16 +3223,16 @@ express-session@^1.17.1: uid-safe "~2.1.5" express@^4.17.1: - version "4.17.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" - integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== + version "4.17.3" + resolved "https://registry.yarnpkg.com/express/-/express-4.17.3.tgz#f6c7302194a4fb54271b73a1fe7a06478c8f85a1" + integrity sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg== dependencies: - accepts "~1.3.7" + accepts "~1.3.8" array-flatten "1.1.1" - body-parser "1.19.0" - content-disposition "0.5.3" + body-parser "1.19.2" + content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.4.0" + cookie "0.4.2" cookie-signature "1.0.6" debug "2.6.9" depd "~1.1.2" @@ -3195,13 +3246,13 @@ express@^4.17.1: on-finished "~2.3.0" parseurl "~1.3.3" path-to-regexp "0.1.7" - proxy-addr "~2.0.5" - qs "6.7.0" + proxy-addr "~2.0.7" + qs "6.9.7" range-parser "~1.2.1" - safe-buffer "5.1.2" - send "0.17.1" - serve-static "1.14.1" - setprototypeof "1.1.1" + safe-buffer "5.2.1" + send "0.17.2" + serve-static "1.14.2" + setprototypeof "1.2.0" statuses "~1.5.0" type-is "~1.6.18" utils-merge "1.0.1" @@ -3275,10 +3326,10 @@ fast-deep-equal@^3.1.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-glob@^3.1.1: - version "3.2.7" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1" - integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q== +fast-glob@^3.2.9: + version "3.2.11" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" + integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== dependencies: "@nodelib/fs.stat" "^2.0.2" "@nodelib/fs.walk" "^1.2.3" @@ -3316,9 +3367,9 @@ fecha@^4.2.0: integrity sha512-MMMQ0ludy/nBs1/o0zVOiKTpG7qMbonKUzjJgQFEuvq6INZ1OraKPRAWkBq5vlKLOUMpmNYG1JoN3oDPUQ9m3Q== fengari-interop@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/fengari-interop/-/fengari-interop-0.1.2.tgz#f7731dcdd2ff4449073fb7ac3c451a8841ce1e87" - integrity sha512-8iTvaByZVoi+lQJhHH9vC+c/Yaok9CwOqNQZN6JrVpjmWwW4dDkeblBXhnHC+BoI6eF4Cy5NKW3z6ICEjvgywQ== + version "0.1.3" + resolved "https://registry.yarnpkg.com/fengari-interop/-/fengari-interop-0.1.3.tgz#3ad37a90e7430b69b365441e9fc0ba168942a146" + integrity sha512-EtZ+oTu3kEwVJnoymFPBVLIbQcCoy9uWCVnMA6h3M/RqHkUBsLYp29+RRHf9rKr6GwjubWREU1O7RretFIXjHw== fengari@^0.1.4: version "0.1.4" @@ -3329,11 +3380,6 @@ fengari@^0.1.4: sprintf-js "^1.1.1" tmp "^0.0.33" -figlet@^1.1.1: - version "1.5.2" - resolved "https://registry.yarnpkg.com/figlet/-/figlet-1.5.2.tgz#dda34ff233c9a48e36fcff6741aeb5bafe49b634" - integrity sha512-WOn21V8AhyE1QqVfPIVxe3tupJacq1xGkPTB4iagT6o+P2cAgEOOwIxMftr4+ZCTI6d551ij9j61DFr0nsP2uQ== - figures@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" @@ -3401,9 +3447,9 @@ fn.name@1.x.x: integrity sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw== follow-redirects@^1.14.0: - version "1.14.5" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.5.tgz#f09a5848981d3c772b5392309778523f8d85c381" - integrity sha512-wtphSXy7d4/OR+MvIFbCVBDzZ5520qV8XfPklSN5QtxuMUJZ+b0Wnst1e1lCDocfzuCkHqj8k0FpZqO+UIaKNA== + version "1.14.9" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" + integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== for-each@^0.3.3: version "0.3.3" @@ -3463,9 +3509,9 @@ fs-exists-cached@^1.0.0: integrity sha1-zyVVTKBQ3EmuZla0HeQiWJidy84= fs-extra@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.0.tgz#9ff61b655dde53fb34a82df84bb214ce802e17c1" - integrity sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ== + version "10.0.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.0.1.tgz#27de43b4320e833f6867cc044bfce29fdf0ef3b8" + integrity sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag== dependencies: graceful-fs "^4.2.0" jsonfile "^6.0.1" @@ -3637,21 +3683,21 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globby@^11.0.1: - version "11.0.4" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5" - integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg== + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== dependencies: array-union "^2.1.0" dir-glob "^3.0.1" - fast-glob "^3.1.1" - ignore "^5.1.4" - merge2 "^1.3.0" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" slash "^3.0.0" graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4: - version "4.2.8" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" - integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== + version "4.2.9" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" + integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== growly@^1.3.0: version "1.3.0" @@ -3671,13 +3717,6 @@ har-validator@~5.1.3: ajv "^6.12.3" har-schema "^2.0.0" -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= - dependencies: - ansi-regex "^2.0.0" - has-bigints@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.1.tgz#64fe6acb020673e3b78db035a5af69aa9d07b113" @@ -3694,9 +3733,9 @@ has-flag@^4.0.0: integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== has-symbols@^1.0.1, has-symbols@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" - integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== has-tostringtag@^1.0.0: version "1.0.0" @@ -3766,9 +3805,9 @@ hosted-git-info@^2.1.4: integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== hosted-git-info@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.0.2.tgz#5e425507eede4fea846b7262f0838456c4209961" - integrity sha512-c9OGXbZ3guC/xOlCg1Ci/VgWlwsqDv1yMQL1CWqXDL0hDjXuNcq0zuR4xqPSuasI3kqFDhqSyTjREz5gzq0fXg== + version "4.1.0" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.1.0.tgz#827b82867e9ff1c8d0c4d9d53880397d2c86d224" + integrity sha512-kyCuEOWjJqZuDbRHzL8V93NzQhwIB71oFWSyzVo+KPZI+pnQPPxucdkrOZvkLRnrf5URsQM+IJ09Dw29cRALIA== dependencies: lru-cache "^6.0.0" @@ -3784,27 +3823,16 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== +http-errors@1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c" + integrity sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g== dependencies: depd "~1.1.2" inherits "2.0.4" - setprototypeof "1.1.1" + setprototypeof "1.2.0" statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" + toidentifier "1.0.1" http-proxy-agent@^4.0.1: version "4.0.1" @@ -3866,15 +3894,15 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" -ignore@^5.1.4: - version "5.1.9" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.9.tgz#9ec1a5cbe8e1446ec60d4420060d43aa6e7382fb" - integrity sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ== +ignore@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== import-local@^3.0.2: - version "3.0.3" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.0.3.tgz#4d51c2c495ca9393da259ec66b62e022920211e0" - integrity sha512-bE9iaUY3CXH8Cwfan/abDKAxe1KGT9kyGsBPqf6DMK/z0a2OzAsrukeYNgIH6cH5Xr452jb1TUL8rSfCLjZ9uA== + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" + integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== dependencies: pkg-dir "^4.2.0" resolve-cwd "^3.0.0" @@ -3902,20 +3930,15 @@ inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, i resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - ini@~1.3.0: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== inquirer@^8.0.0: - version "8.2.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.0.tgz#f44f008dd344bbfc4b30031f45d984e034a3ac3a" - integrity sha512-0crLweprevJ02tTuA6ThpoAERAGyVILC4sS74uib58Xf/zSr1/ZWtmm7D5CI+bSQEaA04f0K7idaHpQbSWgiVQ== + version "8.2.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.1.tgz#e00022e3e8930a92662f760f020686530a84671d" + integrity sha512-pxhBaw9cyTFMjwKtkjePWDhvwzvrNGAw7En4hottzlPvz80GZaMZthdDU35aA6/f5FRZf3uhE057q8w1DE3V2g== dependencies: ansi-escapes "^4.2.1" chalk "^4.1.1" @@ -3927,7 +3950,7 @@ inquirer@^8.0.0: mute-stream "0.0.8" ora "^5.4.1" run-async "^2.4.0" - rxjs "^7.2.0" + rxjs "^7.5.5" string-width "^4.1.0" strip-ansi "^6.0.0" through "^2.3.6" @@ -3942,9 +3965,9 @@ internal-slot@^1.0.3: side-channel "^1.0.4" ioredis-mock@^5.6.0: - version "5.7.0" - resolved "https://registry.yarnpkg.com/ioredis-mock/-/ioredis-mock-5.7.0.tgz#c2f2464313b0c8592cf096d84b0ef4019813fc22" - integrity sha512-Z3U7SoDoLP+LeljcNWWGuldbZKzjzbyBrVa1/j0+GurFIgZlT4Ij+/6IqQlTDwZZkss/Prp3UaOdvr5e0Iow5g== + version "5.9.1" + resolved "https://registry.yarnpkg.com/ioredis-mock/-/ioredis-mock-5.9.1.tgz#e0229822bacf7e0143d2e4c755770626a7983919" + integrity sha512-ZirdGJFOqH5nP8FYXuHUJmexvtZ6r2Ybc5alaGMzt38QA0kse5/rYnBQcb4ofxkyqzhXHuaCsXiwLlfG6NyhhQ== dependencies: fengari "^0.1.4" fengari-interop "^0.1.2" @@ -3952,9 +3975,9 @@ ioredis-mock@^5.6.0: standard-as-callback "^2.1.0" ioredis@^4.17.3, ioredis@^4.27.0: - version "4.28.0" - resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-4.28.0.tgz#5a2be3f37ff2075e2332f280eaeb02ab4d9ff0d3" - integrity sha512-I+zkeeWp3XFgPT2CtJKxvaF5FjGBGt4yGYljRjQecdQKteThuAsKqffeF1lgHVlYnuNeozRbPOCDNZ7tDWPeig== + version "4.28.5" + resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-4.28.5.tgz#5c149e6a8d76a7f8fa8a504ffc85b7d5b6797f9f" + integrity sha512-3GYo0GJtLqgNXj4YhrisLaNNvWSNwSS2wS4OELGfGxH8I69+XfNdnmV1AyN+ZqMh0i7eX+SWjrwFKDBDgfBC1A== dependencies: cluster-key-slot "^1.1.0" debug "^4.3.1" @@ -4036,10 +4059,10 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-core-module@^2.2.0: - version "2.8.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.0.tgz#0321336c3d0925e497fd97f5d95cb114a5ccd548" - integrity sha512-vd15qHsaqrRL7dtH6QNuy0ndJmRDrS9HAM1CAiSifNUFv4x1a0CCVsj18hJ1mShxIG6T2i1sO78MkP56r0nYRw== +is-core-module@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" + integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== dependencies: has "^1.0.3" @@ -4116,11 +4139,6 @@ is-fullwidth-code-point@^1.0.0: dependencies: number-is-nan "^1.0.0" -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= - is-fullwidth-code-point@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" @@ -4166,9 +4184,9 @@ is-nan@^1.3.0: define-properties "^1.1.3" is-negative-zero@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.1.tgz#3de746c18dda2319241a53675908d8f766f11c24" - integrity sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w== + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== is-number-object@^1.0.4: version "1.0.6" @@ -4271,11 +4289,11 @@ is-valid-path@^0.1.1: is-invalid-path "^0.1.0" is-weakref@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.1.tgz#842dba4ec17fa9ac9850df2d6efbc1737274f2a2" - integrity sha512-b2jKc2pQZjaeFYWEf7ScFj+Be1I+PXmlu572Q8coTXZ+LD/QQZ7ShPMst8h16riVgyXTQwUsFEl74mDvc/3MHQ== + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== dependencies: - call-bind "^1.0.0" + call-bind "^1.0.2" is-windows@^1.0.2: version "1.0.2" @@ -4376,9 +4394,9 @@ istanbul-lib-source-maps@^4.0.0: source-map "^0.6.1" istanbul-reports@^3.0.2: - version "3.0.5" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.0.5.tgz#a2580107e71279ea6d661ddede929ffc6d693384" - integrity sha512-5+19PlhnGabNWB7kOFnuxT8H3T/iIyQzIbQMxXsURmmvKg86P2sbkrGOT77VnHw0Qr0gc2XzRaRfMZYYbSQCJQ== + version "3.1.4" + resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.4.tgz#1b6f068ecbc6c331040aab5741991273e609e40c" + integrity sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw== dependencies: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" @@ -4762,13 +4780,13 @@ joi-objectid@^3.0.1: integrity sha512-V/3hbTlGpvJ03Me6DJbdBI08hBTasFOmipsauOsxOSnsF1blxV537WTl1zPwbfcKle4AK0Ma4OPnzMH4LlvTpQ== joi@^17.3.0: - version "17.4.2" - resolved "https://registry.yarnpkg.com/joi/-/joi-17.4.2.tgz#02f4eb5cf88e515e614830239379dcbbe28ce7f7" - integrity sha512-Lm56PP+n0+Z2A2rfRvsfWVDXGEWjXxatPopkQ8qQ5mxCEhwHG+Ettgg5o98FFaxilOxozoa14cFhrE/hOzh/Nw== + version "17.6.0" + resolved "https://registry.yarnpkg.com/joi/-/joi-17.6.0.tgz#0bb54f2f006c09a96e75ce687957bd04290054b2" + integrity sha512-OX5dG6DTbcr/kbMFj0KGYxuew69HPcAE3K/sZpEV2nP6e/j/C0HV+HNiBPCASxdx5T7DMoa0s8UeHWMnb6n2zw== dependencies: "@hapi/hoek" "^9.0.0" "@hapi/topo" "^5.0.0" - "@sideway/address" "^4.1.0" + "@sideway/address" "^4.1.3" "@sideway/formula" "^3.0.0" "@sideway/pinpoint" "^2.0.0" @@ -4850,10 +4868,10 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== -json-schema@0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13" - integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM= +json-schema@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" + integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== json-stringify-safe@~5.0.1: version "5.0.1" @@ -4861,11 +4879,9 @@ json-stringify-safe@~5.0.1: integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= json5@^2.1.2: - version "2.2.0" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.0.tgz#2dfefe720c6ba525d9ebd909950f0515316c89a3" - integrity sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA== - dependencies: - minimist "^1.2.5" + version "2.2.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" + integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== jsonfile@^4.0.0: version "4.0.0" @@ -4900,13 +4916,13 @@ jsonwebtoken@^8.2.0, jsonwebtoken@^8.5.1: semver "^5.6.0" jsprim@^1.2.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2" - integrity sha1-MT5mvB5cwG5Di8G3SZwuXFastqI= + version "1.4.2" + resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.2.tgz#712c65533a15c878ba59e9ed5f0e26d5b77c5feb" + integrity sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw== dependencies: assert-plus "1.0.0" extsprintf "1.3.0" - json-schema "0.2.3" + json-schema "0.4.0" verror "1.10.0" jwa@^1.4.1: @@ -4974,14 +4990,14 @@ levn@~0.3.0: type-check "~0.3.2" libphonenumber-js@^1.9.43: - version "1.9.43" - resolved "http://localhost:4873/libphonenumber-js/-/libphonenumber-js-1.9.43.tgz#2371e4383e6780990381d5b900b8c22666221cbb" - integrity sha512-tNB87ZutAiAkl3DE/Bo0Mxqn/XZbNxhPg4v9bYBwQQW4dlhBGqXl1vtmPxeDWbrijzwOA9vRjOOFm5V9SK/W3w== + version "1.9.50" + resolved "https://registry.yarnpkg.com/libphonenumber-js/-/libphonenumber-js-1.9.50.tgz#f5028a2c4cc47a69d69a0de3629afad97a613712" + integrity sha512-cCzQPChw2XbordcO2LKiw5Htx5leHVfFk/EXkxNHqJfFo7Fndcb1kF5wPJpc316vCJhhikedYnVysMh3Sc7Ocw== lines-and-columns@^1.1.6: - version "1.1.6" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" - integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= + version "1.2.4" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== locate-path@^3.0.0: version "3.0.0" @@ -5053,7 +5069,7 @@ lodash.once@^4.0.0: resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= -lodash@^4.17.11, lodash@^4.17.21, lodash@^4.7.0: +lodash@^4.17.21, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -5066,15 +5082,15 @@ log-symbols@^4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" -logform@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/logform/-/logform-2.3.0.tgz#a3997a05985de2ebd325ae0d166dffc9c6fe6b57" - integrity sha512-graeoWUH2knKbGthMtuG1EfaSPMZFZBIrhuJHhkS5ZseFBrc7DupCzihOQAzsK/qIKPQaPJ/lFQFctILUY5ARQ== +logform@^2.3.2, logform@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/logform/-/logform-2.4.0.tgz#131651715a17d50f09c2a2c1a524ff1a4164bcfe" + integrity sha512-CPSJw4ftjf517EhXZGGvTHHkYobo7ZCc0kvwUoOYcjfR2UVrI66RHj8MCrfAdEitdmFqbu2BYdYs8FHHZSb6iw== dependencies: - colors "^1.2.1" + "@colors/colors" "1.5.0" fecha "^4.2.0" ms "^2.1.1" - safe-stable-stringify "^1.1.0" + safe-stable-stringify "^2.3.1" triple-beam "^1.3.0" lower-case@^2.0.2: @@ -5140,25 +5156,25 @@ media-typer@0.3.0: resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= -medusa-core-utils@1.1.31-dev-1647336201011: - version "1.1.31-dev-1647336201011" - resolved "http://localhost:4873/medusa-core-utils/-/medusa-core-utils-1.1.31-dev-1647336201011.tgz#6b6d9c9708d8377d1bddc8ef9d26723b550312c9" - integrity sha512-/qYyS0vE5lqHhNZfhNM2iTE5Sh8qYockVyHn2dapolBsmYE9f7IjhOsB3bz2o0b1J33L3se6iG0wSCQeN3INXA== +medusa-core-utils@1.1.31-dev-1648026403166: + version "1.1.31-dev-1648026403166" + resolved "http://localhost:4873/medusa-core-utils/-/medusa-core-utils-1.1.31-dev-1648026403166.tgz#0f3bde6fc0a77d3027d80a4ca5e1a1ce2426ad21" + integrity sha512-B5eFj3dH8g/HgNd8p8ChwR4bpydl0dqyBJllyvqS1AnFpjW7BcXpO0ZPkdYrIHflQL9e2OiIq3A2Lm6ZsYCI1A== dependencies: joi "^17.3.0" joi-objectid "^3.0.1" -medusa-interfaces@1.2.0-dev-1647336201011: - version "1.2.0-dev-1647336201011" - resolved "http://localhost:4873/medusa-interfaces/-/medusa-interfaces-1.2.0-dev-1647336201011.tgz#f6a25ef007c8ffe2828b4e2f64f23bd60929f4f5" - integrity sha512-8PvQpLfwB0YGTQU0qh/miDhJaOczoyCFs1bvlMbe3cOsn7ua7UKeUj+TLQQwh6ykbezjtggUgafEH+fKOmLUWg== +medusa-interfaces@1.2.1-dev-1648026403166: + version "1.2.1-dev-1648026403166" + resolved "http://localhost:4873/medusa-interfaces/-/medusa-interfaces-1.2.1-dev-1648026403166.tgz#29742128c852c967a94df1e00f0c8dacccff6b86" + integrity sha512-VRnFIFqPeOd0TcPMlng1kIzjhT7AtJzNqIDmKDxeJeE1MqU89g6YME/yQfCPzTXKNMdwN+8Xx+E5gANNn5i1QA== dependencies: - medusa-core-utils "1.1.31-dev-1647336201011" + medusa-core-utils "1.1.31-dev-1648026403166" -medusa-telemetry@0.0.11-dev-1647336201011: - version "0.0.11-dev-1647336201011" - resolved "http://localhost:4873/medusa-telemetry/-/medusa-telemetry-0.0.11-dev-1647336201011.tgz#d8a33d114a5bd4e6d2bdef112a07eed96a5b2f8d" - integrity sha512-am/sacr0XhCyc2OT6w8QCLuI7AXioJvaXxPzB4P1n5OiEGOn3IJIHZJY22MQzdY/dJZ7Rb4XuFlXdZInbc4woA== +medusa-telemetry@0.0.11-dev-1648026403166: + version "0.0.11-dev-1648026403166" + resolved "http://localhost:4873/medusa-telemetry/-/medusa-telemetry-0.0.11-dev-1648026403166.tgz#dd66a411a214b953f8b6673f59c0b02dd78ec99f" + integrity sha512-SH07C6rOQyx7bHH4/2TzmBgzgMY8fLiE7PH7dk6BGwY8bjx9w6DvF9CvhdwxFnFnzDTed/cjkE/cHNkQFkjSrQ== dependencies: axios "^0.21.1" axios-retry "^3.1.9" @@ -5170,13 +5186,13 @@ medusa-telemetry@0.0.11-dev-1647336201011: remove-trailing-slash "^0.1.1" uuid "^8.3.2" -medusa-test-utils@1.1.37-dev-1647336201011: - version "1.1.37-dev-1647336201011" - resolved "http://localhost:4873/medusa-test-utils/-/medusa-test-utils-1.1.37-dev-1647336201011.tgz#6a1cb877abf79210db0065095b1baa0427eb93d1" - integrity sha512-K6J7FlUm3q3jL94Ye01gpk3rcan9JEH1SDRoUm1zqZ0XAX3tl49R7VQtHO7kWcO05o2JUJt8/+LvNv6suth4ow== +medusa-test-utils@1.1.37-dev-1648026403166: + version "1.1.37-dev-1648026403166" + resolved "http://localhost:4873/medusa-test-utils/-/medusa-test-utils-1.1.37-dev-1648026403166.tgz#f32f0a04d7d38f6a84e58a2937bd026767ea5d1f" + integrity sha512-VQCuRal14tl/ZLsN6Ueh+z3FBgQEXgsLLSJxfpsrmABKTgoHONhkoe7UyXxxUozXwPWWqqtHhy80zfCIlfHF+w== dependencies: "@babel/plugin-transform-classes" "^7.9.5" - medusa-core-utils "1.1.31-dev-1647336201011" + medusa-core-utils "1.1.31-dev-1648026403166" randomatic "^3.1.1" merge-descriptors@1.0.1: @@ -5189,7 +5205,7 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -merge2@^1.3.0: +merge2@^1.3.0, merge2@^1.4.1: version "1.4.1" resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== @@ -5226,17 +5242,17 @@ micromatch@^4.0.2, micromatch@^4.0.4: braces "^3.0.1" picomatch "^2.2.3" -mime-db@1.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@~2.1.19, mime-types@~2.1.24: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== +mime-types@^2.1.12, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== dependencies: - mime-db "1.51.0" + mime-db "1.52.0" mime@1.6.0: version "1.6.0" @@ -5256,9 +5272,9 @@ min-document@^2.19.0: dom-walk "^0.1.0" minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" @@ -5303,9 +5319,9 @@ mkdirp@^1.0.4: integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== moment-timezone@^0.5.31: - version "0.5.33" - resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.33.tgz#b252fd6bb57f341c9b59a5ab61a8e51a73bbd22c" - integrity sha512-PTc2vcT8K9J5/9rDEPe5czSIKgLoGsH8UNpA4qZTVw0Vd/Uz19geE9abbIOQKaAQFcnQ3v5YEXrbSc5BpshH+w== + version "0.5.34" + resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.34.tgz#a75938f7476b88f155d3504a9343f7519d9a405c" + integrity sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg== dependencies: moment ">= 2.9.0" @@ -5330,25 +5346,20 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= -ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.1.1: +ms@2.1.3, ms@^2.1.1: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== multer@^1.4.2: - version "1.4.3" - resolved "https://registry.yarnpkg.com/multer/-/multer-1.4.3.tgz#4db352d6992e028ac0eacf7be45c6efd0264297b" - integrity sha512-np0YLKncuZoTzufbkM6wEKp68EhWJXcU6fq6QqrSwkckd2LlMgd1UqhUJLj6NS/5sZ8dE8LYDWslsltJznnXlg== + version "1.4.4" + resolved "https://registry.yarnpkg.com/multer/-/multer-1.4.4.tgz#e2bc6cac0df57a8832b858d7418ccaa8ebaf7d8c" + integrity sha512-2wY2+xD4udX612aMqMcB8Ws2Voq6NIUPEtD1be6m411T4uDH/VtL9i//xvcyFlTVfRdaBsk7hV5tgrGQqhuBiw== dependencies: append-field "^1.0.0" busboy "^0.2.11" @@ -5409,10 +5420,10 @@ needle@^2.2.1: iconv-lite "^0.4.4" sax "^1.2.4" -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== +negotiator@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" + integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== netrc-parser@^3.1.6: version "3.1.6" @@ -5471,11 +5482,6 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= -node-modules-regexp@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40" - integrity sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA= - node-notifier@^8.0.0: version "8.0.2" resolved "https://registry.yarnpkg.com/node-notifier/-/node-notifier-8.0.2.tgz#f3167a38ef0d2c8a866a83e318c1ba0efeb702c5" @@ -5504,10 +5510,10 @@ node-pre-gyp@^0.11.0: semver "^5.3.0" tar "^4" -node-releases@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.1.tgz#3d1d395f204f1f2f29a54358b9fb678765ad2fc5" - integrity sha512-CqyzN6z7Q6aMeF/ktcMVTzhAHCEpf8SOarwpzpf8pNBY2k5/oM34UHldUwp8VKI7uxct2HxSRdJjBaZeESzcxA== +node-releases@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.2.tgz#7139fe71e2f4f11b47d4d2986aaf8c48699e0c01" + integrity sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg== "nopt@2 || 3": version "3.0.6" @@ -5621,9 +5627,9 @@ object-copy@^0.1.0: kind-of "^3.0.3" object-inspect@^1.11.0, object-inspect@^1.9.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.0.tgz#9dceb146cedd4148a0d9e51ab88d34cf509922b1" - integrity sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg== + version "1.12.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" + integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== object-keys@^1.0.12, object-keys@^1.1.1: version "1.1.1" @@ -5668,7 +5674,14 @@ object.pick@^1.3.0: dependencies: isobject "^3.0.1" -on-finished@^2.3.0, on-finished@~2.3.0: +on-finished@^2.3.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" + integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== + dependencies: + ee-first "1.1.1" + +on-finished@~2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= @@ -5808,11 +5821,6 @@ packet-reader@1.0.0: resolved "https://registry.yarnpkg.com/packet-reader/-/packet-reader-1.0.0.tgz#9238e5480dedabacfe1fe3f2771063f164157d74" integrity sha512-HAKu/fG3HpHFO0AA8WE8q2g+gBJaZ9MG7fcKk+IJPLTGAD6Psw4443l+9DGRbOIh3/aXr7Phy0TjilYivJo5XQ== -parent-require@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/parent-require/-/parent-require-1.0.0.tgz#746a167638083a860b0eef6732cb27ed46c32977" - integrity sha1-dGoWdjgIOoYLDu9nMssn7UbDKXc= - parse-json@^5.0.0: version "5.2.0" resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" @@ -5931,7 +5939,7 @@ path-key@^3.0.0, path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -path-parse@^1.0.6: +path-parse@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== @@ -5978,10 +5986,10 @@ pg-int8@1.0.1: resolved "https://registry.yarnpkg.com/pg-int8/-/pg-int8-1.0.1.tgz#943bd463bf5b71b4170115f80f8efc9a0c0eb78c" integrity sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw== -pg-pool@^3.4.1: - version "3.4.1" - resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-3.4.1.tgz#0e71ce2c67b442a5e862a9c182172c37eda71e9c" - integrity sha512-TVHxR/gf3MeJRvchgNHxsYsTCHQ+4wm3VIHSS19z8NC0+gioEhq1okDY1sm/TYbfoP6JLFx01s0ShvZ3puP/iQ== +pg-pool@^3.5.1: + version "3.5.1" + resolved "https://registry.yarnpkg.com/pg-pool/-/pg-pool-3.5.1.tgz#f499ce76f9bf5097488b3b83b19861f28e4ed905" + integrity sha512-6iCR0wVrro6OOHFsyavV+i6KYL4lVNyYAB9RD18w66xSzN+d8b66HiwuP30Gp1SH5O9T82fckkzsRjlrhD0ioQ== pg-protocol@^1.5.0: version "1.5.0" @@ -6000,24 +6008,24 @@ pg-types@^2.1.0: postgres-interval "^1.1.0" pg@^8.3.0, pg@^8.5.1: - version "8.7.1" - resolved "https://registry.yarnpkg.com/pg/-/pg-8.7.1.tgz#9ea9d1ec225980c36f94e181d009ab9f4ce4c471" - integrity sha512-7bdYcv7V6U3KAtWjpQJJBww0UEsWuh4yQ/EjNf2HeO/NnvKjpvhEIe/A/TleP6wtmSKnUnghs5A9jUoK6iDdkA== + version "8.7.3" + resolved "https://registry.yarnpkg.com/pg/-/pg-8.7.3.tgz#8a5bdd664ca4fda4db7997ec634c6e5455b27c44" + integrity sha512-HPmH4GH4H3AOprDJOazoIcpI49XFsHCe8xlrjHkWiapdbHK+HLtbm/GQzXYAZwmPju/kzKhjaSfMACG+8cgJcw== dependencies: buffer-writer "2.0.0" packet-reader "1.0.0" pg-connection-string "^2.5.0" - pg-pool "^3.4.1" + pg-pool "^3.5.1" pg-protocol "^1.5.0" pg-types "^2.1.0" pgpass "1.x" pgpass@1.x: - version "1.0.4" - resolved "https://registry.yarnpkg.com/pgpass/-/pgpass-1.0.4.tgz#85eb93a83800b20f8057a2b029bf05abaf94ea9c" - integrity sha512-YmuA56alyBq7M59vxVBfPJrGSozru8QAdoNlWuW3cz8l+UX3cWge0vTvjKhsSHSJpo3Bom8/Mm6hf0TR5GY0+w== + version "1.0.5" + resolved "https://registry.yarnpkg.com/pgpass/-/pgpass-1.0.5.tgz#9b873e4a564bb10fa7a7dbd55312728d422a223d" + integrity sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug== dependencies: - split2 "^3.1.1" + split2 "^4.1.0" picocolors@^1.0.0: version "1.0.0" @@ -6025,21 +6033,19 @@ picocolors@^1.0.0: integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: - version "2.3.0" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972" - integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw== + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== pify@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== -pirates@^4.0.0, pirates@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" - integrity sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA== - dependencies: - node-modules-regexp "^1.0.0" +pirates@^4.0.1, pirates@^4.0.5: + version "4.0.5" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" + integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== pkg-dir@^3.0.0: version "3.0.0" @@ -6124,7 +6130,7 @@ prompts@^2.0.1, prompts@^2.4.1: kleur "^3.0.3" sisteransi "^1.0.5" -proxy-addr@~2.0.5: +proxy-addr@~2.0.7: version "2.0.7" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== @@ -6155,15 +6161,15 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -qs@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== +qs@6.9.7: + version "6.9.7" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.7.tgz#4610846871485e1e048f44ae3b94033f0e675afe" + integrity sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw== qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== + version "6.5.3" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad" + integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA== querystring@0.2.0: version "0.2.0" @@ -6194,13 +6200,13 @@ range-parser@~1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== +raw-body@2.4.3: + version "2.4.3" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.3.tgz#8f80305d11c2a0a545c2d9d89d7a0286fcead43c" + integrity sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g== dependencies: - bytes "3.1.0" - http-errors "1.7.2" + bytes "3.1.2" + http-errors "1.8.1" iconv-lite "0.4.24" unpipe "1.0.0" @@ -6248,7 +6254,7 @@ readable-stream@1.1.x: isarray "0.0.1" string_decoder "~0.10.x" -readable-stream@^2.0.6, readable-stream@^2.2.2, readable-stream@^2.3.7: +readable-stream@^2.0.6, readable-stream@^2.2.2: version "2.3.7" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== @@ -6261,7 +6267,7 @@ readable-stream@^2.0.6, readable-stream@^2.2.2, readable-stream@^2.3.7: string_decoder "~1.1.1" util-deprecate "~1.0.1" -readable-stream@^3.0.0, readable-stream@^3.4.0: +readable-stream@^3.4.0, readable-stream@^3.6.0: version "3.6.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== @@ -6321,10 +6327,10 @@ reflect-metadata@^0.1.13: resolved "https://registry.yarnpkg.com/reflect-metadata/-/reflect-metadata-0.1.13.tgz#67ae3ca57c972a2aa1642b10fe363fe32d49dc08" integrity sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg== -regenerate-unicode-properties@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz#54d09c7115e1f53dc2314a974b32c1c344efe326" - integrity sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA== +regenerate-unicode-properties@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.0.1.tgz#7f442732aa7934a3740c779bb9b3340dccc1fb56" + integrity sha512-vn5DU6yg6h8hP/2OkQo3K7uVILvY4iu0oI4t3HFa81UPkhGJwkRwM10JEc3upjdhHjs/k8GJY1sRBhk5sr69Bw== dependencies: regenerate "^1.4.2" @@ -6353,27 +6359,27 @@ regex-not@^1.0.0, regex-not@^1.0.2: extend-shallow "^3.0.2" safe-regex "^1.1.0" -regexpu-core@^4.7.1: - version "4.8.0" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.8.0.tgz#e5605ba361b67b1718478501327502f4479a98f0" - integrity sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg== +regexpu-core@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.0.1.tgz#c531122a7840de743dcf9c83e923b5560323ced3" + integrity sha512-CriEZlrKK9VJw/xQGJpQM5rY88BtuL8DM+AEwvcThHilbxiTAy8vq4iJnd2tqq8wLmjbGZzP7ZcKFjbGkmEFrw== dependencies: regenerate "^1.4.2" - regenerate-unicode-properties "^9.0.0" - regjsgen "^0.5.2" - regjsparser "^0.7.0" + regenerate-unicode-properties "^10.0.1" + regjsgen "^0.6.0" + regjsparser "^0.8.2" unicode-match-property-ecmascript "^2.0.0" unicode-match-property-value-ecmascript "^2.0.0" -regjsgen@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.5.2.tgz#92ff295fb1deecbf6ecdab2543d207e91aa33733" - integrity sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A== +regjsgen@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.6.0.tgz#83414c5354afd7d6627b16af5f10f41c4e71808d" + integrity sha512-ozE883Uigtqj3bx7OhL1KNbCzGyW2NQZPl6Hs09WTvCuZD5sTI4JY58bkbQWa/Y9hxIsvJ3M8Nbf7j54IqeZbA== -regjsparser@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.7.0.tgz#a6b667b54c885e18b52554cb4960ef71187e9968" - integrity sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ== +regjsparser@^0.8.2: + version "0.8.4" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.8.4.tgz#8a14285ffcc5de78c5b95d62bbf413b6bc132d5f" + integrity sha512-J3LABycON/VNEu3abOviqGHuB/LOtOQj8SKmfP9anY5GfAVw/SPjwzSjxGjbZXIxbGfqTHtJw58C2Li/WkStmA== dependencies: jsesc "~0.5.0" @@ -6458,12 +6464,13 @@ resolve-url@^0.2.1: integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= resolve@^1.10.0, resolve@^1.14.2, resolve@^1.18.1: - version "1.20.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.20.0.tgz#629a013fb3f70755d6f0b7935cc1c2c5378b1975" - integrity sha512-wENBPt4ySzg4ybFQW2TT1zMQucPK95HSh/nq2CFTZVOGut2+pQvSsgtda4d26YrYcr067wjbmzOG8byDPBX63A== + version "1.22.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" + integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== dependencies: - is-core-module "^2.2.0" - path-parse "^1.0.6" + is-core-module "^2.8.1" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" restore-cursor@^3.1.0: version "3.1.0" @@ -6514,12 +6521,12 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^7.2.0: - version "7.4.0" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.4.0.tgz#a12a44d7eebf016f5ff2441b87f28c9a51cebc68" - integrity sha512-7SQDi7xeTMCJpqViXh8gL/lebcwlp3d831F05+9B44A4B0WfsEwUQHR64gsH1kvJ+Ep/J9K2+n1hVl1CsGN23w== +rxjs@^7.5.5: + version "7.5.5" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.5.tgz#2ebad89af0f560f460ad5cc4213219e1f7dd4e9f" + integrity sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw== dependencies: - tslib "~2.1.0" + tslib "^2.1.0" safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" @@ -6538,10 +6545,10 @@ safe-regex@^1.1.0: dependencies: ret "~0.1.10" -safe-stable-stringify@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-1.1.1.tgz#c8a220ab525cd94e60ebf47ddc404d610dc5d84a" - integrity sha512-ERq4hUjKDbJfE4+XtZLFPCDi8Vb1JqaxAPTxWFLBx8XcAlf9Bda/ZJdVezs/NAfsMQScyIlUMx+Yeu7P7rx5jw== +safe-stable-stringify@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz#ab67cbe1fe7d40603ca641c5e765cb942d04fc73" + integrity sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg== "safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" @@ -6607,10 +6614,10 @@ semver@~5.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" integrity sha1-myzl094C0XxgEq0yaqa00M9U+U8= -send@0.17.1: - version "0.17.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" - integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== +send@0.17.2: + version "0.17.2" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.2.tgz#926622f76601c41808012c8bf1688fe3906f7820" + integrity sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww== dependencies: debug "2.6.9" depd "~1.1.2" @@ -6619,22 +6626,22 @@ send@0.17.1: escape-html "~1.0.3" etag "~1.8.1" fresh "0.5.2" - http-errors "~1.7.2" + http-errors "1.8.1" mime "1.6.0" - ms "2.1.1" + ms "2.1.3" on-finished "~2.3.0" range-parser "~1.2.1" statuses "~1.5.0" -serve-static@1.14.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" - integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== +serve-static@1.14.2: + version "1.14.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.2.tgz#722d6294b1d62626d41b43a013ece4598d292bfa" + integrity sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ== dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" parseurl "~1.3.3" - send "0.17.1" + send "0.17.2" set-blocking@^2.0.0, set-blocking@~2.0.0: version "2.0.0" @@ -6651,10 +6658,10 @@ set-value@^2.0.0, set-value@^2.0.1: is-plain-object "^2.0.3" split-string "^3.0.1" -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== sha.js@^2.4.11: version "2.4.11" @@ -6710,9 +6717,9 @@ side-channel@^1.0.4: object-inspect "^1.9.0" signal-exit@^3.0.0, signal-exit@^3.0.2, signal-exit@^3.0.3: - version "3.0.5" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.5.tgz#9e3e8cc0c75a99472b44321033a7702e7738252f" - integrity sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ== + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== simple-swizzle@^0.2.2: version "0.2.2" @@ -6778,9 +6785,9 @@ source-map-resolve@^0.5.0: urix "^0.1.0" source-map-support@^0.5.16, source-map-support@^0.5.6: - version "0.5.20" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.20.tgz#12166089f8f5e5e8c56926b377633392dd2cb6c9" - integrity sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw== + version "0.5.21" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" source-map "^0.6.0" @@ -6827,9 +6834,9 @@ spdx-expression-parse@^3.0.0: spdx-license-ids "^3.0.0" spdx-license-ids@^3.0.0: - version "3.0.10" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz#0d9becccde7003d6c658d487dd48a32f0bf3014b" - integrity sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA== + version "3.0.11" + resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.11.tgz#50c0d8c40a14ec1bf449bae69a0ea4685a9d9f95" + integrity sha512-Ctl2BrFiM0X3MANYgj3CkygxhRmr9mi6xhejbdO960nF6EDJApTYpn0BQnDKlnNBULKiCN1n3w9EBkHK8ZWg+g== split-string@^3.0.1, split-string@^3.0.2: version "3.1.0" @@ -6838,12 +6845,10 @@ split-string@^3.0.1, split-string@^3.0.2: dependencies: extend-shallow "^3.0.0" -split2@^3.1.1: - version "3.2.2" - resolved "https://registry.yarnpkg.com/split2/-/split2-3.2.2.tgz#bf2cf2a37d838312c249c89206fd7a17dd12365f" - integrity sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg== - dependencies: - readable-stream "^3.0.0" +split2@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/split2/-/split2-4.1.0.tgz#101907a24370f85bb782f08adaabe4e281ecf809" + integrity sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ== sprintf-js@^1.1.1: version "1.1.2" @@ -6866,9 +6871,9 @@ sqlite3@^5.0.2: node-gyp "3.x" sshpk@^1.7.0: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== + version "1.17.0" + resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.17.0.tgz#578082d92d4fe612b13007496e543fa0fbcbe4c5" + integrity sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ== dependencies: asn1 "~0.2.3" assert-plus "^1.0.0" @@ -6932,7 +6937,7 @@ string-width@^1.0.1: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2: +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -6941,14 +6946,6 @@ string-width@^1.0.1: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string-width@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" - integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^4.0.0" - string.prototype.trimend@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.4.tgz#e75ae90c2942c63504686c18b287b4a0b1a45f80" @@ -6991,13 +6988,6 @@ strip-ansi@^3.0.0, strip-ansi@^3.0.1: dependencies: ansi-regex "^2.0.0" -strip-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" - integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= - dependencies: - ansi-regex "^3.0.0" - strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" @@ -7025,11 +7015,6 @@ strip-json-comments@~2.0.1: resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo= -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= - supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -7059,6 +7044,11 @@ supports-hyperlinks@^2.0.0, supports-hyperlinks@^2.1.0: has-flag "^4.0.0" supports-color "^7.0.0" +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + symbol-tree@^3.2.4: version "3.2.4" resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" @@ -7181,10 +7171,10 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== tough-cookie@^4.0.0: version "4.0.0" @@ -7210,26 +7200,21 @@ tr46@^2.1.0: dependencies: punycode "^2.1.1" -triple-beam@^1.2.0, triple-beam@^1.3.0: +triple-beam@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/triple-beam/-/triple-beam-1.3.0.tgz#a595214c7298db8339eeeee083e4d10bd8cb8dd9" integrity sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw== -tslib@^1, tslib@^1.9.3: +tslib@^1: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0: +tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== -tslib@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.1.0.tgz#da60860f1c2ecaa5703ab7d39bc05b6bf988b97a" - integrity sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A== - tunnel-agent@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" @@ -7274,7 +7259,7 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -type-is@^1.6.4, type-is@~1.6.17, type-is@~1.6.18: +type-is@^1.6.4, type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== @@ -7295,9 +7280,9 @@ typedarray@^0.0.6: integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= typeorm@^0.2.31: - version "0.2.38" - resolved "https://registry.yarnpkg.com/typeorm/-/typeorm-0.2.38.tgz#2af08079919f6ab04cd17017f9faa2c8d5cd566f" - integrity sha512-M6Y3KQcAREQcphOVJciywf4mv6+A0I/SeR+lWNjKsjnQ+a3XcMwGYMGL0Jonsx3H0Cqlf/3yYqVki1jIXSK/xg== + version "0.2.45" + resolved "https://registry.yarnpkg.com/typeorm/-/typeorm-0.2.45.tgz#e5bbb3af822dc4646bad96cfa48cd22fa4687cea" + integrity sha512-c0rCO8VMJ3ER7JQ73xfk0zDnVv0WDjpsP6Q1m6CVKul7DB9iVdWLRjPzc8v2eaeBuomsbZ2+gTaYr8k1gm3bYA== dependencies: "@sqltools/formatter" "^1.2.2" app-root-path "^3.0.0" @@ -7312,8 +7297,8 @@ typeorm@^0.2.31: reflect-metadata "^0.1.13" sha.js "^2.4.11" tslib "^2.1.0" + uuid "^8.3.2" xml2js "^0.4.23" - yargonaut "^1.1.4" yargs "^17.0.1" zen-observable-ts "^1.0.0" @@ -7484,7 +7469,7 @@ validate-npm-package-license@^3.0.1: validator@^13.7.0: version "13.7.0" - resolved "http://localhost:4873/validator/-/validator-13.7.0.tgz#4f9658ba13ba8f3d82ee881d3516489ea85c0857" + resolved "https://registry.yarnpkg.com/validator/-/validator-13.7.0.tgz#4f9658ba13ba8f3d82ee881d3516489ea85c0857" integrity sha512-nYXQLCBkpJ8X6ltALua9dRrZDHVYxjJ1wgskNt1lH9fzGjs3tgojGSCBjmEPwkWS1y29+DrizMTW19Pr9uB2nw== vary@^1, vary@~1.1.2: @@ -7604,43 +7589,36 @@ widest-line@^3.1.0: dependencies: string-width "^4.0.0" -winston-transport@^4.4.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.4.0.tgz#17af518daa690d5b2ecccaa7acf7b20ca7925e59" - integrity sha512-Lc7/p3GtqtqPBYYtS6KCN3c77/2QCev51DvcJKbkFPQNoj1sinkGwLGFDxkXY9J6p9+EPnYs+D90uwbnaiURTw== +winston-transport@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/winston-transport/-/winston-transport-4.5.0.tgz#6e7b0dd04d393171ed5e4e4905db265f7ab384fa" + integrity sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q== dependencies: - readable-stream "^2.3.7" - triple-beam "^1.2.0" + logform "^2.3.2" + readable-stream "^3.6.0" + triple-beam "^1.3.0" winston@^3.2.1, winston@^3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/winston/-/winston-3.3.3.tgz#ae6172042cafb29786afa3d09c8ff833ab7c9170" - integrity sha512-oEXTISQnC8VlSAKf1KYSSd7J6IWuRPQqDdo8eoRNaYKLvwSb5+79Z3Yi1lrl6KDpU6/VWaxpakDAtb1oQ4n9aw== + version "3.6.0" + resolved "https://registry.yarnpkg.com/winston/-/winston-3.6.0.tgz#be32587a099a292b88c49fac6fa529d478d93fb6" + integrity sha512-9j8T75p+bcN6D00sF/zjFVmPp+t8KMPB1MzbbzYjeN9VWxdsYnTB40TkbNUEXAmILEfChMvAMgidlX64OG3p6w== dependencies: "@dabh/diagnostics" "^2.0.2" - async "^3.1.0" + async "^3.2.3" is-stream "^2.0.0" - logform "^2.2.0" + logform "^2.4.0" one-time "^1.0.0" readable-stream "^3.4.0" + safe-stable-stringify "^2.3.1" stack-trace "0.0.x" triple-beam "^1.3.0" - winston-transport "^4.4.0" + winston-transport "^4.5.0" word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== -wrap-ansi@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-4.0.0.tgz#b3570d7c70156159a2d42be5cc942e957f7b1131" - integrity sha512-uMTsj9rDb0/7kk1PbcbCcwvHUxp60fGDB/NNXpVa0Q+ic/e7y5+BwTxKfQ33VYgDppSwi/FBzpetYzo8s6tfbg== - dependencies: - ansi-styles "^3.2.0" - string-width "^2.1.1" - strip-ansi "^4.0.0" - wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" @@ -7675,9 +7653,9 @@ write-file-atomic@^3.0.0: typedarray-to-buffer "^3.1.5" ws@^7.4.6: - version "7.5.5" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.5.tgz#8b4bc4af518cfabd0473ae4f99144287b33eb881" - integrity sha512-BAkMFcAzl8as1G/hArkxOxq3G7pjUqQ3gzYbLL0/5zNkph70e+lCoxBGnm6AW1+/aiNeV4fnKqZ8m4GZewmH2w== + version "7.5.7" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.7.tgz#9e0ac77ee50af70d58326ecff7e85eb3fa375e67" + integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A== xdg-basedir@^4.0.0: version "4.0.0" @@ -7732,15 +7710,6 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yargonaut@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/yargonaut/-/yargonaut-1.1.4.tgz#c64f56432c7465271221f53f5cc517890c3d6e0c" - integrity sha512-rHgFmbgXAAzl+1nngqOcwEljqHGG9uUZoPjsdZEs1w5JW9RXYzrSvH/u70C1JE5qFi0qjsdhnUX/dJRpWqitSA== - dependencies: - chalk "^1.1.1" - figlet "^1.1.1" - parent-require "^1.0.0" - yargs-parser@^18.1.2: version "18.1.3" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-18.1.3.tgz#be68c4975c6b2abf469236b0c870362fab09a7b0" @@ -7754,6 +7723,11 @@ yargs-parser@^20.2.2: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== +yargs-parser@^21.0.0: + version "21.0.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" + integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== + yargs@^15.3.1, yargs@^15.4.1: version "15.4.1" resolved "https://registry.yarnpkg.com/yargs/-/yargs-15.4.1.tgz#0d87a16de01aee9d8bec2bfbf74f67851730f4f8" @@ -7785,17 +7759,17 @@ yargs@^16.0.0: yargs-parser "^20.2.2" yargs@^17.0.1: - version "17.2.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.2.1.tgz#e2c95b9796a0e1f7f3bf4427863b42e0418191ea" - integrity sha512-XfR8du6ua4K6uLGm5S6fA+FIJom/MdJcFNVY8geLlp2v8GYbOXD4EB1tPNZsRn4vBzKGMgb5DRZMeWuFc2GO8Q== + version "17.4.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.4.0.tgz#9fc9efc96bd3aa2c1240446af28499f0e7593d00" + integrity sha512-WJudfrk81yWFSOkZYpAZx4Nt7V4xp7S/uJkX0CnxovMCt1wCE8LNftPpNuF9X/u9gN5nsD7ycYtRcDf2pL3UiA== dependencies: cliui "^7.0.2" escalade "^3.1.1" get-caller-file "^2.0.5" require-directory "^2.1.1" - string-width "^4.2.0" + string-width "^4.2.3" y18n "^5.0.5" - yargs-parser "^20.2.2" + yargs-parser "^21.0.0" zen-observable-ts@^1.0.0: version "1.1.0" diff --git a/packages/medusa-fulfillment-webshipper/src/services/webshipper-fulfillment.js b/packages/medusa-fulfillment-webshipper/src/services/webshipper-fulfillment.js index bb90e57cc9..4ea0cd2e00 100644 --- a/packages/medusa-fulfillment-webshipper/src/services/webshipper-fulfillment.js +++ b/packages/medusa-fulfillment-webshipper/src/services/webshipper-fulfillment.js @@ -1,4 +1,3 @@ -import { TotalsService } from "@medusajs/medusa" import { humanizeAmount } from "medusa-core-utils" import { FulfillmentService } from "medusa-interfaces" import Webshipper from "../utils/webshipper" @@ -114,13 +113,7 @@ class WebshipperFulfillmentService extends FulfillmentService { const fromOrder = await this.orderService_.retrieve(orderId, { select: ["total"], - relations: [ - "discounts", - "discounts.rule", - "discounts.rule.valid_for", - "shipping_address", - "returns", - ], + relations: ["discounts", "discounts.rule", "shipping_address", "returns"], }) const methodData = returnOrder.shipping_method.data @@ -145,7 +138,7 @@ class WebshipperFulfillmentService extends FulfillmentService { } } - let docs = [] + const docs = [] if (this.invoiceGenerator_) { const base64Invoice = await this.invoiceGenerator_.createReturnInvoice( fromOrder, @@ -338,7 +331,7 @@ class WebshipperFulfillmentService extends FulfillmentService { } } - let id = fulfillment.id + const id = fulfillment.id let visible_ref = `${fromOrder.display_id}-${id.substr(id.length - 4)}` let ext_ref = `${fromOrder.id}.${fulfillment.id}` diff --git a/packages/medusa-plugin-segment/src/subscribers/order.js b/packages/medusa-plugin-segment/src/subscribers/order.js index 2ee8a25985..49961fc8c5 100644 --- a/packages/medusa-plugin-segment/src/subscribers/order.js +++ b/packages/medusa-plugin-segment/src/subscribers/order.js @@ -45,7 +45,6 @@ class OrderSubscriber { "shipping_address", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_methods", "payments", "fulfillments", @@ -149,7 +148,6 @@ class OrderSubscriber { "shipping_address", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_methods", "payments", "fulfillments", @@ -258,7 +256,6 @@ class OrderSubscriber { "shipping_address", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_methods", "payments", "fulfillments", diff --git a/packages/medusa-plugin-sendgrid/src/services/sendgrid.js b/packages/medusa-plugin-sendgrid/src/services/sendgrid.js index 3cf920ed8c..d5d46f4688 100644 --- a/packages/medusa-plugin-sendgrid/src/services/sendgrid.js +++ b/packages/medusa-plugin-sendgrid/src/services/sendgrid.js @@ -1,7 +1,6 @@ import SendGrid from "@sendgrid/mail" - -import { NotificationService } from "medusa-interfaces" import { humanizeAmount, zeroDecimalCurrencies } from "medusa-core-utils" +import { NotificationService } from "medusa-interfaces" class SendGridService extends NotificationService { static identifier = "sendgrid" @@ -293,7 +292,7 @@ class SendGridService extends NotificationService { * @param {string} from - sender of email * @param {string} to - receiver of email * @param {Object} data - data to send in mail (match with template) - * @returns {Promise} result of the send operation + * @return {Promise} result of the send operation */ async sendEmail(options) { try { @@ -321,7 +320,6 @@ class SendGridService extends NotificationService { "shipping_address", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_methods", "shipping_methods.shipping_option", "payments", @@ -366,7 +364,6 @@ class SendGridService extends NotificationService { "shipping_address", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_methods", "shipping_methods.shipping_option", "payments", @@ -465,7 +462,6 @@ class SendGridService extends NotificationService { "shipping_address", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_methods", "shipping_methods.shipping_option", "payments", @@ -624,7 +620,6 @@ class SendGridService extends NotificationService { "items.tax_lines", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_address", "returns", ], @@ -747,7 +742,6 @@ class SendGridService extends NotificationService { "items", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_address", "swaps", "swaps.additional_items", @@ -875,7 +869,6 @@ class SendGridService extends NotificationService { "items.tax_lines", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_address", "swaps", "swaps.additional_items", @@ -985,7 +978,6 @@ class SendGridService extends NotificationService { "items.tax_lines", "discounts", "discounts.rule", - "discounts.rule.valid_for", "swaps", "swaps.additional_items", "swaps.additional_items.tax_lines", diff --git a/packages/medusa-plugin-slack-notification/src/services/slack.js b/packages/medusa-plugin-slack-notification/src/services/slack.js index 16a404e409..b7e948d0e1 100644 --- a/packages/medusa-plugin-slack-notification/src/services/slack.js +++ b/packages/medusa-plugin-slack-notification/src/services/slack.js @@ -1,5 +1,5 @@ import axios from "axios" -import { zeroDecimalCurrencies, humanizeAmount } from "medusa-core-utils" +import { humanizeAmount, zeroDecimalCurrencies } from "medusa-core-utils" import { BaseService } from "medusa-interfaces" class SlackService extends BaseService { @@ -41,7 +41,6 @@ class SlackService extends BaseService { "shipping_address", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_methods", "payments", "fulfillments", @@ -69,7 +68,7 @@ class SlackService extends BaseService { return humanAmount.toFixed(2) } - let blocks = [ + const blocks = [ { type: "section", text: { @@ -147,7 +146,7 @@ class SlackService extends BaseService { include_tax: true, } ) - let line = { + const line = { type: "section", text: { type: "mrkdwn", diff --git a/packages/medusa/src/api/routes/admin/customer-groups/list-customer-groups.ts b/packages/medusa/src/api/routes/admin/customer-groups/list-customer-groups.ts index a38cd88b08..1685f3c2df 100644 --- a/packages/medusa/src/api/routes/admin/customer-groups/list-customer-groups.ts +++ b/packages/medusa/src/api/routes/admin/customer-groups/list-customer-groups.ts @@ -1,13 +1,12 @@ -import { IsNumber, IsOptional, IsString } from "class-validator" import { Type } from "class-transformer" +import { IsNumber, IsOptional, IsString } from "class-validator" import omit from "lodash/omit" - -import { validator } from "../../../../utils/validator" -import { CustomerGroupService } from "../../../../services" -import { CustomerGroup } from "../../../../models/customer-group" -import { FindConfig } from "../../../../types/common" import { defaultAdminCustomerGroupsRelations } from "." +import { CustomerGroup } from "../../../../models/customer-group" +import { CustomerGroupService } from "../../../../services" +import { FindConfig } from "../../../../types/common" import { FilterableCustomerGroupProps } from "../../../../types/customer-groups" +import { validator } from "../../../../utils/validator" /** * @oas [get] /customer-groups diff --git a/packages/medusa/src/api/routes/admin/discounts/__tests__/add-region.js b/packages/medusa/src/api/routes/admin/discounts/__tests__/add-region.js index cef0080af1..1bbe2dc0ae 100644 --- a/packages/medusa/src/api/routes/admin/discounts/__tests__/add-region.js +++ b/packages/medusa/src/api/routes/admin/discounts/__tests__/add-region.js @@ -48,7 +48,7 @@ describe("POST /admin/discounts/:discount_id/regions/:region_id", () => { "metadata", "valid_duration", ], - relations: ["rule", "parent_discount", "regions", "rule.valid_for"], + relations: ["rule", "parent_discount", "regions", "rule.conditions"], } ) diff --git a/packages/medusa/src/api/routes/admin/discounts/__tests__/add-valid-product.js b/packages/medusa/src/api/routes/admin/discounts/__tests__/add-valid-product.js index 6377ae7020..542505036e 100644 --- a/packages/medusa/src/api/routes/admin/discounts/__tests__/add-valid-product.js +++ b/packages/medusa/src/api/routes/admin/discounts/__tests__/add-valid-product.js @@ -48,7 +48,7 @@ describe("POST /admin/discounts/:discount_id/products/:product_id", () => { "metadata", "valid_duration", ], - relations: ["rule", "parent_discount", "regions", "rule.valid_for"], + relations: ["rule", "parent_discount", "regions", "rule.conditions"], } ) diff --git a/packages/medusa/src/api/routes/admin/discounts/__tests__/create-discount.js b/packages/medusa/src/api/routes/admin/discounts/__tests__/create-discount.js index 70ca11cd77..b9ed3fa9f8 100644 --- a/packages/medusa/src/api/routes/admin/discounts/__tests__/create-discount.js +++ b/packages/medusa/src/api/routes/admin/discounts/__tests__/create-discount.js @@ -166,6 +166,49 @@ describe("POST /admin/discounts", () => { }) }) + describe("fails on xor constraint for conditions", () => { + let subject + + beforeAll(async () => { + subject = await request("POST", "/admin/discounts", { + payload: { + code: "TEST", + rule: { + description: "Test", + type: "fixed", + value: 10, + allocation: "total", + conditions: [ + { + products: ["product1"], + operator: "in", + product_types: ["producttype1"], + }, + ], + }, + starts_at: "02/02/2021 13:45", + is_dynamic: true, + valid_duration: "P1Y2M03DT04H05M", + }, + adminSession: { + jwt: { + userId: IdMap.getId("admin_user"), + }, + }, + }) + }) + + it("returns 400", () => { + expect(subject.status).toEqual(400) + }) + + it("returns error", () => { + expect(subject.body.message).toEqual( + `Only one of products, product_types is allowed, Only one of product_types, products is allowed` + ) + }) + }) + describe("fails on invalid date intervals", () => { let subject diff --git a/packages/medusa/src/api/routes/admin/discounts/__tests__/get-discount.js b/packages/medusa/src/api/routes/admin/discounts/__tests__/get-discount.js index 7616b1d0a4..9522708e68 100644 --- a/packages/medusa/src/api/routes/admin/discounts/__tests__/get-discount.js +++ b/packages/medusa/src/api/routes/admin/discounts/__tests__/get-discount.js @@ -24,7 +24,7 @@ const defaultRelations = [ "rule", "parent_discount", "regions", - "rule.valid_for", + "rule.conditions", ] describe("GET /admin/discounts/:discount_id", () => { diff --git a/packages/medusa/src/api/routes/admin/discounts/__tests__/remove-region.js b/packages/medusa/src/api/routes/admin/discounts/__tests__/remove-region.js index 895ca98c7f..44662e7873 100644 --- a/packages/medusa/src/api/routes/admin/discounts/__tests__/remove-region.js +++ b/packages/medusa/src/api/routes/admin/discounts/__tests__/remove-region.js @@ -24,7 +24,7 @@ const defaultRelations = [ "rule", "parent_discount", "regions", - "rule.valid_for", + "rule.conditions", ] describe("DELETE /admin/discounts/:discount_id/regions/region_id", () => { diff --git a/packages/medusa/src/api/routes/admin/discounts/__tests__/remove-valid-product.js b/packages/medusa/src/api/routes/admin/discounts/__tests__/remove-valid-product.js index a64d6e14d7..d09bf2e3d1 100644 --- a/packages/medusa/src/api/routes/admin/discounts/__tests__/remove-valid-product.js +++ b/packages/medusa/src/api/routes/admin/discounts/__tests__/remove-valid-product.js @@ -24,7 +24,7 @@ const defaultRelations = [ "rule", "parent_discount", "regions", - "rule.valid_for", + "rule.conditions", ] describe("DELETE /admin/discounts/:discount_id/products/:product_id", () => { diff --git a/packages/medusa/src/api/routes/admin/discounts/create-discount.ts b/packages/medusa/src/api/routes/admin/discounts/create-discount.ts index ee8bd986ed..d3019a54b9 100644 --- a/packages/medusa/src/api/routes/admin/discounts/create-discount.ts +++ b/packages/medusa/src/api/routes/admin/discounts/create-discount.ts @@ -11,11 +11,16 @@ import { IsString, ValidateNested, } from "class-validator" -import { defaultAdminDiscountsRelations } from "." +import { defaultAdminDiscountsFields, defaultAdminDiscountsRelations } from "." +import { Discount } from "../../../../models/discount" +import { DiscountConditionOperator } from "../../../../models/discount-condition" import DiscountService from "../../../../services/discount" -import { IsGreaterThan } from "../../../../utils/validators/greater-than" +import { AdminUpsertConditionsReq } from "../../../../types/discount" +import { getRetrieveConfig } from "../../../../utils/get-query-config" import { validator } from "../../../../utils/validator" +import { IsGreaterThan } from "../../../../utils/validators/greater-than" import { IsISO8601Duration } from "../../../../utils/validators/iso8601-duration" +import { AdminPostDiscountsDiscountParams } from "./update-discount" /** * @oas [post] /discounts * operationId: "PostDiscounts" @@ -74,16 +79,30 @@ import { IsISO8601Duration } from "../../../../utils/validators/iso8601-duration * discount: * $ref: "#/components/schemas/discount" */ + export default async (req, res) => { const validated = await validator(AdminPostDiscountsReq, req.body) - const discountService: DiscountService = req.scope.resolve("discountService") - const created = await discountService.create(validated) - const discount = await discountService.retrieve( - created.id, - defaultAdminDiscountsRelations + console.log(validated.rule.conditions) + + const validatedParams = await validator( + AdminPostDiscountsDiscountParams, + req.query ) + const discountService: DiscountService = req.scope.resolve("discountService") + + const created = await discountService.create(validated) + + const config = getRetrieveConfig( + defaultAdminDiscountsFields, + defaultAdminDiscountsRelations, + validatedParams?.fields?.split(",") as (keyof Discount)[], + validatedParams?.expand?.split(",") + ) + + const discount = await discountService.retrieve(created.id, config) + res.status(200).json({ discount }) } @@ -132,7 +151,7 @@ export class AdminPostDiscountsReq { @IsObject() @IsOptional() - metadata?: object + metadata?: Record } export class AdminPostDiscountsDiscountRule { @@ -153,6 +172,22 @@ export class AdminPostDiscountsDiscountRule { @IsOptional() @IsArray() - @IsString({ each: true }) - valid_for?: string[] + @ValidateNested({ each: true }) + @Type(() => AdminCreateCondition) + conditions?: AdminCreateCondition[] +} + +export class AdminCreateCondition extends AdminUpsertConditionsReq { + @IsString() + operator: DiscountConditionOperator +} + +export class AdminPostDiscountsParams { + @IsArray() + @IsOptional() + expand?: string[] + + @IsArray() + @IsOptional() + fields?: string[] } diff --git a/packages/medusa/src/api/routes/admin/discounts/create-dynamic-code.ts b/packages/medusa/src/api/routes/admin/discounts/create-dynamic-code.ts index 57fb34ba8b..14e0b030f4 100644 --- a/packages/medusa/src/api/routes/admin/discounts/create-dynamic-code.ts +++ b/packages/medusa/src/api/routes/admin/discounts/create-dynamic-code.ts @@ -5,6 +5,7 @@ import { IsOptional, IsString, } from "class-validator" +import { defaultAdminDiscountsFields, defaultAdminDiscountsRelations } from "." import DiscountService from "../../../../services/discount" import { validator } from "../../../../utils/validator" /** @@ -16,6 +17,7 @@ import { validator } from "../../../../utils/validator" * parameters: * - (path) id=* {string} The id of the Discount to create the dynamic code from." * - (body) code=* {string} The unique code that will be used to redeem the Discount. + * - (body) usage_limit=* {number} amount of times the discount can be applied * - (body) metadata {object} An optional set of key-value paris to hold additional information. * tags: * - Discount @@ -44,7 +46,8 @@ export default async (req, res) => { ) const discount = await discountService.retrieve(created.id, { - relations: ["rule", "rule.valid_for", "regions"], + select: defaultAdminDiscountsFields, + relations: defaultAdminDiscountsRelations, }) res.status(200).json({ discount }) diff --git a/packages/medusa/src/api/routes/admin/discounts/delete-dynamic-code.ts b/packages/medusa/src/api/routes/admin/discounts/delete-dynamic-code.ts index 1aa76a74a9..b198a93aeb 100644 --- a/packages/medusa/src/api/routes/admin/discounts/delete-dynamic-code.ts +++ b/packages/medusa/src/api/routes/admin/discounts/delete-dynamic-code.ts @@ -1,3 +1,4 @@ +import { defaultAdminDiscountsFields, defaultAdminDiscountsRelations } from "." import DiscountService from "../../../../services/discount" /** @@ -28,7 +29,8 @@ export default async (req, res) => { await discountService.deleteDynamicCode(discount_id, code) const discount = await discountService.retrieve(discount_id, { - relations: ["rule", "rule.valid_for", "regions"], + select: defaultAdminDiscountsFields, + relations: defaultAdminDiscountsRelations, }) res.status(200).json({ discount }) diff --git a/packages/medusa/src/api/routes/admin/discounts/index.ts b/packages/medusa/src/api/routes/admin/discounts/index.ts index 20c6c23790..51a9a4a48d 100644 --- a/packages/medusa/src/api/routes/admin/discounts/index.ts +++ b/packages/medusa/src/api/routes/admin/discounts/index.ts @@ -62,7 +62,7 @@ export default (app) => { return app } -export const defaultAdminDiscountsFields = [ +export const defaultAdminDiscountsFields: (keyof Discount)[] = [ "id", "code", "is_dynamic", @@ -84,7 +84,7 @@ export const defaultAdminDiscountsRelations = [ "rule", "parent_discount", "regions", - "rule.valid_for", + "rule.conditions", ] export type AdminDiscountsRes = { diff --git a/packages/medusa/src/api/routes/admin/discounts/list-discounts.ts b/packages/medusa/src/api/routes/admin/discounts/list-discounts.ts index 11b2724273..48817605f6 100644 --- a/packages/medusa/src/api/routes/admin/discounts/list-discounts.ts +++ b/packages/medusa/src/api/routes/admin/discounts/list-discounts.ts @@ -1,7 +1,6 @@ -import { Type, Transform } from "class-transformer" +import { Transform, Type } from "class-transformer" import { IsBoolean, - IsEnum, IsInt, IsOptional, IsString, @@ -9,12 +8,10 @@ import { } from "class-validator" import _, { pickBy } from "lodash" import { defaultAdminDiscountsFields, defaultAdminDiscountsRelations } from "." -import { - AllocationType, - DiscountRuleType, -} from "../../../../models/discount-rule" +import { Discount } from "../../../.." import DiscountService from "../../../../services/discount" -import { DateComparisonOperator } from "../../../../types/common" +import { FindConfig } from "../../../../types/common" +import { AdminGetDiscountsDiscountRuleParams } from "../../../../types/discount" import { validator } from "../../../../utils/validator" /** * @oas [get] /discounts @@ -46,7 +43,7 @@ export default async (req, res) => { const discountService: DiscountService = req.scope.resolve("discountService") - const listConfig = { + const listConfig: FindConfig = { select: defaultAdminDiscountsFields, relations: defaultAdminDiscountsRelations, skip: validated.offset, @@ -69,17 +66,12 @@ export default async (req, res) => { }) } -class AdminGetDiscountsDiscountRuleParams { - @IsOptional() - @IsEnum(DiscountRuleType) - type: DiscountRuleType - - @IsOptional() - @IsEnum(AllocationType) - allocation: AllocationType -} - export class AdminGetDiscountsParams { + @ValidateNested() + @IsOptional() + @Type(() => AdminGetDiscountsDiscountRuleParams) + rule?: AdminGetDiscountsDiscountRuleParams + @IsString() @IsOptional() q?: string @@ -94,11 +86,6 @@ export class AdminGetDiscountsParams { @Transform(({ value }) => value === "true") is_disabled?: boolean - @ValidateNested() - @IsOptional() - @Type(() => AdminGetDiscountsDiscountRuleParams) - rule?: AdminGetDiscountsDiscountRuleParams - @IsInt() @IsOptional() @Type(() => Number) diff --git a/packages/medusa/src/api/routes/admin/discounts/update-discount.ts b/packages/medusa/src/api/routes/admin/discounts/update-discount.ts index 0e16bd4a47..e8791cb4ba 100644 --- a/packages/medusa/src/api/routes/admin/discounts/update-discount.ts +++ b/packages/medusa/src/api/routes/admin/discounts/update-discount.ts @@ -12,7 +12,11 @@ import { ValidateNested, } from "class-validator" import { defaultAdminDiscountsFields, defaultAdminDiscountsRelations } from "." +import { Discount } from "../../../../models/discount" +import { DiscountConditionOperator } from "../../../../models/discount-condition" import DiscountService from "../../../../services/discount" +import { AdminUpsertConditionsReq } from "../../../../types/discount" +import { getRetrieveConfig } from "../../../../utils/get-query-config" import { validator } from "../../../../utils/validator" import { IsGreaterThan } from "../../../../utils/validators/greater-than" import { IsISO8601Duration } from "../../../../utils/validators/iso8601-duration" @@ -73,12 +77,24 @@ export default async (req, res) => { const { discount_id } = req.params const validated = await validator(AdminPostDiscountsDiscountReq, req.body) + + const validatedParams = await validator( + AdminPostDiscountsDiscountParams, + req.query + ) + const discountService: DiscountService = req.scope.resolve("discountService") + await discountService.update(discount_id, validated) - const discount = await discountService.retrieve(discount_id, { - select: defaultAdminDiscountsFields, - relations: defaultAdminDiscountsRelations, - }) + + const config = getRetrieveConfig( + defaultAdminDiscountsFields, + defaultAdminDiscountsRelations, + validatedParams?.fields?.split(",") as (keyof Discount)[], + validatedParams?.expand?.split(",") + ) + + const discount = await discountService.retrieve(discount_id, config) res.status(200).json({ discount }) } @@ -128,7 +144,7 @@ export class AdminPostDiscountsDiscountReq { @IsObject() @IsOptional() - metadata?: object + metadata?: Record } export class AdminUpdateDiscountRule { @@ -151,8 +167,29 @@ export class AdminUpdateDiscountRule { @IsNotEmpty() allocation: string - @IsArray() @IsOptional() - @IsString({ each: true }) - valid_for?: string[] + @IsArray() + @ValidateNested({ each: true }) + @Type(() => AdminUpsertCondition) + conditions?: AdminUpsertCondition[] +} + +export class AdminUpsertCondition extends AdminUpsertConditionsReq { + @IsString() + @IsOptional() + id?: string + + @IsString() + @IsOptional() + operator: DiscountConditionOperator +} + +export class AdminPostDiscountsDiscountParams { + @IsString() + @IsOptional() + expand?: string + + @IsString() + @IsOptional() + fields?: string } diff --git a/packages/medusa/src/api/routes/admin/draft-orders/register-payment.ts b/packages/medusa/src/api/routes/admin/draft-orders/register-payment.ts index e6b801353f..91df35c1e1 100644 --- a/packages/medusa/src/api/routes/admin/draft-orders/register-payment.ts +++ b/packages/medusa/src/api/routes/admin/draft-orders/register-payment.ts @@ -56,7 +56,6 @@ export default async (req, res) => { relations: [ "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_methods", "region", "items", diff --git a/packages/medusa/src/api/routes/admin/orders/__tests__/get-order.js b/packages/medusa/src/api/routes/admin/orders/__tests__/get-order.js index 3b70832f6a..3c75a6a93f 100644 --- a/packages/medusa/src/api/routes/admin/orders/__tests__/get-order.js +++ b/packages/medusa/src/api/routes/admin/orders/__tests__/get-order.js @@ -8,7 +8,6 @@ const defaultRelations = [ "shipping_address", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_methods", "payments", "fulfillments", diff --git a/packages/medusa/src/api/routes/admin/orders/index.ts b/packages/medusa/src/api/routes/admin/orders/index.ts index a1600cc654..05254db5c3 100644 --- a/packages/medusa/src/api/routes/admin/orders/index.ts +++ b/packages/medusa/src/api/routes/admin/orders/index.ts @@ -1,8 +1,8 @@ import { Router } from "express" -import { Order } from "../../../.." -import middlewares from "../../../middlewares" -import { DeleteResponse, PaginatedResponse } from "../../../../types/common" import "reflect-metadata" +import { Order } from "../../../.." +import { DeleteResponse, PaginatedResponse } from "../../../../types/common" +import middlewares from "../../../middlewares" const route = Router() @@ -231,7 +231,6 @@ export const defaultAdminOrdersRelations = [ "shipping_address", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_methods", "payments", "fulfillments", @@ -332,7 +331,6 @@ export const allowedAdminOrdersRelations = [ "shipping_address", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_methods", "payments", "fulfillments", diff --git a/packages/medusa/src/api/routes/admin/tax-rates/utils/get-query-config.ts b/packages/medusa/src/api/routes/admin/tax-rates/utils/get-query-config.ts index a8ce900e82..caf1bf80e1 100644 --- a/packages/medusa/src/api/routes/admin/tax-rates/utils/get-query-config.ts +++ b/packages/medusa/src/api/routes/admin/tax-rates/utils/get-query-config.ts @@ -1,7 +1,7 @@ -import { defaultAdminTaxRatesFields, defaultAdminTaxRatesRelations } from "../" import { pick } from "lodash" -import { FindConfig } from "../../../../../types/common" +import { defaultAdminTaxRatesFields, defaultAdminTaxRatesRelations } from "../" import { TaxRate } from "../../../../.." +import { FindConfig } from "../../../../../types/common" export function pickByConfig( obj: T | T[], @@ -64,7 +64,9 @@ export function getListConfig( expandFields = expand } - const orderBy = order ?? { created_at: "DESC" } + const orderBy: Record = order ?? { + created_at: "DESC", + } return { select: includeFields.length ? includeFields : defaultAdminTaxRatesFields, diff --git a/packages/medusa/src/api/routes/store/carts/index.ts b/packages/medusa/src/api/routes/store/carts/index.ts index f3d44c9f79..077b366f19 100644 --- a/packages/medusa/src/api/routes/store/carts/index.ts +++ b/packages/medusa/src/api/routes/store/carts/index.ts @@ -125,23 +125,25 @@ export const defaultStoreCartRelations = [ "shipping_methods.shipping_option", "discounts", "discounts.rule", - "discounts.rule.valid_for", ] export type StoreCartsRes = { cart: Omit } -export type StoreCompleteCartRes = { - type: "cart" - data: Cart -} | { - type: "order" - data: Order -} | { - type: "swap" - data: Swap -} +export type StoreCompleteCartRes = + | { + type: "cart" + data: Cart + } + | { + type: "order" + data: Order + } + | { + type: "swap" + data: Swap + } export type StoreCartsDeleteRes = DeleteResponse diff --git a/packages/medusa/src/api/routes/store/orders/index.ts b/packages/medusa/src/api/routes/store/orders/index.ts index 319980ab6f..8b01f357c8 100644 --- a/packages/medusa/src/api/routes/store/orders/index.ts +++ b/packages/medusa/src/api/routes/store/orders/index.ts @@ -39,7 +39,6 @@ export const defaultStoreOrdersRelations = [ "shipping_methods", "discounts", "discounts.rule", - "discounts.rule.valid_for", "customer", "payments", "region", @@ -79,7 +78,6 @@ export const allowedStoreOrdersRelations = [ "shipping_methods", "discounts", "discounts.rule", - "discounts.rule.valid_for", "customer", "payments", "region", diff --git a/packages/medusa/src/migrations/1646324713514-discount_conditions.ts b/packages/medusa/src/migrations/1646324713514-discount_conditions.ts new file mode 100644 index 0000000000..f0559cbe18 --- /dev/null +++ b/packages/medusa/src/migrations/1646324713514-discount_conditions.ts @@ -0,0 +1,245 @@ +import { MigrationInterface, QueryRunner } from "typeorm" + +export class discountConditions1646324713514 implements MigrationInterface { + name = "discountConditions1646324713514" + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `CREATE TYPE "discount_condition_type_enum" AS ENUM('products', 'product_types', 'product_collections', 'product_tags', 'customer_groups')` + ) + await queryRunner.query( + `CREATE TYPE "discount_condition_operator_enum" AS ENUM('in', 'not_in')` + ) + await queryRunner.query( + `CREATE TABLE "discount_condition" ("id" character varying NOT NULL, "type" "discount_condition_type_enum" NOT NULL, "operator" "discount_condition_operator_enum" NOT NULL, "discount_rule_id" character varying NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, "metadata" jsonb, CONSTRAINT "PK_e6b81d83133ddc21a2baf2e2204" PRIMARY KEY ("id"), CONSTRAINT "dctypeuniq" UNIQUE ("type", "operator", "discount_rule_id"))` + ) + await queryRunner.query( + `CREATE INDEX "IDX_efff700651718e452ca9580a62" ON "discount_condition" ("discount_rule_id") ` + ) + await queryRunner.query( + `CREATE TABLE "discount_condition_customer_group" ("customer_group_id" character varying NOT NULL, "condition_id" character varying NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "metadata" jsonb, CONSTRAINT "PK_cdc8b2277169a16b8b7d4c73e0e" PRIMARY KEY ("customer_group_id", "condition_id"))` + ) + await queryRunner.query( + `CREATE TABLE "discount_condition_product_collection" ("product_collection_id" character varying NOT NULL, "condition_id" character varying NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "metadata" jsonb, CONSTRAINT "PK_b3508fc787aa4a38705866cbb6d" PRIMARY KEY ("product_collection_id", "condition_id"))` + ) + await queryRunner.query( + `CREATE TABLE "discount_condition_product_tag" ("product_tag_id" character varying NOT NULL, "condition_id" character varying NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "metadata" jsonb, CONSTRAINT "PK_a95382c1e62205b121aa058682b" PRIMARY KEY ("product_tag_id", "condition_id"))` + ) + await queryRunner.query( + `CREATE TABLE "discount_condition_product_type" ("product_type_id" character varying NOT NULL, "condition_id" character varying NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "metadata" jsonb, CONSTRAINT "PK_35d538a5a24399d0df978df12ed" PRIMARY KEY ("product_type_id", "condition_id"))` + ) + await queryRunner.query( + `CREATE TABLE "discount_condition_product" ("product_id" character varying NOT NULL, "condition_id" character varying NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "metadata" jsonb, CONSTRAINT "PK_994eb4529fdbf14450d64ec17e8" PRIMARY KEY ("product_id", "condition_id"))` + ) + await queryRunner.query( + `CREATE INDEX "IDX_f05132301e95bdab4ba1cf29a2" ON "discount_condition_product" ("condition_id") ` + ) + await queryRunner.query( + `CREATE INDEX "IDX_c759f53b2e48e8cfb50638fe4e" ON "discount_condition_product" ("product_id") ` + ) + await queryRunner.query( + `CREATE INDEX "IDX_6ef23ce0b1d9cf9b5b833e52b9" ON "discount_condition_product_type" ("condition_id") ` + ) + await queryRunner.query( + `CREATE INDEX "IDX_e706deb68f52ab2756119b9e70" ON "discount_condition_product_type" ("product_type_id") ` + ) + await queryRunner.query( + `CREATE INDEX "IDX_fbb2499551ed074526f3ee3624" ON "discount_condition_product_tag" ("condition_id") ` + ) + await queryRunner.query( + `CREATE INDEX "IDX_01486cc9dc6b36bf658685535f" ON "discount_condition_product_tag" ("product_tag_id") ` + ) + await queryRunner.query( + `CREATE INDEX "IDX_a1c4f9cfb599ad1f0db39cadd5" ON "discount_condition_product_collection" ("condition_id") ` + ) + await queryRunner.query( + `CREATE INDEX "IDX_a0b05dc4257abe639cb75f8eae" ON "discount_condition_product_collection" ("product_collection_id") ` + ) + await queryRunner.query( + `CREATE INDEX "IDX_8486ee16e69013c645d0b8716b" ON "discount_condition_customer_group" ("condition_id") ` + ) + await queryRunner.query( + `CREATE INDEX "IDX_4d5f98645a67545d8dea42e2eb" ON "discount_condition_customer_group" ("customer_group_id") ` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition" ADD CONSTRAINT "FK_efff700651718e452ca9580a624" FOREIGN KEY ("discount_rule_id") REFERENCES "discount_rule"("id") ON DELETE NO ACTION ON UPDATE NO ACTION` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_customer_group" ADD CONSTRAINT "FK_4d5f98645a67545d8dea42e2eb8" FOREIGN KEY ("customer_group_id") REFERENCES "customer_group"("id") ON DELETE CASCADE ON UPDATE NO ACTION` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_customer_group" ADD CONSTRAINT "FK_8486ee16e69013c645d0b8716b6" FOREIGN KEY ("condition_id") REFERENCES "discount_condition"("id") ON DELETE CASCADE ON UPDATE NO ACTION` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_collection" ADD CONSTRAINT "FK_a0b05dc4257abe639cb75f8eae2" FOREIGN KEY ("product_collection_id") REFERENCES "product_collection"("id") ON DELETE CASCADE ON UPDATE NO ACTION` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_collection" ADD CONSTRAINT "FK_a1c4f9cfb599ad1f0db39cadd5f" FOREIGN KEY ("condition_id") REFERENCES "discount_condition"("id") ON DELETE CASCADE ON UPDATE NO ACTION` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_tag" ADD CONSTRAINT "FK_01486cc9dc6b36bf658685535f6" FOREIGN KEY ("product_tag_id") REFERENCES "product_tag"("id") ON DELETE CASCADE ON UPDATE NO ACTION` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_tag" ADD CONSTRAINT "FK_fbb2499551ed074526f3ee36241" FOREIGN KEY ("condition_id") REFERENCES "discount_condition"("id") ON DELETE CASCADE ON UPDATE NO ACTION` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_type" ADD CONSTRAINT "FK_e706deb68f52ab2756119b9e704" FOREIGN KEY ("product_type_id") REFERENCES "product_type"("id") ON DELETE CASCADE ON UPDATE NO ACTION` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_type" ADD CONSTRAINT "FK_6ef23ce0b1d9cf9b5b833e52b9d" FOREIGN KEY ("condition_id") REFERENCES "discount_condition"("id") ON DELETE CASCADE ON UPDATE NO ACTION` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product" ADD CONSTRAINT "FK_c759f53b2e48e8cfb50638fe4e0" FOREIGN KEY ("product_id") REFERENCES "product"("id") ON DELETE CASCADE ON UPDATE NO ACTION` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product" ADD CONSTRAINT "FK_f05132301e95bdab4ba1cf29a24" FOREIGN KEY ("condition_id") REFERENCES "discount_condition"("id") ON DELETE CASCADE ON UPDATE NO ACTION` + ) + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "discount_condition_product" DROP CONSTRAINT "FK_f05132301e95bdab4ba1cf29a24"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product" DROP CONSTRAINT "FK_c759f53b2e48e8cfb50638fe4e0"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_type" DROP CONSTRAINT "FK_6ef23ce0b1d9cf9b5b833e52b9d"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_type" DROP CONSTRAINT "FK_e706deb68f52ab2756119b9e704"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_tag" DROP CONSTRAINT "FK_fbb2499551ed074526f3ee36241"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_tag" DROP CONSTRAINT "FK_01486cc9dc6b36bf658685535f6"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_collection" DROP CONSTRAINT "FK_a1c4f9cfb599ad1f0db39cadd5f"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_collection" DROP CONSTRAINT "FK_a0b05dc4257abe639cb75f8eae2"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_customer_group" DROP CONSTRAINT "FK_8486ee16e69013c645d0b8716b6"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_customer_group" DROP CONSTRAINT "FK_4d5f98645a67545d8dea42e2eb8"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition" DROP CONSTRAINT "FK_efff700651718e452ca9580a624"` + ) + await queryRunner.query(`DROP INDEX "IDX_4d5f98645a67545d8dea42e2eb"`) + await queryRunner.query(`DROP INDEX "IDX_8486ee16e69013c645d0b8716b"`) + await queryRunner.query(`DROP INDEX "IDX_a0b05dc4257abe639cb75f8eae"`) + await queryRunner.query(`DROP INDEX "IDX_a1c4f9cfb599ad1f0db39cadd5"`) + await queryRunner.query(`DROP INDEX "IDX_01486cc9dc6b36bf658685535f"`) + await queryRunner.query(`DROP INDEX "IDX_fbb2499551ed074526f3ee3624"`) + await queryRunner.query(`DROP INDEX "IDX_e706deb68f52ab2756119b9e70"`) + await queryRunner.query(`DROP INDEX "IDX_6ef23ce0b1d9cf9b5b833e52b9"`) + await queryRunner.query(`DROP INDEX "IDX_c759f53b2e48e8cfb50638fe4e"`) + await queryRunner.query(`DROP INDEX "IDX_f05132301e95bdab4ba1cf29a2"`) + await queryRunner.query( + `ALTER TABLE "discount_condition_product" DROP COLUMN "metadata"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product" DROP COLUMN "updated_at"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product" DROP COLUMN "created_at"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_type" DROP COLUMN "metadata"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_type" DROP COLUMN "updated_at"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_type" DROP COLUMN "created_at"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_tag" DROP COLUMN "metadata"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_tag" DROP COLUMN "updated_at"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_tag" DROP COLUMN "created_at"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_collection" DROP COLUMN "metadata"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_collection" DROP COLUMN "updated_at"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_collection" DROP COLUMN "created_at"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_customer_group" DROP COLUMN "metadata"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_customer_group" DROP COLUMN "updated_at"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_customer_group" DROP COLUMN "created_at"` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_customer_group" ADD "metadata" jsonb` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_customer_group" ADD "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_customer_group" ADD "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_collection" ADD "metadata" jsonb` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_collection" ADD "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_collection" ADD "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_tag" ADD "metadata" jsonb` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_tag" ADD "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_tag" ADD "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_type" ADD "metadata" jsonb` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_type" ADD "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product_type" ADD "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product" ADD "metadata" jsonb` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product" ADD "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()` + ) + await queryRunner.query( + `ALTER TABLE "discount_condition_product" ADD "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()` + ) + await queryRunner.query(`DROP TABLE "discount_condition_product"`) + await queryRunner.query(`DROP TABLE "discount_condition_product_type"`) + await queryRunner.query(`DROP TABLE "discount_condition_product_tag"`) + await queryRunner.query( + `DROP TABLE "discount_condition_product_collection"` + ) + await queryRunner.query(`DROP TABLE "discount_condition_customer_group"`) + await queryRunner.query(`DROP INDEX "IDX_efff700651718e452ca9580a62"`) + await queryRunner.query(`DROP TABLE "discount_condition"`) + await queryRunner.query(`DROP TYPE "discount_condition_operator_enum"`) + await queryRunner.query(`DROP TYPE "discount_condition_type_enum"`) + } +} diff --git a/packages/medusa/src/models/discount-condition-customer-group.ts b/packages/medusa/src/models/discount-condition-customer-group.ts new file mode 100644 index 0000000000..a7efc4d76c --- /dev/null +++ b/packages/medusa/src/models/discount-condition-customer-group.ts @@ -0,0 +1,66 @@ +import { + CreateDateColumn, + Entity, + JoinColumn, + ManyToOne, + PrimaryColumn, + UpdateDateColumn, +} from "typeorm" +import { DbAwareColumn, resolveDbType } from "../utils/db-aware-column" +import { CustomerGroup } from "./customer-group" +import { DiscountCondition } from "./discount-condition" + +@Entity() +export class DiscountConditionCustomerGroup { + @PrimaryColumn() + customer_group_id: string + + @PrimaryColumn() + condition_id: string + + @ManyToOne(() => CustomerGroup, { onDelete: "CASCADE" }) + @JoinColumn({ name: "customer_group_id" }) + customer_group?: CustomerGroup + + @ManyToOne(() => DiscountCondition, { onDelete: "CASCADE" }) + @JoinColumn({ name: "condition_id" }) + discount_condition?: DiscountCondition + + @CreateDateColumn({ type: resolveDbType("timestamptz") }) + created_at: Date + + @UpdateDateColumn({ type: resolveDbType("timestamptz") }) + updated_at: Date + + @DbAwareColumn({ type: "jsonb", nullable: true }) + metadata: any +} + +/** + * @schema discount_condition_customer_group + * title: "Product Tag Discount Condition" + * description: "Associates a discount condition with a customer group" + * x-resourceId: discount_condition_customer_group + * properties: + * customer_group_id: + * description: "The id of the Product Tag" + * type: string + * condition_id: + * description: "The id of the Discount Condition" + * type: string + * created_at: + * description: "The date with timezone at which the resource was created." + * type: string + * format: date-time + * updated_at: + * description: "The date with timezone at which the resource was last updated." + * type: string + * format: date-time + * deleted_at: + * description: "The date with timezone at which the resource was deleted." + * type: string + * format: date-time + * metadata: + * description: "An optional key-value map with additional information." + * type: object + */ diff --git a/packages/medusa/src/models/discount-condition-product-collection.ts b/packages/medusa/src/models/discount-condition-product-collection.ts new file mode 100644 index 0000000000..3947447bb2 --- /dev/null +++ b/packages/medusa/src/models/discount-condition-product-collection.ts @@ -0,0 +1,66 @@ +import { + CreateDateColumn, + Entity, + JoinColumn, + ManyToOne, + PrimaryColumn, + UpdateDateColumn, +} from "typeorm" +import { DbAwareColumn, resolveDbType } from "../utils/db-aware-column" +import { DiscountCondition } from "./discount-condition" +import { ProductCollection } from "./product-collection" + +@Entity() +export class DiscountConditionProductCollection { + @PrimaryColumn() + product_collection_id: string + + @PrimaryColumn() + condition_id: string + + @ManyToOne(() => ProductCollection, { onDelete: "CASCADE" }) + @JoinColumn({ name: "product_collection_id" }) + product_collection?: ProductCollection + + @ManyToOne(() => DiscountCondition, { onDelete: "CASCADE" }) + @JoinColumn({ name: "condition_id" }) + discount_condition?: DiscountCondition + + @CreateDateColumn({ type: resolveDbType("timestamptz") }) + created_at: Date + + @UpdateDateColumn({ type: resolveDbType("timestamptz") }) + updated_at: Date + + @DbAwareColumn({ type: "jsonb", nullable: true }) + metadata: any +} + +/** + * @schema discount_condition_product_collection + * title: "Product Collection Discount Condition" + * description: "Associates a discount condition with a product collection" + * x-resourceId: discount_condition_product_collection + * properties: + * product_collection_id: + * description: "The id of the Product Collection" + * type: string + * condition_id: + * description: "The id of the Discount Condition" + * type: string + * created_at: + * description: "The date with timezone at which the resource was created." + * type: string + * format: date-time + * updated_at: + * description: "The date with timezone at which the resource was last updated." + * type: string + * format: date-time + * deleted_at: + * description: "The date with timezone at which the resource was deleted." + * type: string + * format: date-time + * metadata: + * description: "An optional key-value map with additional information." + * type: object + */ diff --git a/packages/medusa/src/models/discount-condition-product-tag.ts b/packages/medusa/src/models/discount-condition-product-tag.ts new file mode 100644 index 0000000000..36ed150763 --- /dev/null +++ b/packages/medusa/src/models/discount-condition-product-tag.ts @@ -0,0 +1,66 @@ +import { + CreateDateColumn, + Entity, + JoinColumn, + ManyToOne, + PrimaryColumn, + UpdateDateColumn, +} from "typeorm" +import { DbAwareColumn, resolveDbType } from "../utils/db-aware-column" +import { DiscountCondition } from "./discount-condition" +import { ProductTag } from "./product-tag" + +@Entity() +export class DiscountConditionProductTag { + @PrimaryColumn() + product_tag_id: string + + @PrimaryColumn() + condition_id: string + + @ManyToOne(() => ProductTag, { onDelete: "CASCADE" }) + @JoinColumn({ name: "product_tag_id" }) + product_tag?: ProductTag + + @ManyToOne(() => DiscountCondition, { onDelete: "CASCADE" }) + @JoinColumn({ name: "condition_id" }) + discount_condition?: DiscountCondition + + @CreateDateColumn({ type: resolveDbType("timestamptz") }) + created_at: Date + + @UpdateDateColumn({ type: resolveDbType("timestamptz") }) + updated_at: Date + + @DbAwareColumn({ type: "jsonb", nullable: true }) + metadata: any +} + +/** + * @schema discount_condition_product_tag + * title: "Product Tag Discount Condition" + * description: "Associates a discount condition with a product tag" + * x-resourceId: discount_condition_product_tag + * properties: + * product_tag_id: + * description: "The id of the Product Tag" + * type: string + * condition_id: + * description: "The id of the Discount Condition" + * type: string + * created_at: + * description: "The date with timezone at which the resource was created." + * type: string + * format: date-time + * updated_at: + * description: "The date with timezone at which the resource was last updated." + * type: string + * format: date-time + * deleted_at: + * description: "The date with timezone at which the resource was deleted." + * type: string + * format: date-time + * metadata: + * description: "An optional key-value map with additional information." + * type: object + */ diff --git a/packages/medusa/src/models/discount-condition-product-type.ts b/packages/medusa/src/models/discount-condition-product-type.ts new file mode 100644 index 0000000000..dcbc2f4262 --- /dev/null +++ b/packages/medusa/src/models/discount-condition-product-type.ts @@ -0,0 +1,66 @@ +import { + CreateDateColumn, + Entity, + JoinColumn, + ManyToOne, + PrimaryColumn, + UpdateDateColumn, +} from "typeorm" +import { DbAwareColumn, resolveDbType } from "../utils/db-aware-column" +import { DiscountCondition } from "./discount-condition" +import { ProductType } from "./product-type" + +@Entity() +export class DiscountConditionProductType { + @PrimaryColumn() + product_type_id: string + + @PrimaryColumn() + condition_id: string + + @ManyToOne(() => ProductType, { onDelete: "CASCADE" }) + @JoinColumn({ name: "product_type_id" }) + product_type?: ProductType + + @ManyToOne(() => DiscountCondition, { onDelete: "CASCADE" }) + @JoinColumn({ name: "condition_id" }) + discount_condition?: DiscountCondition + + @CreateDateColumn({ type: resolveDbType("timestamptz") }) + created_at: Date + + @UpdateDateColumn({ type: resolveDbType("timestamptz") }) + updated_at: Date + + @DbAwareColumn({ type: "jsonb", nullable: true }) + metadata: any +} + +/** + * @schema discount_condition_product_type + * title: "Product Type Discount Condition" + * description: "Associates a discount condition with a product type" + * x-resourceId: discount_condition_product + * properties: + * product_type_id: + * description: "The id of the Product Type" + * type: string + * condition_id: + * description: "The id of the Discount Condition" + * type: string + * created_at: + * description: "The date with timezone at which the resource was created." + * type: string + * format: date-time + * updated_at: + * description: "The date with timezone at which the resource was last updated." + * type: string + * format: date-time + * deleted_at: + * description: "The date with timezone at which the resource was deleted." + * type: string + * format: date-time + * metadata: + * description: "An optional key-value map with additional information." + * type: object + */ diff --git a/packages/medusa/src/models/discount-condition-product.ts b/packages/medusa/src/models/discount-condition-product.ts new file mode 100644 index 0000000000..abf00d36c5 --- /dev/null +++ b/packages/medusa/src/models/discount-condition-product.ts @@ -0,0 +1,66 @@ +import { + CreateDateColumn, + Entity, + JoinColumn, + ManyToOne, + PrimaryColumn, + UpdateDateColumn, +} from "typeorm" +import { DbAwareColumn, resolveDbType } from "../utils/db-aware-column" +import { DiscountCondition } from "./discount-condition" +import { Product } from "./product" + +@Entity() +export class DiscountConditionProduct { + @PrimaryColumn() + product_id: string + + @PrimaryColumn() + condition_id: string + + @ManyToOne(() => Product, { onDelete: "CASCADE" }) + @JoinColumn({ name: "product_id" }) + product?: Product + + @ManyToOne(() => DiscountCondition, { onDelete: "CASCADE" }) + @JoinColumn({ name: "condition_id" }) + discount_condition?: DiscountCondition + + @CreateDateColumn({ type: resolveDbType("timestamptz") }) + created_at: Date + + @UpdateDateColumn({ type: resolveDbType("timestamptz") }) + updated_at: Date + + @DbAwareColumn({ type: "jsonb", nullable: true }) + metadata: any +} + +/** + * @schema discount_condition_product + * title: "Product Discount Condition" + * description: "Associates a discount condition with a product" + * x-resourceId: discount_condition_product + * properties: + * product_id: + * description: "The id of the Product" + * type: string + * condition_id: + * description: "The id of the Discount Condition" + * type: string + * created_at: + * description: "The date with timezone at which the resource was created." + * type: string + * format: date-time + * updated_at: + * description: "The date with timezone at which the resource was last updated." + * type: string + * format: date-time + * deleted_at: + * description: "The date with timezone at which the resource was deleted." + * type: string + * format: date-time + * metadata: + * description: "An optional key-value map with additional information." + * type: object + */ diff --git a/packages/medusa/src/models/discount-condition.ts b/packages/medusa/src/models/discount-condition.ts new file mode 100644 index 0000000000..4dd96be349 --- /dev/null +++ b/packages/medusa/src/models/discount-condition.ts @@ -0,0 +1,186 @@ +import { + BeforeInsert, + Column, + CreateDateColumn, + DeleteDateColumn, + Entity, + Index, + JoinColumn, + JoinTable, + ManyToMany, + ManyToOne, + PrimaryColumn, + Unique, + UpdateDateColumn, +} from "typeorm" +import { ulid } from "ulid" +import { DbAwareColumn, resolveDbType } from "../utils/db-aware-column" +import { CustomerGroup } from "./customer-group" +import { DiscountRule } from "./discount-rule" +import { Product } from "./product" +import { ProductCollection } from "./product-collection" +import { ProductTag } from "./product-tag" +import { ProductType } from "./product-type" + +export enum DiscountConditionType { + PRODUCTS = "products", + PRODUCT_TYPES = "product_types", + PRODUCT_COLLECTIONS = "product_collections", + PRODUCT_TAGS = "product_tags", + CUSTOMER_GROUPS = "customer_groups", +} + +export enum DiscountConditionOperator { + IN = "in", + NOT_IN = "not_in", +} + +@Entity() +@Unique("dctypeuniq", ["type", "operator", "discount_rule_id"]) +export class DiscountCondition { + @PrimaryColumn() + id: string + + @DbAwareColumn({ + type: "enum", + enum: DiscountConditionType, + }) + type: DiscountConditionType + + @DbAwareColumn({ + type: "enum", + enum: DiscountConditionOperator, + }) + operator: DiscountConditionOperator + + @Index() + @Column() + discount_rule_id: string + + @ManyToOne(() => DiscountRule, (dr) => dr.conditions) + @JoinColumn({ name: "discount_rule_id" }) + discount_rule: DiscountRule + + @ManyToMany(() => Product) + @JoinTable({ + name: "discount_condition_product", + joinColumn: { + name: "condition_id", + referencedColumnName: "id", + }, + inverseJoinColumn: { + name: "product_id", + referencedColumnName: "id", + }, + }) + products: Product[] + + @ManyToMany(() => ProductType) + @JoinTable({ + name: "discount_condition_product_type", + joinColumn: { + name: "condition_id", + referencedColumnName: "id", + }, + inverseJoinColumn: { + name: "product_type_id", + referencedColumnName: "id", + }, + }) + product_types: ProductType[] + + @ManyToMany(() => ProductTag) + @JoinTable({ + name: "discount_condition_product_tag", + joinColumn: { + name: "condition_id", + referencedColumnName: "id", + }, + inverseJoinColumn: { + name: "product_tag_id", + referencedColumnName: "id", + }, + }) + product_tags: ProductTag[] + + @ManyToMany(() => ProductCollection) + @JoinTable({ + name: "discount_condition_product_collection", + joinColumn: { + name: "condition_id", + referencedColumnName: "id", + }, + inverseJoinColumn: { + name: "product_collection_id", + referencedColumnName: "id", + }, + }) + product_collections: ProductCollection[] + + @ManyToMany(() => CustomerGroup) + @JoinTable({ + name: "discount_condition_customer_group", + joinColumn: { + name: "condition_id", + referencedColumnName: "id", + }, + inverseJoinColumn: { + name: "customer_group_id", + referencedColumnName: "id", + }, + }) + customer_groups: CustomerGroup[] + + @CreateDateColumn({ type: resolveDbType("timestamptz") }) + created_at: Date + + @UpdateDateColumn({ type: resolveDbType("timestamptz") }) + updated_at: Date + + @DeleteDateColumn({ type: resolveDbType("timestamptz") }) + deleted_at: Date + + @DbAwareColumn({ type: "jsonb", nullable: true }) + metadata: any + + @BeforeInsert() + private beforeInsert() { + const id = ulid() + this.id = `discon_${id}` + } +} + +/** + * @schema discount_condition + * title: "Discount Condition" + * description: "Holds rule conditions for when a discount is applicable" + * x-resourceId: discount_condition + * properties: + * id: + * description: "The id of the Discount Condition. Will be prefixed by `discon_`." + * type: string + * type: + * description: "The type of the Condition" + * type: string + * enum: + * - products + * - product_types + * - product_collections + * - product_tags + * - customer_groups + * created_at: + * description: "The date with timezone at which the resource was created." + * type: string + * format: date-time + * update_at: + * description: "The date with timezone at which the resource was last updated." + * type: string + * format: date-time + * deleted_at: + * description: "The date with timezone at which the resource was deleted." + * type: string + * format: date-time + * metadata: + * description: "An optional key-value map with additional information." + * type: object + */ diff --git a/packages/medusa/src/models/discount-rule.ts b/packages/medusa/src/models/discount-rule.ts index 0ea2d46296..f1dc636343 100644 --- a/packages/medusa/src/models/discount-rule.ts +++ b/packages/medusa/src/models/discount-rule.ts @@ -1,19 +1,16 @@ import { - Entity, BeforeInsert, - CreateDateColumn, - UpdateDateColumn, - DeleteDateColumn, - Index, Column, + CreateDateColumn, + DeleteDateColumn, + Entity, + OneToMany, PrimaryColumn, - ManyToMany, - JoinTable, + UpdateDateColumn, } from "typeorm" import { ulid } from "ulid" -import { resolveDbType, DbAwareColumn } from "../utils/db-aware-column" - -import { Product } from "./product" +import { DbAwareColumn, resolveDbType } from "../utils/db-aware-column" +import { DiscountCondition } from "./discount-condition" export enum DiscountRuleType { FIXED = "fixed", @@ -50,19 +47,8 @@ export class DiscountRule { }) allocation: AllocationType - @ManyToMany(() => Product, { cascade: true }) - @JoinTable({ - name: "discount_rule_products", - joinColumn: { - name: "discount_rule_id", - referencedColumnName: "id", - }, - inverseJoinColumn: { - name: "product_id", - referencedColumnName: "id", - }, - }) - valid_for: Product[] + @OneToMany(() => DiscountCondition, (conditions) => conditions.discount_rule) + conditions: DiscountCondition[] @CreateDateColumn({ type: resolveDbType("timestamptz") }) created_at: Date @@ -111,11 +97,11 @@ export class DiscountRule { * enum: * - total * - item - * valid_for: - * description: "A set of Products that the discount can be used for." + * conditions: + * description: "A set of conditions that can be used to limit when the discount can be used" * type: array * items: - * $ref: "#/components/schemas/product" + * $ref: "#/components/schemas/discount_condition" * created_at: * description: "The date with timezone at which the resource was created." * type: string diff --git a/packages/medusa/src/models/discount.ts b/packages/medusa/src/models/discount.ts index 0ca2e8ebdb..f0acd2a6c3 100644 --- a/packages/medusa/src/models/discount.ts +++ b/packages/medusa/src/models/discount.ts @@ -1,21 +1,19 @@ import { - Entity, BeforeInsert, - DeleteDateColumn, - CreateDateColumn, - UpdateDateColumn, - Index, Column, - PrimaryColumn, + CreateDateColumn, + DeleteDateColumn, + Entity, + Index, + JoinColumn, + JoinTable, ManyToMany, ManyToOne, - OneToOne, - JoinTable, - JoinColumn, + PrimaryColumn, + UpdateDateColumn, } from "typeorm" import { ulid } from "ulid" -import { resolveDbType, DbAwareColumn } from "../utils/db-aware-column" - +import { DbAwareColumn, resolveDbType } from "../utils/db-aware-column" import { DiscountRule } from "./discount-rule" import { Region } from "./region" diff --git a/packages/medusa/src/repositories/__mocks__/discount.js b/packages/medusa/src/repositories/__mocks__/discount.js index 3fe1d0c0a9..632583477a 100644 --- a/packages/medusa/src/repositories/__mocks__/discount.js +++ b/packages/medusa/src/repositories/__mocks__/discount.js @@ -29,7 +29,6 @@ export const discounts = { type: "percentage", allocation: "item", value: 10, - valid_for: [IdMap.getId("eur-8-us-10"), IdMap.getId("eur-10-us-12")], }, regions: [IdMap.getId("region-france")], }, @@ -50,7 +49,6 @@ export const discounts = { type: "fixed", allocation: "item", value: 9, - valid_for: [IdMap.getId("eur-8-us-10"), IdMap.getId("eur-10-us-12")], }, regions: [IdMap.getId("region-france")], }, @@ -61,7 +59,6 @@ export const discounts = { type: "fixed", allocation: "item", value: 2, - valid_for: [IdMap.getId("eur-8-us-10"), IdMap.getId("eur-10-us-12")], }, regions: [IdMap.getId("region-france")], }, @@ -72,7 +69,6 @@ export const discounts = { type: "fixed", allocation: "item", value: 10, - valid_for: [], }, regions: [IdMap.getId("region-france")], }, @@ -84,7 +80,6 @@ export const discounts = { type: "fixed", allocation: "item", value: 10, - valid_for: [], }, regions: [IdMap.getId("region-france")], }, @@ -95,7 +90,6 @@ export const discounts = { type: "free_shipping", allocation: "total", value: 10, - valid_for: [], }, regions: [IdMap.getId("region-france")], }, @@ -106,7 +100,6 @@ export const discounts = { type: "free_shipping", allocation: "total", value: 10, - valid_for: [], }, regions: [IdMap.getId("us")], }, @@ -122,12 +115,12 @@ export const discounts = { } export const DiscountModelMock = { - create: jest.fn().mockImplementation(data => Promise.resolve(data)), + create: jest.fn().mockImplementation((data) => Promise.resolve(data)), updateOne: jest.fn().mockImplementation((query, update) => { return Promise.resolve() }), deleteOne: jest.fn().mockReturnValue(Promise.resolve()), - findOne: jest.fn().mockImplementation(query => { + findOne: jest.fn().mockImplementation((query) => { if (query._id === IdMap.getId("dynamic")) { return Promise.resolve(discounts.dynamic) } diff --git a/packages/medusa/src/repositories/discount-condition.ts b/packages/medusa/src/repositories/discount-condition.ts new file mode 100644 index 0000000000..c969865ea6 --- /dev/null +++ b/packages/medusa/src/repositories/discount-condition.ts @@ -0,0 +1,305 @@ +import { + DeleteResult, + EntityRepository, + EntityTarget, + In, + Not, + Repository, +} from "typeorm" +import { + DiscountCondition, + DiscountConditionOperator, + DiscountConditionType, +} from "../models/discount-condition" +import { DiscountConditionCustomerGroup } from "../models/discount-condition-customer-group" +import { DiscountConditionProduct } from "../models/discount-condition-product" +import { DiscountConditionProductCollection } from "../models/discount-condition-product-collection" +import { DiscountConditionProductTag } from "../models/discount-condition-product-tag" +import { DiscountConditionProductType } from "../models/discount-condition-product-type" + +export enum DiscountConditionJoinTableForeignKey { + PRODUCT_ID = "product_id", + PRODUCT_TYPE_ID = "product_type_id", + PRODUCT_COLLECTION_ID = "product_collection_id", + PRODUCT_TAG_ID = "product_tag_id", + CUSTOMER_GROUP_ID = "customer_group_id", +} + +type DiscountConditionResourceType = EntityTarget< + | DiscountConditionProduct + | DiscountConditionProductType + | DiscountConditionProductCollection + | DiscountConditionProductTag + | DiscountConditionCustomerGroup +> + +@EntityRepository(DiscountCondition) +export class DiscountConditionRepository extends Repository { + getJoinTableResourceIdentifiers(type: string): { + joinTable: string + resourceKey: string + joinTableForeignKey: DiscountConditionJoinTableForeignKey + conditionTable: DiscountConditionResourceType + joinTableKey: string + } { + let conditionTable: DiscountConditionResourceType = DiscountConditionProduct + + let joinTable = "product" + let joinTableForeignKey: DiscountConditionJoinTableForeignKey = + DiscountConditionJoinTableForeignKey.PRODUCT_ID + let joinTableKey = "id" + + // On the joined table (e.g. `product`), what key should be match on + // (e.g `type_id` for product types and `id` for products) + let resourceKey + + switch (type) { + case DiscountConditionType.PRODUCTS: { + resourceKey = "id" + joinTableForeignKey = DiscountConditionJoinTableForeignKey.PRODUCT_ID + joinTable = "product" + + conditionTable = DiscountConditionProduct + break + } + case DiscountConditionType.PRODUCT_TYPES: { + resourceKey = "type_id" + joinTableForeignKey = + DiscountConditionJoinTableForeignKey.PRODUCT_TYPE_ID + joinTable = "product" + + conditionTable = DiscountConditionProductType + break + } + case DiscountConditionType.PRODUCT_COLLECTIONS: { + resourceKey = "collection_id" + joinTableForeignKey = + DiscountConditionJoinTableForeignKey.PRODUCT_COLLECTION_ID + joinTable = "product" + + conditionTable = DiscountConditionProductCollection + break + } + case DiscountConditionType.PRODUCT_TAGS: { + joinTableKey = "product_id" + resourceKey = "product_tag_id" + joinTableForeignKey = + DiscountConditionJoinTableForeignKey.PRODUCT_TAG_ID + joinTable = "product_tags" + + conditionTable = DiscountConditionProductTag + break + } + case DiscountConditionType.CUSTOMER_GROUPS: { + joinTableKey = "customer_id" + resourceKey = "customer_group_id" + joinTable = "customer_group_customers" + joinTableForeignKey = + DiscountConditionJoinTableForeignKey.CUSTOMER_GROUP_ID + + conditionTable = DiscountConditionCustomerGroup + break + } + default: + break + } + + return { + joinTable, + joinTableKey, + resourceKey, + joinTableForeignKey, + conditionTable, + } + } + + async removeConditionResources( + id: string, + type: DiscountConditionType, + resourceIds: string[] + ): Promise { + const { conditionTable, joinTableForeignKey } = + this.getJoinTableResourceIdentifiers(type) + + if (!conditionTable || !joinTableForeignKey) { + return Promise.resolve() + } + + return await this.createQueryBuilder() + .delete() + .from(conditionTable) + .where({ condition_id: id, [joinTableForeignKey]: In(resourceIds) }) + .execute() + } + + async addConditionResources( + conditionId: string, + resourceIds: string[], + type: DiscountConditionType, + overrideExisting = false + ): Promise< + ( + | DiscountConditionProduct + | DiscountConditionProductType + | DiscountConditionProductCollection + | DiscountConditionProductTag + | DiscountConditionCustomerGroup + )[] + > { + let toInsert: { condition_id: string; [x: string]: string }[] | [] = [] + + const { conditionTable, joinTableForeignKey } = + this.getJoinTableResourceIdentifiers(type) + + if (!conditionTable || !joinTableForeignKey) { + return Promise.resolve([]) + } + + toInsert = resourceIds.map((rId) => ({ + condition_id: conditionId, + [joinTableForeignKey]: rId, + })) + + const insertResult = await this.createQueryBuilder() + .insert() + .orIgnore(true) + .into(conditionTable) + .values(toInsert) + .execute() + + if (overrideExisting) { + await this.createQueryBuilder() + .delete() + .from(conditionTable) + .where({ + condition_id: conditionId, + [joinTableForeignKey]: Not(In(resourceIds)), + }) + .execute() + } + + return await this.manager + .createQueryBuilder(conditionTable, "discon") + .select() + .where(insertResult.identifiers) + .getMany() + } + + async queryConditionTable({ type, condId, resourceId }): Promise { + const { + conditionTable, + joinTable, + joinTableForeignKey, + resourceKey, + joinTableKey, + } = this.getJoinTableResourceIdentifiers(type) + + return await this.manager + .createQueryBuilder(conditionTable, "dc") + .innerJoin( + joinTable, + "resource", + `dc.${joinTableForeignKey} = resource.${resourceKey} and resource.${joinTableKey} = :resourceId `, + { + resourceId, + } + ) + .where(`dc.condition_id = :conditionId`, { + conditionId: condId, + }) + .getCount() + } + + async isValidForProduct( + discountRuleId: string, + productId: string + ): Promise { + const discountConditions = await this.createQueryBuilder("discon") + .select(["discon.id", "discon.type", "discon.operator"]) + .where("discon.discount_rule_id = :discountRuleId", { + discountRuleId, + }) + .getMany() + + // in case of no discount conditions, we assume that the discount + // is valid for all + if (!discountConditions.length) { + return true + } + + // retrieve all conditions for each type where condition type id is in jointable (products, product_types, product_collections, product_tags) + // "E.g. for a given product condition, give me all products affected by it" + // for each of these types, we check: + // if condition operation is `in` and the query for conditions defined for the given type is empty, the discount is invalid + // if condition operation is `not_in` and the query for conditions defined for the given type is not empty, the discount is invalid + for (const condition of discountConditions) { + const numConditions = await this.queryConditionTable({ + type: condition.type, + condId: condition.id, + resourceId: productId, + }) + + if ( + condition.operator === DiscountConditionOperator.IN && + numConditions === 0 + ) { + return false + } + + if ( + condition.operator === DiscountConditionOperator.NOT_IN && + numConditions > 0 + ) { + return false + } + } + + return true + } + + async canApplyForCustomer( + discountRuleId: string, + customerId: string + ): Promise { + const discountConditions = await this.createQueryBuilder("discon") + .select(["discon.id", "discon.type", "discon.operator"]) + .where("discon.discount_rule_id = :discountRuleId", { + discountRuleId, + }) + .getMany() + + // in case of no discount conditions, we assume that the discount + // is valid for all + if (!discountConditions.length) { + return true + } + + // retrieve conditions for customer groups + // for each customer group + // if condition operation is `in` and the query for customer group conditions is empty, the discount is invalid + // if condition operation is `not_in` and the query for customer group conditions is not empty, the discount is invalid + for (const condition of discountConditions) { + const numConditions = await this.queryConditionTable({ + type: "customer_groups", + condId: condition.id, + resourceId: customerId, + }) + + if ( + condition.operator === DiscountConditionOperator.IN && + numConditions === 0 + ) { + return false + } + + if ( + condition.operator === DiscountConditionOperator.NOT_IN && + numConditions > 0 + ) { + return false + } + } + + return true + } +} diff --git a/packages/medusa/src/services/__mocks__/discount.js b/packages/medusa/src/services/__mocks__/discount.js index d2f5ffe4b2..97effdd307 100644 --- a/packages/medusa/src/services/__mocks__/discount.js +++ b/packages/medusa/src/services/__mocks__/discount.js @@ -29,7 +29,6 @@ export const discounts = { type: "percentage", allocation: "item", value: 10, - valid_for: [IdMap.getId("eur-8-us-10"), IdMap.getId("eur-10-us-12")], }, regions: [IdMap.getId("region-france")], }, @@ -50,7 +49,6 @@ export const discounts = { type: "fixed", allocation: "item", value: 9, - valid_for: [IdMap.getId("eur-8-us-10"), IdMap.getId("eur-10-us-12")], }, regions: [IdMap.getId("region-france")], }, @@ -61,7 +59,6 @@ export const discounts = { type: "fixed", allocation: "item", value: 2, - valid_for: [IdMap.getId("eur-8-us-10"), IdMap.getId("eur-10-us-12")], }, regions: [IdMap.getId("region-france")], }, @@ -72,7 +69,6 @@ export const discounts = { type: "fixed", allocation: "item", value: 10, - valid_for: [], }, regions: [IdMap.getId("region-france")], }, @@ -84,7 +80,6 @@ export const discounts = { type: "fixed", allocation: "item", value: 10, - valid_for: [], }, regions: [IdMap.getId("region-france")], }, @@ -95,7 +90,6 @@ export const discounts = { type: "free_shipping", allocation: "total", value: 10, - valid_for: [], }, regions: [IdMap.getId("region-france")], }, @@ -106,7 +100,6 @@ export const discounts = { type: "free_shipping", allocation: "total", value: 10, - valid_for: [], }, regions: [IdMap.getId("us")], }, @@ -125,10 +118,10 @@ export const DiscountServiceMock = { withTransaction: function() { return this }, - create: jest.fn().mockImplementation(data => { + create: jest.fn().mockImplementation((data) => { return Promise.resolve(data) }), - retrieveByCode: jest.fn().mockImplementation(data => { + retrieveByCode: jest.fn().mockImplementation((data) => { if (data === "10%OFF") { return Promise.resolve(discounts.total10Percent) } @@ -140,7 +133,7 @@ export const DiscountServiceMock = { } return Promise.resolve(undefined) }), - retrieve: jest.fn().mockImplementation(data => { + retrieve: jest.fn().mockImplementation((data) => { if (data === IdMap.getId("total10")) { return Promise.resolve(discounts.total10Percent) } @@ -152,20 +145,20 @@ export const DiscountServiceMock = { } return Promise.resolve(undefined) }), - update: jest.fn().mockImplementation(data => { + update: jest.fn().mockImplementation((data) => { return Promise.resolve() }), - delete: jest.fn().mockImplementation(data => { + delete: jest.fn().mockImplementation((data) => { return Promise.resolve({ id: IdMap.getId("total10"), object: "discount", deleted: true, }) }), - list: jest.fn().mockImplementation(data => { + list: jest.fn().mockImplementation((data) => { return Promise.resolve([{}]) }), - listAndCount: jest.fn().mockImplementation(data => { + listAndCount: jest.fn().mockImplementation((data) => { return Promise.resolve([{}]) }), addRegion: jest.fn().mockReturnValue(Promise.resolve()), diff --git a/packages/medusa/src/services/__tests__/cart.js b/packages/medusa/src/services/__tests__/cart.js index 2a700f6bfa..aab9ab7ff5 100644 --- a/packages/medusa/src/services/__tests__/cart.js +++ b/packages/medusa/src/services/__tests__/cart.js @@ -1,12 +1,12 @@ import _ from "lodash" -import { IdMap, MockRepository, MockManager } from "medusa-test-utils" +import { MedusaError } from "medusa-core-utils" +import { IdMap, MockManager, MockRepository } from "medusa-test-utils" import CartService from "../cart" import { InventoryServiceMock } from "../__mocks__/inventory" -import { MedusaError } from "medusa-core-utils" const eventBusService = { emit: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -209,7 +209,7 @@ describe("CartService", () => { email: "email@test.com", }) ), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -317,14 +317,14 @@ describe("CartService", () => { const lineItemService = { update: jest.fn(), create: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } const shippingOptionService = { deleteShippingMethod: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -505,7 +505,7 @@ describe("CartService", () => { const lineItemService = { delete: jest.fn(), update: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -547,7 +547,7 @@ describe("CartService", () => { const shippingOptionService = { deleteShippingMethod: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -653,7 +653,6 @@ describe("CartService", () => { "region.countries", "discounts", "discounts.rule", - "discounts.rule.valid_for", "discounts.regions", "items.tax_lines", "region.tax_rates", @@ -668,7 +667,7 @@ describe("CartService", () => { describe("updateLineItem", () => { const lineItemService = { update: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -764,7 +763,7 @@ describe("CartService", () => { email: data.email, }) ), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -986,7 +985,7 @@ describe("CartService", () => { const lineItemService = { update: jest.fn((r) => r), delete: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -1036,7 +1035,7 @@ describe("CartService", () => { deleteSession: jest.fn(), updateSession: jest.fn(), createSession: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -1254,7 +1253,7 @@ describe("CartService", () => { deleteSession: jest.fn(), updateSession: jest.fn(), createSession: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -1412,7 +1411,7 @@ describe("CartService", () => { const lineItemService = { update: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -1425,7 +1424,7 @@ describe("CartService", () => { }) }), deleteShippingMethod: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -1469,11 +1468,9 @@ describe("CartService", () => { IdMap.getId("option"), data ) - expect(shippingOptionService.createShippingMethod).toHaveBeenCalledWith( - IdMap.getId("option"), - data, - { cart: cart1 } - ) + expect( + shippingOptionService.createShippingMethod + ).toHaveBeenCalledWith(IdMap.getId("option"), data, { cart: cart1 }) }) it("successfully overrides existing profile shipping method", async () => { @@ -1485,11 +1482,9 @@ describe("CartService", () => { IdMap.getId("profile1"), data ) - expect(shippingOptionService.createShippingMethod).toHaveBeenCalledWith( - IdMap.getId("profile1"), - data, - { cart: cart2 } - ) + expect( + shippingOptionService.createShippingMethod + ).toHaveBeenCalledWith(IdMap.getId("profile1"), data, { cart: cart2 }) expect(shippingOptionService.deleteShippingMethod).toHaveBeenCalledWith({ id: IdMap.getId("ship1"), shipping_option: { @@ -1515,11 +1510,9 @@ describe("CartService", () => { expect(shippingOptionService.createShippingMethod).toHaveBeenCalledTimes( 1 ) - expect(shippingOptionService.createShippingMethod).toHaveBeenCalledWith( - IdMap.getId("additional"), - data, - { cart: cart2 } - ) + expect( + shippingOptionService.createShippingMethod + ).toHaveBeenCalledWith(IdMap.getId("additional"), data, { cart: cart2 }) }) it("updates item shipping", async () => { @@ -1539,11 +1532,9 @@ describe("CartService", () => { expect(shippingOptionService.createShippingMethod).toHaveBeenCalledTimes( 1 ) - expect(shippingOptionService.createShippingMethod).toHaveBeenCalledWith( - IdMap.getId("profile1"), - data, - { cart: cart3 } - ) + expect( + shippingOptionService.createShippingMethod + ).toHaveBeenCalledWith(IdMap.getId("profile1"), data, { cart: cart3 }) expect(lineItemService.update).toHaveBeenCalledTimes(1) expect(lineItemService.update).toHaveBeenCalledWith(IdMap.getId("line"), { @@ -1610,6 +1601,20 @@ describe("CartService", () => { region_id: IdMap.getId("good"), }) } + if (q.where.id === "with-d-and-customer") { + return Promise.resolve({ + id: "with-d-and-customer", + discounts: [ + { + code: "ApplicableForCustomer", + rule: { + type: "fixed", + }, + }, + ], + region_id: IdMap.getId("good"), + }) + } return Promise.resolve({ id: IdMap.getId("cart"), discounts: [], @@ -1718,6 +1723,19 @@ describe("CartService", () => { ends_at: getOffsetDate(10), }) } + if (code === "ApplicableForCustomer") { + return Promise.resolve({ + id: "ApplicableForCustomer", + code: "ApplicableForCustomer", + regions: [{ id: IdMap.getId("good") }], + rule: { + id: "test-rule", + type: "percentage", + }, + starts_at: getOffsetDate(-10), + ends_at: getOffsetDate(10), + }) + } return Promise.resolve({ id: IdMap.getId("10off"), code: "10%OFF", @@ -1727,6 +1745,17 @@ describe("CartService", () => { }, }) }), + canApplyForCustomer: jest + .fn() + .mockImplementation((ruleId, customerId) => { + if (ruleId === "test-rule") { + return Promise.resolve(true) + } + if (!customerId) { + return Promise.resolve(false) + } + return Promise.resolve(false) + }), } const cartService = new CartService({ @@ -1953,6 +1982,45 @@ describe("CartService", () => { }) ).rejects.toThrow("The discount is not available in current region") }) + + it("successfully applies discount with a check for customer applicableness", async () => { + await cartService.update("with-d-and-customer", { + discounts: [ + { + code: "ApplicableForCustomer", + }, + ], + }) + expect(eventBusService.emit).toHaveBeenCalledTimes(1) + expect(eventBusService.emit).toHaveBeenCalledWith( + "cart.updated", + expect.any(Object) + ) + + expect(cartRepository.save).toHaveBeenCalledTimes(1) + expect(cartRepository.save).toHaveBeenCalledWith({ + id: "with-d-and-customer", + region_id: IdMap.getId("good"), + discount_total: 0, + shipping_total: 0, + subtotal: 0, + tax_total: 0, + total: 0, + discounts: [ + { + id: "ApplicableForCustomer", + code: "ApplicableForCustomer", + regions: [{ id: IdMap.getId("good") }], + rule: { + id: "test-rule", + type: "percentage", + }, + starts_at: expect.any(Date), + ends_at: expect.any(Date), + }, + ], + }) + }) }) describe("removeDiscount", () => { diff --git a/packages/medusa/src/services/__tests__/discount.js b/packages/medusa/src/services/__tests__/discount.js index dde4904b2b..d25e7e8d17 100644 --- a/packages/medusa/src/services/__tests__/discount.js +++ b/packages/medusa/src/services/__tests__/discount.js @@ -1,7 +1,5 @@ -import DiscountService from "../discount" import { IdMap, MockManager, MockRepository } from "medusa-test-utils" -import { MedusaError } from "medusa-core-utils" -import { exportAllDeclaration } from "@babel/types" +import DiscountService from "../discount" describe("DiscountService", () => { describe("create", () => { @@ -15,7 +13,7 @@ describe("DiscountService", () => { id: IdMap.getId("france"), } }, - withTransaction: function () { + withTransaction: function() { return this }, } @@ -309,121 +307,6 @@ describe("DiscountService", () => { }) }) - describe("addValidProduct", () => { - const discountRepository = MockRepository({ - findOne: () => - Promise.resolve({ - id: IdMap.getId("total10"), - rule: { - id: IdMap.getId("test-rule"), - valid_for: [{ id: IdMap.getId("test-product") }], - }, - }), - }) - - const discountRuleRepository = MockRepository({}) - - const productService = { - retrieve: () => { - return { - id: IdMap.getId("test-product-2"), - } - }, - } - - const discountService = new DiscountService({ - manager: MockManager, - discountRepository, - discountRuleRepository, - productService, - }) - - beforeEach(() => { - jest.clearAllMocks() - }) - - it("successfully adds a product", async () => { - await discountService.addValidProduct( - IdMap.getId("total10"), - IdMap.getId("test-product-2") - ) - - expect(discountRuleRepository.save).toHaveBeenCalledTimes(1) - expect(discountRuleRepository.save).toHaveBeenCalledWith({ - id: IdMap.getId("test-rule"), - valid_for: [ - { id: IdMap.getId("test-product") }, - { id: IdMap.getId("test-product-2") }, - ], - }) - }) - - it("successfully resolves if product already exists", async () => { - await discountService.addValidProduct( - IdMap.getId("total10"), - IdMap.getId("test-product") - ) - - expect(discountRuleRepository.save).toHaveBeenCalledTimes(0) - }) - }) - - describe("removeValidVariant", () => { - const discountRepository = MockRepository({ - findOne: () => - Promise.resolve({ - id: IdMap.getId("total10"), - rule: { - id: IdMap.getId("test-rule"), - valid_for: [{ id: IdMap.getId("test-product") }], - }, - }), - }) - - const discountRuleRepository = MockRepository({}) - - const productService = { - retrieve: () => { - return { - id: IdMap.getId("test-product"), - } - }, - } - - const discountService = new DiscountService({ - manager: MockManager, - discountRepository, - discountRuleRepository, - productService, - }) - - beforeEach(() => { - jest.clearAllMocks() - }) - - it("successfully removes a product", async () => { - await discountService.removeValidProduct( - IdMap.getId("total10"), - IdMap.getId("test-product") - ) - - expect(discountRuleRepository.save).toHaveBeenCalledTimes(1) - expect(discountRuleRepository.save).toHaveBeenCalledWith({ - id: IdMap.getId("test-rule"), - valid_for: [], - }) - }) - - it("successfully resolve if product does not exist", async () => { - await discountService.removeValidProduct( - IdMap.getId("total10"), - IdMap.getId("test-product-2") - ) - - expect(discountRuleRepository.save).toHaveBeenCalledTimes(0) - }) - }) - describe("addRegion", () => { const discountRepository = MockRepository({ findOne: (q) => { @@ -638,7 +521,7 @@ describe("DiscountService", () => { expect(discountRepository.findAndCount).toHaveBeenCalledWith({ where: expect.anything(), skip: 0, - take: 50, + take: 20, order: { created_at: "DESC" }, }) }) @@ -658,4 +541,198 @@ describe("DiscountService", () => { }) }) }) + + describe("calculateDiscountForLineItem", () => { + const discountRepository = MockRepository({ + findOne: ({ where }) => { + if (where.id === "disc_percentage") { + return Promise.resolve({ + code: "MEDUSA", + rule: { + type: "percentage", + allocation: "total", + value: 15, + }, + }) + } + if (where.id === "disc_fixed_total") { + return Promise.resolve({ + code: "MEDUSA", + rule: { + type: "fixed", + allocation: "total", + value: 400, + }, + }) + } + return Promise.resolve({ + id: "disc_fixed", + code: "MEDUSA", + rule: { + type: "fixed", + allocation: "item", + value: 200, + }, + }) + }, + }) + + const totalsService = { + getSubtotal: () => { + return 1100 + }, + } + + const discountService = new DiscountService({ + manager: MockManager, + discountRepository, + totalsService, + }) + + beforeEach(() => { + jest.clearAllMocks() + }) + + it("correctly calculates fixed + item discount", async () => { + const adjustment = await discountService.calculateDiscountForLineItem( + "disc_fixed", + { + unit_price: 300, + quantity: 2, + allow_discounts: true, + } + ) + + expect(adjustment).toBe(400) + }) + + it("correctly calculates fixed + total discount", async () => { + const adjustment1 = await discountService.calculateDiscountForLineItem( + "disc_fixed_total", + { + unit_price: 400, + quantity: 2, + allow_discounts: true, + } + ) + + const adjustment2 = await discountService.calculateDiscountForLineItem( + "disc_fixed_total", + { + unit_price: 300, + quantity: 1, + allow_discounts: true, + } + ) + + expect(adjustment1).toBe(291) + expect(adjustment2).toBe(109) + }) + + it("returns line item amount if discount exceeds lime item price", async () => { + const adjustment = await discountService.calculateDiscountForLineItem( + "disc_fixed", + { + unit_price: 100, + quantity: 1, + allow_discounts: true, + } + ) + + expect(adjustment).toBe(100) + }) + + it("correctly calculates percentage discount", async () => { + const adjustment = await discountService.calculateDiscountForLineItem( + "disc_percentage", + { + unit_price: 400, + quantity: 2, + allow_discounts: true, + } + ) + + expect(adjustment).toBe(120) + }) + + it("returns full amount if exceeds total line item amount", async () => { + const adjustment = await discountService.calculateDiscountForLineItem( + "disc_fixed", + { + unit_price: 50, + quantity: 2, + allow_discounts: true, + } + ) + + expect(adjustment).toBe(100) + }) + + it("returns early if discounts are not allowed", async () => { + const adjustment = await discountService.calculateDiscountForLineItem( + "disc_percentage", + { + unit_price: 400, + quantity: 2, + allow_discounts: false, + } + ) + + expect(adjustment).toBe(0) + }) + }) + + describe("canApplyForCustomer", () => { + const discountConditionRepository = { + canApplyForCustomer: jest + .fn() + .mockImplementation(() => Promise.resolve(true)), + } + + const customerService = { + retrieve: jest.fn().mockImplementation((id) => { + if (id === "customer-no-groups") { + return Promise.resolve({ id: "customer-no-groups" }) + } + if (id === "customer-with-groups") { + return Promise.resolve({ + id: "customer-with-groups", + groups: [{ id: "group-1" }], + }) + } + }), + } + + const discountService = new DiscountService({ + manager: MockManager, + discountConditionRepository, + customerService, + }) + + it("returns false on undefined customer id", async () => { + const res = await discountService.canApplyForCustomer("rule-1") + + expect(res).toBe(false) + + expect( + discountConditionRepository.canApplyForCustomer + ).toHaveBeenCalledTimes(0) + }) + + it("returns true on customer with groups", async () => { + const res = await discountService.canApplyForCustomer( + "rule-1", + "customer-with-groups" + ) + + expect(res).toBe(true) + + expect( + discountConditionRepository.canApplyForCustomer + ).toHaveBeenCalledTimes(1) + expect( + discountConditionRepository.canApplyForCustomer + ).toHaveBeenCalledWith("rule-1", "customer-with-groups") + }) + }) }) diff --git a/packages/medusa/src/services/__tests__/order.js b/packages/medusa/src/services/__tests__/order.js index 425c42cf30..37f13a038e 100644 --- a/packages/medusa/src/services/__tests__/order.js +++ b/packages/medusa/src/services/__tests__/order.js @@ -33,7 +33,7 @@ describe("OrderService", () => { const eventBusService = { emit: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -78,20 +78,20 @@ describe("OrderService", () => { }) const lineItemService = { update: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } const shippingOptionService = { updateShippingMethod: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } const giftCardService = { update: jest.fn(), createTransaction: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -103,7 +103,7 @@ describe("OrderService", () => { cancelPayment: jest.fn().mockImplementation((payment) => { return Promise.resolve({ ...payment, status: "cancelled" }) }), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -142,7 +142,7 @@ describe("OrderService", () => { total: 100, }) }), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -230,7 +230,6 @@ describe("OrderService", () => { "items", "discounts", "discounts.rule", - "discounts.rule.valid_for", "gift_cards", "shipping_methods", ], @@ -456,7 +455,7 @@ describe("OrderService", () => { await expect(res).rejects.toThrow( "Variant with id: variant-1 does not have the required inventory" ) - //check to see if payment is cancelled + // check to see if payment is cancelled expect( orderService.paymentProviderService_.cancelPayment ).toHaveBeenCalledTimes(1) @@ -634,14 +633,14 @@ describe("OrderService", () => { const fulfillmentService = { cancelFulfillment: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } const paymentProviderService = { cancelPayment: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -738,7 +737,7 @@ describe("OrderService", () => { ? Promise.reject() : Promise.resolve({ ...p, captured_at: "notnull" }) ), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -843,7 +842,7 @@ describe("OrderService", () => { const lineItemService = { update: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -856,7 +855,7 @@ describe("OrderService", () => { }, ]) }), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -1023,7 +1022,7 @@ describe("OrderService", () => { }) } }), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -1092,7 +1091,7 @@ describe("OrderService", () => { .mockImplementation((p) => p.id === "payment_fail" ? Promise.reject() : Promise.resolve() ), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -1233,7 +1232,7 @@ describe("OrderService", () => { .fn() .mockImplementation(() => Promise.resolve({})), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -1367,7 +1366,7 @@ describe("OrderService", () => { const lineItemService = { update: jest.fn(), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -1390,7 +1389,7 @@ describe("OrderService", () => { ], }) }), - withTransaction: function () { + withTransaction: function() { return this }, } @@ -1417,7 +1416,9 @@ describe("OrderService", () => { ) expect(fulfillmentService.createShipment).toHaveBeenCalledTimes(1) - expect(fulfillmentService.createShipment).toHaveBeenCalledWith( + expect( + fulfillmentService.createShipment + ).toHaveBeenCalledWith( IdMap.getId("fulfillment"), [{ tracking_number: "1234" }, { tracking_number: "2345" }], { metadata: undefined, no_notification: true } @@ -1509,7 +1510,7 @@ describe("OrderService", () => { refundPayment: jest .fn() .mockImplementation((p) => Promise.resolve({ id: "ref" })), - withTransaction: function () { + withTransaction: function() { return this }, } diff --git a/packages/medusa/src/services/__tests__/totals.js b/packages/medusa/src/services/__tests__/totals.js index 0b3426cd9c..b696ae307f 100644 --- a/packages/medusa/src/services/__tests__/totals.js +++ b/packages/medusa/src/services/__tests__/totals.js @@ -1,5 +1,5 @@ -import TotalsService from "../totals" import { IdMap } from "medusa-test-utils" +import TotalsService from "../totals" const discounts = { total10Percent: { @@ -19,7 +19,6 @@ const discounts = { type: "fixed", allocation: "item", value: 2, - valid_for: [{ id: "testp2" }], }, regions: [{ id: "fr" }], }, @@ -30,7 +29,6 @@ const discounts = { type: "percentage", allocation: "item", value: 10, - valid_for: [{ id: "testp2" }], }, regions: [{ id: "fr" }], }, @@ -41,7 +39,6 @@ const discounts = { type: "fixed", allocation: "total", value: 10, - valid_for: [], }, regions: [{ id: "fr" }], }, @@ -53,7 +50,6 @@ const discounts = { type: "fixed", allocation: "item", value: 10, - valid_for: [], }, regions: [{ id: "fr" }], }, @@ -65,131 +61,130 @@ describe("TotalsService", () => { taxCalculationStrategy: {}, } - describe("getAllocationItemDiscounts", () => { - let res + // TODO: Redo tests to include new line item adjustments - const totalsService = new TotalsService(container) + // describe("getAllocationItemDiscounts", () => { + // let res - beforeEach(() => { - jest.clearAllMocks() - }) + // const totalsService = new TotalsService(container) - it("calculates item with percentage discount", async () => { - const cart = { - items: [ - { - id: "test", - allow_discounts: true, - unit_price: 10, - quantity: 10, - variant: { - id: "testv", - product_id: "testp", - }, - }, - ], - } + // beforeEach(() => { + // jest.clearAllMocks() + // }) - const discount = { - rule: { - type: "percentage", - value: 10, - valid_for: [{ id: "testp" }], - }, - } + // it("calculates item with percentage discount", async () => { + // const cart = { + // items: [ + // { + // id: "test", + // allow_discounts: true, + // unit_price: 10, + // quantity: 10, + // variant: { + // id: "testv", + // product_id: "testp", + // }, + // }, + // ], + // } - res = totalsService.getAllocationItemDiscounts(discount, cart) + // const discount = { + // rule: { + // type: "percentage", + // value: 10, + // }, + // } - expect(res).toEqual([ - { - lineItem: { - id: "test", - allow_discounts: true, - unit_price: 10, - quantity: 10, - variant: { - id: "testv", - product_id: "testp", - }, - }, - variant: "testv", - amount: 10, - }, - ]) - }) + // res = totalsService.getAllocationItemDiscounts(discount, cart) - it("calculates item with fixed discount", async () => { - const cart = { - items: [ - { - id: "exists", - allow_discounts: true, - unit_price: 10, - variant: { - id: "testv", - product_id: "testp", - }, - quantity: 10, - }, - ], - } + // expect(res).toEqual([ + // { + // lineItem: { + // id: "test", + // allow_discounts: true, + // unit_price: 10, + // quantity: 10, + // variant: { + // id: "testv", + // product_id: "testp", + // }, + // }, + // variant: "testv", + // amount: 10, + // }, + // ]) + // }) - const discount = { - rule: { - type: "fixed", - value: 9, - valid_for: [{ id: "testp" }], - }, - } + // it("calculates item with fixed discount", async () => { + // const cart = { + // items: [ + // { + // id: "exists", + // allow_discounts: true, + // unit_price: 10, + // variant: { + // id: "testv", + // product_id: "testp", + // }, + // quantity: 10, + // }, + // ], + // } - res = totalsService.getAllocationItemDiscounts(discount, cart) + // const discount = { + // rule: { + // type: "fixed", + // value: 9, + // }, + // } - expect(res).toEqual([ - { - lineItem: { - id: "exists", - allow_discounts: true, - unit_price: 10, - variant: { - id: "testv", - product_id: "testp", - }, - quantity: 10, - }, - variant: "testv", - amount: 90, - }, - ]) - }) + // res = totalsService.getAllocationItemDiscounts(discount, cart) - it("does not apply discount if no valid variants are provided", async () => { - const cart = { - items: [ - { - id: "exists", - allow_discounts: true, - unit_price: 10, - variant: { - id: "testv", - product_id: "testp", - }, - quantity: 10, - }, - ], - } + // expect(res).toEqual([ + // { + // lineItem: { + // id: "exists", + // allow_discounts: true, + // unit_price: 10, + // variant: { + // id: "testv", + // product_id: "testp", + // }, + // quantity: 10, + // }, + // variant: "testv", + // amount: 90, + // }, + // ]) + // }) - const discount = { - rule: { - type: "fixed", - value: 9, - valid_for: [], - }, - } - res = totalsService.getAllocationItemDiscounts(discount, cart) + // it("does not apply discount if no valid variants are provided", async () => { + // const cart = { + // items: [ + // { + // id: "exists", + // allow_discounts: true, + // unit_price: 10, + // variant: { + // id: "testv", + // product_id: "testp", + // }, + // quantity: 10, + // }, + // ], + // } - expect(res).toEqual([]) - }) - }) + // const discount = { + // rule: { + // type: "fixed", + // value: 9, + // }, + // } + // res = totalsService.getAllocationItemDiscounts(discount, cart) + + // expect(res).toEqual([]) + // }) + // }) describe("getDiscountTotal", () => { let res @@ -235,19 +230,21 @@ describe("TotalsService", () => { expect(res).toEqual(28) }) - it("calculate item fixed discount", async () => { - discountCart.discounts.push(discounts.item2Fixed) - res = totalsService.getDiscountTotal(discountCart) + // TODO: Redo tests to include new line item adjustments - expect(res).toEqual(20) - }) + // it("calculate item fixed discount", async () => { + // discountCart.discounts.push(discounts.item2Fixed) + // res = totalsService.getDiscountTotal(discountCart) - it("calculate item percentage discount", async () => { - discountCart.discounts.push(discounts.item10Percent) - res = totalsService.getDiscountTotal(discountCart) + // expect(res).toEqual(20) + // }) - expect(res).toEqual(10) - }) + // it("calculate item percentage discount", async () => { + // discountCart.discounts.push(discounts.item10Percent) + // res = totalsService.getDiscountTotal(discountCart) + + // expect(res).toEqual(10) + // }) it("calculate total fixed discount", async () => { discountCart.discounts.push(discounts.total10Fixed) @@ -350,82 +347,84 @@ describe("TotalsService", () => { expect(res).toEqual(1250) }) - it("calculates refund with total precentage discount", async () => { - orderToRefund.discounts.push(discounts.total10Percent) - res = totalsService.getRefundTotal(orderToRefund, [ - { - id: "line2", - unit_price: 100, - allow_discounts: true, - variant: { - id: "variant", - product_id: "product2", - }, - returned_quantity: 0, - metadata: {}, - quantity: 10, - }, - ]) + // TODO: Redo tests to include new line item adjustments - expect(res).toEqual(1125) - }) + // it("calculates refund with total precentage discount", async () => { + // orderToRefund.discounts.push(discounts.total10Percent) + // res = totalsService.getRefundTotal(orderToRefund, [ + // { + // id: "line2", + // unit_price: 100, + // allow_discounts: true, + // variant: { + // id: "variant", + // product_id: "product2", + // }, + // returned_quantity: 0, + // metadata: {}, + // quantity: 10, + // }, + // ]) - it("calculates refund with total fixed discount", async () => { - orderToRefund.discounts.push(discounts.total10Fixed) - res = totalsService.getRefundTotal(orderToRefund, [ - { - id: "line", - unit_price: 100, - allow_discounts: true, - variant: { - id: "variant", - product_id: "product", - }, - quantity: 10, - returned_quantity: 0, - }, - ]) + // expect(res).toEqual(1125) + // }) - expect(res).toEqual(1244) - }) + // it("calculates refund with total fixed discount", async () => { + // orderToRefund.discounts.push(discounts.total10Fixed) + // res = totalsService.getRefundTotal(orderToRefund, [ + // { + // id: "line", + // unit_price: 100, + // allow_discounts: true, + // variant: { + // id: "variant", + // product_id: "product", + // }, + // quantity: 10, + // returned_quantity: 0, + // }, + // ]) - it("calculates refund with item fixed discount", async () => { - orderToRefund.discounts.push(discounts.item2Fixed) - res = totalsService.getRefundTotal(orderToRefund, [ - { - id: "line2", - unit_price: 100, - allow_discounts: true, - variant: { - id: "variant", - product_id: "testp2", - }, - quantity: 10, - returned_quantity: 0, - }, - ]) + // expect(res).toEqual(1244) + // }) - expect(res).toEqual(1225) - }) + // it("calculates refund with item fixed discount", async () => { + // orderToRefund.discounts.push(discounts.item2Fixed) + // res = totalsService.getRefundTotal(orderToRefund, [ + // { + // id: "line2", + // unit_price: 100, + // allow_discounts: true, + // variant: { + // id: "variant", + // product_id: "testp2", + // }, + // quantity: 10, + // returned_quantity: 0, + // }, + // ]) - it("calculates refund with item percentage discount", async () => { - orderToRefund.discounts.push(discounts.item10Percent) - res = totalsService.getRefundTotal(orderToRefund, [ - { - id: "line2", - unit_price: 100, - allow_discounts: true, - variant: { - id: "variant", - product_id: "testp2", - }, - quantity: 10, - returned_quantity: 0, - }, - ]) + // expect(res).toEqual(1225) + // }) - expect(res).toEqual(1125) - }) + // it("calculates refund with item percentage discount", async () => { + // orderToRefund.discounts.push(discounts.item10Percent) + // res = totalsService.getRefundTotal(orderToRefund, [ + // { + // id: "line2", + // unit_price: 100, + // allow_discounts: true, + // variant: { + // id: "variant", + // product_id: "testp2", + // }, + // quantity: 10, + // returned_quantity: 0, + // }, + // ]) + + // expect(res).toEqual(1125) + // }) it("throws if line items to return is not in order", async () => { const work = () => diff --git a/packages/medusa/src/services/cart.ts b/packages/medusa/src/services/cart.ts index 45a543dc93..5a2f1b2b05 100644 --- a/packages/medusa/src/services/cart.ts +++ b/packages/medusa/src/services/cart.ts @@ -1,48 +1,40 @@ import _ from "lodash" -import { - EntityManager, - DeepPartial, - AlreadyHasActiveConnectionError, -} from "typeorm" import { MedusaError, Validator } from "medusa-core-utils" import { BaseService } from "medusa-interfaces" - -import { ShippingMethodRepository } from "../repositories/shipping-method" -import { CartRepository } from "../repositories/cart" -import { AddressRepository } from "../repositories/address" -import { PaymentSessionRepository } from "../repositories/payment-session" - +import { DeepPartial, EntityManager } from "typeorm" +import { IPriceSelectionStrategy } from "../interfaces/price-selection-strategy" import { Address } from "../models/address" -import { Discount } from "../models/discount" import { Cart } from "../models/cart" +import { CustomShippingOption } from "../models/custom-shipping-option" import { Customer } from "../models/customer" +import { Discount } from "../models/discount" import { LineItem } from "../models/line-item" import { ShippingMethod } from "../models/shipping-method" -import { CustomShippingOption } from "../models/custom-shipping-option" - -import { TotalField, FindConfig } from "../types/common" +import { AddressRepository } from "../repositories/address" +import { CartRepository } from "../repositories/cart" +import { PaymentSessionRepository } from "../repositories/payment-session" +import { ShippingMethodRepository } from "../repositories/shipping-method" import { + CartCreateProps, + CartUpdateProps, FilterableCartProps, LineItemUpdate, - CartUpdateProps, - CartCreateProps, } from "../types/cart" - +import { FindConfig, TotalField } from "../types/common" +import CustomShippingOptionService from "./custom-shipping-option" +import CustomerService from "./customer" +import DiscountService from "./discount" import EventBusService from "./event-bus" -import ProductVariantService from "./product-variant" -import ProductService from "./product" -import RegionService from "./region" +import GiftCardService from "./gift-card" +import InventoryService from "./inventory" import LineItemService from "./line-item" import PaymentProviderService from "./payment-provider" +import ProductService from "./product" +import ProductVariantService from "./product-variant" +import RegionService from "./region" import ShippingOptionService from "./shipping-option" -import CustomerService from "./customer" import TaxProviderService from "./tax-provider" -import DiscountService from "./discount" -import GiftCardService from "./gift-card" import TotalsService from "./totals" -import InventoryService from "./inventory" -import CustomShippingOptionService from "./custom-shipping-option" -import { IPriceSelectionStrategy } from "../interfaces/price-selection-strategy" type CartConstructorProps = { manager: EntityManager @@ -213,7 +205,6 @@ class CartService extends BaseService { relationSet.add("gift_cards") relationSet.add("discounts") relationSet.add("discounts.rule") - relationSet.add("discounts.rule.valid_for") // relationSet.add("discounts.parent_discount") // relationSet.add("discounts.parent_discount.rule") // relationSet.add("discounts.parent_discount.regions") @@ -706,7 +697,6 @@ class CartService extends BaseService { "region.countries", "discounts", "discounts.rule", - "discounts.rule.valid_for", "discounts.regions", ], }) @@ -1016,10 +1006,23 @@ class CartService extends BaseService { async applyDiscount(cart: Cart, discountCode: string): Promise { const discount = await this.discountService_.retrieveByCode(discountCode, [ "rule", - "rule.valid_for", "regions", ]) + if (cart.customer_id) { + const canApply = await this.discountService_.canApplyForCustomer( + discount.rule.id, + cart.customer_id + ) + + if (!canApply) { + throw new MedusaError( + MedusaError.Types.NOT_ALLOWED, + "Discount is not valid for customer" + ) + } + } + const rule = discount.rule // if limit is set and reached, we make an early exit @@ -1103,7 +1106,7 @@ class CartService extends BaseService { } }) - cart.discounts = newDiscounts.filter(Boolean) + cart.discounts = newDiscounts.filter(Boolean) as Discount[] } /** @@ -1118,7 +1121,6 @@ class CartService extends BaseService { relations: [ "discounts", "discounts.rule", - "discounts.rule.valid_for", "payment_sessions", "shipping_methods", ], @@ -1333,7 +1335,6 @@ class CartService extends BaseService { "items", "discounts", "discounts.rule", - "discounts.rule.valid_for", "gift_cards", "shipping_methods", "billing_address", @@ -1508,7 +1509,6 @@ class CartService extends BaseService { "shipping_methods", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_methods.shipping_option", "items", "items.variant", @@ -1566,12 +1566,7 @@ class CartService extends BaseService { } const result = await this.retrieve(cartId, { - relations: [ - "discounts", - "discounts.rule", - "discounts.rule.valid_for", - "shipping_methods", - ], + relations: ["discounts", "discounts.rule", "shipping_methods"], }) // if cart has freeshipping, adjust price @@ -1801,13 +1796,7 @@ class CartService extends BaseService { async delete(cartId: string): Promise { return await this.atomicPhase_(async (manager: EntityManager) => { const cart = await this.retrieve(cartId, { - relations: [ - "items", - "discounts", - "discounts.rule", - "discounts.rule.valid_for", - "payment_sessions", - ], + relations: ["items", "discounts", "discounts.rule", "payment_sessions"], }) if (cart.completed_at) { @@ -1878,7 +1867,6 @@ class CartService extends BaseService { "gift_cards", "discounts", "discounts.rule", - "discounts.rule.valid_for", "shipping_methods", "region", "region.tax_rates", diff --git a/packages/medusa/src/services/discount.js b/packages/medusa/src/services/discount.ts similarity index 56% rename from packages/medusa/src/services/discount.js rename to packages/medusa/src/services/discount.ts index 80e88bb397..c706cab1b7 100644 --- a/packages/medusa/src/services/discount.js +++ b/packages/medusa/src/services/discount.ts @@ -1,22 +1,62 @@ import { parse, toSeconds } from "iso8601-duration" +import { isEmpty, omit } from "lodash" import { MedusaError, Validator } from "medusa-core-utils" import { BaseService } from "medusa-interfaces" -import { Brackets, ILike } from "typeorm" -import { formatException } from "../utils/exception-formatter" +import { Brackets, EntityManager, ILike, SelectQueryBuilder } from "typeorm" +import { + EventBusService, + ProductService, + RegionService, + TotalsService, +} from "." +import { Cart } from "../models/cart" +import { Discount } from "../models/discount" +import { DiscountConditionType } from "../models/discount-condition" +import { + AllocationType as DiscountAllocation, + DiscountRule, + DiscountRuleType, +} from "../models/discount-rule" +import { LineItem } from "../models/line-item" +import { DiscountRepository } from "../repositories/discount" +import { DiscountConditionRepository } from "../repositories/discount-condition" +import { DiscountRuleRepository } from "../repositories/discount-rule" +import { GiftCardRepository } from "../repositories/gift-card" +import { FindConfig } from "../types/common" +import { + CreateDiscountInput, + CreateDynamicDiscountInput, + FilterableDiscountProps, + UpdateDiscountInput, + UpsertDiscountConditionInput, +} from "../types/discount" +import { formatException, PostgresError } from "../utils/exception-formatter" /** * Provides layer to manipulate discounts. * @implements {BaseService} */ class DiscountService extends BaseService { + private manager_: EntityManager + private discountRepository_: typeof DiscountRepository + private discountRuleRepository_: typeof DiscountRuleRepository + private giftCardRepository_: typeof GiftCardRepository + private discountConditionRepository_: typeof DiscountConditionRepository + private totalsService_: TotalsService + private productService_: ProductService + private regionService_: RegionService + private eventBus_: EventBusService + constructor({ manager, discountRepository, discountRuleRepository, giftCardRepository, + discountConditionRepository, totalsService, productService, regionService, + customerService, eventBusService, }) { super() @@ -33,6 +73,9 @@ class DiscountService extends BaseService { /** @private @const {GiftCardRepository} */ this.giftCardRepository_ = giftCardRepository + /** @private @const {DiscountConditionRepository} */ + this.discountConditionRepository_ = discountConditionRepository + /** @private @const {TotalsService} */ this.totalsService_ = totalsService @@ -42,11 +85,14 @@ class DiscountService extends BaseService { /** @private @const {RegionService} */ this.regionService_ = regionService + /** @private @const {CustomerService} */ + this.customerService_ = customerService + /** @private @const {EventBus} */ this.eventBus_ = eventBusService } - withTransaction(transactionManager) { + withTransaction(transactionManager: EntityManager): DiscountService { if (!transactionManager) { return this } @@ -56,13 +102,16 @@ class DiscountService extends BaseService { discountRepository: this.discountRepository_, discountRuleRepository: this.discountRuleRepository_, giftCardRepository: this.giftCardRepository_, + discountConditionRepository: this.discountConditionRepository_, totalsService: this.totalsService_, productService: this.productService_, regionService: this.regionService_, + customerService: this.customerService_, eventBusService: this.eventBus_, }) cloned.transactionManager_ = transactionManager + cloned.manager_ = transactionManager return cloned } @@ -72,14 +121,13 @@ class DiscountService extends BaseService { * @param {DiscountRule} discountRule - the discount rule to create * @return {Promise} the result of the create operation */ - validateDiscountRule_(discountRule) { + validateDiscountRule_(discountRule): DiscountRule { const schema = Validator.object().keys({ id: Validator.string().optional(), description: Validator.string().optional(), type: Validator.string().required(), value: Validator.number().min(0).required(), allocation: Validator.string().required(), - valid_for: Validator.array().optional(), created_at: Validator.date().optional(), updated_at: Validator.date().allow(null).optional(), deleted_at: Validator.date().allow(null).optional(), @@ -109,7 +157,10 @@ class DiscountService extends BaseService { * @param {Object} config - the config object containing query settings * @return {Promise} the result of the find operation */ - async list(selector = {}, config = { relations: [], skip: 0, take: 10 }) { + async list( + selector: FilterableDiscountProps = {}, + config: FindConfig = { relations: [], skip: 0, take: 10 } + ): Promise { const discountRepo = this.manager_.getCustomRepository( this.discountRepository_ ) @@ -124,9 +175,13 @@ class DiscountService extends BaseService { * @return {Promise} the result of the find operation */ async listAndCount( - selector = {}, - config = { skip: 0, take: 50, order: { created_at: "DESC" } } - ) { + selector: FilterableDiscountProps = {}, + config: FindConfig = { + take: 20, + skip: 0, + order: { created_at: "DESC" }, + } + ): Promise<[Discount[], number]> { const discountRepo = this.manager_.getCustomRepository( this.discountRepository_ ) @@ -144,7 +199,7 @@ class DiscountService extends BaseService { delete where.code - query.where = (qb) => { + query.where = (qb: SelectQueryBuilder): void => { qb.where(where) qb.andWhere( @@ -166,18 +221,23 @@ class DiscountService extends BaseService { * @param {Discount} discount - the discount data to create * @return {Promise} the result of the create operation */ - async create(discount) { + async create(discount: CreateDiscountInput): Promise { return this.atomicPhase_(async (manager) => { const discountRepo = manager.getCustomRepository(this.discountRepository_) const ruleRepo = manager.getCustomRepository(this.discountRuleRepository_) - if (discount.rule?.valid_for) { - discount.rule.valid_for = discount.rule.valid_for.map((id) => ({ id })) - } + const conditions = discount.rule?.conditions + + const ruleToCreate = omit(discount.rule, ["conditions"]) + discount.rule = ruleToCreate const validatedRule = this.validateDiscountRule_(discount.rule) - if (discount.regions?.length > 1 && discount.rule.type === "fixed") { + if ( + discount?.regions && + discount?.regions.length > 1 && + discount?.rule?.type === "fixed" + ) { throw new MedusaError( MedusaError.Types.INVALID_DATA, "Fixed discounts can have one region" @@ -195,11 +255,18 @@ class DiscountService extends BaseService { const discountRule = await ruleRepo.create(validatedRule) const createdDiscountRule = await ruleRepo.save(discountRule) - discount.code = discount.code.toUpperCase() + discount.code = discount.code!.toUpperCase() discount.rule = createdDiscountRule const created = await discountRepo.create(discount) const result = await discountRepo.save(created) + + if (conditions?.length) { + for (const cond of conditions) { + await this.upsertDiscountCondition_(result.id, cond) + } + } + return result } catch (error) { throw formatException(error) @@ -213,7 +280,10 @@ class DiscountService extends BaseService { * @param {Object} config - the config object containing query settings * @return {Promise} the discount */ - async retrieve(discountId, config = {}) { + async retrieve( + discountId: string, + config: FindConfig = {} + ): Promise { const discountRepo = this.manager_.getCustomRepository( this.discountRepository_ ) @@ -238,7 +308,10 @@ class DiscountService extends BaseService { * @param {array} relations - list of relations * @return {Promise} the discount document */ - async retrieveByCode(discountCode, relations = []) { + async retrieveByCode( + discountCode: string, + relations: string[] = [] + ): Promise { const discountRepo = this.manager_.getCustomRepository( this.discountRepository_ ) @@ -271,7 +344,10 @@ class DiscountService extends BaseService { * @param {Discount} update - the data to update the discount with * @return {Promise} the result of the update operation */ - async update(discountId, update) { + async update( + discountId: string, + update: UpdateDiscountInput + ): Promise { return this.atomicPhase_(async (manager) => { const discountRepo = manager.getCustomRepository(this.discountRepository_) @@ -279,10 +355,17 @@ class DiscountService extends BaseService { relations: ["rule"], }) + const conditions = update?.rule?.conditions + const ruleToUpdate = omit(update.rule, "conditions") + + if (!isEmpty(ruleToUpdate)) { + update.rule = ruleToUpdate + } + const { rule, metadata, regions, ...rest } = update if (rest.ends_at) { - if (discount.starts_at >= new Date(update.ends_at)) { + if (discount.starts_at >= new Date(rest.ends_at)) { throw new MedusaError( MedusaError.Types.INVALID_DATA, `"ends_at" must be greater than "starts_at"` @@ -290,13 +373,19 @@ class DiscountService extends BaseService { } } - if (regions?.length > 1 && discount.rule.type === "fixed") { + if (regions && regions?.length > 1 && discount.rule.type === "fixed") { throw new MedusaError( MedusaError.Types.INVALID_DATA, "Fixed discounts can have one region" ) } + if (conditions?.length) { + for (const cond of conditions) { + await this.upsertDiscountCondition_(discount.id, cond) + } + } + if (regions) { discount.regions = await Promise.all( regions.map((regionId) => this.regionService_.retrieve(regionId)) @@ -308,16 +397,11 @@ class DiscountService extends BaseService { } if (rule) { - discount.rule = this.validateDiscountRule_(rule) - if (rule.valid_for) { - discount.rule.valid_for = discount.rule.valid_for.map((id) => ({ - id, - })) - } + discount.rule = this.validateDiscountRule_(ruleToUpdate) } for (const key of Object.keys(rest).filter( - (k) => rest[k] !== undefined + (k) => typeof rest[k] !== `undefined` )) { discount[key] = rest[key] } @@ -335,7 +419,10 @@ class DiscountService extends BaseService { * @param {Object} data - the object containing a code to identify the discount by * @return {Promise} the newly created dynamic code */ - async createDynamicCode(discountId, data) { + async createDynamicCode( + discountId: string, + data: CreateDynamicDiscountInput + ): Promise { return this.atomicPhase_(async (manager) => { const discountRepo = manager.getCustomRepository(this.discountRepository_) @@ -384,7 +471,7 @@ class DiscountService extends BaseService { * @param {string} code - the code to identify the discount by * @return {Promise} the newly created dynamic code */ - async deleteDynamicCode(discountId, code) { + async deleteDynamicCode(discountId: string, code: string): Promise { return this.atomicPhase_(async (manager) => { const discountRepo = manager.getCustomRepository(this.discountRepository_) const discount = await discountRepo.findOne({ @@ -401,77 +488,13 @@ class DiscountService extends BaseService { }) } - /** - * Adds a valid product to the discount rule valid_for array. - * @param {string} discountId - id of discount - * @param {string} productId - id of product to add - * @return {Promise} the result of the update operation - */ - async addValidProduct(discountId, productId) { - return this.atomicPhase_(async (manager) => { - const discountRuleRepo = manager.getCustomRepository( - this.discountRuleRepository_ - ) - - const discount = await this.retrieve(discountId, { - relations: ["rule", "rule.valid_for"], - }) - - const { rule } = discount - - const exists = rule.valid_for.find((p) => p.id === productId) - // If product is already present, we return early - if (exists) { - return rule - } - - const product = await this.productService_.retrieve(productId) - - rule.valid_for = [...rule.valid_for, product] - - const updated = await discountRuleRepo.save(rule) - return updated - }) - } - - /** - * Removes a product from the discount rule valid_for array - * @param {string} discountId - id of discount - * @param {string} productId - id of product to add - * @return {Promise} the result of the update operation - */ - async removeValidProduct(discountId, productId) { - return this.atomicPhase_(async (manager) => { - const discountRuleRepo = manager.getCustomRepository( - this.discountRuleRepository_ - ) - - const discount = await this.retrieve(discountId, { - relations: ["rule", "rule.valid_for"], - }) - - const { rule } = discount - - const exists = rule.valid_for.find((p) => p.id === productId) - // If product is not present, we return early - if (!exists) { - return rule - } - - rule.valid_for = rule.valid_for.filter((p) => p.id !== productId) - - const updated = await discountRuleRepo.save(rule) - return updated - }) - } - /** * Adds a region to the discount regions array. * @param {string} discountId - id of discount * @param {string} regionId - id of region to add * @return {Promise} the result of the update operation */ - async addRegion(discountId, regionId) { + async addRegion(discountId: string, regionId: string): Promise { return this.atomicPhase_(async (manager) => { const discountRepo = manager.getCustomRepository(this.discountRepository_) @@ -507,7 +530,7 @@ class DiscountService extends BaseService { * @param {string} regionId - id of region to remove * @return {Promise} the result of the update operation */ - async removeRegion(discountId, regionId) { + async removeRegion(discountId: string, regionId: string): Promise { return this.atomicPhase_(async (manager) => { const discountRepo = manager.getCustomRepository(this.discountRepository_) @@ -533,7 +556,7 @@ class DiscountService extends BaseService { * @param {string} discountId - id of discount to delete * @return {Promise} the result of the delete operation */ - async delete(discountId) { + async delete(discountId: string): Promise { return this.atomicPhase_(async (manager) => { const discountRepo = manager.getCustomRepository(this.discountRepository_) @@ -549,25 +572,191 @@ class DiscountService extends BaseService { }) } - /** - * Decorates a discount. - * @param {string} discountId - id of discount to decorate - * @param {string[]} fields - the fields to include. - * @param {string[]} expandFields - fields to expand. - * @return {Discount} return the decorated discount. - */ - async decorate(discountId, fields = [], expandFields = []) { - const requiredFields = ["id", "code", "is_dynamic", "metadata"] + resolveConditionType_(data: UpsertDiscountConditionInput): + | { + type: DiscountConditionType + resource_ids: string[] + } + | undefined { + switch (true) { + case !!data.products?.length: + return { + type: DiscountConditionType.PRODUCTS, + resource_ids: data.products!, + } + case !!data.product_collections?.length: + return { + type: DiscountConditionType.PRODUCT_COLLECTIONS, + resource_ids: data.product_collections!, + } + case !!data.product_types?.length: + return { + type: DiscountConditionType.PRODUCT_TYPES, + resource_ids: data.product_types!, + } + case !!data.product_tags?.length: + return { + type: DiscountConditionType.PRODUCT_TAGS, + resource_ids: data.product_tags!, + } + case !!data.customer_groups?.length: + return { + type: DiscountConditionType.CUSTOMER_GROUPS, + resource_ids: data.customer_groups!, + } + default: + return undefined + } + } - fields = fields.concat(requiredFields) + async upsertDiscountCondition_( + discountId: string, + data: UpsertDiscountConditionInput + ): Promise { + const resolvedConditionType = this.resolveConditionType_(data) - const discount = await this.retrieve(discountId, { - select: fields, - relations: expandFields, + const res = this.atomicPhase_( + async (manager) => { + const discountConditionRepo: DiscountConditionRepository = + manager.getCustomRepository(this.discountConditionRepository_) + + if (!resolvedConditionType) { + throw new MedusaError( + MedusaError.Types.INVALID_DATA, + `Missing one of products, collections, tags, types or customer groups in data` + ) + } + + if (data.id) { + return await discountConditionRepo.addConditionResources( + data.id, + resolvedConditionType.resource_ids, + resolvedConditionType.type, + true + ) + } + + const discount = await this.retrieve(discountId, { + relations: ["rule", "rule.conditions"], + }) + + const created = discountConditionRepo.create({ + discount_rule_id: discount.rule_id, + operator: data.operator, + type: resolvedConditionType.type, + }) + + const discountCondition = await discountConditionRepo.save(created) + + return await discountConditionRepo.addConditionResources( + discountCondition.id, + resolvedConditionType.resource_ids, + resolvedConditionType.type + ) + }, + async (err: any) => { + if (err.code === PostgresError.DUPLICATE_ERROR) { + // A unique key constraint failed meaning the combination of + // discount rule id, type, and operator already exists in the db. + throw new MedusaError( + MedusaError.Types.DUPLICATE_ERROR, + `Discount Condition with operator '${data.operator}' and type '${resolvedConditionType?.type}' already exist on a Discount Rule` + ) + } + } + ) + + return res + } + + async validateDiscountForProduct( + discountRuleId: string, + productId: string | undefined + ): Promise { + return this.atomicPhase_(async (manager) => { + const discountConditionRepo: DiscountConditionRepository = + manager.getCustomRepository(this.discountConditionRepository_) + + // In case of custom line items, we don't have a product id. + // Instead of throwing, we simply invalidate the discount. + if (!productId) { + return false + } + + const product = await this.productService_.retrieve(productId, { + relations: ["tags"], + }) + + return await discountConditionRepo.isValidForProduct( + discountRuleId, + product.id + ) }) + } - // const final = await this.runDecorators_(decorated) - return discount + async calculateDiscountForLineItem( + discountId: string, + lineItem: LineItem, + cart: Cart + ): Promise { + let adjustment = 0 + + if (!lineItem.allow_discounts) { + return adjustment + } + + const discount = await this.retrieve(discountId, { relations: ["rule"] }) + + const { type, value, allocation } = discount.rule + + const fullItemPrice = lineItem.unit_price * lineItem.quantity + + if (type === DiscountRuleType.PERCENTAGE) { + adjustment = Math.round((fullItemPrice / 100) * value) + } else if ( + type === DiscountRuleType.FIXED && + allocation === DiscountAllocation.TOTAL + ) { + // when a fixed discount should be applied to the total, + // we create line adjustments for each item with an amount + // relative to the subtotal + const subtotal = this.totalsService_.getSubtotal(cart, { + excludeNonDiscounts: true, + }) + const nominator = Math.min(value, subtotal) + const itemRelativeToSubtotal = lineItem.unit_price / subtotal + const totalItemPercentage = itemRelativeToSubtotal * lineItem.quantity + adjustment = Math.round(nominator * totalItemPercentage) + } else { + adjustment = value * lineItem.quantity + } + // if the amount of the discount exceeds the total price of the item, + // we return the total item price, else the fixed amount + return adjustment >= fullItemPrice ? fullItemPrice : adjustment + } + + async canApplyForCustomer( + discountRuleId: string, + customerId: string | undefined + ): Promise { + return this.atomicPhase_(async (manager) => { + const discountConditionRepo: DiscountConditionRepository = + manager.getCustomRepository(this.discountConditionRepository_) + + // Instead of throwing on missing customer id, we simply invalidate the discount + if (!customerId) { + return false + } + + const customer = await this.customerService_.retrieve(customerId, { + relations: ["groups"], + }) + + return await discountConditionRepo.canApplyForCustomer( + discountRuleId, + customer.id + ) + }) } } diff --git a/packages/medusa/src/services/order.js b/packages/medusa/src/services/order.js index db9f2d78c4..758bd53bd8 100644 --- a/packages/medusa/src/services/order.js +++ b/packages/medusa/src/services/order.js @@ -188,8 +188,9 @@ class OrderService extends BaseService { const orderRepo = this.manager_.getCustomRepository(this.orderRepository_) const query = this.buildQuery_(selector, config) - const { select, relations, totalsToSelect } = - this.transformQueryForTotals_(config) + const { select, relations, totalsToSelect } = this.transformQueryForTotals_( + config + ) if (select && select.length) { query.select = select @@ -248,8 +249,9 @@ class OrderService extends BaseService { } } - const { select, relations, totalsToSelect } = - this.transformQueryForTotals_(config) + const { select, relations, totalsToSelect } = this.transformQueryForTotals_( + config + ) if (select && select.length) { query.select = select @@ -306,7 +308,6 @@ class OrderService extends BaseService { relationSet.add("claims.additional_items.tax_lines") relationSet.add("discounts") relationSet.add("discounts.rule") - relationSet.add("discounts.rule.valid_for") relationSet.add("gift_cards") relationSet.add("gift_card_transactions") relationSet.add("refunds") @@ -340,8 +341,9 @@ class OrderService extends BaseService { const orderRepo = this.manager_.getCustomRepository(this.orderRepository_) const validatedId = this.validateId_(orderId) - const { select, relations, totalsToSelect } = - this.transformQueryForTotals_(config) + const { select, relations, totalsToSelect } = this.transformQueryForTotals_( + config + ) const query = { where: { id: validatedId }, @@ -377,8 +379,9 @@ class OrderService extends BaseService { async retrieveByCartId(cartId, config = {}) { const orderRepo = this.manager_.getCustomRepository(this.orderRepository_) - const { select, relations, totalsToSelect } = - this.transformQueryForTotals_(config) + const { select, relations, totalsToSelect } = this.transformQueryForTotals_( + config + ) const query = { where: { cart_id: cartId }, @@ -414,8 +417,9 @@ class OrderService extends BaseService { async retrieveByExternalId(externalId, config = {}) { const orderRepo = this.manager_.getCustomRepository(this.orderRepository_) - const { select, relations, totalsToSelect } = - this.transformQueryForTotals_(config) + const { select, relations, totalsToSelect } = this.transformQueryForTotals_( + config + ) const query = { where: { external_id: externalId }, @@ -508,7 +512,6 @@ class OrderService extends BaseService { "items", "discounts", "discounts.rule", - "discounts.rule.valid_for", "gift_cards", "shipping_methods", ], @@ -1180,7 +1183,6 @@ class OrderService extends BaseService { relations: [ "discounts", "discounts.rule", - "discounts.rule.valid_for", "region", "fulfillments", "shipping_address", diff --git a/packages/medusa/src/services/return.js b/packages/medusa/src/services/return.js index 439fb6b7e3..28a1748d08 100644 --- a/packages/medusa/src/services/return.js +++ b/packages/medusa/src/services/return.js @@ -422,8 +422,9 @@ class ReturnService extends BaseService { } ) - const calculationContext = - this.totalsService_.getCalculationContext(order) + const calculationContext = this.totalsService_.getCalculationContext( + order + ) const taxLines = await this.taxProviderService_ .withTransaction(manager) @@ -495,8 +496,9 @@ class ReturnService extends BaseService { return returnOrder } - const fulfillmentData = - await this.fulfillmentProviderService_.createReturn(returnData) + const fulfillmentData = await this.fulfillmentProviderService_.createReturn( + returnData + ) returnOrder.shipping_data = fulfillmentData @@ -558,7 +560,6 @@ class ReturnService extends BaseService { "payments", "discounts", "discounts.rule", - "discounts.rule.valid_for", "refunds", "shipping_methods", "region", diff --git a/packages/medusa/src/services/tax-rate.ts b/packages/medusa/src/services/tax-rate.ts index 49e465e8f1..70a593ac58 100644 --- a/packages/medusa/src/services/tax-rate.ts +++ b/packages/medusa/src/services/tax-rate.ts @@ -1,10 +1,10 @@ +import { MedusaError } from "medusa-core-utils" import { BaseService } from "medusa-interfaces" import { EntityManager } from "typeorm" -import { MedusaError } from "medusa-core-utils" -import { TaxRate } from "../models/tax-rate" -import { ShippingTaxRate } from "../models/shipping-tax-rate" import { ProductTaxRate } from "../models/product-tax-rate" import { ProductTypeTaxRate } from "../models/product-type-tax-rate" +import { ShippingTaxRate } from "../models/shipping-tax-rate" +import { TaxRate } from "../models/tax-rate" import { TaxRateRepository } from "../repositories/tax-rate" import ProductService from "../services/product" import ProductTypeService from "../services/product-type" @@ -12,9 +12,9 @@ import ShippingOptionService from "../services/shipping-option" import { FindConfig } from "../types/common" import { CreateTaxRateInput, - UpdateTaxRateInput, - TaxRateListByConfig, FilterableTaxRateProps, + TaxRateListByConfig, + UpdateTaxRateInput, } from "../types/tax-rate" class TaxRateService extends BaseService { diff --git a/packages/medusa/src/services/totals.ts b/packages/medusa/src/services/totals.ts index b1bf7d2333..511e75e7f0 100644 --- a/packages/medusa/src/services/totals.ts +++ b/packages/medusa/src/services/totals.ts @@ -1,28 +1,25 @@ import _ from "lodash" -import { BaseService } from "medusa-interfaces" import { MedusaError } from "medusa-core-utils" - -import { LineItemTaxLine } from "../models/line-item-tax-line" -import { ShippingMethodTaxLine } from "../models/shipping-method-tax-line" -import { Order } from "../models/order" -import { Cart } from "../models/cart" -import { ShippingMethod } from "../models/shipping-method" -import { LineItem } from "../models/line-item" -import { Discount } from "../models/discount" -import { DiscountRuleType } from "../models/discount-rule" - -import TaxProviderService from "./tax-provider" +import { BaseService } from "medusa-interfaces" import { ITaxCalculationStrategy } from "../interfaces/tax-calculation-strategy" import { TaxCalculationContext } from "../interfaces/tax-service" +import { Cart } from "../models/cart" +import { Discount } from "../models/discount" +import { DiscountRuleType } from "../models/discount-rule" +import { LineItem } from "../models/line-item" +import { LineItemTaxLine } from "../models/line-item-tax-line" +import { Order } from "../models/order" +import { ShippingMethod } from "../models/shipping-method" +import { ShippingMethodTaxLine } from "../models/shipping-method-tax-line" import { isCart } from "../types/cart" import { isOrder } from "../types/orders" - import { - SubtotalOptions, - LineDiscount, LineAllocationsMap, + LineDiscount, LineDiscountAmount, + SubtotalOptions, } from "../types/totals" +import TaxProviderService from "./tax-provider" type ShippingMethodTotals = { price: number @@ -594,23 +591,7 @@ class TotalsService extends BaseService { cart: Cart | Order ): LineDiscount[] { const discounts: LineDiscount[] = [] - for (const item of cart.items) { - if (discount.rule.valid_for?.length > 0) { - discount.rule.valid_for.map(({ id }) => { - if (item.variant.product_id === id) { - discounts.push( - this.calculateDiscount_( - item, - item.variant.id, - item.unit_price, - discount.rule.value, - discount.rule.type - ) - ) - } - }) - } - } + // TODO: Add line item adjustments return discounts } diff --git a/packages/medusa/src/subscribers/order.js b/packages/medusa/src/subscribers/order.js index ec49737a47..aaf00cccbd 100644 --- a/packages/medusa/src/subscribers/order.js +++ b/packages/medusa/src/subscribers/order.js @@ -29,20 +29,14 @@ class OrderSubscriber { this.eventBus_.subscribe("order.placed", this.updateDraftOrder) } - handleOrderPlaced = async data => { + handleOrderPlaced = async (data) => { const order = await this.orderService_.retrieve(data.id, { select: ["subtotal"], - relations: [ - "discounts", - "discounts.rule", - "discounts.rule.valid_for", - "items", - "gift_cards", - ], + relations: ["discounts", "discounts.rule", "items", "gift_cards"], }) await Promise.all( - order.items.map(async i => { + order.items.map(async (i) => { if (i.is_giftcard) { for (let qty = 0; qty < i.quantity; qty++) { await this.giftCardService_.create({ @@ -58,7 +52,7 @@ class OrderSubscriber { ) await Promise.all( - order.discounts.map(async d => { + order.discounts.map(async (d) => { const usageCount = d?.usage_count || 0 return this.discountService_.update(d.id, { usage_count: usageCount + 1, @@ -67,11 +61,11 @@ class OrderSubscriber { ) } - updateDraftOrder = async data => { + updateDraftOrder = async (data) => { const order = await this.orderService_.retrieve(data.id) const draftOrder = await this.draftOrderService_ .retrieveByCartId(order.cart_id) - .catch(_ => null) + .catch((_) => null) if (draftOrder) { await this.draftOrderService_.registerCartCompletion( diff --git a/packages/medusa/src/types/common.ts b/packages/medusa/src/types/common.ts index 40be2a99f5..94f06c01e1 100644 --- a/packages/medusa/src/types/common.ts +++ b/packages/medusa/src/types/common.ts @@ -22,7 +22,7 @@ export interface FindConfig { skip?: number take?: number relations?: string[] - order?: { [k: symbol]: "ASC" | "DESC" } + order?: Record } export type PaginatedResponse = { limit: number; offset: number; count: number } diff --git a/packages/medusa/src/types/discount.ts b/packages/medusa/src/types/discount.ts index 20e2355dba..0e3a2199ba 100644 --- a/packages/medusa/src/types/discount.ts +++ b/packages/medusa/src/types/discount.ts @@ -1,12 +1,165 @@ -import { IsEnum, IsOptional } from "class-validator" +import { Transform, Type } from "class-transformer" +import { + IsArray, + IsBoolean, + IsEnum, + IsOptional, + IsString, + Validate, + ValidateNested, +} from "class-validator" +import { DiscountConditionOperator } from "../models/discount-condition" import { AllocationType, DiscountRuleType } from "../models/discount-rule" +import { ExactlyOne } from "./validators/exactly-one" export type QuerySelector = { q?: string } -export class ListSelector { +export class FilterableDiscountProps { + @IsString() + @IsOptional() q?: string + + @IsBoolean() + @IsOptional() + @Transform(({ value }) => value === "true") + is_dynamic?: boolean + + @IsBoolean() + @IsOptional() + @Transform(({ value }) => value === "true") + is_disabled?: boolean + + @ValidateNested() + @IsOptional() + @Type(() => AdminGetDiscountsDiscountRuleParams) + rule?: AdminGetDiscountsDiscountRuleParams +} + +export class AdminGetDiscountsDiscountRuleParams { + @IsOptional() + @IsEnum(DiscountRuleType) + type?: DiscountRuleType + + @IsOptional() + @IsEnum(AllocationType) + allocation?: AllocationType +} + +export class AdminUpsertConditionsReq { + @Validate(ExactlyOne, [ + "product_collections", + "product_types", + "product_tags", + "customer_groups", + ]) + @IsArray() + @IsOptional() + @IsString({ each: true }) + products?: string[] + + @Validate(ExactlyOne, [ + "products", + "product_types", + "product_tags", + "customer_groups", + ]) + @IsArray() + @IsOptional() + @IsString({ each: true }) + product_collections?: string[] + + @Validate(ExactlyOne, [ + "product_collections", + "products", + "product_tags", + "customer_groups", + ]) + @IsArray() + @IsOptional() + @IsString({ each: true }) + product_types?: string[] + + @Validate(ExactlyOne, [ + "product_collections", + "product_types", + "products", + "customer_groups", + ]) + @IsArray() + @IsOptional() + @IsString({ each: true }) + product_tags?: string[] + + @Validate(ExactlyOne, [ + "product_collections", + "product_types", + "products", + "product_tags", + ]) + @IsArray() + @IsOptional() + @IsString({ each: true }) + customer_groups?: string[] +} + +export type UpsertDiscountConditionInput = { + id?: string + operator?: DiscountConditionOperator + products?: string[] + product_collections?: string[] + product_types?: string[] + product_tags?: string[] + customer_groups?: string[] +} + +export type CreateDiscountRuleInput = { + description?: string + type: string + value: number + allocation: string + conditions?: UpsertDiscountConditionInput[] +} + +export type CreateDiscountInput = { + code: string + rule: CreateDiscountRuleInput + is_dynamic: boolean + is_disabled: boolean + starts_at?: Date + ends_at?: Date + valid_duration?: string + usage_limit?: number + regions?: string[] + metadata?: Record +} + +export type UpdateDiscountRuleInput = { + id: string + description?: string + type: string + value: number + allocation: string + conditions?: UpsertDiscountConditionInput[] +} + +export type UpdateDiscountInput = { + code?: string + rule?: UpdateDiscountRuleInput is_dynamic?: boolean is_disabled?: boolean + starts_at?: Date + ends_at?: Date + valid_duration?: string + usage_limit?: number + regions?: string[] + metadata?: Record +} + +export type CreateDynamicDiscountInput = { + code: string + ends_at?: Date + usage_limit: number + metadata?: object } diff --git a/packages/medusa/src/types/validators/exactly-one.ts b/packages/medusa/src/types/validators/exactly-one.ts new file mode 100644 index 0000000000..f76b5ffdf9 --- /dev/null +++ b/packages/medusa/src/types/validators/exactly-one.ts @@ -0,0 +1,31 @@ +import { + isDefined, + ValidationArguments, + ValidatorConstraint, + ValidatorConstraintInterface, +} from "class-validator" + +// Defines constraint that ensures exactly one of given properties +// It simply checks if any of the values provided is defined as +// a property on the class along side the property which is decorated +// +// Inspiration: https://github.com/typestack/class-validator/issues/245 +@ValidatorConstraint({ async: false }) +export class ExactlyOne implements ValidatorConstraintInterface { + validate(propertyValue: string, args: ValidationArguments): boolean { + if (isDefined(propertyValue)) { + return this.getFailedConstraints(args).length === 0 + } + return true + } + + defaultMessage(args: ValidationArguments): string { + return `Only one of ${args.property}, ${this.getFailedConstraints( + args + ).join(", ")} is allowed` + } + + getFailedConstraints(args: ValidationArguments): boolean[] { + return args.constraints.filter((prop) => isDefined(args.object[prop])) + } +} diff --git a/packages/medusa/src/utils/get-query-config.ts b/packages/medusa/src/utils/get-query-config.ts new file mode 100644 index 0000000000..9d541379ff --- /dev/null +++ b/packages/medusa/src/utils/get-query-config.ts @@ -0,0 +1,83 @@ +import { pick } from "lodash" +import { FindConfig } from "../types/common" + +type BaseEntity = { + id: string + created_at: Date +} + +export function pickByConfig( + obj: TModel | TModel[], + config: FindConfig +): Partial | Partial[] { + const fields = [...(config.select ?? []), ...(config.relations ?? [])] + + if (fields.length) { + if (Array.isArray(obj)) { + return obj.map((o) => pick(o, fields)) + } else { + return pick(obj, fields) + } + } + return obj +} + +export function getRetrieveConfig( + defaultFields: (keyof TModel)[], + defaultRelations: string[], + fields?: (keyof TModel)[], + expand?: string[] +): FindConfig { + let includeFields: (keyof TModel)[] = [] + if (typeof fields !== "undefined") { + const fieldSet = new Set(fields) + fieldSet.add("id") + includeFields = Array.from(fieldSet) as (keyof TModel)[] + } + + let expandFields: string[] = [] + if (typeof expand !== "undefined") { + expandFields = expand + } + + return { + select: includeFields.length ? includeFields : defaultFields, + relations: expandFields.length ? expandFields : defaultRelations, + } +} + +export function getListConfig( + defaultFields: (keyof TModel)[], + defaultRelations: string[], + fields?: (keyof TModel)[], + expand?: string[], + limit = 50, + offset = 0, + order?: { [k: symbol]: "DESC" | "ASC" } +): FindConfig { + let includeFields: (keyof TModel)[] = [] + if (typeof fields !== "undefined") { + const fieldSet = new Set(fields) + // Ensure created_at is included, since we are sorting on this + fieldSet.add("created_at") + fieldSet.add("id") + includeFields = Array.from(fieldSet) as (keyof TModel)[] + } + + let expandFields: string[] = [] + if (typeof expand !== "undefined") { + expandFields = expand + } + + const orderBy: Record = order ?? { + created_at: "DESC", + } + + return { + select: includeFields.length ? includeFields : defaultFields, + relations: expandFields.length ? expandFields : defaultRelations, + skip: offset, + take: limit, + order: orderBy, + } +}