@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
|
@@ -104,49 +104,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
104
104
|
};
|
|
105
105
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
106
106
|
var medusa_core_utils_1 = require("medusa-core-utils");
|
|
107
|
-
var medusa_interfaces_1 = require("medusa-interfaces");
|
|
108
107
|
var randomatic_1 = __importDefault(require("randomatic"));
|
|
109
|
-
var
|
|
108
|
+
var interfaces_1 = require("../interfaces");
|
|
109
|
+
var utils_1 = require("../utils");
|
|
110
110
|
/**
|
|
111
111
|
* Provides layer to manipulate gift cards.
|
|
112
|
-
* @extends BaseService
|
|
113
112
|
*/
|
|
114
113
|
var GiftCardService = /** @class */ (function (_super) {
|
|
115
114
|
__extends(GiftCardService, _super);
|
|
116
115
|
function GiftCardService(_a) {
|
|
117
116
|
var manager = _a.manager, giftCardRepository = _a.giftCardRepository, giftCardTransactionRepository = _a.giftCardTransactionRepository, regionService = _a.regionService, eventBusService = _a.eventBusService;
|
|
118
|
-
var _this =
|
|
119
|
-
|
|
117
|
+
var _this =
|
|
118
|
+
// eslint-disable-next-line prefer-rest-params
|
|
119
|
+
_super.call(this, arguments[0]) || this;
|
|
120
120
|
_this.manager_ = manager;
|
|
121
|
-
/** @private @const {GiftCardRepository} */
|
|
122
121
|
_this.giftCardRepository_ = giftCardRepository;
|
|
123
|
-
/** @private @const {GiftCardRepository} */
|
|
124
122
|
_this.giftCardTransactionRepo_ = giftCardTransactionRepository;
|
|
125
|
-
/** @private @const {RegionService} */
|
|
126
123
|
_this.regionService_ = regionService;
|
|
127
|
-
/** @private @const {EventBus} */
|
|
128
124
|
_this.eventBus_ = eventBusService;
|
|
129
125
|
return _this;
|
|
130
126
|
}
|
|
131
|
-
GiftCardService.prototype.withTransaction = function (transactionManager) {
|
|
132
|
-
if (!transactionManager) {
|
|
133
|
-
return this;
|
|
134
|
-
}
|
|
135
|
-
var cloned = new GiftCardService({
|
|
136
|
-
manager: transactionManager,
|
|
137
|
-
giftCardRepository: this.giftCardRepository_,
|
|
138
|
-
giftCardTransactionRepository: this.giftCardTransactionRepo_,
|
|
139
|
-
regionService: this.regionService_,
|
|
140
|
-
eventBusService: this.eventBus_,
|
|
141
|
-
});
|
|
142
|
-
cloned.transactionManager_ = transactionManager;
|
|
143
|
-
return cloned;
|
|
144
|
-
};
|
|
145
127
|
/**
|
|
146
128
|
* Generates a 16 character gift card code
|
|
147
|
-
* @return
|
|
129
|
+
* @return the generated gift card code
|
|
148
130
|
*/
|
|
149
|
-
GiftCardService.
|
|
131
|
+
GiftCardService.generateCode = function () {
|
|
150
132
|
var code = [
|
|
151
133
|
(0, randomatic_1.default)("A0", 4),
|
|
152
134
|
(0, randomatic_1.default)("A0", 4),
|
|
@@ -156,44 +138,71 @@ var GiftCardService = /** @class */ (function (_super) {
|
|
|
156
138
|
return code;
|
|
157
139
|
};
|
|
158
140
|
/**
|
|
159
|
-
* @param
|
|
160
|
-
* @param
|
|
161
|
-
* @return
|
|
141
|
+
* @param selector - the query object for find
|
|
142
|
+
* @param config - the configuration used to find the objects. contains relations, skip, and take.
|
|
143
|
+
* @return the result of the find operation
|
|
144
|
+
*/
|
|
145
|
+
GiftCardService.prototype.listAndCount = function (selector, config) {
|
|
146
|
+
if (selector === void 0) { selector = {}; }
|
|
147
|
+
if (config === void 0) { config = { relations: [], skip: 0, take: 10 }; }
|
|
148
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
149
|
+
var _this = this;
|
|
150
|
+
return __generator(this, function (_a) {
|
|
151
|
+
switch (_a.label) {
|
|
152
|
+
case 0: return [4 /*yield*/, this.atomicPhase_(function (manager) { return __awaiter(_this, void 0, void 0, function () {
|
|
153
|
+
var giftCardRepo, q, query, rels;
|
|
154
|
+
return __generator(this, function (_a) {
|
|
155
|
+
switch (_a.label) {
|
|
156
|
+
case 0:
|
|
157
|
+
giftCardRepo = manager.getCustomRepository(this.giftCardRepository_);
|
|
158
|
+
if (typeof selector.q !== "undefined") {
|
|
159
|
+
q = selector.q;
|
|
160
|
+
delete selector.q;
|
|
161
|
+
}
|
|
162
|
+
query = (0, utils_1.buildQuery)(selector, config);
|
|
163
|
+
rels = query.relations;
|
|
164
|
+
delete query.relations;
|
|
165
|
+
return [4 /*yield*/, giftCardRepo.listGiftCardsAndCount(query, rels, q)];
|
|
166
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}); })];
|
|
170
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* @param selector - the query object for find
|
|
177
|
+
* @param config - the configuration used to find the objects. contains relations, skip, and take.
|
|
178
|
+
* @return the result of the find operation
|
|
162
179
|
*/
|
|
163
180
|
GiftCardService.prototype.list = function (selector, config) {
|
|
164
181
|
if (selector === void 0) { selector = {}; }
|
|
165
182
|
if (config === void 0) { config = { relations: [], skip: 0, take: 10 }; }
|
|
166
183
|
return __awaiter(this, void 0, void 0, function () {
|
|
167
|
-
var
|
|
184
|
+
var _this = this;
|
|
168
185
|
return __generator(this, function (_a) {
|
|
169
186
|
switch (_a.label) {
|
|
170
|
-
case 0:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
.where("gift_card.code ILIKE :q", { q: "%".concat(q, "%") })
|
|
190
|
-
.orWhere("display_id::varchar(255) ILIKE :dId", { dId: "".concat(q) });
|
|
191
|
-
}))
|
|
192
|
-
.getMany()];
|
|
193
|
-
case 1:
|
|
194
|
-
raw = _a.sent();
|
|
195
|
-
return [2 /*return*/, giftCardRepo.findWithRelations(rels, raw.map(function (i) { return i.id; }))];
|
|
196
|
-
case 2: return [2 /*return*/, giftCardRepo.findWithRelations(rels, query)];
|
|
187
|
+
case 0: return [4 /*yield*/, this.atomicPhase_(function (manager) { return __awaiter(_this, void 0, void 0, function () {
|
|
188
|
+
var giftCardRepo, q, query, rels;
|
|
189
|
+
return __generator(this, function (_a) {
|
|
190
|
+
switch (_a.label) {
|
|
191
|
+
case 0:
|
|
192
|
+
giftCardRepo = manager.getCustomRepository(this.giftCardRepository_);
|
|
193
|
+
if (typeof selector.q !== "undefined") {
|
|
194
|
+
q = selector.q;
|
|
195
|
+
delete selector.q;
|
|
196
|
+
}
|
|
197
|
+
query = (0, utils_1.buildQuery)(selector, config);
|
|
198
|
+
rels = query.relations;
|
|
199
|
+
delete query.relations;
|
|
200
|
+
return [4 /*yield*/, giftCardRepo.listGiftCards(query, rels, q)];
|
|
201
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}); })];
|
|
205
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
197
206
|
}
|
|
198
207
|
});
|
|
199
208
|
});
|
|
@@ -202,99 +211,121 @@ var GiftCardService = /** @class */ (function (_super) {
|
|
|
202
211
|
return __awaiter(this, void 0, void 0, function () {
|
|
203
212
|
var _this = this;
|
|
204
213
|
return __generator(this, function (_a) {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
214
|
+
switch (_a.label) {
|
|
215
|
+
case 0: return [4 /*yield*/, this.atomicPhase_(function (manager) { return __awaiter(_this, void 0, void 0, function () {
|
|
216
|
+
var gctRepo, created, saved;
|
|
217
|
+
return __generator(this, function (_a) {
|
|
218
|
+
switch (_a.label) {
|
|
219
|
+
case 0:
|
|
220
|
+
gctRepo = manager.getCustomRepository(this.giftCardTransactionRepo_);
|
|
221
|
+
created = gctRepo.create(data);
|
|
222
|
+
return [4 /*yield*/, gctRepo.save(created)];
|
|
223
|
+
case 1:
|
|
224
|
+
saved = _a.sent();
|
|
225
|
+
return [2 /*return*/, saved.id];
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
}); })];
|
|
229
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
230
|
+
}
|
|
219
231
|
});
|
|
220
232
|
});
|
|
221
233
|
};
|
|
222
234
|
/**
|
|
223
235
|
* Creates a gift card with provided data given that the data is validated.
|
|
224
|
-
* @param
|
|
225
|
-
* @return
|
|
236
|
+
* @param giftCard - the gift card data to create
|
|
237
|
+
* @return the result of the create operation
|
|
226
238
|
*/
|
|
227
239
|
GiftCardService.prototype.create = function (giftCard) {
|
|
228
240
|
return __awaiter(this, void 0, void 0, function () {
|
|
229
241
|
var _this = this;
|
|
230
242
|
return __generator(this, function (_a) {
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
243
|
+
switch (_a.label) {
|
|
244
|
+
case 0: return [4 /*yield*/, this.atomicPhase_(function (manager) { return __awaiter(_this, void 0, void 0, function () {
|
|
245
|
+
var giftCardRepo, region, code, toCreate, created, result;
|
|
246
|
+
return __generator(this, function (_a) {
|
|
247
|
+
switch (_a.label) {
|
|
248
|
+
case 0:
|
|
249
|
+
giftCardRepo = manager.getCustomRepository(this.giftCardRepository_);
|
|
250
|
+
return [4 /*yield*/, this.regionService_
|
|
251
|
+
.withTransaction(manager)
|
|
252
|
+
.retrieve(giftCard.region_id)];
|
|
253
|
+
case 1:
|
|
254
|
+
region = _a.sent();
|
|
255
|
+
code = GiftCardService.generateCode();
|
|
256
|
+
toCreate = __assign(__assign({ code: code }, giftCard), { region_id: region.id });
|
|
257
|
+
created = giftCardRepo.create(toCreate);
|
|
258
|
+
return [4 /*yield*/, giftCardRepo.save(created)];
|
|
259
|
+
case 2:
|
|
260
|
+
result = _a.sent();
|
|
261
|
+
return [4 /*yield*/, this.eventBus_
|
|
262
|
+
.withTransaction(manager)
|
|
263
|
+
.emit(GiftCardService.Events.CREATED, {
|
|
264
|
+
id: result.id,
|
|
265
|
+
})];
|
|
266
|
+
case 3:
|
|
267
|
+
_a.sent();
|
|
268
|
+
return [2 /*return*/, result];
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
}); })];
|
|
272
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
});
|
|
276
|
+
};
|
|
277
|
+
GiftCardService.prototype.retrieve_ = function (selector, config) {
|
|
278
|
+
if (config === void 0) { config = {}; }
|
|
279
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
280
|
+
var _this = this;
|
|
281
|
+
return __generator(this, function (_a) {
|
|
282
|
+
switch (_a.label) {
|
|
283
|
+
case 0: return [4 /*yield*/, this.atomicPhase_(function (manager) { return __awaiter(_this, void 0, void 0, function () {
|
|
284
|
+
var giftCardRepo, _a, relations, query, giftCard, selectorConstraints;
|
|
285
|
+
return __generator(this, function (_b) {
|
|
286
|
+
switch (_b.label) {
|
|
287
|
+
case 0:
|
|
288
|
+
giftCardRepo = manager.getCustomRepository(this.giftCardRepository_);
|
|
289
|
+
_a = (0, utils_1.buildQuery)(selector, config), relations = _a.relations, query = __rest(_a, ["relations"]);
|
|
290
|
+
return [4 /*yield*/, giftCardRepo.findOneWithRelations(relations, query)];
|
|
291
|
+
case 1:
|
|
292
|
+
giftCard = _b.sent();
|
|
293
|
+
if (!giftCard) {
|
|
294
|
+
selectorConstraints = Object.entries(selector)
|
|
295
|
+
.map(function (key, value) { return "".concat(key, ": ").concat(value); })
|
|
296
|
+
.join(", ");
|
|
297
|
+
throw new medusa_core_utils_1.MedusaError(medusa_core_utils_1.MedusaError.Types.NOT_FOUND, "Gift card with ".concat(selectorConstraints, " was not found"));
|
|
298
|
+
}
|
|
299
|
+
return [2 /*return*/, giftCard];
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
}); })];
|
|
303
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
304
|
+
}
|
|
262
305
|
});
|
|
263
306
|
});
|
|
264
307
|
};
|
|
265
308
|
/**
|
|
266
309
|
* Gets a gift card by id.
|
|
267
|
-
* @param
|
|
268
|
-
* @param
|
|
269
|
-
* @return
|
|
310
|
+
* @param giftCardId - id of gift card to retrieve
|
|
311
|
+
* @param config - optional values to include with gift card query
|
|
312
|
+
* @return the gift card
|
|
270
313
|
*/
|
|
271
314
|
GiftCardService.prototype.retrieve = function (giftCardId, config) {
|
|
272
315
|
if (config === void 0) { config = {}; }
|
|
273
316
|
return __awaiter(this, void 0, void 0, function () {
|
|
274
|
-
var
|
|
317
|
+
var _this = this;
|
|
275
318
|
return __generator(this, function (_a) {
|
|
276
319
|
switch (_a.label) {
|
|
277
|
-
case 0:
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
if (config.relations) {
|
|
287
|
-
query.relations = config.relations;
|
|
288
|
-
}
|
|
289
|
-
rels = query.relations;
|
|
290
|
-
delete query.relations;
|
|
291
|
-
return [4 /*yield*/, giftCardRepo.findOneWithRelations(rels, query)];
|
|
292
|
-
case 1:
|
|
293
|
-
giftCard = _a.sent();
|
|
294
|
-
if (!giftCard) {
|
|
295
|
-
throw new medusa_core_utils_1.MedusaError(medusa_core_utils_1.MedusaError.Types.NOT_FOUND, "Gift card with ".concat(giftCardId, " was not found"));
|
|
296
|
-
}
|
|
297
|
-
return [2 /*return*/, giftCard];
|
|
320
|
+
case 0: return [4 /*yield*/, this.atomicPhase_(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
321
|
+
return __generator(this, function (_a) {
|
|
322
|
+
switch (_a.label) {
|
|
323
|
+
case 0: return [4 /*yield*/, this.retrieve_({ id: giftCardId }, config)];
|
|
324
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
}); })];
|
|
328
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
298
329
|
}
|
|
299
330
|
});
|
|
300
331
|
});
|
|
@@ -302,125 +333,112 @@ var GiftCardService = /** @class */ (function (_super) {
|
|
|
302
333
|
GiftCardService.prototype.retrieveByCode = function (code, config) {
|
|
303
334
|
if (config === void 0) { config = {}; }
|
|
304
335
|
return __awaiter(this, void 0, void 0, function () {
|
|
305
|
-
var
|
|
336
|
+
var _this = this;
|
|
306
337
|
return __generator(this, function (_a) {
|
|
307
338
|
switch (_a.label) {
|
|
308
|
-
case 0:
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
query.relations = config.relations;
|
|
318
|
-
}
|
|
319
|
-
rels = query.relations;
|
|
320
|
-
delete query.relations;
|
|
321
|
-
return [4 /*yield*/, giftCardRepo.findOneWithRelations(rels, query)];
|
|
322
|
-
case 1:
|
|
323
|
-
giftCard = _a.sent();
|
|
324
|
-
if (!giftCard) {
|
|
325
|
-
throw new medusa_core_utils_1.MedusaError(medusa_core_utils_1.MedusaError.Types.NOT_FOUND, "Gift card with ".concat(code, " was not found"));
|
|
326
|
-
}
|
|
327
|
-
return [2 /*return*/, giftCard];
|
|
339
|
+
case 0: return [4 /*yield*/, this.atomicPhase_(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
340
|
+
return __generator(this, function (_a) {
|
|
341
|
+
switch (_a.label) {
|
|
342
|
+
case 0: return [4 /*yield*/, this.retrieve_({ code: code }, config)];
|
|
343
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
344
|
+
}
|
|
345
|
+
});
|
|
346
|
+
}); })];
|
|
347
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
328
348
|
}
|
|
329
349
|
});
|
|
330
350
|
});
|
|
331
351
|
};
|
|
332
352
|
/**
|
|
333
353
|
* Updates a giftCard.
|
|
334
|
-
* @param
|
|
335
|
-
* @param
|
|
336
|
-
* @return
|
|
354
|
+
* @param giftCardId - giftCard id of giftCard to update
|
|
355
|
+
* @param update - the data to update the giftCard with
|
|
356
|
+
* @return the result of the update operation
|
|
337
357
|
*/
|
|
338
358
|
GiftCardService.prototype.update = function (giftCardId, update) {
|
|
339
359
|
return __awaiter(this, void 0, void 0, function () {
|
|
340
360
|
var _this = this;
|
|
341
361
|
return __generator(this, function (_a) {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
case 4:
|
|
364
|
-
_a.metadata = _f.sent();
|
|
365
|
-
_f.label = 5;
|
|
366
|
-
case 5:
|
|
367
|
-
if (typeof balance !== "undefined") {
|
|
368
|
-
if (balance < 0 || giftCard.value < balance) {
|
|
369
|
-
throw new medusa_core_utils_1.MedusaError(medusa_core_utils_1.MedusaError.Types.INVALID_ARGUMENT, "new balance is invalid");
|
|
362
|
+
switch (_a.label) {
|
|
363
|
+
case 0: return [4 /*yield*/, this.atomicPhase_(function (manager) { return __awaiter(_this, void 0, void 0, function () {
|
|
364
|
+
var giftCardRepo, giftCard, region_id, metadata, balance, rest, region, _a, _b, _c, key, value;
|
|
365
|
+
var e_1, _d;
|
|
366
|
+
return __generator(this, function (_e) {
|
|
367
|
+
switch (_e.label) {
|
|
368
|
+
case 0:
|
|
369
|
+
giftCardRepo = manager.getCustomRepository(this.giftCardRepository_);
|
|
370
|
+
return [4 /*yield*/, this.retrieve(giftCardId)];
|
|
371
|
+
case 1:
|
|
372
|
+
giftCard = _e.sent();
|
|
373
|
+
region_id = update.region_id, metadata = update.metadata, balance = update.balance, rest = __rest(update, ["region_id", "metadata", "balance"]);
|
|
374
|
+
if (!(region_id && region_id !== giftCard.region_id)) return [3 /*break*/, 3];
|
|
375
|
+
return [4 /*yield*/, this.regionService_.retrieve(region_id)];
|
|
376
|
+
case 2:
|
|
377
|
+
region = _e.sent();
|
|
378
|
+
giftCard.region_id = region.id;
|
|
379
|
+
_e.label = 3;
|
|
380
|
+
case 3:
|
|
381
|
+
if (metadata) {
|
|
382
|
+
giftCard.metadata = (0, utils_1.setMetadata)(giftCard, metadata);
|
|
370
383
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
giftCard[key] = value;
|
|
384
|
+
if (typeof balance !== "undefined") {
|
|
385
|
+
if (balance < 0 || giftCard.value < balance) {
|
|
386
|
+
throw new medusa_core_utils_1.MedusaError(medusa_core_utils_1.MedusaError.Types.INVALID_ARGUMENT, "new balance is invalid");
|
|
387
|
+
}
|
|
388
|
+
giftCard.balance = balance;
|
|
377
389
|
}
|
|
378
|
-
}
|
|
379
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
380
|
-
finally {
|
|
381
390
|
try {
|
|
382
|
-
|
|
391
|
+
for (_a = __values(Object.entries(rest)), _b = _a.next(); !_b.done; _b = _a.next()) {
|
|
392
|
+
_c = __read(_b.value, 2), key = _c[0], value = _c[1];
|
|
393
|
+
giftCard[key] = value;
|
|
394
|
+
}
|
|
383
395
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
396
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
397
|
+
finally {
|
|
398
|
+
try {
|
|
399
|
+
if (_b && !_b.done && (_d = _a.return)) _d.call(_a);
|
|
400
|
+
}
|
|
401
|
+
finally { if (e_1) throw e_1.error; }
|
|
402
|
+
}
|
|
403
|
+
return [4 /*yield*/, giftCardRepo.save(giftCard)];
|
|
404
|
+
case 4: return [2 /*return*/, _e.sent()];
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
}); })];
|
|
408
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
409
|
+
}
|
|
393
410
|
});
|
|
394
411
|
});
|
|
395
412
|
};
|
|
396
413
|
/**
|
|
397
414
|
* Deletes a gift card idempotently
|
|
398
|
-
* @param
|
|
399
|
-
* @return
|
|
415
|
+
* @param giftCardId - id of gift card to delete
|
|
416
|
+
* @return the result of the delete operation
|
|
400
417
|
*/
|
|
401
418
|
GiftCardService.prototype.delete = function (giftCardId) {
|
|
402
419
|
return __awaiter(this, void 0, void 0, function () {
|
|
403
420
|
var _this = this;
|
|
404
421
|
return __generator(this, function (_a) {
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
_a.sent();
|
|
420
|
-
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
|
-
|
|
422
|
+
switch (_a.label) {
|
|
423
|
+
case 0: return [4 /*yield*/, this.atomicPhase_(function (manager) { return __awaiter(_this, void 0, void 0, function () {
|
|
424
|
+
var giftCardRepo, giftCard;
|
|
425
|
+
return __generator(this, function (_a) {
|
|
426
|
+
switch (_a.label) {
|
|
427
|
+
case 0:
|
|
428
|
+
giftCardRepo = manager.getCustomRepository(this.giftCardRepository_);
|
|
429
|
+
return [4 /*yield*/, giftCardRepo.findOne({ where: { id: giftCardId } })];
|
|
430
|
+
case 1:
|
|
431
|
+
giftCard = _a.sent();
|
|
432
|
+
if (!giftCard) {
|
|
433
|
+
return [2 /*return*/];
|
|
434
|
+
}
|
|
435
|
+
return [4 /*yield*/, giftCardRepo.softRemove(giftCard)];
|
|
436
|
+
case 2: return [2 /*return*/, _a.sent()];
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
}); })];
|
|
440
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
441
|
+
}
|
|
424
442
|
});
|
|
425
443
|
});
|
|
426
444
|
};
|
|
@@ -428,6 +446,6 @@ var GiftCardService = /** @class */ (function (_super) {
|
|
|
428
446
|
CREATED: "gift_card.created",
|
|
429
447
|
};
|
|
430
448
|
return GiftCardService;
|
|
431
|
-
}(
|
|
449
|
+
}(interfaces_1.TransactionBaseService));
|
|
432
450
|
exports.default = GiftCardService;
|
|
433
451
|
//# sourceMappingURL=gift-card.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gift-card.js","sourceRoot":"","sources":["../../src/services/gift-card.
|
|
1
|
+
{"version":3,"file":"gift-card.js","sourceRoot":"","sources":["../../src/services/gift-card.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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