@medusajs/medusa 1.3.2 → 1.3.3
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 +43 -0
- package/dist/api/index.d.ts +15 -14
- package/dist/api/index.js +15 -14
- package/dist/api/index.js.map +1 -1
- package/dist/api/middlewares/authenticate-customer.d.ts +2 -1
- package/dist/api/middlewares/authenticate-customer.js +1 -2
- package/dist/api/middlewares/authenticate-customer.js.map +1 -1
- package/dist/api/middlewares/authenticate.d.ts +2 -1
- package/dist/api/middlewares/authenticate.js.map +1 -1
- package/dist/api/middlewares/await-middleware.d.ts +3 -1
- package/dist/api/middlewares/await-middleware.js +2 -31
- package/dist/api/middlewares/await-middleware.js.map +1 -1
- package/dist/api/middlewares/error-handler.d.ts +3 -1
- package/dist/api/middlewares/error-handler.js.map +1 -1
- package/dist/api/middlewares/feature-flag-enabled.d.ts +2 -0
- package/dist/api/middlewares/feature-flag-enabled.js +57 -0
- package/dist/api/middlewares/feature-flag-enabled.js.map +1 -0
- package/dist/api/middlewares/index.d.ts +10 -10
- package/dist/api/middlewares/index.js +5 -1
- package/dist/api/middlewares/index.js.map +1 -1
- package/dist/api/middlewares/normalized-query.d.ts +6 -1
- package/dist/api/middlewares/normalized-query.js +5 -2
- package/dist/api/middlewares/normalized-query.js.map +1 -1
- package/dist/api/middlewares/transform-body.d.ts +4 -0
- package/dist/api/middlewares/transform-body.js +66 -0
- package/dist/api/middlewares/transform-body.js.map +1 -0
- package/dist/api/middlewares/transform-query.d.ts +6 -0
- package/dist/api/middlewares/transform-query.js +86 -0
- package/dist/api/middlewares/transform-query.js.map +1 -0
- package/dist/api/routes/admin/batch/cancel-batch-job.d.ts +22 -0
- package/dist/api/routes/admin/batch/cancel-batch-job.js +74 -0
- package/dist/api/routes/admin/batch/cancel-batch-job.js.map +1 -0
- package/dist/api/routes/admin/batch/confirm-batch-job.d.ts +22 -0
- package/dist/api/routes/admin/batch/confirm-batch-job.js +74 -0
- package/dist/api/routes/admin/batch/confirm-batch-job.js.map +1 -0
- package/dist/api/routes/admin/batch/create-batch-job.d.ts +30 -0
- package/dist/api/routes/admin/batch/create-batch-job.js +125 -0
- package/dist/api/routes/admin/batch/create-batch-job.js.map +1 -0
- package/dist/api/routes/admin/batch/get-batch-job.d.ts +22 -0
- package/dist/api/routes/admin/batch/get-batch-job.js +67 -0
- package/dist/api/routes/admin/batch/get-batch-job.js.map +1 -0
- package/dist/api/routes/admin/batch/index.d.ts +4 -0
- package/dist/api/routes/admin/batch/index.js +36 -7
- package/dist/api/routes/admin/batch/index.js.map +1 -1
- package/dist/api/routes/admin/batch/list-batch-jobs.d.ts +15 -7
- package/dist/api/routes/admin/batch/list-batch-jobs.js +61 -46
- package/dist/api/routes/admin/batch/list-batch-jobs.js.map +1 -1
- package/dist/api/routes/admin/collections/add-products.d.ts +2 -1
- package/dist/api/routes/admin/collections/add-products.js +4 -7
- package/dist/api/routes/admin/collections/add-products.js.map +1 -1
- package/dist/api/routes/admin/collections/create-collection.d.ts +2 -1
- package/dist/api/routes/admin/collections/create-collection.js +6 -8
- package/dist/api/routes/admin/collections/create-collection.js.map +1 -1
- package/dist/api/routes/admin/collections/delete-collection.d.ts +2 -1
- package/dist/api/routes/admin/collections/delete-collection.js.map +1 -1
- package/dist/api/routes/admin/collections/get-collection.d.ts +2 -1
- package/dist/api/routes/admin/collections/get-collection.js +4 -5
- package/dist/api/routes/admin/collections/get-collection.js.map +1 -1
- package/dist/api/routes/admin/collections/index.js +32 -12
- package/dist/api/routes/admin/collections/index.js.map +1 -1
- package/dist/api/routes/admin/collections/list-collections.d.ts +2 -1
- package/dist/api/routes/admin/collections/list-collections.js +9 -19
- package/dist/api/routes/admin/collections/list-collections.js.map +1 -1
- package/dist/api/routes/admin/collections/remove-products.d.ts +2 -1
- package/dist/api/routes/admin/collections/remove-products.js +5 -8
- package/dist/api/routes/admin/collections/remove-products.js.map +1 -1
- package/dist/api/routes/admin/collections/update-collection.d.ts +2 -1
- package/dist/api/routes/admin/collections/update-collection.js +5 -8
- package/dist/api/routes/admin/collections/update-collection.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/add-customers-batch.d.ts +2 -1
- package/dist/api/routes/admin/customer-groups/add-customers-batch.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/create-customer-group.d.ts +2 -1
- package/dist/api/routes/admin/customer-groups/create-customer-group.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/delete-customer-group.d.ts +2 -1
- package/dist/api/routes/admin/customer-groups/delete-customer-group.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/delete-customers-batch.d.ts +2 -1
- package/dist/api/routes/admin/customer-groups/delete-customers-batch.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/get-customer-group-customers.d.ts +2 -1
- package/dist/api/routes/admin/customer-groups/get-customer-group-customers.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/get-customer-group.d.ts +2 -1
- package/dist/api/routes/admin/customer-groups/get-customer-group.js +3 -17
- package/dist/api/routes/admin/customer-groups/get-customer-group.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/index.js +29 -11
- package/dist/api/routes/admin/customer-groups/index.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts +2 -1
- package/dist/api/routes/admin/customer-groups/list-customer-groups.js +10 -45
- package/dist/api/routes/admin/customer-groups/list-customer-groups.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/update-customer-group.d.ts +2 -1
- package/dist/api/routes/admin/customer-groups/update-customer-group.js.map +1 -1
- package/dist/api/routes/admin/customers/create-customer.d.ts +1 -1
- package/dist/api/routes/admin/customers/create-customer.js.map +1 -1
- package/dist/api/routes/admin/customers/update-customer.d.ts +1 -1
- package/dist/api/routes/admin/customers/update-customer.js.map +1 -1
- package/dist/api/routes/admin/discounts/add-valid-product.d.ts +23 -0
- package/dist/api/routes/admin/discounts/add-valid-product.js +82 -0
- package/dist/api/routes/admin/discounts/add-valid-product.js.map +1 -0
- package/dist/api/routes/admin/discounts/remove-valid-product.d.ts +23 -0
- package/dist/api/routes/admin/discounts/remove-valid-product.js +82 -0
- package/dist/api/routes/admin/discounts/remove-valid-product.js.map +1 -0
- package/dist/api/routes/admin/draft-orders/index.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/index.js +1 -0
- package/dist/api/routes/admin/draft-orders/index.js.map +1 -1
- package/dist/api/routes/admin/draft-orders/list-draft-orders.js +7 -6
- package/dist/api/routes/admin/draft-orders/list-draft-orders.js.map +1 -1
- package/dist/api/routes/admin/gift-cards/create-gift-card.d.ts +2 -2
- package/dist/api/routes/admin/gift-cards/create-gift-card.js +0 -1
- package/dist/api/routes/admin/gift-cards/create-gift-card.js.map +1 -1
- package/dist/api/routes/admin/gift-cards/index.d.ts +1 -1
- package/dist/api/routes/admin/gift-cards/index.js +19 -5
- package/dist/api/routes/admin/gift-cards/index.js.map +1 -1
- package/dist/api/routes/admin/gift-cards/list-gift-cards.js +24 -18
- package/dist/api/routes/admin/gift-cards/list-gift-cards.js.map +1 -1
- package/dist/api/routes/admin/gift-cards/update-gift-card.d.ts +1 -1
- package/dist/api/routes/admin/gift-cards/update-gift-card.js.map +1 -1
- package/dist/api/routes/admin/orders/create-claim.d.ts +4 -14
- package/dist/api/routes/admin/orders/create-claim.js +3 -14
- package/dist/api/routes/admin/orders/create-claim.js.map +1 -1
- package/dist/api/routes/admin/orders/fulfill-claim.d.ts +1 -1
- package/dist/api/routes/admin/orders/fulfill-claim.js.map +1 -1
- package/dist/api/routes/admin/orders/update-claim.d.ts +1 -1
- package/dist/api/routes/admin/orders/update-claim.js.map +1 -1
- package/dist/api/routes/admin/price-lists/create-price-list.d.ts +2 -1
- package/dist/api/routes/admin/price-lists/create-price-list.js +4 -7
- package/dist/api/routes/admin/price-lists/create-price-list.js.map +1 -1
- package/dist/api/routes/admin/price-lists/index.js +26 -7
- package/dist/api/routes/admin/price-lists/index.js.map +1 -1
- package/dist/api/routes/admin/price-lists/list-price-list-products.d.ts +3 -7
- package/dist/api/routes/admin/price-lists/list-price-list-products.js +21 -59
- package/dist/api/routes/admin/price-lists/list-price-list-products.js.map +1 -1
- package/dist/api/routes/admin/price-lists/list-price-lists.d.ts +2 -1
- package/dist/api/routes/admin/price-lists/list-price-lists.js +8 -40
- package/dist/api/routes/admin/price-lists/list-price-lists.js.map +1 -1
- package/dist/api/routes/admin/products/add-option.js +26 -6
- package/dist/api/routes/admin/products/add-option.js.map +1 -1
- package/dist/api/routes/admin/products/create-product.d.ts +3 -3
- package/dist/api/routes/admin/products/create-product.js +13 -9
- package/dist/api/routes/admin/products/create-product.js.map +1 -1
- package/dist/api/routes/admin/products/delete-variant.js +26 -6
- package/dist/api/routes/admin/products/delete-variant.js.map +1 -1
- package/dist/api/routes/admin/products/get-product.js +24 -4
- package/dist/api/routes/admin/products/get-product.js.map +1 -1
- package/dist/api/routes/admin/products/get-variants.d.ts +24 -0
- package/dist/api/routes/admin/products/get-variants.js +76 -0
- package/dist/api/routes/admin/products/get-variants.js.map +1 -0
- package/dist/api/routes/admin/products/index.d.ts +3 -2
- package/dist/api/routes/admin/products/index.js +1 -4
- package/dist/api/routes/admin/products/index.js.map +1 -1
- package/dist/api/routes/admin/products/list-products.d.ts +1 -6
- package/dist/api/routes/admin/products/list-products.js +3 -9
- package/dist/api/routes/admin/products/list-products.js.map +1 -1
- package/dist/api/routes/admin/products/update-product.d.ts +3 -3
- package/dist/api/routes/admin/products/update-product.js +28 -7
- package/dist/api/routes/admin/products/update-product.js.map +1 -1
- package/dist/api/routes/admin/products/update-variant.js +27 -10
- package/dist/api/routes/admin/products/update-variant.js.map +1 -1
- package/dist/api/routes/admin/shipping-options/list-shipping-options.js +6 -2
- package/dist/api/routes/admin/shipping-options/list-shipping-options.js.map +1 -1
- package/dist/api/routes/admin/store/get-store.js +4 -2
- package/dist/api/routes/admin/store/get-store.js.map +1 -1
- package/dist/api/routes/admin/store/update-store.d.ts +1 -0
- package/dist/api/routes/admin/store/update-store.js +5 -0
- package/dist/api/routes/admin/store/update-store.js.map +1 -1
- package/dist/api/routes/admin/uploads/create-upload.d.ts +1 -1
- package/dist/api/routes/admin/uploads/create-upload.js +5 -5
- package/dist/api/routes/admin/uploads/create-upload.js.map +1 -1
- package/dist/api/routes/admin/uploads/delete-upload.d.ts +4 -1
- package/dist/api/routes/admin/uploads/delete-upload.js +29 -11
- package/dist/api/routes/admin/uploads/delete-upload.js.map +1 -1
- package/dist/api/routes/admin/uploads/get-download-url.d.ts +28 -0
- package/dist/api/routes/admin/uploads/get-download-url.js +99 -0
- package/dist/api/routes/admin/uploads/get-download-url.js.map +1 -0
- package/dist/api/routes/admin/uploads/index.d.ts +10 -3
- package/dist/api/routes/admin/uploads/index.js +19 -4
- package/dist/api/routes/admin/uploads/index.js.map +1 -1
- package/dist/api/routes/store/carts/add-shipping-method.js +6 -2
- package/dist/api/routes/store/carts/add-shipping-method.js.map +1 -1
- package/dist/api/routes/store/carts/calculate-taxes.js +9 -2
- package/dist/api/routes/store/carts/calculate-taxes.js.map +1 -1
- package/dist/api/routes/store/carts/create-cart.js +6 -2
- package/dist/api/routes/store/carts/create-cart.js.map +1 -1
- package/dist/api/routes/store/carts/create-line-item.js +6 -2
- package/dist/api/routes/store/carts/create-line-item.js.map +1 -1
- package/dist/api/routes/store/carts/create-payment-sessions.js +6 -2
- package/dist/api/routes/store/carts/create-payment-sessions.js.map +1 -1
- package/dist/api/routes/store/carts/decorate-line-items-with-totals.d.ts +5 -0
- package/dist/api/routes/store/carts/decorate-line-items-with-totals.js +71 -0
- package/dist/api/routes/store/carts/decorate-line-items-with-totals.js.map +1 -0
- package/dist/api/routes/store/carts/delete-discount.js +6 -2
- package/dist/api/routes/store/carts/delete-discount.js.map +1 -1
- package/dist/api/routes/store/carts/delete-line-item.js +6 -2
- package/dist/api/routes/store/carts/delete-line-item.js.map +1 -1
- package/dist/api/routes/store/carts/delete-payment-session.js +6 -2
- package/dist/api/routes/store/carts/delete-payment-session.js.map +1 -1
- package/dist/api/routes/store/carts/get-cart.js +6 -2
- package/dist/api/routes/store/carts/get-cart.js.map +1 -1
- package/dist/api/routes/store/carts/refresh-payment-session.js +6 -2
- package/dist/api/routes/store/carts/refresh-payment-session.js.map +1 -1
- package/dist/api/routes/store/carts/set-payment-session.js +6 -2
- package/dist/api/routes/store/carts/set-payment-session.js.map +1 -1
- package/dist/api/routes/store/carts/update-cart.js +6 -2
- package/dist/api/routes/store/carts/update-cart.js.map +1 -1
- package/dist/api/routes/store/carts/update-line-item.js +6 -2
- package/dist/api/routes/store/carts/update-line-item.js.map +1 -1
- package/dist/api/routes/store/carts/update-payment-method.d.ts +38 -0
- package/dist/api/routes/store/carts/update-payment-method.js +122 -0
- package/dist/api/routes/store/carts/update-payment-method.js.map +1 -0
- package/dist/api/routes/store/carts/update-payment-session.js +6 -2
- package/dist/api/routes/store/carts/update-payment-session.js.map +1 -1
- package/dist/api/routes/store/customers/get-payment-methods.js +6 -7
- package/dist/api/routes/store/customers/get-payment-methods.js.map +1 -1
- package/dist/api/routes/store/customers/index.d.ts +1 -1
- package/dist/api/routes/store/customers/index.js.map +1 -1
- package/dist/api/routes/store/customers/update-address.js +1 -1
- package/dist/api/routes/store/customers/update-address.js.map +1 -1
- package/dist/api/routes/store/customers/update-customer.d.ts +1 -1
- package/dist/api/routes/store/customers/update-customer.js.map +1 -1
- package/dist/api/routes/store/gift-cards/index.d.ts +1 -1
- package/dist/api/routes/store/gift-cards/index.js +6 -1
- package/dist/api/routes/store/gift-cards/index.js.map +1 -1
- package/dist/api/routes/store/products/get-product.js +51 -12
- package/dist/api/routes/store/products/get-product.js.map +1 -1
- package/dist/api/routes/store/products/list-products.js +30 -7
- package/dist/api/routes/store/products/list-products.js.map +1 -1
- package/dist/api/routes/store/shipping-options/list-options.js +6 -2
- package/dist/api/routes/store/shipping-options/list-options.js.map +1 -1
- package/dist/api/routes/store/shipping-options/list-shipping-options.js +8 -2
- package/dist/api/routes/store/shipping-options/list-shipping-options.js.map +1 -1
- package/dist/api/routes/store/variants/get-variant.js +51 -12
- package/dist/api/routes/store/variants/get-variant.js.map +1 -1
- package/dist/api/routes/store/variants/list-variants.js +29 -6
- package/dist/api/routes/store/variants/list-variants.js.map +1 -1
- package/dist/commands/migrate.js +29 -14
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/seed.js +14 -10
- package/dist/commands/seed.js.map +1 -1
- package/dist/commands/start.js +1 -1
- package/dist/commands/utils/get-migrations.d.ts +2 -1
- package/dist/commands/utils/get-migrations.js +95 -36
- package/dist/commands/utils/get-migrations.js.map +1 -1
- package/dist/config/index.d.ts +14 -0
- package/dist/config/index.js +40 -0
- package/dist/config/index.js.map +1 -0
- package/dist/controllers/products/admin-list-products.js +16 -8
- package/dist/controllers/products/admin-list-products.js.map +1 -1
- package/dist/helpers/test-request.js +21 -15
- package/dist/helpers/test-request.js.map +1 -1
- package/dist/interfaces/abstract-parser.d.ts +25 -0
- package/dist/interfaces/abstract-parser.js +14 -0
- package/dist/interfaces/abstract-parser.js.map +1 -0
- package/dist/interfaces/base-service.d.ts +66 -0
- package/dist/interfaces/base-service.js +377 -0
- package/dist/interfaces/base-service.js.map +1 -0
- package/dist/interfaces/batch-job-strategy.d.ts +34 -0
- package/dist/interfaces/batch-job-strategy.js +182 -0
- package/dist/interfaces/batch-job-strategy.js.map +1 -0
- package/dist/interfaces/csv-parser.d.ts +46 -0
- package/dist/interfaces/csv-parser.js +15 -0
- package/dist/interfaces/csv-parser.js.map +1 -0
- package/dist/interfaces/file-service.d.ts +66 -0
- package/dist/interfaces/file-service.js +32 -0
- package/dist/interfaces/file-service.js.map +1 -0
- package/dist/interfaces/index.d.ts +2 -0
- package/dist/interfaces/index.js +2 -0
- package/dist/interfaces/index.js.map +1 -1
- package/dist/loaders/config.js +3 -2
- package/dist/loaders/config.js.map +1 -1
- package/dist/loaders/feature-flags/index.d.ts +6 -0
- package/dist/loaders/feature-flags/index.js +71 -0
- package/dist/loaders/feature-flags/index.js.map +1 -0
- package/dist/loaders/index.d.ts +1 -1
- package/dist/loaders/index.js +8 -5
- package/dist/loaders/index.js.map +1 -1
- package/dist/loaders/plugins.d.ts +4 -3
- package/dist/loaders/plugins.js +71 -34
- package/dist/loaders/plugins.js.map +1 -1
- package/dist/loaders/redis.d.ts +1 -1
- package/dist/loaders/redis.js.map +1 -1
- package/dist/loaders/search-index.js +1 -0
- package/dist/loaders/search-index.js.map +1 -1
- package/dist/loaders/strategies.d.ts +2 -2
- package/dist/loaders/strategies.js +21 -7
- package/dist/loaders/strategies.js.map +1 -1
- package/dist/migrations/1649775522087-add_batch_job_model.js +4 -4
- package/dist/migrations/1649775522087-add_batch_job_model.js.map +1 -1
- package/dist/models/batch-job.d.ts +45 -4
- package/dist/models/batch-job.js +94 -7
- package/dist/models/batch-job.js.map +1 -1
- package/dist/models/customer.d.ts +1 -1
- package/dist/models/customer.js +1 -1
- package/dist/models/customer.js.map +1 -1
- package/dist/models/draft-order.d.ts +1 -2
- package/dist/models/draft-order.js +2 -2
- package/dist/models/draft-order.js.map +1 -1
- package/dist/models/line-item.d.ts +9 -2
- package/dist/models/line-item.js +2 -2
- package/dist/models/line-item.js.map +1 -1
- package/dist/models/product.d.ts +17 -17
- package/dist/models/product.js +34 -34
- package/dist/models/product.js.map +1 -1
- package/dist/models/shipping-method.d.ts +1 -1
- package/dist/models/shipping-method.js +1 -1
- package/dist/models/shipping-method.js.map +1 -1
- package/dist/models/shipping-option.d.ts +1 -1
- package/dist/models/shipping-option.js +1 -1
- package/dist/models/shipping-option.js.map +1 -1
- package/dist/repositories/customer.d.ts +2 -1
- package/dist/repositories/customer.js +18 -7
- package/dist/repositories/customer.js.map +1 -1
- package/dist/repositories/gift-card.d.ts +5 -1
- package/dist/repositories/gift-card.js +124 -29
- package/dist/repositories/gift-card.js.map +1 -1
- package/dist/repositories/image.d.ts +1 -0
- package/dist/repositories/image.js +100 -0
- package/dist/repositories/image.js.map +1 -1
- package/dist/repositories/price-list.js.map +1 -1
- package/dist/repositories/product-tag.d.ts +6 -0
- package/dist/repositories/product-tag.js +113 -0
- package/dist/repositories/product-tag.js.map +1 -1
- package/dist/repositories/product-type.d.ts +5 -0
- package/dist/repositories/product-type.js +64 -0
- package/dist/repositories/product-type.js.map +1 -1
- package/dist/repositories/product-variant.js +4 -5
- package/dist/repositories/product-variant.js.map +1 -1
- package/dist/repositories/product.d.ts +14 -17
- package/dist/repositories/product.js +64 -2
- package/dist/repositories/product.js.map +1 -1
- package/dist/repositories/tax-rate.d.ts +1 -1
- package/dist/repositories/tax-rate.js +2 -9
- package/dist/repositories/tax-rate.js.map +1 -1
- package/dist/services/auth.d.ts +16 -7
- package/dist/services/auth.js +130 -93
- package/dist/services/auth.js.map +1 -1
- package/dist/services/batch-job.d.ts +30 -5
- package/dist/services/batch-job.js +437 -2
- package/dist/services/batch-job.js.map +1 -1
- package/dist/services/cart.js +34 -13
- package/dist/services/cart.js.map +1 -1
- package/dist/services/claim-item.d.ts +23 -27
- package/dist/services/claim-item.js +217 -247
- package/dist/services/claim-item.js.map +1 -1
- package/dist/services/claim.d.ts +89 -71
- package/dist/services/claim.js +911 -879
- package/dist/services/claim.js.map +1 -1
- package/dist/services/csv-parser.d.ts +17 -0
- package/dist/services/csv-parser.js +319 -0
- package/dist/services/csv-parser.js.map +1 -0
- package/dist/services/custom-shipping-option.d.ts +30 -32
- package/dist/services/custom-shipping-option.js +78 -74
- package/dist/services/custom-shipping-option.js.map +1 -1
- package/dist/services/customer.d.ts +48 -50
- package/dist/services/customer.js +465 -428
- package/dist/services/customer.js.map +1 -1
- package/dist/services/discount-condition.d.ts +13 -13
- package/dist/services/discount-condition.js +5 -16
- package/dist/services/discount-condition.js.map +1 -1
- package/dist/services/discount.d.ts +22 -16
- package/dist/services/discount.js +530 -484
- package/dist/services/discount.js.map +1 -1
- package/dist/services/draft-order.d.ts +69 -66
- package/dist/services/draft-order.js +375 -353
- package/dist/services/draft-order.js.map +1 -1
- package/dist/services/event-bus.d.ts +72 -56
- package/dist/services/event-bus.js +122 -99
- package/dist/services/event-bus.js.map +1 -1
- package/dist/services/file.d.ts +14 -0
- package/dist/services/file.js +43 -0
- package/dist/services/file.js.map +1 -0
- package/dist/services/fulfillment.d.ts +63 -64
- package/dist/services/fulfillment.js +200 -194
- package/dist/services/fulfillment.js.map +1 -1
- package/dist/services/gift-card.d.ts +54 -45
- package/dist/services/gift-card.js +239 -221
- package/dist/services/gift-card.js.map +1 -1
- package/dist/services/idempotency-key.d.ts +1 -5
- package/dist/services/idempotency-key.js +2 -5
- package/dist/services/idempotency-key.js.map +1 -1
- package/dist/services/index.d.ts +11 -9
- package/dist/services/index.js +23 -19
- package/dist/services/index.js.map +1 -1
- package/dist/services/line-item.d.ts +3 -2
- package/dist/services/line-item.js +9 -7
- package/dist/services/line-item.js.map +1 -1
- package/dist/services/price-list.d.ts +4 -1
- package/dist/services/price-list.js +7 -4
- package/dist/services/price-list.js.map +1 -1
- package/dist/services/pricing.d.ts +101 -0
- package/dist/services/pricing.js +588 -0
- package/dist/services/pricing.js.map +1 -0
- package/dist/services/product-variant.d.ts +0 -11
- package/dist/services/product-variant.js +28 -138
- package/dist/services/product-variant.js.map +1 -1
- package/dist/services/product.d.ts +107 -145
- package/dist/services/product.js +708 -1036
- package/dist/services/product.js.map +1 -1
- package/dist/services/region.js +4 -4
- package/dist/services/region.js.map +1 -1
- package/dist/services/shipping-option.d.ts +43 -108
- package/dist/services/shipping-option.js +305 -352
- package/dist/services/shipping-option.js.map +1 -1
- package/dist/services/shipping-profile.d.ts +2 -2
- package/dist/services/shipping-profile.js +1 -1
- package/dist/services/store.d.ts +36 -45
- package/dist/services/store.js +207 -217
- package/dist/services/store.js.map +1 -1
- package/dist/services/strategy-resolver.d.ts +13 -0
- package/dist/services/strategy-resolver.js +40 -0
- package/dist/services/strategy-resolver.js.map +1 -0
- package/dist/services/tax-provider.d.ts +7 -3
- package/dist/services/tax-provider.js +6 -6
- package/dist/services/tax-provider.js.map +1 -1
- package/dist/services/tax-rate.d.ts +1 -1
- package/dist/services/tax-rate.js +2 -2
- package/dist/services/tax-rate.js.map +1 -1
- package/dist/services/totals.js.map +1 -1
- package/dist/services/user.d.ts +8 -9
- package/dist/services/user.js +216 -168
- package/dist/services/user.js.map +1 -1
- package/dist/strategies/__fixtures__/order-export-data.d.ts +3 -0
- package/dist/strategies/__fixtures__/order-export-data.js +70 -0
- package/dist/strategies/__fixtures__/order-export-data.js.map +1 -0
- package/dist/strategies/__fixtures__/product-export-data.d.ts +319 -0
- package/dist/strategies/__fixtures__/product-export-data.js +401 -0
- package/dist/strategies/__fixtures__/product-export-data.js.map +1 -0
- package/dist/strategies/batch-jobs/order/export.d.ts +36 -0
- package/dist/strategies/batch-jobs/order/export.js +351 -0
- package/dist/strategies/batch-jobs/order/export.js.map +1 -0
- package/dist/strategies/batch-jobs/order/index.d.ts +29 -0
- package/dist/strategies/batch-jobs/order/index.js +115 -0
- package/dist/strategies/batch-jobs/order/index.js.map +1 -0
- package/dist/strategies/batch-jobs/product/export.d.ts +36 -0
- package/dist/strategies/batch-jobs/product/export.js +546 -0
- package/dist/strategies/batch-jobs/product/export.js.map +1 -0
- package/dist/strategies/batch-jobs/product/index.d.ts +45 -0
- package/dist/strategies/batch-jobs/product/index.js +272 -0
- package/dist/strategies/batch-jobs/product/index.js.map +1 -0
- package/dist/subscribers/batch-job.d.ts +17 -0
- package/dist/subscribers/batch-job.js +96 -0
- package/dist/subscribers/batch-job.js.map +1 -0
- package/dist/types/batch-job.d.ts +23 -2
- package/dist/types/batch-job.js +4 -1
- package/dist/types/batch-job.js.map +1 -1
- package/dist/types/claim.d.ts +67 -0
- package/dist/types/claim.js +3 -0
- package/dist/types/claim.js.map +1 -0
- package/dist/types/common.d.ts +27 -3
- package/dist/types/common.js.map +1 -1
- package/dist/types/customers.d.ts +24 -0
- package/dist/types/customers.js.map +1 -1
- package/dist/types/discount.d.ts +2 -1
- package/dist/types/discount.js.map +1 -1
- package/dist/types/feature-flags.d.ts +9 -0
- package/dist/types/feature-flags.js +3 -0
- package/dist/types/feature-flags.js.map +1 -0
- package/dist/types/fulfillment.d.ts +27 -0
- package/dist/types/fulfillment.js +3 -0
- package/dist/types/fulfillment.js.map +1 -0
- package/dist/types/gift-card.d.ts +21 -0
- package/dist/types/gift-card.js +3 -0
- package/dist/types/gift-card.js.map +1 -0
- package/dist/types/global.d.ts +12 -1
- package/dist/types/price-list.d.ts +9 -0
- package/dist/types/pricing.d.ts +30 -0
- package/dist/types/pricing.js +3 -0
- package/dist/types/pricing.js.map +1 -0
- package/dist/types/product-variant.d.ts +4 -3
- package/dist/types/product-variant.js.map +1 -1
- package/dist/types/product.d.ts +110 -8
- package/dist/types/product.js +8 -11
- package/dist/types/product.js.map +1 -1
- package/dist/types/shipping-options.d.ts +62 -0
- package/dist/types/shipping-options.js +3 -0
- package/dist/types/shipping-options.js.map +1 -0
- package/dist/types/store.d.ts +9 -0
- package/dist/types/store.js +3 -0
- package/dist/types/store.js.map +1 -0
- package/dist/utils/build-query.d.ts +7 -7
- package/dist/utils/build-query.js +9 -5
- package/dist/utils/build-query.js.map +1 -1
- package/dist/utils/countries.d.ts +3 -2
- package/dist/utils/countries.js.map +1 -1
- package/dist/utils/currencies.d.ts +10 -1899
- package/dist/utils/currencies.js.map +1 -1
- package/dist/utils/db-aware-column.js +2 -2
- package/dist/utils/db-aware-column.js.map +1 -1
- package/dist/utils/feature-flag-decorators.d.ts +4 -0
- package/dist/utils/feature-flag-decorators.js +52 -0
- package/dist/utils/feature-flag-decorators.js.map +1 -0
- package/dist/utils/flag-router.d.ts +7 -0
- package/dist/utils/flag-router.js +19 -0
- package/dist/utils/flag-router.js.map +1 -0
- package/dist/utils/format-registration-name.d.ts +4 -4
- package/dist/utils/format-registration-name.js +7 -10
- package/dist/utils/format-registration-name.js.map +1 -1
- package/dist/utils/get-query-config.d.ts +4 -6
- package/dist/utils/get-query-config.js +46 -1
- package/dist/utils/get-query-config.js.map +1 -1
- package/dist/utils/omit-relation-if-exists.d.ts +7 -0
- package/dist/utils/omit-relation-if-exists.js +16 -0
- package/dist/utils/omit-relation-if-exists.js.map +1 -0
- package/dist/utils/set-metadata.d.ts +6 -6
- package/dist/utils/set-metadata.js +5 -5
- package/dist/utils/set-metadata.js.map +1 -1
- package/dist/utils/sleep.d.ts +1 -0
- package/dist/utils/sleep.js +50 -0
- package/dist/utils/sleep.js.map +1 -0
- package/package.json +6 -4
- package/yarn-error.log +29038 -0
|
@@ -1,129 +1,124 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { EntityManager } from "typeorm";
|
|
2
|
+
import { SearchService } from ".";
|
|
3
|
+
import { TransactionBaseService } from "../interfaces";
|
|
4
|
+
import { Product, ProductTag, ProductType, ProductVariant } from "../models";
|
|
5
|
+
import { ImageRepository } from "../repositories/image";
|
|
6
|
+
import { FindWithoutRelationsOptions, ProductRepository } from "../repositories/product";
|
|
7
|
+
import { ProductOptionRepository } from "../repositories/product-option";
|
|
8
|
+
import { ProductTagRepository } from "../repositories/product-tag";
|
|
9
|
+
import { ProductTypeRepository } from "../repositories/product-type";
|
|
10
|
+
import { ProductVariantRepository } from "../repositories/product-variant";
|
|
11
|
+
import { Selector } from "../types/common";
|
|
12
|
+
import { CreateProductInput, FilterableProductProps, FindProductConfig, ProductOptionInput, UpdateProductInput } from "../types/product";
|
|
13
|
+
import EventBusService from "./event-bus";
|
|
14
|
+
import ProductVariantService from "./product-variant";
|
|
15
|
+
declare type InjectedDependencies = {
|
|
16
|
+
manager: EntityManager;
|
|
17
|
+
productOptionRepository: typeof ProductOptionRepository;
|
|
18
|
+
productRepository: typeof ProductRepository;
|
|
19
|
+
productVariantRepository: typeof ProductVariantRepository;
|
|
20
|
+
productTypeRepository: typeof ProductTypeRepository;
|
|
21
|
+
productTagRepository: typeof ProductTagRepository;
|
|
22
|
+
imageRepository: typeof ImageRepository;
|
|
23
|
+
productVariantService: ProductVariantService;
|
|
24
|
+
searchService: SearchService;
|
|
25
|
+
eventBusService: EventBusService;
|
|
26
|
+
};
|
|
27
|
+
declare class ProductService extends TransactionBaseService<ProductService> {
|
|
28
|
+
protected manager_: EntityManager;
|
|
29
|
+
protected transactionManager_: EntityManager | undefined;
|
|
30
|
+
protected readonly productOptionRepository_: typeof ProductOptionRepository;
|
|
31
|
+
protected readonly productRepository_: typeof ProductRepository;
|
|
32
|
+
protected readonly productVariantRepository_: typeof ProductVariantRepository;
|
|
33
|
+
protected readonly productTypeRepository_: typeof ProductTypeRepository;
|
|
34
|
+
protected readonly productTagRepository_: typeof ProductTagRepository;
|
|
35
|
+
protected readonly imageRepository_: typeof ImageRepository;
|
|
36
|
+
protected readonly productVariantService_: ProductVariantService;
|
|
37
|
+
protected readonly searchService_: SearchService;
|
|
38
|
+
protected readonly eventBus_: EventBusService;
|
|
39
|
+
static readonly IndexName = "products";
|
|
40
|
+
static readonly Events: {
|
|
11
41
|
UPDATED: string;
|
|
12
42
|
CREATED: string;
|
|
13
43
|
DELETED: string;
|
|
14
44
|
};
|
|
15
|
-
constructor({ manager, productRepository, productVariantRepository, productOptionRepository, eventBusService, productVariantService,
|
|
16
|
-
manager: any;
|
|
17
|
-
productRepository: any;
|
|
18
|
-
productVariantRepository: any;
|
|
19
|
-
productOptionRepository: any;
|
|
20
|
-
eventBusService: any;
|
|
21
|
-
productVariantService: any;
|
|
22
|
-
productCollectionService: any;
|
|
23
|
-
productTypeRepository: any;
|
|
24
|
-
productTagRepository: any;
|
|
25
|
-
imageRepository: any;
|
|
26
|
-
searchService: any;
|
|
27
|
-
cartRepository: any;
|
|
28
|
-
priceSelectionStrategy: any;
|
|
29
|
-
});
|
|
30
|
-
/** @private @const {EntityManager} */
|
|
31
|
-
private manager_;
|
|
32
|
-
/** @private @const {ProductOption} */
|
|
33
|
-
private productOptionRepository_;
|
|
34
|
-
/** @private @const {Product} */
|
|
35
|
-
private productRepository_;
|
|
36
|
-
/** @private @const {ProductVariant} */
|
|
37
|
-
private productVariantRepository_;
|
|
38
|
-
/** @private @const {EventBus} */
|
|
39
|
-
private eventBus_;
|
|
40
|
-
/** @private @const {ProductVariantService} */
|
|
41
|
-
private productVariantService_;
|
|
42
|
-
/** @private @const {ProductCollectionService} */
|
|
43
|
-
private productCollectionService_;
|
|
44
|
-
/** @private @const {ProductCollectionService} */
|
|
45
|
-
private productTypeRepository_;
|
|
46
|
-
/** @private @const {ProductCollectionService} */
|
|
47
|
-
private productTagRepository_;
|
|
48
|
-
/** @private @const {ImageRepository} */
|
|
49
|
-
private imageRepository_;
|
|
50
|
-
/** @private @const {SearchService} */
|
|
51
|
-
private searchService_;
|
|
52
|
-
/** @private @const {CartRepository} */
|
|
53
|
-
private cartRepository_;
|
|
54
|
-
/** @private @const {IPriceSelectionStrategy} */
|
|
55
|
-
private priceSelectionStrategy_;
|
|
56
|
-
withTransaction(transactionManager: any): ProductService;
|
|
45
|
+
constructor({ manager, productRepository, productVariantRepository, productOptionRepository, eventBusService, productVariantService, productTypeRepository, productTagRepository, imageRepository, searchService, }: InjectedDependencies);
|
|
57
46
|
/**
|
|
58
47
|
* Lists products based on the provided parameters.
|
|
59
|
-
* @param
|
|
48
|
+
* @param selector - an object that defines rules to filter products
|
|
60
49
|
* by
|
|
61
|
-
* @param
|
|
50
|
+
* @param config - object that defines the scope for what should be
|
|
62
51
|
* returned
|
|
63
|
-
* @return
|
|
52
|
+
* @return the result of the find operation
|
|
64
53
|
*/
|
|
65
|
-
list(selector?:
|
|
54
|
+
list(selector?: FilterableProductProps | Selector<Product>, config?: FindProductConfig): Promise<Product[]>;
|
|
66
55
|
/**
|
|
67
56
|
* Lists products based on the provided parameters and includes the count of
|
|
68
57
|
* products that match the query.
|
|
69
|
-
* @param
|
|
58
|
+
* @param selector - an object that defines rules to filter products
|
|
70
59
|
* by
|
|
71
|
-
* @param
|
|
60
|
+
* @param config - object that defines the scope for what should be
|
|
72
61
|
* returned
|
|
73
|
-
* @return
|
|
62
|
+
* @return an array containing the products as
|
|
74
63
|
* the first element and the total count of products that matches the query
|
|
75
64
|
* as the second element.
|
|
76
65
|
*/
|
|
77
|
-
listAndCount(selector
|
|
66
|
+
listAndCount(selector: FilterableProductProps | Selector<Product>, config?: FindProductConfig): Promise<[Product[], number]>;
|
|
78
67
|
/**
|
|
79
68
|
* Return the total number of documents in database
|
|
80
69
|
* @param {object} selector - the selector to choose products by
|
|
81
70
|
* @return {Promise} the result of the count operation
|
|
82
71
|
*/
|
|
83
|
-
count(selector?:
|
|
72
|
+
count(selector?: Selector<Product>): Promise<number>;
|
|
84
73
|
/**
|
|
85
74
|
* Gets a product by id.
|
|
86
75
|
* Throws in case of DB Error and if product was not found.
|
|
87
|
-
* @param
|
|
88
|
-
* @param
|
|
76
|
+
* @param productId - id of the product to get.
|
|
77
|
+
* @param config - object that defines what should be included in the
|
|
89
78
|
* query response
|
|
90
|
-
* @return
|
|
79
|
+
* @return the result of the find one operation.
|
|
91
80
|
*/
|
|
92
|
-
retrieve(productId: string, config?:
|
|
81
|
+
retrieve(productId: string, config?: FindProductConfig): Promise<Product>;
|
|
93
82
|
/**
|
|
94
83
|
* Gets a product by handle.
|
|
95
84
|
* Throws in case of DB Error and if product was not found.
|
|
96
|
-
* @param
|
|
97
|
-
* @param
|
|
98
|
-
* @return
|
|
85
|
+
* @param productHandle - handle of the product to get.
|
|
86
|
+
* @param config - details about what to get from the product
|
|
87
|
+
* @return the result of the find one operation.
|
|
99
88
|
*/
|
|
100
|
-
retrieveByHandle(productHandle: string, config?:
|
|
89
|
+
retrieveByHandle(productHandle: string, config?: FindProductConfig): Promise<Product>;
|
|
101
90
|
/**
|
|
102
91
|
* Gets a product by external id.
|
|
103
92
|
* Throws in case of DB Error and if product was not found.
|
|
104
|
-
* @param
|
|
105
|
-
* @param
|
|
106
|
-
* @return
|
|
93
|
+
* @param externalId - handle of the product to get.
|
|
94
|
+
* @param config - details about what to get from the product
|
|
95
|
+
* @return the result of the find one operation.
|
|
96
|
+
*/
|
|
97
|
+
retrieveByExternalId(externalId: string, config?: FindProductConfig): Promise<Product>;
|
|
98
|
+
/**
|
|
99
|
+
* Gets a product by selector.
|
|
100
|
+
* Throws in case of DB Error and if product was not found.
|
|
101
|
+
* @param selector - selector object
|
|
102
|
+
* @param config - object that defines what should be included in the
|
|
103
|
+
* query response
|
|
104
|
+
* @return the result of the find one operation.
|
|
107
105
|
*/
|
|
108
|
-
|
|
106
|
+
retrieve_(selector: Selector<Product>, config?: FindProductConfig): Promise<Product>;
|
|
109
107
|
/**
|
|
110
108
|
* Gets all variants belonging to a product.
|
|
111
|
-
* @param
|
|
112
|
-
* @param
|
|
113
|
-
* @return
|
|
109
|
+
* @param productId - the id of the product to get variants from.
|
|
110
|
+
* @param config - The config to select and configure relations etc...
|
|
111
|
+
* @return an array of variants
|
|
114
112
|
*/
|
|
115
|
-
retrieveVariants(productId: string, config?:
|
|
116
|
-
listTypes(): Promise<
|
|
117
|
-
listTagsByUsage(count?: number): Promise<
|
|
118
|
-
upsertProductType_(type: any): Promise<any>;
|
|
119
|
-
upsertProductTags_(tags: any): Promise<any[]>;
|
|
113
|
+
retrieveVariants(productId: string, config?: FindProductConfig): Promise<ProductVariant[]>;
|
|
114
|
+
listTypes(): Promise<ProductType[]>;
|
|
115
|
+
listTagsByUsage(count?: number): Promise<ProductTag[]>;
|
|
120
116
|
/**
|
|
121
117
|
* Creates a product.
|
|
122
|
-
* @param
|
|
123
|
-
* @return
|
|
118
|
+
* @param productObject - the product to create
|
|
119
|
+
* @return resolves to the creation result.
|
|
124
120
|
*/
|
|
125
|
-
create(productObject:
|
|
126
|
-
upsertImages_(images: any): Promise<any[]>;
|
|
121
|
+
create(productObject: CreateProductInput): Promise<Product>;
|
|
127
122
|
/**
|
|
128
123
|
* Updates a product. Product variant updates should use dedicated methods,
|
|
129
124
|
* e.g. `addVariant`, etc. The function will throw errors if metadata or
|
|
@@ -133,85 +128,52 @@ declare class ProductService extends ProductService_base {
|
|
|
133
128
|
* @param {object} update - an object with the update values.
|
|
134
129
|
* @return {Promise} resolves to the update result.
|
|
135
130
|
*/
|
|
136
|
-
update(productId: string, update:
|
|
131
|
+
update(productId: string, update: UpdateProductInput): Promise<Product>;
|
|
137
132
|
/**
|
|
138
133
|
* Deletes a product from a given product id. The product's associated
|
|
139
134
|
* variants will also be deleted.
|
|
140
|
-
* @param
|
|
135
|
+
* @param productId - the id of the product to delete. Must be
|
|
141
136
|
* castable as an ObjectId
|
|
142
|
-
* @return
|
|
137
|
+
* @return empty promise
|
|
143
138
|
*/
|
|
144
|
-
delete(productId: string): Promise<
|
|
139
|
+
delete(productId: string): Promise<void>;
|
|
145
140
|
/**
|
|
146
141
|
* Adds an option to a product. Options can, for example, be "Size", "Color",
|
|
147
142
|
* etc. Will update all the products variants with a dummy value for the newly
|
|
148
143
|
* created option. The same option cannot be added more than once.
|
|
149
|
-
* @param
|
|
150
|
-
* @param
|
|
151
|
-
* @return
|
|
152
|
-
*/
|
|
153
|
-
addOption(productId: string, optionTitle: string): Promise<any>;
|
|
154
|
-
reorderVariants(productId: any, variantOrder: any): Promise<any>;
|
|
155
|
-
/**
|
|
156
|
-
* Changes the order of a product's options. Will throw if the length of
|
|
157
|
-
* optionOrder and the length of the product's options are different. Will
|
|
158
|
-
* throw optionOrder contains an id not associated with the product.
|
|
159
|
-
* @param {string} productId - the product whose options we are reordering
|
|
160
|
-
* @param {string[]} optionOrder - the ids of the product's options in the
|
|
161
|
-
* new order
|
|
162
|
-
* @return {Promise} the result of the update operation
|
|
144
|
+
* @param productId - the product to apply the new option to
|
|
145
|
+
* @param optionTitle - the display title of the option, e.g. "Size"
|
|
146
|
+
* @return the result of the model update operation
|
|
163
147
|
*/
|
|
164
|
-
|
|
148
|
+
addOption(productId: string, optionTitle: string): Promise<Product>;
|
|
149
|
+
reorderVariants(productId: string, variantOrder: string[]): Promise<Product>;
|
|
165
150
|
/**
|
|
166
151
|
* Updates a product's option. Throws if the call tries to update an option
|
|
167
152
|
* not associated with the product. Throws if the updated title already exists.
|
|
168
|
-
* @param
|
|
169
|
-
* @param
|
|
170
|
-
* @param
|
|
171
|
-
* @return
|
|
153
|
+
* @param productId - the product whose option we are updating
|
|
154
|
+
* @param optionId - the id of the option we are updating
|
|
155
|
+
* @param data - the data to update the option with
|
|
156
|
+
* @return the updated product
|
|
172
157
|
*/
|
|
173
|
-
updateOption(productId: string, optionId: string, data:
|
|
158
|
+
updateOption(productId: string, optionId: string, data: ProductOptionInput): Promise<Product>;
|
|
174
159
|
/**
|
|
175
160
|
* Delete an option from a product.
|
|
176
|
-
* @param
|
|
177
|
-
* @param
|
|
178
|
-
* @return
|
|
161
|
+
* @param productId - the product to delete an option from
|
|
162
|
+
* @param optionId - the option to delete
|
|
163
|
+
* @return the updated product
|
|
179
164
|
*/
|
|
180
|
-
deleteOption(productId: string, optionId: string): Promise<
|
|
181
|
-
/**
|
|
182
|
-
* Decorates a product with product variants.
|
|
183
|
-
* @param {string} productId - the productId to decorate.
|
|
184
|
-
* @param {string[]} fields - the fields to include.
|
|
185
|
-
* @param {string[]} expandFields - fields to expand.
|
|
186
|
-
* @param {object} config - retrieve config for price calculation.
|
|
187
|
-
* @return {Product} return the decorated product.
|
|
188
|
-
*/
|
|
189
|
-
decorate(productId: string, fields?: string[], expandFields?: string[], config?: object): Product;
|
|
165
|
+
deleteOption(productId: string, optionId: string): Promise<Product | void>;
|
|
190
166
|
/**
|
|
191
167
|
* Creates a query object to be used for list queries.
|
|
192
|
-
* @param
|
|
193
|
-
* @param
|
|
194
|
-
* @return
|
|
168
|
+
* @param selector - the selector to create the query from
|
|
169
|
+
* @param config - the config to use for the query
|
|
170
|
+
* @return an object containing the query, relations and free-text
|
|
195
171
|
* search param.
|
|
196
172
|
*/
|
|
197
|
-
prepareListQuery_(selector:
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
* @param {string} q - the text to perform free text search from
|
|
203
|
-
* @return {QueryBuilder<Product>} a query builder that can fetch products
|
|
204
|
-
*/
|
|
205
|
-
getFreeTextQueryBuilder_(productRepo: ProductRepository, query: FindOptions<Product>, q: string): QueryBuilder<Product>;
|
|
206
|
-
/**
|
|
207
|
-
* Set additional prices on a list of products.
|
|
208
|
-
* @param {Product[] | Product} products list of products on which to set additional prices
|
|
209
|
-
* @param {string} currency_code currency code to fetch prices for
|
|
210
|
-
* @param {string} region_id region to fetch prices for
|
|
211
|
-
* @param {string} cart_id string of cart to use as a basis for getting currency and region
|
|
212
|
-
* @param {string} customer_id id of potentially logged in customer, used to get prices valid for their customer groups
|
|
213
|
-
* @param {boolean} include_discount_prices indication wether or not to include sales prices in result
|
|
214
|
-
* @return {Promise<Product[]>} A list of products with variants decorated with "additional_prices"
|
|
215
|
-
*/
|
|
216
|
-
setAdditionalPrices(products: Product[] | Product, currency_code: string, region_id: string, cart_id: string, customer_id: string, include_discount_prices?: boolean): Promise<Product[]>;
|
|
173
|
+
protected prepareListQuery_(selector: FilterableProductProps | Selector<Product>, config: FindProductConfig): {
|
|
174
|
+
q: string;
|
|
175
|
+
relations: (keyof Product)[];
|
|
176
|
+
query: FindWithoutRelationsOptions;
|
|
177
|
+
};
|
|
217
178
|
}
|
|
179
|
+
export default ProductService;
|