@medusajs/medusa 1.3.3 → 1.3.4
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/.turbo/turbo-build.log +1 -0
- package/CHANGELOG.md +170 -194
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +6 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/middlewares/normalized-query.d.ts +1 -1
- package/dist/api/routes/admin/apps/authorize-app.d.ts +1 -1
- package/dist/api/routes/admin/apps/list.d.ts +1 -1
- package/dist/api/routes/admin/auth/create-session.d.ts +1 -1
- package/dist/api/routes/admin/auth/delete-session.d.ts +1 -1
- package/dist/api/routes/admin/auth/get-session.d.ts +1 -1
- package/dist/api/routes/admin/auth/index.js +5 -1
- package/dist/api/routes/admin/auth/index.js.map +1 -1
- package/dist/api/routes/admin/batch/cancel-batch-job.d.ts +1 -1
- package/dist/api/routes/admin/batch/confirm-batch-job.d.ts +1 -1
- package/dist/api/routes/admin/batch/create-batch-job.d.ts +1 -1
- package/dist/api/routes/admin/batch/get-batch-job.d.ts +1 -1
- package/dist/api/routes/admin/batch/index.js +5 -1
- package/dist/api/routes/admin/batch/index.js.map +1 -1
- package/dist/api/routes/admin/batch/list-batch-jobs.d.ts +1 -1
- package/dist/api/routes/admin/collections/add-products.d.ts +1 -1
- package/dist/api/routes/admin/collections/create-collection.d.ts +1 -1
- package/dist/api/routes/admin/collections/delete-collection.d.ts +1 -1
- package/dist/api/routes/admin/collections/get-collection.d.ts +1 -1
- package/dist/api/routes/admin/collections/index.js +5 -1
- package/dist/api/routes/admin/collections/index.js.map +1 -1
- package/dist/api/routes/admin/collections/list-collections.d.ts +1 -1
- package/dist/api/routes/admin/collections/list-collections.js +5 -1
- package/dist/api/routes/admin/collections/list-collections.js.map +1 -1
- package/dist/api/routes/admin/collections/remove-products.d.ts +1 -1
- package/dist/api/routes/admin/collections/update-collection.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/add-customers-batch.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/create-customer-group.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/delete-customer-group.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/delete-customers-batch.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/get-customer-group-customers.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/get-customer-group.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/index.js +5 -1
- package/dist/api/routes/admin/customer-groups/index.js.map +1 -1
- package/dist/api/routes/admin/customer-groups/list-customer-groups.d.ts +1 -1
- package/dist/api/routes/admin/customer-groups/update-customer-group.d.ts +1 -1
- package/dist/api/routes/admin/customers/create-customer.d.ts +1 -1
- package/dist/api/routes/admin/customers/get-customer.d.ts +1 -1
- package/dist/api/routes/admin/customers/index.js +5 -1
- package/dist/api/routes/admin/customers/index.js.map +1 -1
- package/dist/api/routes/admin/customers/list-customers.d.ts +1 -1
- package/dist/api/routes/admin/customers/update-customer.d.ts +1 -1
- package/dist/api/routes/admin/discounts/add-region.d.ts +1 -1
- package/dist/api/routes/admin/discounts/create-condition.d.ts +1 -1
- package/dist/api/routes/admin/discounts/create-discount.d.ts +1 -1
- package/dist/api/routes/admin/discounts/create-dynamic-code.d.ts +1 -1
- package/dist/api/routes/admin/discounts/delete-condition.d.ts +1 -1
- package/dist/api/routes/admin/discounts/delete-discount.d.ts +1 -1
- package/dist/api/routes/admin/discounts/delete-dynamic-code.d.ts +1 -1
- package/dist/api/routes/admin/discounts/get-condition.d.ts +1 -1
- package/dist/api/routes/admin/discounts/get-discount-by-code.d.ts +1 -1
- package/dist/api/routes/admin/discounts/get-discount.d.ts +1 -1
- package/dist/api/routes/admin/discounts/index.js +5 -1
- package/dist/api/routes/admin/discounts/index.js.map +1 -1
- package/dist/api/routes/admin/discounts/list-discounts.d.ts +1 -1
- package/dist/api/routes/admin/discounts/list-discounts.js +5 -1
- package/dist/api/routes/admin/discounts/list-discounts.js.map +1 -1
- package/dist/api/routes/admin/discounts/remove-region.d.ts +1 -1
- package/dist/api/routes/admin/discounts/update-condition.d.ts +1 -1
- package/dist/api/routes/admin/discounts/update-discount.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/create-draft-order.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/create-line-item.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/delete-draft-order.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/delete-line-item.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/get-draft-order.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/index.js +5 -1
- package/dist/api/routes/admin/draft-orders/index.js.map +1 -1
- package/dist/api/routes/admin/draft-orders/list-draft-orders.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/register-payment.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/update-draft-order.d.ts +1 -1
- package/dist/api/routes/admin/draft-orders/update-line-item.d.ts +1 -1
- package/dist/api/routes/admin/gift-cards/create-gift-card.d.ts +1 -1
- package/dist/api/routes/admin/gift-cards/delete-gift-card.d.ts +1 -1
- package/dist/api/routes/admin/gift-cards/get-gift-card.d.ts +1 -1
- package/dist/api/routes/admin/gift-cards/index.js +5 -1
- package/dist/api/routes/admin/gift-cards/index.js.map +1 -1
- package/dist/api/routes/admin/gift-cards/list-gift-cards.d.ts +1 -1
- package/dist/api/routes/admin/gift-cards/update-gift-card.d.ts +1 -1
- package/dist/api/routes/admin/index.js +27 -20
- package/dist/api/routes/admin/index.js.map +1 -1
- package/dist/api/routes/admin/invites/accept-invite.d.ts +1 -1
- package/dist/api/routes/admin/invites/create-invite.d.ts +1 -1
- package/dist/api/routes/admin/invites/delete-invite.d.ts +1 -1
- package/dist/api/routes/admin/invites/index.js +5 -1
- package/dist/api/routes/admin/invites/index.js.map +1 -1
- package/dist/api/routes/admin/invites/list-invites.d.ts +1 -1
- package/dist/api/routes/admin/invites/resend-invite.d.ts +1 -1
- package/dist/api/routes/admin/notes/create-note.d.ts +1 -1
- package/dist/api/routes/admin/notes/delete-note.d.ts +1 -1
- package/dist/api/routes/admin/notes/get-note.d.ts +1 -1
- package/dist/api/routes/admin/notes/index.js +5 -1
- package/dist/api/routes/admin/notes/index.js.map +1 -1
- package/dist/api/routes/admin/notes/list-notes.d.ts +1 -1
- package/dist/api/routes/admin/notes/update-note.d.ts +1 -1
- package/dist/api/routes/admin/notifications/index.js +5 -1
- package/dist/api/routes/admin/notifications/index.js.map +1 -1
- package/dist/api/routes/admin/notifications/list-notifications.d.ts +1 -1
- package/dist/api/routes/admin/notifications/resend-notification.d.ts +1 -1
- package/dist/api/routes/admin/orders/add-shipping-method.d.ts +1 -1
- package/dist/api/routes/admin/orders/archive-order.d.ts +1 -1
- package/dist/api/routes/admin/orders/cancel-claim.d.ts +1 -1
- package/dist/api/routes/admin/orders/cancel-fulfillment-claim.d.ts +1 -1
- package/dist/api/routes/admin/orders/cancel-fulfillment-swap.d.ts +1 -1
- package/dist/api/routes/admin/orders/cancel-fulfillment.d.ts +1 -1
- package/dist/api/routes/admin/orders/cancel-order.d.ts +1 -1
- package/dist/api/routes/admin/orders/cancel-swap.d.ts +1 -1
- package/dist/api/routes/admin/orders/capture-payment.d.ts +1 -1
- package/dist/api/routes/admin/orders/complete-order.d.ts +1 -1
- package/dist/api/routes/admin/orders/create-claim-shipment.d.ts +1 -1
- package/dist/api/routes/admin/orders/create-claim.d.ts +1 -1
- package/dist/api/routes/admin/orders/create-fulfillment.d.ts +1 -1
- package/dist/api/routes/admin/orders/create-order.d.ts +1 -1
- package/dist/api/routes/admin/orders/create-shipment.d.ts +1 -1
- package/dist/api/routes/admin/orders/create-swap-shipment.d.ts +1 -1
- package/dist/api/routes/admin/orders/create-swap.d.ts +1 -1
- package/dist/api/routes/admin/orders/delete-metadata.d.ts +1 -1
- package/dist/api/routes/admin/orders/fulfill-claim.d.ts +1 -1
- package/dist/api/routes/admin/orders/fulfill-swap.d.ts +1 -1
- package/dist/api/routes/admin/orders/get-order.d.ts +1 -1
- package/dist/api/routes/admin/orders/get-order.js +1 -5
- package/dist/api/routes/admin/orders/get-order.js.map +1 -1
- package/dist/api/routes/admin/orders/index.d.ts +2 -1
- package/dist/api/routes/admin/orders/index.js +61 -7
- package/dist/api/routes/admin/orders/index.js.map +1 -1
- package/dist/api/routes/admin/orders/list-orders.d.ts +1 -1
- package/dist/api/routes/admin/orders/list-orders.js +10 -37
- package/dist/api/routes/admin/orders/list-orders.js.map +1 -1
- package/dist/api/routes/admin/orders/process-swap-payment.d.ts +1 -1
- package/dist/api/routes/admin/orders/refund-payment.d.ts +1 -1
- package/dist/api/routes/admin/orders/request-return.d.ts +1 -1
- package/dist/api/routes/admin/orders/update-claim.d.ts +1 -1
- package/dist/api/routes/admin/orders/update-order.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/add-prices-batch.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/create-price-list.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/delete-price-list.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/delete-prices-batch.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/delete-product-prices.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/delete-variant-prices.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/get-price-list.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/index.js +5 -1
- 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 +1 -1
- package/dist/api/routes/admin/price-lists/list-price-lists.d.ts +1 -1
- package/dist/api/routes/admin/price-lists/update-price-list.d.ts +1 -1
- package/dist/api/routes/admin/product-tags/index.js +5 -1
- package/dist/api/routes/admin/product-tags/index.js.map +1 -1
- package/dist/api/routes/admin/product-tags/list-product-tags.d.ts +1 -1
- package/dist/api/routes/admin/product-types/index.js +5 -1
- package/dist/api/routes/admin/product-types/index.js.map +1 -1
- package/dist/api/routes/admin/product-types/list-product-types.d.ts +1 -1
- package/dist/api/routes/admin/products/add-option.d.ts +1 -1
- package/dist/api/routes/admin/products/create-product.d.ts +1 -1
- package/dist/api/routes/admin/products/create-variant.d.ts +1 -1
- package/dist/api/routes/admin/products/delete-option.d.ts +1 -1
- package/dist/api/routes/admin/products/delete-product.d.ts +1 -1
- package/dist/api/routes/admin/products/delete-variant.d.ts +1 -1
- package/dist/api/routes/admin/products/get-product.d.ts +1 -1
- package/dist/api/routes/admin/products/get-product.js +1 -5
- package/dist/api/routes/admin/products/get-product.js.map +1 -1
- package/dist/api/routes/admin/products/index.d.ts +2 -1
- package/dist/api/routes/admin/products/index.js +62 -7
- package/dist/api/routes/admin/products/index.js.map +1 -1
- package/dist/api/routes/admin/products/list-products.d.ts +1 -1
- package/dist/api/routes/admin/products/list-products.js +37 -28
- package/dist/api/routes/admin/products/list-products.js.map +1 -1
- package/dist/api/routes/admin/products/list-types.d.ts +1 -1
- package/dist/api/routes/admin/products/list-variants.d.ts +1 -1
- package/dist/api/routes/admin/products/set-metadata.d.ts +1 -1
- package/dist/api/routes/admin/products/update-option.d.ts +1 -1
- package/dist/api/routes/admin/products/update-product.d.ts +1 -1
- package/dist/api/routes/admin/products/update-variant.d.ts +1 -1
- package/dist/api/routes/admin/regions/add-country.d.ts +1 -1
- package/dist/api/routes/admin/regions/add-fulfillment-provider.d.ts +1 -1
- package/dist/api/routes/admin/regions/add-payment-provider.d.ts +1 -1
- package/dist/api/routes/admin/regions/create-region.d.ts +1 -1
- package/dist/api/routes/admin/regions/delete-metadata.d.ts +1 -1
- package/dist/api/routes/admin/regions/delete-region.d.ts +1 -1
- package/dist/api/routes/admin/regions/get-fulfillment-options.d.ts +1 -1
- package/dist/api/routes/admin/regions/get-region.d.ts +1 -1
- package/dist/api/routes/admin/regions/index.js +5 -1
- package/dist/api/routes/admin/regions/index.js.map +1 -1
- package/dist/api/routes/admin/regions/list-regions.d.ts +1 -1
- package/dist/api/routes/admin/regions/list-regions.js +5 -1
- package/dist/api/routes/admin/regions/list-regions.js.map +1 -1
- package/dist/api/routes/admin/regions/remove-country.d.ts +1 -1
- package/dist/api/routes/admin/regions/remove-fulfillment-provider.d.ts +1 -1
- package/dist/api/routes/admin/regions/remove-payment-provider.d.ts +1 -1
- package/dist/api/routes/admin/regions/set-metadata.d.ts +1 -1
- package/dist/api/routes/admin/regions/update-region.d.ts +1 -1
- package/dist/api/routes/admin/return-reasons/create-reason.d.ts +1 -1
- package/dist/api/routes/admin/return-reasons/delete-reason.d.ts +1 -1
- package/dist/api/routes/admin/return-reasons/get-reason.d.ts +1 -1
- package/dist/api/routes/admin/return-reasons/index.js +5 -1
- package/dist/api/routes/admin/return-reasons/index.js.map +1 -1
- package/dist/api/routes/admin/return-reasons/list-reasons.d.ts +1 -1
- package/dist/api/routes/admin/return-reasons/update-reason.d.ts +1 -1
- package/dist/api/routes/admin/returns/cancel-return.d.ts +1 -1
- package/dist/api/routes/admin/returns/index.js +5 -1
- package/dist/api/routes/admin/returns/index.js.map +1 -1
- package/dist/api/routes/admin/returns/list-returns.d.ts +1 -1
- package/dist/api/routes/admin/returns/receive-return.d.ts +1 -1
- package/dist/api/routes/admin/sales-channels/create-sales-channel.d.ts +28 -0
- package/dist/api/routes/admin/{discounts/remove-valid-product.js → sales-channels/create-sales-channel.js} +43 -25
- package/dist/api/routes/admin/sales-channels/create-sales-channel.js.map +1 -0
- package/dist/api/routes/admin/sales-channels/delete-sales-channel.d.ts +29 -0
- package/dist/api/routes/admin/{discounts/add-valid-product.js → sales-channels/delete-sales-channel.js} +27 -25
- package/dist/api/routes/admin/sales-channels/delete-sales-channel.js.map +1 -0
- package/dist/api/routes/admin/sales-channels/get-sales-channel.d.ts +23 -0
- package/dist/api/routes/admin/{products/get-variants.js → sales-channels/get-sales-channel.js} +14 -16
- package/dist/api/routes/admin/sales-channels/get-sales-channel.js.map +1 -0
- package/dist/api/routes/admin/sales-channels/index.d.ts +15 -0
- package/dist/api/routes/admin/sales-channels/index.js +53 -0
- package/dist/api/routes/admin/sales-channels/index.js.map +1 -0
- package/dist/api/routes/admin/sales-channels/update-sales-channel.d.ts +42 -0
- package/dist/api/routes/{store/carts/update-payment-method.js → admin/sales-channels/update-sales-channel.js} +39 -40
- package/dist/api/routes/admin/sales-channels/update-sales-channel.js.map +1 -0
- package/dist/api/routes/admin/shipping-options/create-shipping-option.d.ts +1 -1
- package/dist/api/routes/admin/shipping-options/delete-shipping-option.d.ts +1 -1
- package/dist/api/routes/admin/shipping-options/get-shipping-option.d.ts +1 -1
- package/dist/api/routes/admin/shipping-options/index.js +5 -1
- package/dist/api/routes/admin/shipping-options/index.js.map +1 -1
- package/dist/api/routes/admin/shipping-options/list-shipping-options.d.ts +1 -1
- package/dist/api/routes/admin/shipping-options/update-shipping-option.d.ts +1 -1
- package/dist/api/routes/admin/shipping-profiles/create-shipping-profile.d.ts +1 -1
- package/dist/api/routes/admin/shipping-profiles/delete-shipping-profile.d.ts +1 -1
- package/dist/api/routes/admin/shipping-profiles/get-shipping-profile.d.ts +1 -1
- package/dist/api/routes/admin/shipping-profiles/index.js +5 -1
- package/dist/api/routes/admin/shipping-profiles/index.js.map +1 -1
- package/dist/api/routes/admin/shipping-profiles/list-shipping-profiles.d.ts +1 -1
- package/dist/api/routes/admin/shipping-profiles/update-shipping-profile.d.ts +1 -1
- package/dist/api/routes/admin/store/add-currency.d.ts +1 -1
- package/dist/api/routes/admin/store/get-store.d.ts +1 -1
- package/dist/api/routes/admin/store/get-store.js +3 -1
- package/dist/api/routes/admin/store/get-store.js.map +1 -1
- package/dist/api/routes/admin/store/index.js +5 -1
- package/dist/api/routes/admin/store/index.js.map +1 -1
- package/dist/api/routes/admin/store/list-payment-providers.d.ts +1 -1
- package/dist/api/routes/admin/store/list-tax-providers.d.ts +1 -1
- package/dist/api/routes/admin/store/remove-currency.d.ts +1 -1
- package/dist/api/routes/admin/store/update-store.d.ts +1 -1
- package/dist/api/routes/admin/swaps/get-swap.d.ts +1 -1
- package/dist/api/routes/admin/swaps/index.js +5 -1
- package/dist/api/routes/admin/swaps/index.js.map +1 -1
- package/dist/api/routes/admin/swaps/list-swaps.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/add-to-product-types.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/add-to-products.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/add-to-shipping-options.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/create-tax-rate.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/delete-tax-rate.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/get-tax-rate.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/index.js +5 -1
- package/dist/api/routes/admin/tax-rates/index.js.map +1 -1
- package/dist/api/routes/admin/tax-rates/list-tax-rates.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/remove-from-product-types.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/remove-from-products.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/remove-from-shipping-options.d.ts +1 -1
- package/dist/api/routes/admin/tax-rates/update-tax-rate.d.ts +1 -1
- package/dist/api/routes/admin/uploads/create-upload.d.ts +1 -1
- package/dist/api/routes/admin/uploads/delete-upload.d.ts +1 -1
- package/dist/api/routes/admin/uploads/get-download-url.d.ts +1 -1
- package/dist/api/routes/admin/uploads/index.js +5 -1
- package/dist/api/routes/admin/uploads/index.js.map +1 -1
- package/dist/api/routes/admin/users/create-user.d.ts +1 -1
- package/dist/api/routes/admin/users/delete-user.d.ts +1 -1
- package/dist/api/routes/admin/users/get-user.d.ts +1 -1
- package/dist/api/routes/admin/users/index.js +5 -1
- package/dist/api/routes/admin/users/index.js.map +1 -1
- package/dist/api/routes/admin/users/list-users.d.ts +1 -1
- package/dist/api/routes/admin/users/reset-password-token.d.ts +1 -1
- package/dist/api/routes/admin/users/reset-password.d.ts +1 -1
- package/dist/api/routes/admin/users/update-user.d.ts +1 -1
- package/dist/api/routes/admin/variants/index.js +5 -1
- package/dist/api/routes/admin/variants/index.js.map +1 -1
- package/dist/api/routes/admin/variants/list-variants.d.ts +1 -1
- package/dist/api/routes/store/auth/create-session.d.ts +1 -1
- package/dist/api/routes/store/auth/delete-session.d.ts +1 -1
- package/dist/api/routes/store/auth/exists.d.ts +1 -1
- package/dist/api/routes/store/auth/get-session.d.ts +1 -1
- package/dist/api/routes/store/auth/index.js +5 -1
- package/dist/api/routes/store/auth/index.js.map +1 -1
- package/dist/api/routes/store/carts/add-shipping-method.d.ts +1 -1
- package/dist/api/routes/store/carts/calculate-taxes.d.ts +1 -1
- package/dist/api/routes/store/carts/complete-cart.d.ts +1 -1
- package/dist/api/routes/store/carts/create-cart.d.ts +1 -1
- package/dist/api/routes/store/carts/create-line-item.d.ts +1 -1
- package/dist/api/routes/store/carts/create-payment-sessions.d.ts +1 -1
- package/dist/api/routes/store/carts/delete-discount.d.ts +1 -1
- package/dist/api/routes/store/carts/delete-line-item.d.ts +1 -1
- package/dist/api/routes/store/carts/delete-payment-session.d.ts +1 -1
- package/dist/api/routes/store/carts/get-cart.d.ts +1 -1
- package/dist/api/routes/store/carts/get-cart.js +1 -5
- package/dist/api/routes/store/carts/get-cart.js.map +1 -1
- package/dist/api/routes/store/carts/index.js +54 -6
- package/dist/api/routes/store/carts/index.js.map +1 -1
- package/dist/api/routes/store/carts/refresh-payment-session.d.ts +1 -1
- package/dist/api/routes/store/carts/set-payment-session.d.ts +1 -1
- package/dist/api/routes/store/carts/update-cart.d.ts +1 -1
- package/dist/api/routes/store/carts/update-line-item.d.ts +1 -1
- package/dist/api/routes/store/carts/update-payment-session.d.ts +1 -1
- package/dist/api/routes/store/collections/get-collection.d.ts +1 -1
- package/dist/api/routes/store/collections/index.js +5 -1
- package/dist/api/routes/store/collections/index.js.map +1 -1
- package/dist/api/routes/store/collections/list-collections.d.ts +1 -1
- package/dist/api/routes/store/customers/create-address.d.ts +1 -1
- package/dist/api/routes/store/customers/create-customer.d.ts +1 -1
- package/dist/api/routes/store/customers/delete-address.d.ts +1 -1
- package/dist/api/routes/store/customers/get-customer.d.ts +1 -1
- package/dist/api/routes/store/customers/get-payment-methods.d.ts +1 -1
- package/dist/api/routes/store/customers/index.js +5 -1
- package/dist/api/routes/store/customers/index.js.map +1 -1
- package/dist/api/routes/store/customers/list-orders.d.ts +1 -1
- package/dist/api/routes/store/customers/reset-password-token.d.ts +1 -1
- package/dist/api/routes/store/customers/reset-password.d.ts +1 -1
- package/dist/api/routes/store/customers/update-address.d.ts +1 -1
- package/dist/api/routes/store/customers/update-customer.d.ts +1 -1
- package/dist/api/routes/store/gift-cards/get-gift-card.d.ts +1 -1
- package/dist/api/routes/store/gift-cards/index.js +5 -1
- package/dist/api/routes/store/gift-cards/index.js.map +1 -1
- package/dist/api/routes/store/orders/get-order-by-cart.d.ts +1 -1
- package/dist/api/routes/store/orders/get-order.d.ts +1 -1
- package/dist/api/routes/store/orders/index.js +5 -1
- package/dist/api/routes/store/orders/index.js.map +1 -1
- package/dist/api/routes/store/orders/lookup-order.d.ts +1 -1
- package/dist/api/routes/store/products/get-product.d.ts +1 -1
- package/dist/api/routes/store/products/index.js +5 -1
- package/dist/api/routes/store/products/index.js.map +1 -1
- package/dist/api/routes/store/products/list-products.d.ts +1 -1
- package/dist/api/routes/store/regions/get-region.d.ts +1 -1
- package/dist/api/routes/store/regions/index.js +5 -1
- package/dist/api/routes/store/regions/index.js.map +1 -1
- package/dist/api/routes/store/regions/list-regions.d.ts +1 -1
- package/dist/api/routes/store/return-reasons/get-reason.d.ts +1 -1
- package/dist/api/routes/store/return-reasons/index.js +5 -1
- package/dist/api/routes/store/return-reasons/index.js.map +1 -1
- package/dist/api/routes/store/return-reasons/list-reasons.d.ts +1 -1
- package/dist/api/routes/store/returns/create-return.d.ts +1 -1
- package/dist/api/routes/store/returns/index.js +5 -1
- package/dist/api/routes/store/returns/index.js.map +1 -1
- package/dist/api/routes/store/shipping-options/index.js +5 -1
- package/dist/api/routes/store/shipping-options/index.js.map +1 -1
- package/dist/api/routes/store/shipping-options/list-options.d.ts +1 -1
- package/dist/api/routes/store/shipping-options/list-shipping-options.d.ts +1 -1
- package/dist/api/routes/store/swaps/create-swap.d.ts +1 -1
- package/dist/api/routes/store/swaps/get-swap-by-cart.d.ts +1 -1
- package/dist/api/routes/store/swaps/index.js +5 -1
- package/dist/api/routes/store/swaps/index.js.map +1 -1
- package/dist/api/routes/store/variants/get-variant.d.ts +1 -1
- package/dist/api/routes/store/variants/index.js +5 -1
- package/dist/api/routes/store/variants/index.js.map +1 -1
- package/dist/api/routes/store/variants/list-variants.d.ts +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces/file-service.d.ts +1 -0
- package/dist/interfaces/index.js +5 -1
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/transaction-base-service.js +2 -3
- package/dist/interfaces/transaction-base-service.js.map +1 -1
- package/dist/loaders/defaults.js +15 -3
- package/dist/loaders/defaults.js.map +1 -1
- package/dist/loaders/feature-flags/index.d.ts +1 -1
- package/dist/loaders/feature-flags/index.js +2 -2
- package/dist/loaders/feature-flags/index.js.map +1 -1
- package/dist/loaders/feature-flags/sales-channels.d.ts +3 -0
- package/dist/loaders/feature-flags/sales-channels.js +10 -0
- package/dist/loaders/feature-flags/sales-channels.js.map +1 -0
- package/dist/loaders/index.js +5 -1
- package/dist/loaders/index.js.map +1 -1
- package/dist/loaders/models.d.ts +3 -3
- package/dist/loaders/plugins.d.ts +1 -1
- package/dist/loaders/repositories.d.ts +3 -3
- package/dist/loaders/services.d.ts +1 -1
- package/dist/loaders/strategies.d.ts +1 -1
- package/dist/loaders/subscribers.d.ts +3 -3
- package/dist/migrations/1649775522087-add_batch_job_model.js.map +1 -1
- package/dist/migrations/1656949291839-sales_channel.d.ts +7 -0
- package/dist/migrations/1656949291839-sales_channel.js +126 -0
- package/dist/migrations/1656949291839-sales_channel.js.map +1 -0
- package/dist/migrations/1657098186554-taxed_gift_card_transactions.d.ts +6 -0
- package/dist/{services/transaction.js → migrations/1657098186554-taxed_gift_card_transactions.js} +33 -30
- package/dist/migrations/1657098186554-taxed_gift_card_transactions.js.map +1 -0
- package/dist/migrations/1657267320181-extended_batch_job.d.ts +6 -0
- package/dist/migrations/1657267320181-extended_batch_job.js +75 -0
- package/dist/migrations/1657267320181-extended_batch_job.js.map +1 -0
- package/dist/models/batch-job.js.map +1 -1
- package/dist/models/cart.d.ts +4 -0
- package/dist/models/cart.js +13 -0
- package/dist/models/cart.js.map +1 -1
- package/dist/models/gift-card-transaction.d.ts +2 -0
- package/dist/models/gift-card-transaction.js +8 -0
- package/dist/models/gift-card-transaction.js.map +1 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +6 -1
- package/dist/models/index.js.map +1 -1
- package/dist/models/order.d.ts +4 -0
- package/dist/models/order.js +15 -0
- package/dist/models/order.js.map +1 -1
- package/dist/models/product.d.ts +2 -0
- package/dist/models/product.js +19 -0
- package/dist/models/product.js.map +1 -1
- package/dist/models/sales-channel.d.ts +7 -0
- package/dist/models/sales-channel.js +64 -0
- package/dist/models/sales-channel.js.map +1 -0
- package/dist/models/store.d.ts +3 -0
- package/dist/models/store.js +13 -0
- package/dist/models/store.js.map +1 -1
- package/dist/repositories/sales-channel.d.ts +4 -0
- package/dist/repositories/sales-channel.js +38 -0
- package/dist/repositories/sales-channel.js.map +1 -0
- package/dist/services/cart.js +48 -31
- package/dist/services/cart.js.map +1 -1
- package/dist/services/event-bus.js +1 -1
- package/dist/services/event-bus.js.map +1 -1
- package/dist/services/index.d.ts +1 -0
- package/dist/services/index.js +3 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/order.js +71 -69
- package/dist/services/order.js.map +1 -1
- package/dist/services/sales-channel.d.ts +59 -0
- package/dist/services/sales-channel.js +304 -0
- package/dist/services/sales-channel.js.map +1 -0
- package/dist/services/totals.d.ts +12 -1
- package/dist/services/totals.js +79 -15
- package/dist/services/totals.js.map +1 -1
- package/dist/strategies/batch-jobs/order/export.js +23 -14
- package/dist/strategies/batch-jobs/order/export.js.map +1 -1
- package/dist/strategies/batch-jobs/product/export.d.ts +1 -0
- package/dist/strategies/batch-jobs/product/export.js +60 -25
- package/dist/strategies/batch-jobs/product/export.js.map +1 -1
- package/dist/strategies/tax-calculation.js +0 -4
- package/dist/strategies/tax-calculation.js.map +1 -1
- package/dist/subscribers/batch-job.js +1 -1
- package/dist/subscribers/batch-job.js.map +1 -1
- package/dist/subscribers/notification.js +1 -1
- package/dist/subscribers/notification.js.map +1 -1
- package/dist/subscribers/order.js +1 -1
- package/dist/subscribers/order.js.map +1 -1
- package/dist/subscribers/product.js +1 -1
- package/dist/subscribers/product.js.map +1 -1
- package/dist/types/common.d.ts +3 -1
- package/dist/types/common.js +7 -1
- package/dist/types/common.js.map +1 -1
- package/dist/types/feature-flags.d.ts +5 -0
- package/dist/types/global.d.ts +4 -0
- package/dist/types/sales-channels.d.ts +6 -0
- package/dist/types/sales-channels.js +3 -0
- package/dist/types/sales-channels.js.map +1 -0
- package/dist/types/store.d.ts +1 -0
- package/dist/utils/feature-flag-decorators.d.ts +1 -1
- package/dist/utils/feature-flag-decorators.js +34 -19
- package/dist/utils/feature-flag-decorators.js.map +1 -1
- package/dist/utils/flag-router.d.ts +2 -1
- package/dist/utils/flag-router.js +25 -0
- package/dist/utils/flag-router.js.map +1 -1
- package/dist/utils/get-query-config.js +5 -4
- package/dist/utils/get-query-config.js.map +1 -1
- package/dist/utils/index.js +5 -1
- package/dist/utils/index.js.map +1 -1
- package/jest.config.js +1 -0
- package/package.json +4 -6
- package/setupTests.js +3 -0
- package/LICENSE +0 -21
- package/dist/api/routes/admin/discounts/add-valid-product.d.ts +0 -23
- package/dist/api/routes/admin/discounts/add-valid-product.js.map +0 -1
- package/dist/api/routes/admin/discounts/remove-valid-product.d.ts +0 -23
- package/dist/api/routes/admin/discounts/remove-valid-product.js.map +0 -1
- package/dist/api/routes/admin/products/get-variants.d.ts +0 -24
- package/dist/api/routes/admin/products/get-variants.js.map +0 -1
- package/dist/api/routes/store/carts/update-payment-method.d.ts +0 -38
- package/dist/api/routes/store/carts/update-payment-method.js.map +0 -1
- package/dist/config/index.d.ts +0 -14
- package/dist/config/index.js +0 -40
- package/dist/config/index.js.map +0 -1
- package/dist/interfaces/base-service.d.ts +0 -66
- package/dist/interfaces/base-service.js +0 -377
- package/dist/interfaces/base-service.js.map +0 -1
- package/dist/scripts/mongo-sql-migration.d.ts +0 -2
- package/dist/scripts/mongo-sql-migration.js +0 -1603
- package/dist/scripts/mongo-sql-migration.js.map +0 -1
- package/dist/services/transaction.d.ts +0 -6
- package/dist/services/transaction.js.map +0 -1
- package/yarn-error.log +0 -29038
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"remove-valid-product.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/discounts/remove-valid-product.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sBAA+E;AAE/E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACtB,KAA8B,GAAG,CAAC,MAAM,EAAtC,WAAW,iBAAA,EAAE,UAAU,gBAAA,CAAe;gBAExC,eAAe,GAAoB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAA;gBAC7E,qBAAM,eAAe,CAAC,kBAAkB,CAAC,WAAW,EAAE,UAAU,CAAC,EAAA;;gBAAjE,SAAiE,CAAA;gBAEhD,qBAAM,eAAe,CAAC,QAAQ,CAAC,WAAW,EAAE;wBAC3D,MAAM,EAAE,8BAA2B;wBACnC,SAAS,EAAE,iCAA8B;qBAC1C,CAAC,EAAA;;gBAHI,QAAQ,GAAG,SAGf;gBAEF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAA;;;;KACnC,EAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
declare const _default: (req: any, res: any) => Promise<void>;
|
|
2
|
-
/**
|
|
3
|
-
* @oas [get] /products/{id}/variants
|
|
4
|
-
* operationId: "GetProductsProductVariants"
|
|
5
|
-
* summary: "List a Product's Product Variants"
|
|
6
|
-
* description: "Retrieves a list of the Product Variants associated with a Product."
|
|
7
|
-
* x-authenticated: true
|
|
8
|
-
* parameters:
|
|
9
|
-
* - (path) id=* {string} The id of the Product.
|
|
10
|
-
* tags:
|
|
11
|
-
* - Product
|
|
12
|
-
* responses:
|
|
13
|
-
* 200:
|
|
14
|
-
* description: OK
|
|
15
|
-
* content:
|
|
16
|
-
* application/json:
|
|
17
|
-
* schema:
|
|
18
|
-
* properties:
|
|
19
|
-
* variants:
|
|
20
|
-
* type: array
|
|
21
|
-
* items:
|
|
22
|
-
* $ref: "#/components/schemas/product_variant"
|
|
23
|
-
*/
|
|
24
|
-
export default _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-variants.js","sourceRoot":"","sources":["../../../../../src/api/routes/admin/products/get-variants.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEnB,cAAc,GAAmB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;gBACzD,qBAAM,cAAc,CAAC,gBAAgB,CAAC,EAAE,CAAC,EAAA;;gBAApD,QAAQ,GAAG,SAAyC;gBAE1D,GAAG,CAAC,IAAI,CAAC,EAAE,QAAQ,UAAA,EAAE,CAAC,CAAA;;;;KACvB,EAAA"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
declare const _default: (req: any, res: any) => Promise<void>;
|
|
2
|
-
/**
|
|
3
|
-
* @oas [post] /store/carts/{id}
|
|
4
|
-
* operationId: PostCartsCartPaymentMethodUpdate
|
|
5
|
-
* summary: Update a Cart"
|
|
6
|
-
* description: "Updates a Cart."
|
|
7
|
-
* parameters:
|
|
8
|
-
* - (path) id=* {string} The id of the Cart.
|
|
9
|
-
* requestBody:
|
|
10
|
-
* content:
|
|
11
|
-
* application/json:
|
|
12
|
-
* schema:
|
|
13
|
-
* required:
|
|
14
|
-
* - provider_id
|
|
15
|
-
* properties:
|
|
16
|
-
* provider_id:
|
|
17
|
-
* type: string
|
|
18
|
-
* description: The id of the Payment Provider.
|
|
19
|
-
* data:
|
|
20
|
-
* type: object
|
|
21
|
-
* description: ""
|
|
22
|
-
* tags:
|
|
23
|
-
* - Cart
|
|
24
|
-
* responses:
|
|
25
|
-
* 200:
|
|
26
|
-
* description: OK
|
|
27
|
-
* content:
|
|
28
|
-
* application/json:
|
|
29
|
-
* schema:
|
|
30
|
-
* properties:
|
|
31
|
-
* cart:
|
|
32
|
-
* $ref: "#/components/schemas/cart"
|
|
33
|
-
*/
|
|
34
|
-
export default _default;
|
|
35
|
-
export declare class StorePostCartsCartPaymentMethodUpdateReq {
|
|
36
|
-
provider_id: string;
|
|
37
|
-
data?: object;
|
|
38
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-payment-method.js","sourceRoot":"","sources":["../../../../../src/api/routes/store/carts/update-payment-method.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAsD;AACtD,sBAAqE;AAErE,yDAAuD;AAEvD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,mBAAe,UAAO,GAAG,EAAE,GAAG;;;;;gBACpB,EAAE,GAAK,GAAG,CAAC,MAAM,GAAf,CAAe;gBAEP,qBAAM,IAAA,qBAAS,EAC/B,wCAAwC,EACxC,GAAG,CAAC,IAAI,CACT,EAAA;;gBAHK,SAAS,GAAG,SAGjB;gBAEK,WAAW,GAAgB,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,CAAA;gBAEtD,qBAAM,WAAW,CAAC,gBAAgB,CAAC,EAAE,EAAE,SAAS,CAAC,EAAA;;gBAAxD,IAAI,GAAG,SAAiD;gBACrD,qBAAM,WAAW,CAAC,QAAQ,CAAC,EAAE,EAAE;wBACpC,MAAM,EAAE,yBAAsB;wBAC9B,SAAS,EAAE,4BAAyB;qBACrC,CAAC,EAAA;;gBAHF,IAAI,GAAG,SAGL,CAAA;gBAEF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,IAAI,MAAA,EAAE,CAAC,CAAA;;;;KAC/B,EAAA;AAED;IAAA;IAMA,CAAC;IAJC;QADC,IAAA,0BAAQ,GAAE;;iFACQ;IAGnB;QADC,IAAA,4BAAU,GAAE;;0EACA;IACf,+CAAC;CAAA,AAND,IAMC;AANY,4FAAwC"}
|
package/dist/config/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export default config;
|
|
2
|
-
declare namespace config {
|
|
3
|
-
const port: number;
|
|
4
|
-
const databaseURL: string | undefined;
|
|
5
|
-
const redisURI: string | undefined;
|
|
6
|
-
const jwtSecret: string | undefined;
|
|
7
|
-
const cookieSecret: string | undefined;
|
|
8
|
-
namespace logs {
|
|
9
|
-
const level: string;
|
|
10
|
-
}
|
|
11
|
-
namespace api {
|
|
12
|
-
const prefix: string;
|
|
13
|
-
}
|
|
14
|
-
}
|
package/dist/config/index.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
var dotenv_1 = __importDefault(require("dotenv"));
|
|
7
|
-
// Set the NODE_ENV to 'development' by default
|
|
8
|
-
process.env.NODE_ENV = process.env.NODE_ENV || "development";
|
|
9
|
-
var envFound = dotenv_1.default.config();
|
|
10
|
-
if (!envFound) {
|
|
11
|
-
// This error should crash whole process
|
|
12
|
-
throw new Error("⚠️ Couldn't find .env file ⚠️");
|
|
13
|
-
}
|
|
14
|
-
var config = {
|
|
15
|
-
/**
|
|
16
|
-
* Your favorite port
|
|
17
|
-
*/
|
|
18
|
-
port: parseInt(process.env.PORT, 10),
|
|
19
|
-
databaseURL: process.env.MONGODB_URI,
|
|
20
|
-
redisURI: process.env.REDIS_URI,
|
|
21
|
-
/**
|
|
22
|
-
* Your secret sauce
|
|
23
|
-
*/
|
|
24
|
-
jwtSecret: process.env.NODE_ENV === "test" ? "test" : process.env.JWT_SECRET,
|
|
25
|
-
cookieSecret: process.env.NODE_ENV === "test" ? "test" : process.env.COOKIE_SECRET,
|
|
26
|
-
/**
|
|
27
|
-
* Used by winston logger
|
|
28
|
-
*/
|
|
29
|
-
logs: {
|
|
30
|
-
level: process.env.LOG_LEVEL || "silly",
|
|
31
|
-
},
|
|
32
|
-
/**
|
|
33
|
-
* API configs
|
|
34
|
-
*/
|
|
35
|
-
api: {
|
|
36
|
-
prefix: "/api",
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
exports.default = config;
|
|
40
|
-
//# sourceMappingURL=index.js.map
|
package/dist/config/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.js"],"names":[],"mappings":";;;;;AAAA,kDAA2B;AAE3B,+CAA+C;AAC/C,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAA;AAE5D,IAAM,QAAQ,GAAG,gBAAM,CAAC,MAAM,EAAE,CAAA;AAChC,IAAI,CAAC,QAAQ,EAAE;IACb,wCAAwC;IACxC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAA;CACnD;AAED,IAAM,MAAM,GAAG;IACb;;OAEG;IACH,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC;IAEpC,WAAW,EAAE,OAAO,CAAC,GAAG,CAAC,WAAW;IACpC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS;IAE/B;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU;IAE5E,YAAY,EACV,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa;IAEtE;;OAEG;IACH,IAAI,EAAE;QACJ,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,OAAO;KACxC;IAED;;OAEG;IACH,GAAG,EAAE;QACH,MAAM,EAAE,MAAM;KACf;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { EntityManager } from "typeorm";
|
|
2
|
-
import { IsolationLevel } from "typeorm/driver/types/IsolationLevel";
|
|
3
|
-
import { FindConfig } from "../types/common";
|
|
4
|
-
declare type Selector<TEntity> = {
|
|
5
|
-
[key in keyof TEntity]?: unknown;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* Common functionality for Services
|
|
9
|
-
* @interface
|
|
10
|
-
*/
|
|
11
|
-
declare class BaseService<TChild extends BaseService<TChild, TContainer>, TContainer = unknown> {
|
|
12
|
-
protected readonly configModule: Record<string, unknown>;
|
|
13
|
-
protected transactionManager_: EntityManager | undefined;
|
|
14
|
-
protected manager_: EntityManager;
|
|
15
|
-
private readonly container_;
|
|
16
|
-
constructor(container: TContainer, configModule: Record<string, unknown>);
|
|
17
|
-
withTransaction(): this;
|
|
18
|
-
withTransaction(transactionManager: EntityManager): TChild;
|
|
19
|
-
/**
|
|
20
|
-
* Used to build TypeORM queries.
|
|
21
|
-
* @param selector The selector
|
|
22
|
-
* @param config The config
|
|
23
|
-
* @return The QueryBuilderConfig
|
|
24
|
-
*/
|
|
25
|
-
buildQuery_<TEntity = unknown>(selector: Selector<TEntity>, config?: FindConfig<TEntity>): FindConfig<TEntity> & {
|
|
26
|
-
where: {
|
|
27
|
-
[key in keyof TEntity]?: unknown;
|
|
28
|
-
};
|
|
29
|
-
withDeleted?: boolean;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Confirms whether a given raw id is valid. Fails if the provided
|
|
33
|
-
* id is null or undefined. The validate function takes an optional config
|
|
34
|
-
* param, to support checking id prefix and length.
|
|
35
|
-
* @param rawId - the id to validate.
|
|
36
|
-
* @param config - optional config
|
|
37
|
-
* @returns the rawId given that nothing failed
|
|
38
|
-
*/
|
|
39
|
-
validateId_(rawId: string, config?: {
|
|
40
|
-
prefix?: string;
|
|
41
|
-
length?: number;
|
|
42
|
-
}): string;
|
|
43
|
-
shouldRetryTransaction(err: {
|
|
44
|
-
code: string;
|
|
45
|
-
} | Record<string, unknown>): boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Wraps some work within a transactional block. If the service already has
|
|
48
|
-
* a transaction manager attached this will be reused, otherwise a new
|
|
49
|
-
* transaction manager is created.
|
|
50
|
-
* @param work - the transactional work to be done
|
|
51
|
-
* @param isolationOrErrorHandler - the isolation level to be used for the work.
|
|
52
|
-
* @param maybeErrorHandlerOrDontFail Potential error handler
|
|
53
|
-
* @return the result of the transactional work
|
|
54
|
-
*/
|
|
55
|
-
atomicPhase_(work: (transactionManager: EntityManager) => Promise<unknown>, isolationOrErrorHandler?: IsolationLevel | ((error: unknown) => Promise<unknown>), maybeErrorHandlerOrDontFail?: (error: unknown) => Promise<unknown>): Promise<unknown | never>;
|
|
56
|
-
/**
|
|
57
|
-
* Dedicated method to set metadata.
|
|
58
|
-
* @param obj - the entity to apply metadata to.
|
|
59
|
-
* @param metadata - the metadata to set
|
|
60
|
-
* @return resolves to the updated result.
|
|
61
|
-
*/
|
|
62
|
-
setMetadata_(obj: {
|
|
63
|
-
metadata: Record<string, unknown>;
|
|
64
|
-
}, metadata: Record<string, unknown>): Record<string, unknown>;
|
|
65
|
-
}
|
|
66
|
-
export default BaseService;
|
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
-
});
|
|
21
|
-
};
|
|
22
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
-
function step(op) {
|
|
27
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
-
while (_) try {
|
|
29
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
-
switch (op[0]) {
|
|
32
|
-
case 0: case 1: t = op; break;
|
|
33
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
-
default:
|
|
37
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
-
if (t[2]) _.ops.pop();
|
|
42
|
-
_.trys.pop(); continue;
|
|
43
|
-
}
|
|
44
|
-
op = body.call(thisArg, _);
|
|
45
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
50
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
51
|
-
if (!m) return o;
|
|
52
|
-
var i = m.call(o), r, ar = [], e;
|
|
53
|
-
try {
|
|
54
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
55
|
-
}
|
|
56
|
-
catch (error) { e = { error: error }; }
|
|
57
|
-
finally {
|
|
58
|
-
try {
|
|
59
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
60
|
-
}
|
|
61
|
-
finally { if (e) throw e.error; }
|
|
62
|
-
}
|
|
63
|
-
return ar;
|
|
64
|
-
};
|
|
65
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
66
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
67
|
-
if (ar || !(i in from)) {
|
|
68
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
69
|
-
ar[i] = from[i];
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
73
|
-
};
|
|
74
|
-
var __values = (this && this.__values) || function(o) {
|
|
75
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
76
|
-
if (m) return m.call(o);
|
|
77
|
-
if (o && typeof o.length === "number") return {
|
|
78
|
-
next: function () {
|
|
79
|
-
if (o && i >= o.length) o = void 0;
|
|
80
|
-
return { value: o && o[i++], done: !o };
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
84
|
-
};
|
|
85
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
86
|
-
var medusa_core_utils_1 = require("medusa-core-utils");
|
|
87
|
-
var typeorm_1 = require("typeorm");
|
|
88
|
-
/**
|
|
89
|
-
* Common functionality for Services
|
|
90
|
-
* @interface
|
|
91
|
-
*/
|
|
92
|
-
var BaseService = /** @class */ (function () {
|
|
93
|
-
function BaseService(container, configModule) {
|
|
94
|
-
this.configModule = configModule;
|
|
95
|
-
this.container_ = container;
|
|
96
|
-
}
|
|
97
|
-
BaseService.prototype.withTransaction = function (transactionManager) {
|
|
98
|
-
if (!transactionManager) {
|
|
99
|
-
return this;
|
|
100
|
-
}
|
|
101
|
-
var cloned = new this.constructor(__assign(__assign({}, this.container_), { manager: transactionManager }), this.configModule);
|
|
102
|
-
cloned.transactionManager_ = transactionManager;
|
|
103
|
-
return cloned;
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* Used to build TypeORM queries.
|
|
107
|
-
* @param selector The selector
|
|
108
|
-
* @param config The config
|
|
109
|
-
* @return The QueryBuilderConfig
|
|
110
|
-
*/
|
|
111
|
-
BaseService.prototype.buildQuery_ = function (selector, config) {
|
|
112
|
-
if (config === void 0) { config = {}; }
|
|
113
|
-
var build = function (obj) {
|
|
114
|
-
return Object.entries(obj).reduce(function (acc, _a) {
|
|
115
|
-
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
116
|
-
// Undefined values indicate that they have no significance to the query.
|
|
117
|
-
// If the query is looking for rows where a column is not set it should use null instead of undefined
|
|
118
|
-
if (typeof value === "undefined") {
|
|
119
|
-
return acc;
|
|
120
|
-
}
|
|
121
|
-
var subquery = [];
|
|
122
|
-
switch (true) {
|
|
123
|
-
case value instanceof typeorm_1.FindOperator:
|
|
124
|
-
acc[key] = value;
|
|
125
|
-
break;
|
|
126
|
-
case Array.isArray(value):
|
|
127
|
-
acc[key] = (0, typeorm_1.In)(__spreadArray([], __read(value), false));
|
|
128
|
-
break;
|
|
129
|
-
case value !== null && typeof value === "object":
|
|
130
|
-
Object.entries(value).map(function (_a) {
|
|
131
|
-
var _b = __read(_a, 2), modifier = _b[0], val = _b[1];
|
|
132
|
-
switch (modifier) {
|
|
133
|
-
case "lt":
|
|
134
|
-
subquery.push({ operator: "<", value: val });
|
|
135
|
-
break;
|
|
136
|
-
case "gt":
|
|
137
|
-
subquery.push({ operator: ">", value: val });
|
|
138
|
-
break;
|
|
139
|
-
case "lte":
|
|
140
|
-
subquery.push({ operator: "<=", value: val });
|
|
141
|
-
break;
|
|
142
|
-
case "gte":
|
|
143
|
-
subquery.push({ operator: ">=", value: val });
|
|
144
|
-
break;
|
|
145
|
-
default:
|
|
146
|
-
acc[key] = value;
|
|
147
|
-
break;
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
if (subquery.length) {
|
|
151
|
-
acc[key] = (0, typeorm_1.Raw)(function (a) {
|
|
152
|
-
return subquery
|
|
153
|
-
.map(function (s, index) { return "".concat(a, " ").concat(s.operator, " :").concat(index); })
|
|
154
|
-
.join(" AND ");
|
|
155
|
-
}, subquery.map(function (s) { return s.value; }));
|
|
156
|
-
}
|
|
157
|
-
break;
|
|
158
|
-
default:
|
|
159
|
-
acc[key] = value;
|
|
160
|
-
break;
|
|
161
|
-
}
|
|
162
|
-
return acc;
|
|
163
|
-
}, {});
|
|
164
|
-
};
|
|
165
|
-
var query = {
|
|
166
|
-
where: build(selector),
|
|
167
|
-
};
|
|
168
|
-
if ("deleted_at" in selector) {
|
|
169
|
-
query.withDeleted = true;
|
|
170
|
-
}
|
|
171
|
-
if ("skip" in config) {
|
|
172
|
-
query.skip = config.skip;
|
|
173
|
-
}
|
|
174
|
-
if ("take" in config) {
|
|
175
|
-
query.take = config.take;
|
|
176
|
-
}
|
|
177
|
-
if ("relations" in config) {
|
|
178
|
-
query.relations = config.relations;
|
|
179
|
-
}
|
|
180
|
-
if ("select" in config) {
|
|
181
|
-
query.select = config.select;
|
|
182
|
-
}
|
|
183
|
-
if ("order" in config) {
|
|
184
|
-
query.order = config.order;
|
|
185
|
-
}
|
|
186
|
-
return query;
|
|
187
|
-
};
|
|
188
|
-
/**
|
|
189
|
-
* Confirms whether a given raw id is valid. Fails if the provided
|
|
190
|
-
* id is null or undefined. The validate function takes an optional config
|
|
191
|
-
* param, to support checking id prefix and length.
|
|
192
|
-
* @param rawId - the id to validate.
|
|
193
|
-
* @param config - optional config
|
|
194
|
-
* @returns the rawId given that nothing failed
|
|
195
|
-
*/
|
|
196
|
-
BaseService.prototype.validateId_ = function (rawId, config) {
|
|
197
|
-
if (config === void 0) { config = {}; }
|
|
198
|
-
var prefix = config.prefix, length = config.length;
|
|
199
|
-
if (!rawId) {
|
|
200
|
-
throw new medusa_core_utils_1.MedusaError(medusa_core_utils_1.MedusaError.Types.INVALID_DATA, "Failed to validate id: ".concat(rawId));
|
|
201
|
-
}
|
|
202
|
-
if (prefix || length) {
|
|
203
|
-
var _a = __read(rawId.split("_"), 2), pre = _a[0], rand = _a[1];
|
|
204
|
-
if (prefix && pre !== prefix) {
|
|
205
|
-
throw new medusa_core_utils_1.MedusaError(medusa_core_utils_1.MedusaError.Types.INVALID_DATA, "The provided id: ".concat(rawId, " does not adhere to prefix constraint: ").concat(prefix));
|
|
206
|
-
}
|
|
207
|
-
if (length && length !== rand.length) {
|
|
208
|
-
throw new medusa_core_utils_1.MedusaError(medusa_core_utils_1.MedusaError.Types.INVALID_DATA, "The provided id: ".concat(rawId, " does not adhere to length constraint: ").concat(length));
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return rawId;
|
|
212
|
-
};
|
|
213
|
-
BaseService.prototype.shouldRetryTransaction = function (err) {
|
|
214
|
-
if (!(err === null || err === void 0 ? void 0 : err.code)) {
|
|
215
|
-
return false;
|
|
216
|
-
}
|
|
217
|
-
var code = err === null || err === void 0 ? void 0 : err.code;
|
|
218
|
-
return code === "40001" || code === "40P01";
|
|
219
|
-
};
|
|
220
|
-
/**
|
|
221
|
-
* Wraps some work within a transactional block. If the service already has
|
|
222
|
-
* a transaction manager attached this will be reused, otherwise a new
|
|
223
|
-
* transaction manager is created.
|
|
224
|
-
* @param work - the transactional work to be done
|
|
225
|
-
* @param isolationOrErrorHandler - the isolation level to be used for the work.
|
|
226
|
-
* @param maybeErrorHandlerOrDontFail Potential error handler
|
|
227
|
-
* @return the result of the transactional work
|
|
228
|
-
*/
|
|
229
|
-
BaseService.prototype.atomicPhase_ = function (work, isolationOrErrorHandler, maybeErrorHandlerOrDontFail) {
|
|
230
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
231
|
-
var errorHandler, isolation, dontFail, doWork, temp_1, doWork_1, result, error_1, error_2, result;
|
|
232
|
-
var _this = this;
|
|
233
|
-
return __generator(this, function (_a) {
|
|
234
|
-
switch (_a.label) {
|
|
235
|
-
case 0:
|
|
236
|
-
errorHandler = maybeErrorHandlerOrDontFail;
|
|
237
|
-
isolation = isolationOrErrorHandler;
|
|
238
|
-
dontFail = false;
|
|
239
|
-
if (typeof isolationOrErrorHandler === "function") {
|
|
240
|
-
isolation = null;
|
|
241
|
-
errorHandler = isolationOrErrorHandler;
|
|
242
|
-
dontFail = !!maybeErrorHandlerOrDontFail;
|
|
243
|
-
}
|
|
244
|
-
if (!this.transactionManager_) return [3 /*break*/, 1];
|
|
245
|
-
doWork = function (m) { return __awaiter(_this, void 0, void 0, function () {
|
|
246
|
-
var error_3, queryRunner;
|
|
247
|
-
return __generator(this, function (_a) {
|
|
248
|
-
switch (_a.label) {
|
|
249
|
-
case 0:
|
|
250
|
-
this.manager_ = m;
|
|
251
|
-
this.transactionManager_ = m;
|
|
252
|
-
_a.label = 1;
|
|
253
|
-
case 1:
|
|
254
|
-
_a.trys.push([1, 3, , 8]);
|
|
255
|
-
return [4 /*yield*/, work(m)];
|
|
256
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
257
|
-
case 3:
|
|
258
|
-
error_3 = _a.sent();
|
|
259
|
-
if (!errorHandler) return [3 /*break*/, 7];
|
|
260
|
-
queryRunner = this.transactionManager_.queryRunner;
|
|
261
|
-
if (!(queryRunner && queryRunner.isTransactionActive)) return [3 /*break*/, 5];
|
|
262
|
-
return [4 /*yield*/, queryRunner.rollbackTransaction()];
|
|
263
|
-
case 4:
|
|
264
|
-
_a.sent();
|
|
265
|
-
_a.label = 5;
|
|
266
|
-
case 5: return [4 /*yield*/, errorHandler(error_3)];
|
|
267
|
-
case 6:
|
|
268
|
-
_a.sent();
|
|
269
|
-
_a.label = 7;
|
|
270
|
-
case 7: throw error_3;
|
|
271
|
-
case 8: return [2 /*return*/];
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
}); };
|
|
275
|
-
return [2 /*return*/, doWork(this.transactionManager_)];
|
|
276
|
-
case 1:
|
|
277
|
-
temp_1 = this.manager_;
|
|
278
|
-
doWork_1 = function (m) { return __awaiter(_this, void 0, void 0, function () {
|
|
279
|
-
var result, error_4;
|
|
280
|
-
return __generator(this, function (_a) {
|
|
281
|
-
switch (_a.label) {
|
|
282
|
-
case 0:
|
|
283
|
-
this.manager_ = m;
|
|
284
|
-
this.transactionManager_ = m;
|
|
285
|
-
_a.label = 1;
|
|
286
|
-
case 1:
|
|
287
|
-
_a.trys.push([1, 3, , 4]);
|
|
288
|
-
return [4 /*yield*/, work(m)];
|
|
289
|
-
case 2:
|
|
290
|
-
result = _a.sent();
|
|
291
|
-
this.manager_ = temp_1;
|
|
292
|
-
this.transactionManager_ = undefined;
|
|
293
|
-
return [2 /*return*/, result];
|
|
294
|
-
case 3:
|
|
295
|
-
error_4 = _a.sent();
|
|
296
|
-
this.manager_ = temp_1;
|
|
297
|
-
this.transactionManager_ = undefined;
|
|
298
|
-
throw error_4;
|
|
299
|
-
case 4: return [2 /*return*/];
|
|
300
|
-
}
|
|
301
|
-
});
|
|
302
|
-
}); };
|
|
303
|
-
if (!isolation) return [3 /*break*/, 9];
|
|
304
|
-
result = void 0;
|
|
305
|
-
_a.label = 2;
|
|
306
|
-
case 2:
|
|
307
|
-
_a.trys.push([2, 4, , 9]);
|
|
308
|
-
return [4 /*yield*/, this.manager_.transaction(isolation, function (m) { return doWork_1(m); })];
|
|
309
|
-
case 3:
|
|
310
|
-
result = _a.sent();
|
|
311
|
-
return [2 /*return*/, result];
|
|
312
|
-
case 4:
|
|
313
|
-
error_1 = _a.sent();
|
|
314
|
-
if (!this.shouldRetryTransaction(error_1)) return [3 /*break*/, 5];
|
|
315
|
-
return [2 /*return*/, this.manager_.transaction(isolation, function (m) {
|
|
316
|
-
return doWork_1(m);
|
|
317
|
-
})];
|
|
318
|
-
case 5:
|
|
319
|
-
if (!errorHandler) return [3 /*break*/, 7];
|
|
320
|
-
return [4 /*yield*/, errorHandler(error_1)];
|
|
321
|
-
case 6:
|
|
322
|
-
_a.sent();
|
|
323
|
-
_a.label = 7;
|
|
324
|
-
case 7: throw error_1;
|
|
325
|
-
case 8: return [3 /*break*/, 9];
|
|
326
|
-
case 9:
|
|
327
|
-
_a.trys.push([9, 11, , 14]);
|
|
328
|
-
return [4 /*yield*/, this.manager_.transaction(function (m) { return doWork_1(m); })];
|
|
329
|
-
case 10: return [2 /*return*/, _a.sent()];
|
|
330
|
-
case 11:
|
|
331
|
-
error_2 = _a.sent();
|
|
332
|
-
if (!errorHandler) return [3 /*break*/, 13];
|
|
333
|
-
return [4 /*yield*/, errorHandler(error_2)];
|
|
334
|
-
case 12:
|
|
335
|
-
result = _a.sent();
|
|
336
|
-
if (dontFail) {
|
|
337
|
-
return [2 /*return*/, result];
|
|
338
|
-
}
|
|
339
|
-
_a.label = 13;
|
|
340
|
-
case 13: throw error_2;
|
|
341
|
-
case 14: return [2 /*return*/];
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
});
|
|
345
|
-
};
|
|
346
|
-
/**
|
|
347
|
-
* Dedicated method to set metadata.
|
|
348
|
-
* @param obj - the entity to apply metadata to.
|
|
349
|
-
* @param metadata - the metadata to set
|
|
350
|
-
* @return resolves to the updated result.
|
|
351
|
-
*/
|
|
352
|
-
BaseService.prototype.setMetadata_ = function (obj, metadata) {
|
|
353
|
-
var e_1, _a;
|
|
354
|
-
var existing = obj.metadata || {};
|
|
355
|
-
var newData = {};
|
|
356
|
-
try {
|
|
357
|
-
for (var _b = __values(Object.entries(metadata)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
358
|
-
var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
|
|
359
|
-
if (typeof key !== "string") {
|
|
360
|
-
throw new medusa_core_utils_1.MedusaError(medusa_core_utils_1.MedusaError.Types.INVALID_ARGUMENT, "Key type is invalid. Metadata keys must be strings");
|
|
361
|
-
}
|
|
362
|
-
newData[key] = value;
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
366
|
-
finally {
|
|
367
|
-
try {
|
|
368
|
-
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
369
|
-
}
|
|
370
|
-
finally { if (e_1) throw e_1.error; }
|
|
371
|
-
}
|
|
372
|
-
return __assign(__assign({}, existing), newData);
|
|
373
|
-
};
|
|
374
|
-
return BaseService;
|
|
375
|
-
}());
|
|
376
|
-
exports.default = BaseService;
|
|
377
|
-
//# sourceMappingURL=base-service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-service.js","sourceRoot":"","sources":["../../src/interfaces/base-service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA+C;AAC/C,mCAA8D;AAM9D;;;GAGG;AACH;IAQE,qBACE,SAAqB,EACF,YAAqC;QAArC,iBAAY,GAAZ,YAAY,CAAyB;QAExD,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;IAC7B,CAAC;IAID,qCAAe,GAAf,UAAgB,kBAAkC;QAChD,IAAI,CAAC,kBAAkB,EAAE;YACvB,OAAO,IAAI,CAAA;SACZ;QAED,IAAM,MAAM,GAAG,IAAyB,IAAI,CAAC,WAAY,uBAKlD,IAAI,CAAC,UAAU,KAClB,OAAO,EAAE,kBAAkB,KAE7B,IAAI,CAAC,YAAY,CAClB,CAAA;QAED,MAAM,CAAC,mBAAmB,GAAG,kBAAkB,CAAA;QAE/C,OAAO,MAAgB,CAAA;IACzB,CAAC;IAED;;;;;OAKG;IACH,iCAAW,GAAX,UACE,QAA2B,EAC3B,MAAgC;QAAhC,uBAAA,EAAA,WAAgC;QAKhC,IAAM,KAAK,GAAG,UACZ,GAA4B;YAE5B,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,EAAiB;oBAAjB,KAAA,aAAiB,EAAhB,GAAG,QAAA,EAAE,KAAK,QAAA;gBACjD,yEAAyE;gBACz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