@medusajs/medusa 1.2.2-dev.47 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +48 -0
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/index.js.map +1 -1
- package/dist/api/middlewares/error-handler.js +1 -1
- package/dist/api/routes/admin/auth/create-session.js +5 -5
- package/dist/api/routes/admin/auth/create-session.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/get-customer-group-customers.d.ts +20 -0
- package/dist/api/routes/admin/customer-groups/get-customer-group-customers.js +76 -0
- package/dist/api/routes/admin/customer-groups/get-customer-group-customers.js.map +1 -0
- package/dist/api/routes/admin/customer-groups/index.js +1 -0
- package/dist/api/routes/admin/customer-groups/index.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/list-customer-groups.js +2 -2
- package/dist/api/routes/admin/customer-groups/list-customer-groups.js.map +1 -1
- package/dist/api/routes/admin/customers/index.js +1 -1
- package/dist/api/routes/admin/customers/index.js.map +1 -1
- package/dist/api/routes/admin/customers/list-customers.js +1 -0
- package/dist/api/routes/admin/customers/list-customers.js.map +1 -1
- package/dist/api/routes/admin/discounts/create-discount.d.ts +11 -2
- package/dist/api/routes/admin/discounts/create-discount.js +66 -12
- package/dist/api/routes/admin/discounts/create-discount.js.map +1 -1
- package/dist/api/routes/admin/discounts/create-dynamic-code.d.ts +1 -0
- package/dist/api/routes/admin/discounts/create-dynamic-code.js +4 -1
- package/dist/api/routes/admin/discounts/create-dynamic-code.js.map +1 -1
- package/dist/api/routes/admin/discounts/delete-dynamic-code.js +3 -1
- package/dist/api/routes/admin/discounts/delete-dynamic-code.js.map +1 -1
- package/dist/api/routes/admin/discounts/get-discount.d.ts +7 -0
- package/dist/api/routes/admin/discounts/get-discount.js +43 -9
- package/dist/api/routes/admin/discounts/get-discount.js.map +1 -1
- package/dist/api/routes/admin/discounts/index.d.ts +1 -3
- package/dist/api/routes/admin/discounts/index.js +1 -6
- package/dist/api/routes/admin/discounts/index.js.map +1 -1
- package/dist/api/routes/admin/discounts/list-discounts.d.ts +2 -6
- package/dist/api/routes/admin/discounts/list-discounts.js +15 -28
- package/dist/api/routes/admin/discounts/list-discounts.js.map +1 -1
- package/dist/api/routes/admin/discounts/update-discount.d.ts +12 -2
- package/dist/api/routes/admin/discounts/update-discount.js +70 -15
- package/dist/api/routes/admin/discounts/update-discount.js.map +1 -1
- package/dist/api/routes/admin/draft-orders/create-draft-order.d.ts +3 -3
- package/dist/api/routes/admin/draft-orders/create-draft-order.js.map +1 -1
- package/dist/api/routes/admin/draft-orders/create-line-item.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/create-line-item.js.map +1 -1
- package/dist/api/routes/admin/draft-orders/index.js +7 -1
- package/dist/api/routes/admin/draft-orders/index.js.map +1 -1
- package/dist/api/routes/admin/draft-orders/register-payment.js +0 -1
- package/dist/api/routes/admin/draft-orders/register-payment.js.map +1 -1
- package/dist/api/routes/admin/draft-orders/update-line-item.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/update-line-item.js.map +1 -1
- package/dist/api/routes/admin/index.js +21 -19
- package/dist/api/routes/admin/index.js.map +1 -1
- package/dist/api/routes/admin/notifications/index.js.map +1 -1
- package/dist/api/routes/admin/notifications/list-notifications.js.map +1 -1
- package/dist/api/routes/admin/notifications/resend-notification.js.map +1 -1
- package/dist/api/routes/admin/orders/add-shipping-method.d.ts +1 -1
- package/dist/api/routes/admin/orders/add-shipping-method.js.map +1 -1
- package/dist/api/routes/admin/orders/create-order.js.map +1 -1
- package/dist/api/routes/admin/orders/create-swap.js +7 -3
- package/dist/api/routes/admin/orders/create-swap.js.map +1 -1
- package/dist/api/routes/admin/orders/index.d.ts +1 -1
- package/dist/api/routes/admin/orders/index.js +1 -3
- package/dist/api/routes/admin/orders/index.js.map +1 -1
- package/dist/api/routes/admin/orders/list-orders.js.map +1 -1
- package/dist/api/routes/admin/orders/update-order.js.map +1 -1
- package/dist/api/routes/admin/price-lists/add-prices-batch.d.ts +70 -0
- package/dist/api/routes/admin/{orders/receive-swap.js → price-lists/add-prices-batch.js} +77 -78
- package/dist/api/routes/admin/price-lists/add-prices-batch.js.map +1 -0
- package/dist/api/routes/admin/price-lists/create-price-list.d.ts +87 -0
- package/dist/api/routes/admin/price-lists/create-price-list.js +193 -0
- package/dist/api/routes/admin/price-lists/create-price-list.js.map +1 -0
- package/dist/api/routes/admin/price-lists/delete-price-list.d.ts +28 -0
- package/dist/api/routes/admin/{discounts/remove-valid-product.js → price-lists/delete-price-list.js} +27 -25
- package/dist/api/routes/admin/price-lists/delete-price-list.js.map +1 -0
- package/dist/api/routes/admin/price-lists/delete-prices-batch.d.ts +43 -0
- package/dist/api/routes/{store/carts/update-payment-method.js → admin/price-lists/delete-prices-batch.js} +42 -46
- package/dist/api/routes/admin/price-lists/delete-prices-batch.js.map +1 -0
- package/dist/api/routes/admin/price-lists/get-price-list.d.ts +22 -0
- package/dist/api/routes/admin/{discounts/add-valid-product.js → price-lists/get-price-list.js} +20 -24
- package/dist/api/routes/admin/price-lists/get-price-list.js.map +1 -0
- package/dist/api/routes/admin/price-lists/index.d.ts +28 -0
- package/dist/api/routes/admin/price-lists/index.js +55 -0
- package/dist/api/routes/admin/price-lists/index.js.map +1 -0
- package/dist/api/routes/admin/price-lists/list-price-list-products.d.ts +74 -0
- package/dist/api/routes/admin/price-lists/list-price-list-products.js +246 -0
- package/dist/api/routes/admin/price-lists/list-price-list-products.js.map +1 -0
- package/dist/api/routes/admin/price-lists/list-price-lists.d.ts +38 -0
- package/dist/api/routes/admin/price-lists/list-price-lists.js +197 -0
- package/dist/api/routes/admin/price-lists/list-price-lists.js.map +1 -0
- package/dist/api/routes/admin/price-lists/update-price-list.d.ts +92 -0
- package/dist/api/routes/admin/price-lists/update-price-list.js +211 -0
- package/dist/api/routes/admin/price-lists/update-price-list.js.map +1 -0
- package/dist/api/routes/admin/products/create-product.d.ts +2 -7
- package/dist/api/routes/admin/products/create-product.js +2 -24
- package/dist/api/routes/admin/products/create-product.js.map +1 -1
- package/dist/api/routes/admin/products/create-variant.d.ts +7 -9
- package/dist/api/routes/admin/products/create-variant.js +7 -26
- package/dist/api/routes/admin/products/create-variant.js.map +1 -1
- package/dist/api/routes/admin/products/index.d.ts +1 -1
- package/dist/api/routes/admin/products/index.js +7 -1
- package/dist/api/routes/admin/products/index.js.map +1 -1
- package/dist/api/routes/admin/products/list-products.d.ts +2 -1
- package/dist/api/routes/admin/products/list-products.js +31 -65
- package/dist/api/routes/admin/products/list-products.js.map +1 -1
- package/dist/api/routes/admin/products/update-product.d.ts +2 -7
- package/dist/api/routes/admin/products/update-product.js +2 -24
- package/dist/api/routes/admin/products/update-product.js.map +1 -1
- package/dist/api/routes/admin/products/update-variant.d.ts +10 -9
- package/dist/api/routes/admin/products/update-variant.js +21 -33
- package/dist/api/routes/admin/products/update-variant.js.map +1 -1
- package/dist/api/routes/admin/regions/index.d.ts +1 -1
- package/dist/api/routes/admin/store/get-store.js.map +1 -1
- package/dist/api/routes/admin/swaps/index.js +3 -0
- package/dist/api/routes/admin/swaps/index.js.map +1 -1
- package/dist/api/routes/admin/tax-rates/list-tax-rates.js.map +1 -1
- package/dist/api/routes/admin/tax-rates/utils/get-query-config.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/utils/get-query-config.js +4 -2
- package/dist/api/routes/admin/tax-rates/utils/get-query-config.js.map +1 -1
- package/dist/api/routes/admin/uploads/index.d.ts +1 -1
- package/dist/api/routes/store/auth/create-session.js +4 -5
- package/dist/api/routes/store/auth/create-session.js.map +1 -1
- package/dist/api/routes/store/carts/create-cart.js +8 -5
- package/dist/api/routes/store/carts/create-cart.js.map +1 -1
- package/dist/api/routes/store/carts/create-line-item.d.ts +1 -1
- package/dist/api/routes/store/carts/create-line-item.js +9 -6
- package/dist/api/routes/store/carts/create-line-item.js.map +1 -1
- package/dist/api/routes/store/carts/index.d.ts +0 -1
- package/dist/api/routes/store/carts/index.js +1 -3
- package/dist/api/routes/store/carts/index.js.map +1 -1
- package/dist/api/routes/store/carts/update-cart.js +7 -7
- package/dist/api/routes/store/carts/update-cart.js.map +1 -1
- package/dist/api/routes/store/collections/list-collections.d.ts +3 -0
- package/dist/api/routes/store/collections/list-collections.js +33 -16
- package/dist/api/routes/store/collections/list-collections.js.map +1 -1
- package/dist/api/routes/store/customers/create-customer.js +3 -4
- package/dist/api/routes/store/customers/create-customer.js.map +1 -1
- package/dist/api/routes/store/orders/index.js +0 -2
- package/dist/api/routes/store/orders/index.js.map +1 -1
- package/dist/api/routes/store/products/get-product.js +17 -5
- package/dist/api/routes/store/products/get-product.js.map +1 -1
- package/dist/api/routes/store/products/index.d.ts +2 -2
- package/dist/api/routes/store/products/list-products.d.ts +5 -3
- package/dist/api/routes/store/products/list-products.js +60 -18
- package/dist/api/routes/store/products/list-products.js.map +1 -1
- package/dist/api/routes/store/products/search.d.ts +1 -1
- package/dist/api/routes/store/products/search.js.map +1 -1
- package/dist/api/routes/store/regions/list-regions.d.ts +3 -0
- package/dist/api/routes/store/regions/list-regions.js +22 -7
- package/dist/api/routes/store/regions/list-regions.js.map +1 -1
- package/dist/api/routes/store/shipping-options/list-options.js.map +1 -1
- package/dist/api/routes/store/swaps/create-swap.js +7 -3
- package/dist/api/routes/store/swaps/create-swap.js.map +1 -1
- package/dist/api/routes/store/variants/get-variant.js +17 -5
- package/dist/api/routes/store/variants/get-variant.js.map +1 -1
- package/dist/api/routes/store/variants/list-variants.d.ts +6 -1
- package/dist/api/routes/store/variants/list-variants.js +63 -10
- package/dist/api/routes/store/variants/list-variants.js.map +1 -1
- package/dist/commands/develop.js +1 -1
- package/dist/commands/develop.js.map +1 -1
- package/dist/controllers/customers/index.d.ts +1 -1
- package/dist/controllers/customers/list-customers.d.ts +1 -1
- package/dist/controllers/customers/list-customers.js +34 -37
- package/dist/controllers/customers/list-customers.js.map +1 -1
- package/dist/controllers/products/admin-list-products.d.ts +16 -0
- package/dist/controllers/products/admin-list-products.js +103 -0
- package/dist/controllers/products/admin-list-products.js.map +1 -0
- package/dist/helpers/test-request.js +15 -7
- package/dist/helpers/test-request.js.map +1 -1
- package/dist/index.d.ts +3 -58
- package/dist/index.js +3 -61
- package/dist/index.js.map +1 -1
- package/dist/interfaces/base-service.d.ts +66 -0
- package/dist/interfaces/base-service.js +378 -0
- package/dist/interfaces/base-service.js.map +1 -0
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/price-selection-strategy.d.ts +50 -0
- package/dist/interfaces/price-selection-strategy.js +34 -0
- package/dist/interfaces/price-selection-strategy.js.map +1 -0
- package/dist/interfaces/tax-service.d.ts +6 -0
- package/dist/interfaces/tax-service.js +31 -0
- package/dist/interfaces/tax-service.js.map +1 -1
- package/dist/loaders/api.d.ts +9 -5
- package/dist/loaders/api.js +2 -6
- package/dist/loaders/api.js.map +1 -1
- package/dist/loaders/config.d.ts +3 -0
- package/dist/loaders/config.js +47 -0
- package/dist/loaders/config.js.map +1 -0
- package/dist/loaders/database.d.ts +8 -4
- package/dist/loaders/database.js.map +1 -1
- package/dist/loaders/defaults.d.ts +4 -3
- package/dist/loaders/defaults.js +39 -31
- package/dist/loaders/defaults.js.map +1 -1
- package/dist/loaders/express.d.ts +7 -4
- package/dist/loaders/express.js +7 -5
- package/dist/loaders/express.js.map +1 -1
- package/dist/loaders/index.d.ts +13 -8
- package/dist/loaders/index.js +29 -54
- package/dist/loaders/index.js.map +1 -1
- package/dist/loaders/logger.d.ts +1 -0
- package/dist/loaders/logger.js.map +1 -1
- package/dist/loaders/models.d.ts +8 -3
- package/dist/loaders/models.js +19 -17
- package/dist/loaders/models.js.map +1 -1
- package/dist/loaders/passport.d.ts +7 -4
- package/dist/loaders/passport.js +23 -21
- package/dist/loaders/passport.js.map +1 -1
- package/dist/loaders/plugins.d.ts +18 -10
- package/dist/loaders/plugins.js +27 -24
- package/dist/loaders/plugins.js.map +1 -1
- package/dist/loaders/redis.d.ts +8 -5
- package/dist/loaders/redis.js +3 -3
- package/dist/loaders/redis.js.map +1 -1
- package/dist/loaders/repositories.d.ts +7 -3
- package/dist/loaders/repositories.js +1 -1
- package/dist/loaders/repositories.js.map +1 -1
- package/dist/loaders/search-index.d.ts +4 -3
- package/dist/loaders/search-index.js.map +1 -1
- package/dist/loaders/services.d.ts +10 -5
- package/dist/loaders/services.js.map +1 -1
- package/dist/loaders/strategies.d.ts +1 -1
- package/dist/loaders/subscribers.d.ts +7 -3
- package/dist/loaders/subscribers.js.map +1 -1
- package/dist/migrations/1646324713514-discount_conditions.d.ts +6 -0
- package/dist/migrations/1646324713514-discount_conditions.js +335 -0
- package/dist/migrations/1646324713514-discount_conditions.js.map +1 -0
- package/dist/migrations/1646915480108-update_money_amount_add_price_list.d.ts +6 -0
- package/dist/migrations/1646915480108-update_money_amount_add_price_list.js +143 -0
- package/dist/migrations/1646915480108-update_money_amount_add_price_list.js.map +1 -0
- package/dist/migrations/1648600574750-add_line_item_adjustments.d.ts +6 -0
- package/dist/migrations/1648600574750-add_line_item_adjustments.js +101 -0
- package/dist/migrations/1648600574750-add_line_item_adjustments.js.map +1 -0
- package/dist/migrations/1648641130007-tax_line_constraints.d.ts +6 -0
- package/dist/migrations/1648641130007-tax_line_constraints.js +77 -0
- package/dist/migrations/1648641130007-tax_line_constraints.js.map +1 -0
- package/dist/migrations/1649775522087-add_batch_job_model.d.ts +6 -0
- package/dist/migrations/1649775522087-add_batch_job_model.js +77 -0
- package/dist/migrations/1649775522087-add_batch_job_model.js.map +1 -0
- package/dist/models/batch-job.d.ts +58 -0
- package/dist/models/batch-job.js +119 -0
- package/dist/models/batch-job.js.map +1 -0
- package/dist/models/country.d.ts +1 -1
- package/dist/models/country.js +1 -1
- package/dist/models/country.js.map +1 -1
- package/dist/models/customer-group.d.ts +3 -1
- package/dist/models/customer-group.js +9 -13
- package/dist/models/customer-group.js.map +1 -1
- package/dist/models/discount-condition-customer-group.d.ts +39 -0
- package/dist/models/discount-condition-customer-group.js +84 -0
- package/dist/models/discount-condition-customer-group.js.map +1 -0
- package/dist/models/discount-condition-product-collection.d.ts +39 -0
- package/dist/models/discount-condition-product-collection.js +84 -0
- package/dist/models/discount-condition-product-collection.js.map +1 -0
- package/dist/models/discount-condition-product-tag.d.ts +39 -0
- package/dist/models/discount-condition-product-tag.js +84 -0
- package/dist/models/discount-condition-product-tag.js.map +1 -0
- package/dist/models/discount-condition-product-type.d.ts +39 -0
- package/dist/models/discount-condition-product-type.js +84 -0
- package/dist/models/discount-condition-product-type.js.map +1 -0
- package/dist/models/discount-condition-product.d.ts +39 -0
- package/dist/models/discount-condition-product.js +84 -0
- package/dist/models/discount-condition-product.js.map +1 -0
- package/dist/models/discount-condition.d.ts +68 -0
- package/dist/models/discount-condition.js +208 -0
- package/dist/models/discount-condition.js.map +1 -0
- package/dist/models/discount-rule.d.ts +5 -5
- package/dist/models/discount-rule.js +6 -17
- package/dist/models/discount-rule.js.map +1 -1
- package/dist/models/discount.js.map +1 -1
- package/dist/models/index.d.ts +66 -0
- package/dist/models/index.js +79 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/line-item-adjustment.d.ts +13 -0
- package/dist/models/line-item-adjustment.js +79 -0
- package/dist/models/line-item-adjustment.js.map +1 -0
- package/dist/models/line-item-tax-line.js +2 -1
- package/dist/models/line-item-tax-line.js.map +1 -1
- package/dist/models/line-item.d.ts +2 -0
- package/dist/models/line-item.js +5 -0
- package/dist/models/line-item.js.map +1 -1
- package/dist/models/money-amount.d.ts +10 -3
- package/dist/models/money-amount.js +25 -5
- package/dist/models/money-amount.js.map +1 -1
- package/dist/models/price-list.d.ts +57 -0
- package/dist/models/price-list.js +146 -0
- package/dist/models/price-list.js.map +1 -0
- package/dist/models/product-variant.js +9 -3
- package/dist/models/product-variant.js.map +1 -1
- package/dist/models/shipping-method-tax-line.js +2 -1
- package/dist/models/shipping-method-tax-line.js.map +1 -1
- package/dist/models/swap.d.ts +4 -4
- package/dist/models/swap.js +23 -23
- package/dist/models/swap.js.map +1 -1
- package/dist/repositories/cart.d.ts +2 -2
- package/dist/repositories/cart.js.map +1 -1
- package/dist/repositories/customer.d.ts +1 -0
- package/dist/repositories/customer.js +63 -0
- package/dist/repositories/customer.js.map +1 -1
- package/dist/repositories/discount-condition.d.ts +34 -0
- package/dist/repositories/discount-condition.js +384 -0
- package/dist/repositories/discount-condition.js.map +1 -0
- package/dist/repositories/line-item-adjustment.d.ts +4 -0
- package/dist/repositories/line-item-adjustment.js +38 -0
- package/dist/repositories/line-item-adjustment.js.map +1 -0
- package/dist/repositories/line-item-tax-line.d.ts +2 -0
- package/dist/repositories/line-item-tax-line.js +80 -0
- package/dist/repositories/line-item-tax-line.js.map +1 -1
- package/dist/repositories/line-item.js +1 -0
- package/dist/repositories/line-item.js.map +1 -1
- package/dist/repositories/money-amount.d.ts +7 -2
- package/dist/repositories/money-amount.js +149 -2
- package/dist/repositories/money-amount.js.map +1 -1
- package/dist/repositories/price-list.d.ts +4 -0
- package/dist/repositories/price-list.js +38 -0
- package/dist/repositories/price-list.js.map +1 -0
- package/dist/repositories/product.d.ts +3 -0
- package/dist/repositories/product.js +41 -19
- package/dist/repositories/product.js.map +1 -1
- package/dist/repositories/shipping-method-tax-line.d.ts +2 -0
- package/dist/repositories/shipping-method-tax-line.js +80 -0
- package/dist/repositories/shipping-method-tax-line.js.map +1 -1
- package/dist/scripts/discount-rule-migration.d.ts +4 -0
- package/dist/scripts/discount-rule-migration.js +177 -0
- package/dist/scripts/discount-rule-migration.js.map +1 -0
- package/dist/scripts/line-item-adjustment-migration.d.ts +4 -0
- package/dist/scripts/line-item-adjustment-migration.js +173 -0
- package/dist/scripts/line-item-adjustment-migration.js.map +1 -0
- package/dist/services/cart.d.ts +58 -47
- package/dist/services/cart.js +1306 -1391
- package/dist/services/cart.js.map +1 -1
- package/dist/services/customer.js +18 -18
- package/dist/services/customer.js.map +1 -1
- package/dist/services/discount.d.ts +50 -58
- package/dist/services/discount.js +365 -154
- package/dist/services/discount.js.map +1 -1
- package/dist/services/draft-order.js +1 -0
- package/dist/services/draft-order.js.map +1 -1
- package/dist/services/fulfillment-provider.js +23 -17
- package/dist/services/fulfillment-provider.js.map +1 -1
- package/dist/services/invite.d.ts +4 -2
- package/dist/services/invite.js +11 -9
- package/dist/services/invite.js.map +1 -1
- package/dist/services/line-item-adjustment.d.ts +87 -0
- package/dist/services/line-item-adjustment.js +436 -0
- package/dist/services/line-item-adjustment.js.map +1 -0
- package/dist/services/line-item.d.ts +48 -40
- package/dist/services/line-item.js +226 -193
- package/dist/services/line-item.js.map +1 -1
- package/dist/services/order.js +4 -4
- package/dist/services/order.js.map +1 -1
- package/dist/services/payment-provider.js +23 -17
- package/dist/services/payment-provider.js.map +1 -1
- package/dist/services/price-list.d.ts +86 -0
- package/dist/services/price-list.js +469 -0
- package/dist/services/price-list.js.map +1 -0
- package/dist/services/product-variant.d.ts +40 -16
- package/dist/services/product-variant.js +259 -109
- package/dist/services/product-variant.js.map +1 -1
- package/dist/services/product.d.ts +22 -4
- package/dist/services/product.js +239 -49
- package/dist/services/product.js.map +1 -1
- package/dist/services/region.js +8 -4
- package/dist/services/region.js.map +1 -1
- package/dist/services/return.js +0 -1
- package/dist/services/return.js.map +1 -1
- package/dist/services/shipping-option.d.ts +2 -2
- package/dist/services/shipping-option.js +7 -4
- package/dist/services/shipping-option.js.map +1 -1
- package/dist/services/swap.d.ts +4 -1
- package/dist/services/swap.js +29 -16
- package/dist/services/swap.js.map +1 -1
- package/dist/services/system-tax.d.ts +2 -3
- package/dist/services/system-tax.js +2 -2
- package/dist/services/system-tax.js.map +1 -1
- package/dist/services/tax-provider.d.ts +2 -0
- package/dist/services/tax-provider.js +96 -7
- package/dist/services/tax-provider.js.map +1 -1
- package/dist/services/tax-rate.d.ts +3 -3
- package/dist/services/tax-rate.js +1 -1
- package/dist/services/tax-rate.js.map +1 -1
- package/dist/services/totals.d.ts +9 -8
- package/dist/services/totals.js +41 -88
- package/dist/services/totals.js.map +1 -1
- package/dist/strategies/price-selection.d.ts +13 -0
- package/dist/strategies/price-selection.js +185 -0
- package/dist/strategies/price-selection.js.map +1 -0
- package/dist/subscribers/order.js +1 -7
- package/dist/subscribers/order.js.map +1 -1
- package/dist/types/batch-job.d.ts +6 -0
- package/dist/types/batch-job.js +11 -0
- package/dist/types/batch-job.js.map +1 -0
- package/dist/types/common.d.ts +1 -3
- package/dist/types/customers.d.ts +1 -0
- package/dist/types/customers.js +5 -0
- package/dist/types/customers.js.map +1 -1
- package/dist/types/discount.d.ts +69 -1
- package/dist/types/discount.js +129 -5
- package/dist/types/discount.js.map +1 -1
- package/dist/types/global.d.ts +34 -0
- package/dist/types/global.js +3 -0
- package/dist/types/global.js.map +1 -0
- package/dist/types/line-item-adjustment.d.ts +9 -0
- package/dist/types/line-item-adjustment.js +50 -0
- package/dist/types/line-item-adjustment.js.map +1 -0
- package/dist/types/price-list.d.ts +70 -0
- package/dist/types/price-list.js +152 -0
- package/dist/types/price-list.js.map +1 -0
- package/dist/types/price-selection.d.ts +5 -0
- package/dist/types/price-selection.js +35 -0
- package/dist/types/price-selection.js.map +1 -0
- package/dist/types/product-variant.d.ts +26 -3
- package/dist/types/product-variant.js +69 -5
- package/dist/types/product-variant.js.map +1 -1
- package/dist/types/product.d.ts +16 -0
- package/dist/types/product.js +86 -1
- package/dist/types/product.js.map +1 -1
- package/dist/types/validators/exactly-one.d.ts +6 -0
- package/dist/types/validators/exactly-one.js +37 -0
- package/dist/types/validators/exactly-one.js.map +1 -0
- package/dist/utils/date-helpers.d.ts +2 -0
- package/dist/utils/date-helpers.js +15 -0
- package/dist/utils/date-helpers.js.map +1 -0
- package/dist/utils/get-query-config.d.ts +11 -0
- package/dist/utils/get-query-config.js +88 -0
- package/dist/utils/get-query-config.js.map +1 -0
- package/package.json +7 -8
- package/dist/api/routes/admin/discounts/add-valid-product.d.ts +0 -23
- package/dist/api/routes/admin/discounts/add-valid-product.js.map +0 -1
- package/dist/api/routes/admin/discounts/remove-valid-product.d.ts +0 -23
- package/dist/api/routes/admin/discounts/remove-valid-product.js.map +0 -1
- package/dist/api/routes/admin/orders/receive-swap.d.ts +0 -46
- package/dist/api/routes/admin/orders/receive-swap.js.map +0 -1
- package/dist/api/routes/store/carts/update-payment-method.d.ts +0 -38
- package/dist/api/routes/store/carts/update-payment-method.js.map +0 -1
- package/dist/config/index.d.ts +0 -14
- package/dist/config/index.js +0 -40
- package/dist/config/index.js.map +0 -1
- package/dist/controllers/list-customers.d.ts +0 -0
- package/dist/controllers/list-customers.js +0 -1
- package/dist/controllers/list-customers.js.map +0 -1
- package/yarn-error.log +0 -6769
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { AdminPriceListPricesCreateReq, PriceListStatus, PriceListType } from "../../../../types/price-list";
|
|
2
|
+
declare const _default: (req: any, res: any) => Promise<void>;
|
|
3
|
+
/**
|
|
4
|
+
* @oas [post] /price_lists
|
|
5
|
+
* operationId: "PostPriceListsPriceList"
|
|
6
|
+
* summary: "Creates a Price List"
|
|
7
|
+
* description: "Creates a Price List"
|
|
8
|
+
* x-authenticated: true
|
|
9
|
+
* requestBody:
|
|
10
|
+
* content:
|
|
11
|
+
* application/json:
|
|
12
|
+
* schema:
|
|
13
|
+
* properties:
|
|
14
|
+
* name:
|
|
15
|
+
* description: "The name of the Price List"
|
|
16
|
+
* type: string
|
|
17
|
+
* description:
|
|
18
|
+
* description: "A description of the Price List."
|
|
19
|
+
* type: string
|
|
20
|
+
* type:
|
|
21
|
+
* description: The type of the Price List.
|
|
22
|
+
* type: string
|
|
23
|
+
* enum:
|
|
24
|
+
* - sale
|
|
25
|
+
* - override
|
|
26
|
+
* status:
|
|
27
|
+
* description: The status of the Price List.
|
|
28
|
+
* type: string
|
|
29
|
+
* enum:
|
|
30
|
+
* - active
|
|
31
|
+
* - draft
|
|
32
|
+
* prices:
|
|
33
|
+
* description: The prices of the Price List.
|
|
34
|
+
* type: array
|
|
35
|
+
* items:
|
|
36
|
+
* properties:
|
|
37
|
+
* region_id:
|
|
38
|
+
* description: The id of the Region for which the price is used.
|
|
39
|
+
* type: string
|
|
40
|
+
* currency_code:
|
|
41
|
+
* description: The 3 character ISO currency code for which the price will be used.
|
|
42
|
+
* type: string
|
|
43
|
+
* amount:
|
|
44
|
+
* description: The amount to charge for the Product Variant.
|
|
45
|
+
* type: integer
|
|
46
|
+
* min_quantity:
|
|
47
|
+
* description: The minimum quantity for which the price will be used.
|
|
48
|
+
* type: integer
|
|
49
|
+
* max_quantity:
|
|
50
|
+
* description: The maximum quantity for which the price will be used.
|
|
51
|
+
* type: integer
|
|
52
|
+
* customer_groups:
|
|
53
|
+
* type: array
|
|
54
|
+
* description: A list of customer groups that the Price List applies to.
|
|
55
|
+
* items:
|
|
56
|
+
* required:
|
|
57
|
+
* - id
|
|
58
|
+
* properties:
|
|
59
|
+
* id:
|
|
60
|
+
* description: The id of a customer group
|
|
61
|
+
* type: string
|
|
62
|
+
* tags:
|
|
63
|
+
* - Price List
|
|
64
|
+
* responses:
|
|
65
|
+
* 200:
|
|
66
|
+
* description: OK
|
|
67
|
+
* content:
|
|
68
|
+
* application/json:
|
|
69
|
+
* schema:
|
|
70
|
+
* properties:
|
|
71
|
+
* product:
|
|
72
|
+
* $ref: "#/components/schemas/price_list"
|
|
73
|
+
*/
|
|
74
|
+
export default _default;
|
|
75
|
+
declare class CustomerGroup {
|
|
76
|
+
id: string;
|
|
77
|
+
}
|
|
78
|
+
export declare class AdminPostPriceListsPriceListReq {
|
|
79
|
+
name: string;
|
|
80
|
+
description: string;
|
|
81
|
+
starts_at?: Date;
|
|
82
|
+
ends_at?: Date;
|
|
83
|
+
status?: PriceListStatus;
|
|
84
|
+
type: PriceListType;
|
|
85
|
+
prices: AdminPriceListPricesCreateReq[];
|
|
86
|
+
customer_groups?: CustomerGroup[];
|
|
87
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
12
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
13
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
14
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
15
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
16
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
21
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
22
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
23
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
24
|
+
function step(op) {
|
|
25
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
26
|
+
while (_) try {
|
|
27
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
28
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
29
|
+
switch (op[0]) {
|
|
30
|
+
case 0: case 1: t = op; break;
|
|
31
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
32
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
33
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
34
|
+
default:
|
|
35
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
36
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
37
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
38
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
39
|
+
if (t[2]) _.ops.pop();
|
|
40
|
+
_.trys.pop(); continue;
|
|
41
|
+
}
|
|
42
|
+
op = body.call(thisArg, _);
|
|
43
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
44
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.AdminPostPriceListsPriceListReq = void 0;
|
|
49
|
+
var class_transformer_1 = require("class-transformer");
|
|
50
|
+
var class_validator_1 = require("class-validator");
|
|
51
|
+
var price_list_1 = require("../../../../types/price-list");
|
|
52
|
+
var validator_1 = require("../../../../utils/validator");
|
|
53
|
+
/**
|
|
54
|
+
* @oas [post] /price_lists
|
|
55
|
+
* operationId: "PostPriceListsPriceList"
|
|
56
|
+
* summary: "Creates a Price List"
|
|
57
|
+
* description: "Creates a Price List"
|
|
58
|
+
* x-authenticated: true
|
|
59
|
+
* requestBody:
|
|
60
|
+
* content:
|
|
61
|
+
* application/json:
|
|
62
|
+
* schema:
|
|
63
|
+
* properties:
|
|
64
|
+
* name:
|
|
65
|
+
* description: "The name of the Price List"
|
|
66
|
+
* type: string
|
|
67
|
+
* description:
|
|
68
|
+
* description: "A description of the Price List."
|
|
69
|
+
* type: string
|
|
70
|
+
* type:
|
|
71
|
+
* description: The type of the Price List.
|
|
72
|
+
* type: string
|
|
73
|
+
* enum:
|
|
74
|
+
* - sale
|
|
75
|
+
* - override
|
|
76
|
+
* status:
|
|
77
|
+
* description: The status of the Price List.
|
|
78
|
+
* type: string
|
|
79
|
+
* enum:
|
|
80
|
+
* - active
|
|
81
|
+
* - draft
|
|
82
|
+
* prices:
|
|
83
|
+
* description: The prices of the Price List.
|
|
84
|
+
* type: array
|
|
85
|
+
* items:
|
|
86
|
+
* properties:
|
|
87
|
+
* region_id:
|
|
88
|
+
* description: The id of the Region for which the price is used.
|
|
89
|
+
* type: string
|
|
90
|
+
* currency_code:
|
|
91
|
+
* description: The 3 character ISO currency code for which the price will be used.
|
|
92
|
+
* type: string
|
|
93
|
+
* amount:
|
|
94
|
+
* description: The amount to charge for the Product Variant.
|
|
95
|
+
* type: integer
|
|
96
|
+
* min_quantity:
|
|
97
|
+
* description: The minimum quantity for which the price will be used.
|
|
98
|
+
* type: integer
|
|
99
|
+
* max_quantity:
|
|
100
|
+
* description: The maximum quantity for which the price will be used.
|
|
101
|
+
* type: integer
|
|
102
|
+
* customer_groups:
|
|
103
|
+
* type: array
|
|
104
|
+
* description: A list of customer groups that the Price List applies to.
|
|
105
|
+
* items:
|
|
106
|
+
* required:
|
|
107
|
+
* - id
|
|
108
|
+
* properties:
|
|
109
|
+
* id:
|
|
110
|
+
* description: The id of a customer group
|
|
111
|
+
* type: string
|
|
112
|
+
* tags:
|
|
113
|
+
* - Price List
|
|
114
|
+
* responses:
|
|
115
|
+
* 200:
|
|
116
|
+
* description: OK
|
|
117
|
+
* content:
|
|
118
|
+
* application/json:
|
|
119
|
+
* schema:
|
|
120
|
+
* properties:
|
|
121
|
+
* product:
|
|
122
|
+
* $ref: "#/components/schemas/price_list"
|
|
123
|
+
*/
|
|
124
|
+
exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
|
|
125
|
+
var validated, priceListService, priceList;
|
|
126
|
+
return __generator(this, function (_a) {
|
|
127
|
+
switch (_a.label) {
|
|
128
|
+
case 0: return [4 /*yield*/, (0, validator_1.validator)(AdminPostPriceListsPriceListReq, req.body)];
|
|
129
|
+
case 1:
|
|
130
|
+
validated = _a.sent();
|
|
131
|
+
priceListService = req.scope.resolve("priceListService");
|
|
132
|
+
return [4 /*yield*/, priceListService.create(validated)];
|
|
133
|
+
case 2:
|
|
134
|
+
priceList = _a.sent();
|
|
135
|
+
res.json({ price_list: priceList });
|
|
136
|
+
return [2 /*return*/];
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}); });
|
|
140
|
+
var CustomerGroup = /** @class */ (function () {
|
|
141
|
+
function CustomerGroup() {
|
|
142
|
+
}
|
|
143
|
+
__decorate([
|
|
144
|
+
(0, class_validator_1.IsString)(),
|
|
145
|
+
__metadata("design:type", String)
|
|
146
|
+
], CustomerGroup.prototype, "id", void 0);
|
|
147
|
+
return CustomerGroup;
|
|
148
|
+
}());
|
|
149
|
+
var AdminPostPriceListsPriceListReq = /** @class */ (function () {
|
|
150
|
+
function AdminPostPriceListsPriceListReq() {
|
|
151
|
+
}
|
|
152
|
+
__decorate([
|
|
153
|
+
(0, class_validator_1.IsString)(),
|
|
154
|
+
__metadata("design:type", String)
|
|
155
|
+
], AdminPostPriceListsPriceListReq.prototype, "name", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
(0, class_validator_1.IsString)(),
|
|
158
|
+
__metadata("design:type", String)
|
|
159
|
+
], AdminPostPriceListsPriceListReq.prototype, "description", void 0);
|
|
160
|
+
__decorate([
|
|
161
|
+
(0, class_validator_1.IsOptional)(),
|
|
162
|
+
__metadata("design:type", Date)
|
|
163
|
+
], AdminPostPriceListsPriceListReq.prototype, "starts_at", void 0);
|
|
164
|
+
__decorate([
|
|
165
|
+
(0, class_validator_1.IsOptional)(),
|
|
166
|
+
__metadata("design:type", Date)
|
|
167
|
+
], AdminPostPriceListsPriceListReq.prototype, "ends_at", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
(0, class_validator_1.IsOptional)(),
|
|
170
|
+
(0, class_validator_1.IsEnum)(price_list_1.PriceListStatus),
|
|
171
|
+
__metadata("design:type", String)
|
|
172
|
+
], AdminPostPriceListsPriceListReq.prototype, "status", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
(0, class_validator_1.IsEnum)(price_list_1.PriceListType),
|
|
175
|
+
__metadata("design:type", String)
|
|
176
|
+
], AdminPostPriceListsPriceListReq.prototype, "type", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
(0, class_validator_1.IsArray)(),
|
|
179
|
+
(0, class_transformer_1.Type)(function () { return price_list_1.AdminPriceListPricesCreateReq; }),
|
|
180
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
181
|
+
__metadata("design:type", Array)
|
|
182
|
+
], AdminPostPriceListsPriceListReq.prototype, "prices", void 0);
|
|
183
|
+
__decorate([
|
|
184
|
+
(0, class_validator_1.IsOptional)(),
|
|
185
|
+
(0, class_validator_1.IsArray)(),
|
|
186
|
+
(0, class_transformer_1.Type)(function () { return CustomerGroup; }),
|
|
187
|
+
(0, class_validator_1.ValidateNested)({ each: true }),
|
|
188
|
+
__metadata("design:type", Array)
|
|
189
|
+
], AdminPostPriceListsPriceListReq.prototype, "customer_groups", void 0);
|
|
190
|
+
return AdminPostPriceListsPriceListReq;
|
|
191
|
+
}());
|
|
192
|
+
exports.AdminPostPriceListsPriceListReq = AdminPostPriceListsPriceListReq;
|
|
193
|
+
//# sourceMappingURL=create-price-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-price-list.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/price-lists/create-price-list.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAwC;AACxC,mDAMwB;AAExB,2DAIqC;AACrC,yDAAuD;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;oBACV,qBAAM,IAAA,qBAAS,EAAC,+BAA+B,EAAE,GAAG,CAAC,IAAI,CAAC,EAAA;;gBAAtE,SAAS,GAAG,SAA0D;gBAEtE,gBAAgB,GACpB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;gBAErB,qBAAM,gBAAgB,CAAC,MAAM,CAAC,SAAS,CAAC,EAAA;;gBAApD,SAAS,GAAG,SAAwC;gBAE1D,GAAG,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAA;;;;KACpC,EAAA;AAED;IAAA;IAGA,CAAC;IADC;QADC,IAAA,0BAAQ,GAAE;;6CACD;IACZ,oBAAC;CAAA,AAHD,IAGC;AAED;IAAA;IA8BA,CAAC;IA5BC;QADC,IAAA,0BAAQ,GAAE;;iEACC;IAGZ;QADC,IAAA,0BAAQ,GAAE;;wEACQ;IAGnB;QADC,IAAA,4BAAU,GAAE;kCACD,IAAI;sEAAA;IAGhB;QADC,IAAA,4BAAU,GAAE;kCACH,IAAI;oEAAA;IAId;QAFC,IAAA,4BAAU,GAAE;QACZ,IAAA,wBAAM,EAAC,4BAAe,CAAC;;mEACA;IAGxB;QADC,IAAA,wBAAM,EAAC,0BAAa,CAAC;;iEACH;IAKnB;QAHC,IAAA,yBAAO,GAAE;QACT,IAAA,wBAAI,EAAC,cAAM,OAAA,0CAA6B,EAA7B,CAA6B,CAAC;QACzC,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;mEACQ;IAMvC;QAJC,IAAA,4BAAU,GAAE;QACZ,IAAA,yBAAO,GAAE;QACT,IAAA,wBAAI,EAAC,cAAM,OAAA,aAAa,EAAb,CAAa,CAAC;QACzB,IAAA,gCAAc,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;4EACE;IACnC,sCAAC;CAAA,AA9BD,IA8BC;AA9BY,0EAA+B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
declare const _default: (req: any, res: any) => Promise<void>;
|
|
2
|
+
/**
|
|
3
|
+
* @oas [delete] /price-lists/{id}
|
|
4
|
+
* operationId: "DeletePriceListsPriceList"
|
|
5
|
+
* summary: "Delete a Price List"
|
|
6
|
+
* description: "Deletes a Price List"
|
|
7
|
+
* x-authenticated: true
|
|
8
|
+
* parameters:
|
|
9
|
+
* - (path) id=* {string} The id of the Price List to delete.
|
|
10
|
+
* tags:
|
|
11
|
+
* - Price List
|
|
12
|
+
* responses:
|
|
13
|
+
* 200:
|
|
14
|
+
* description: OK
|
|
15
|
+
* content:
|
|
16
|
+
* application/json:
|
|
17
|
+
* schema:
|
|
18
|
+
* properties:
|
|
19
|
+
* id:
|
|
20
|
+
* type: string
|
|
21
|
+
* description: The id of the deleted Price List.
|
|
22
|
+
* object:
|
|
23
|
+
* type: string
|
|
24
|
+
* description: The type of the object that was deleted.
|
|
25
|
+
* deleted:
|
|
26
|
+
* type: boolean
|
|
27
|
+
*/
|
|
28
|
+
export default _default;
|
package/dist/api/routes/admin/{discounts/remove-valid-product.js → price-lists/delete-price-list.js}
RENAMED
|
@@ -36,18 +36,16 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var _1 = require(".");
|
|
40
39
|
/**
|
|
41
|
-
* @oas [delete] /
|
|
42
|
-
* operationId: "
|
|
43
|
-
* summary: "
|
|
44
|
-
* description: "
|
|
40
|
+
* @oas [delete] /price-lists/{id}
|
|
41
|
+
* operationId: "DeletePriceListsPriceList"
|
|
42
|
+
* summary: "Delete a Price List"
|
|
43
|
+
* description: "Deletes a Price List"
|
|
45
44
|
* x-authenticated: true
|
|
46
45
|
* parameters:
|
|
47
|
-
* - (path) id=* {string} The id of the
|
|
48
|
-
* - (path) product_id=* {string} The id of the Product.
|
|
46
|
+
* - (path) id=* {string} The id of the Price List to delete.
|
|
49
47
|
* tags:
|
|
50
|
-
* -
|
|
48
|
+
* - Price List
|
|
51
49
|
* responses:
|
|
52
50
|
* 200:
|
|
53
51
|
* description: OK
|
|
@@ -55,28 +53,32 @@ var _1 = require(".");
|
|
|
55
53
|
* application/json:
|
|
56
54
|
* schema:
|
|
57
55
|
* properties:
|
|
58
|
-
*
|
|
59
|
-
*
|
|
56
|
+
* id:
|
|
57
|
+
* type: string
|
|
58
|
+
* description: The id of the deleted Price List.
|
|
59
|
+
* object:
|
|
60
|
+
* type: string
|
|
61
|
+
* description: The type of the object that was deleted.
|
|
62
|
+
* deleted:
|
|
63
|
+
* type: boolean
|
|
60
64
|
*/
|
|
61
65
|
exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
|
|
62
|
-
var
|
|
63
|
-
return __generator(this, function (
|
|
64
|
-
switch (
|
|
66
|
+
var id, priceListService;
|
|
67
|
+
return __generator(this, function (_a) {
|
|
68
|
+
switch (_a.label) {
|
|
65
69
|
case 0:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return [4 /*yield*/,
|
|
70
|
+
id = req.params.id;
|
|
71
|
+
priceListService = req.scope.resolve("priceListService");
|
|
72
|
+
return [4 /*yield*/, priceListService.delete(id)];
|
|
69
73
|
case 1:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
discount = _b.sent();
|
|
77
|
-
res.status(200).json({ discount: discount });
|
|
74
|
+
_a.sent();
|
|
75
|
+
res.json({
|
|
76
|
+
id: id,
|
|
77
|
+
object: "price-list",
|
|
78
|
+
deleted: true,
|
|
79
|
+
});
|
|
78
80
|
return [2 /*return*/];
|
|
79
81
|
}
|
|
80
82
|
});
|
|
81
83
|
}); });
|
|
82
|
-
//# sourceMappingURL=
|
|
84
|
+
//# sourceMappingURL=delete-price-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-price-list.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/price-lists/delete-price-list.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEnB,gBAAgB,GACpB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;gBACvC,qBAAM,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,EAAA;;gBAAjC,SAAiC,CAAA;gBAEjC,GAAG,CAAC,IAAI,CAAC;oBACP,EAAE,IAAA;oBACF,MAAM,EAAE,YAAY;oBACpB,OAAO,EAAE,IAAI;iBACd,CAAC,CAAA;;;;KACH,EAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
declare const _default: (req: any, res: any) => Promise<void>;
|
|
2
|
+
/**
|
|
3
|
+
* @oas [delete] /price-lists/{id}/prices/batch
|
|
4
|
+
* operationId: "DeletePriceListsPriceListPricesBatch"
|
|
5
|
+
* summary: "Batch delete prices that belongs to a Price List"
|
|
6
|
+
* description: "Batch delete prices that belongs to a Price List"
|
|
7
|
+
* x-authenticated: true
|
|
8
|
+
* parameters:
|
|
9
|
+
* - (path) id=* {string} The id of the Price List that the Money Amounts that will be deleted belongs to.
|
|
10
|
+
* requestBody:
|
|
11
|
+
* content:
|
|
12
|
+
* application/json:
|
|
13
|
+
* schema:
|
|
14
|
+
* properties:
|
|
15
|
+
* price_ids:
|
|
16
|
+
* description: The price id's of the Money Amounts to delete.
|
|
17
|
+
* type: array
|
|
18
|
+
* items:
|
|
19
|
+
* type: string
|
|
20
|
+
* tags:
|
|
21
|
+
* - Price List
|
|
22
|
+
* responses:
|
|
23
|
+
* 200:
|
|
24
|
+
* description: OK
|
|
25
|
+
* content:
|
|
26
|
+
* application/json:
|
|
27
|
+
* schema:
|
|
28
|
+
* properties:
|
|
29
|
+
* ids:
|
|
30
|
+
* type: array
|
|
31
|
+
* items:
|
|
32
|
+
* type: string
|
|
33
|
+
* description: The id of the deleted Money Amount.
|
|
34
|
+
* object:
|
|
35
|
+
* type: string
|
|
36
|
+
* description: The type of the object that was deleted.
|
|
37
|
+
* deleted:
|
|
38
|
+
* type: boolean
|
|
39
|
+
*/
|
|
40
|
+
export default _default;
|
|
41
|
+
export declare class AdminDeletePriceListPricesPricesReq {
|
|
42
|
+
price_ids: string[];
|
|
43
|
+
}
|
|
@@ -45,32 +45,29 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
-
exports.
|
|
48
|
+
exports.AdminDeletePriceListPricesPricesReq = void 0;
|
|
49
49
|
var class_validator_1 = require("class-validator");
|
|
50
|
-
var _1 = require(".");
|
|
51
50
|
var validator_1 = require("../../../../utils/validator");
|
|
52
51
|
/**
|
|
53
|
-
* @oas [
|
|
54
|
-
* operationId:
|
|
55
|
-
* summary:
|
|
56
|
-
* description: "
|
|
52
|
+
* @oas [delete] /price-lists/{id}/prices/batch
|
|
53
|
+
* operationId: "DeletePriceListsPriceListPricesBatch"
|
|
54
|
+
* summary: "Batch delete prices that belongs to a Price List"
|
|
55
|
+
* description: "Batch delete prices that belongs to a Price List"
|
|
56
|
+
* x-authenticated: true
|
|
57
57
|
* parameters:
|
|
58
|
-
* - (path) id=* {string} The id of the
|
|
58
|
+
* - (path) id=* {string} The id of the Price List that the Money Amounts that will be deleted belongs to.
|
|
59
59
|
* requestBody:
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* data:
|
|
70
|
-
* type: object
|
|
71
|
-
* description: ""
|
|
60
|
+
* content:
|
|
61
|
+
* application/json:
|
|
62
|
+
* schema:
|
|
63
|
+
* properties:
|
|
64
|
+
* price_ids:
|
|
65
|
+
* description: The price id's of the Money Amounts to delete.
|
|
66
|
+
* type: array
|
|
67
|
+
* items:
|
|
68
|
+
* type: string
|
|
72
69
|
* tags:
|
|
73
|
-
* -
|
|
70
|
+
* - Price List
|
|
74
71
|
* responses:
|
|
75
72
|
* 200:
|
|
76
73
|
* description: OK
|
|
@@ -78,45 +75,44 @@ var validator_1 = require("../../../../utils/validator");
|
|
|
78
75
|
* application/json:
|
|
79
76
|
* schema:
|
|
80
77
|
* properties:
|
|
81
|
-
*
|
|
82
|
-
*
|
|
78
|
+
* ids:
|
|
79
|
+
* type: array
|
|
80
|
+
* items:
|
|
81
|
+
* type: string
|
|
82
|
+
* description: The id of the deleted Money Amount.
|
|
83
|
+
* object:
|
|
84
|
+
* type: string
|
|
85
|
+
* description: The type of the object that was deleted.
|
|
86
|
+
* deleted:
|
|
87
|
+
* type: boolean
|
|
83
88
|
*/
|
|
84
89
|
exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
|
|
85
|
-
var id, validated,
|
|
90
|
+
var id, validated, priceListService;
|
|
86
91
|
return __generator(this, function (_a) {
|
|
87
92
|
switch (_a.label) {
|
|
88
93
|
case 0:
|
|
89
94
|
id = req.params.id;
|
|
90
|
-
return [4 /*yield*/, (0, validator_1.validator)(
|
|
95
|
+
return [4 /*yield*/, (0, validator_1.validator)(AdminDeletePriceListPricesPricesReq, req.body)];
|
|
91
96
|
case 1:
|
|
92
97
|
validated = _a.sent();
|
|
93
|
-
|
|
94
|
-
return [4 /*yield*/,
|
|
98
|
+
priceListService = req.scope.resolve("priceListService");
|
|
99
|
+
return [4 /*yield*/, priceListService.deletePrices(id, validated.price_ids)];
|
|
95
100
|
case 2:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
select: _1.defaultStoreCartFields,
|
|
99
|
-
relations: _1.defaultStoreCartRelations,
|
|
100
|
-
})];
|
|
101
|
-
case 3:
|
|
102
|
-
cart = _a.sent();
|
|
103
|
-
res.status(200).json({ cart: cart });
|
|
101
|
+
_a.sent();
|
|
102
|
+
res.json({ ids: validated.price_ids, object: "money-amount", deleted: true });
|
|
104
103
|
return [2 /*return*/];
|
|
105
104
|
}
|
|
106
105
|
});
|
|
107
106
|
}); });
|
|
108
|
-
var
|
|
109
|
-
function
|
|
107
|
+
var AdminDeletePriceListPricesPricesReq = /** @class */ (function () {
|
|
108
|
+
function AdminDeletePriceListPricesPricesReq() {
|
|
110
109
|
}
|
|
111
110
|
__decorate([
|
|
112
|
-
(0, class_validator_1.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
__metadata("design:type", Object)
|
|
118
|
-
], StorePostCartsCartPaymentMethodUpdateReq.prototype, "data", void 0);
|
|
119
|
-
return StorePostCartsCartPaymentMethodUpdateReq;
|
|
111
|
+
(0, class_validator_1.ArrayNotEmpty)(),
|
|
112
|
+
(0, class_validator_1.IsString)({ each: true }),
|
|
113
|
+
__metadata("design:type", Array)
|
|
114
|
+
], AdminDeletePriceListPricesPricesReq.prototype, "price_ids", void 0);
|
|
115
|
+
return AdminDeletePriceListPricesPricesReq;
|
|
120
116
|
}());
|
|
121
|
-
exports.
|
|
122
|
-
//# sourceMappingURL=
|
|
117
|
+
exports.AdminDeletePriceListPricesPricesReq = AdminDeletePriceListPricesPricesReq;
|
|
118
|
+
//# sourceMappingURL=delete-prices-batch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-prices-batch.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/price-lists/delete-prices-batch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAyD;AAEzD,yDAAuD;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEP,qBAAM,IAAA,qBAAS,EAC/B,mCAAmC,EACnC,GAAG,CAAC,IAAI,CACT,EAAA;;gBAHK,SAAS,GAAG,SAGjB;gBAEK,gBAAgB,GACpB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;gBAEvC,qBAAM,gBAAgB,CAAC,YAAY,CAAC,EAAE,EAAE,SAAS,CAAC,SAAS,CAAC,EAAA;;gBAA5D,SAA4D,CAAA;gBAE5D,GAAG,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;;;;KAC9E,EAAA;AAED;IAAA;IAIA,CAAC;IADC;QAFC,IAAA,+BAAa,GAAE;QACf,IAAA,0BAAQ,EAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;0EACN;IACrB,0CAAC;CAAA,AAJD,IAIC;AAJY,kFAAmC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
declare const _default: (req: any, res: any) => Promise<void>;
|
|
2
|
+
/**
|
|
3
|
+
* @oas [get] /price-lists/{id}
|
|
4
|
+
* operationId: "GetPriceListsPriceList"
|
|
5
|
+
* summary: "Retrieve a Price List"
|
|
6
|
+
* description: "Retrieves a Price List."
|
|
7
|
+
* x-authenticated: true
|
|
8
|
+
* parameters:
|
|
9
|
+
* - (path) id=* {string} The id of the Price List.
|
|
10
|
+
* tags:
|
|
11
|
+
* - Price List
|
|
12
|
+
* responses:
|
|
13
|
+
* 200:
|
|
14
|
+
* description: OK
|
|
15
|
+
* content:
|
|
16
|
+
* application/json:
|
|
17
|
+
* schema:
|
|
18
|
+
* properties:
|
|
19
|
+
* price_list:
|
|
20
|
+
* $ref: "#/components/schemas/price_list"
|
|
21
|
+
*/
|
|
22
|
+
export default _default;
|
package/dist/api/routes/admin/{discounts/add-valid-product.js → price-lists/get-price-list.js}
RENAMED
|
@@ -38,16 +38,15 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
var _1 = require(".");
|
|
40
40
|
/**
|
|
41
|
-
* @oas [
|
|
42
|
-
* operationId: "
|
|
43
|
-
* summary: "
|
|
44
|
-
* description: "
|
|
41
|
+
* @oas [get] /price-lists/{id}
|
|
42
|
+
* operationId: "GetPriceListsPriceList"
|
|
43
|
+
* summary: "Retrieve a Price List"
|
|
44
|
+
* description: "Retrieves a Price List."
|
|
45
45
|
* x-authenticated: true
|
|
46
46
|
* parameters:
|
|
47
|
-
* - (path) id=* {string} The id of the
|
|
48
|
-
* - (path) product_id=* {string} The id of the Product.
|
|
47
|
+
* - (path) id=* {string} The id of the Price List.
|
|
49
48
|
* tags:
|
|
50
|
-
* -
|
|
49
|
+
* - Price List
|
|
51
50
|
* responses:
|
|
52
51
|
* 200:
|
|
53
52
|
* description: OK
|
|
@@ -55,28 +54,25 @@ var _1 = require(".");
|
|
|
55
54
|
* application/json:
|
|
56
55
|
* schema:
|
|
57
56
|
* properties:
|
|
58
|
-
*
|
|
59
|
-
* $ref: "#/components/schemas/
|
|
57
|
+
* price_list:
|
|
58
|
+
* $ref: "#/components/schemas/price_list"
|
|
60
59
|
*/
|
|
61
60
|
exports.default = (function (req, res) { return __awaiter(void 0, void 0, void 0, function () {
|
|
62
|
-
var
|
|
63
|
-
return __generator(this, function (
|
|
64
|
-
switch (
|
|
61
|
+
var id, priceListService, priceList;
|
|
62
|
+
return __generator(this, function (_a) {
|
|
63
|
+
switch (_a.label) {
|
|
65
64
|
case 0:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return [4 /*yield*/,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return [4 /*yield*/, discountService.retrieve(discount_id, {
|
|
72
|
-
select: _1.defaultAdminDiscountsFields,
|
|
73
|
-
relations: _1.defaultAdminDiscountsRelations,
|
|
65
|
+
id = req.params.id;
|
|
66
|
+
priceListService = req.scope.resolve("priceListService");
|
|
67
|
+
return [4 /*yield*/, priceListService.retrieve(id, {
|
|
68
|
+
select: _1.defaultAdminPriceListFields,
|
|
69
|
+
relations: _1.defaultAdminPriceListRelations,
|
|
74
70
|
})];
|
|
75
|
-
case
|
|
76
|
-
|
|
77
|
-
res.status(200).json({
|
|
71
|
+
case 1:
|
|
72
|
+
priceList = _a.sent();
|
|
73
|
+
res.status(200).json({ price_list: priceList });
|
|
78
74
|
return [2 /*return*/];
|
|
79
75
|
}
|
|
80
76
|
});
|
|
81
77
|
}); });
|
|
82
|
-
//# sourceMappingURL=
|
|
78
|
+
//# sourceMappingURL=get-price-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-price-list.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/price-lists/get-price-list.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sBAA+E;AAI/E;;;;;;;;;;;;;;;;;;;GAmBG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEnB,gBAAgB,GACpB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAA;gBAErB,qBAAM,gBAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE;wBACpD,MAAM,EAAE,8BAAkD;wBAC1D,SAAS,EAAE,iCAA8B;qBAC1C,CAAC,EAAA;;gBAHI,SAAS,GAAG,SAGhB;gBAEF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAA;;;;KAChD,EAAA"}
|