@medusajs/order 0.1.3 → 1.0.0-rc-20241003153304
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.ts +6 -8
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -26
- package/dist/index.js.map +1 -1
- package/dist/joiner-config.d.ts +2 -5
- package/dist/joiner-config.d.ts.map +1 -0
- package/dist/joiner-config.js +21 -28
- package/dist/joiner-config.js.map +1 -1
- package/dist/migrations/Migration20240219102530.d.ts +1 -0
- package/dist/migrations/Migration20240219102530.d.ts.map +1 -0
- package/dist/migrations/Migration20240219102530.js +53 -19
- package/dist/migrations/Migration20240219102530.js.map +1 -1
- package/dist/migrations/Migration20240604100512.d.ts +5 -0
- package/dist/migrations/Migration20240604100512.d.ts.map +1 -0
- package/dist/migrations/Migration20240604100512.js +371 -0
- package/dist/migrations/Migration20240604100512.js.map +1 -0
- package/dist/migrations/Migration20240715102100.d.ts +5 -0
- package/dist/migrations/Migration20240715102100.d.ts.map +1 -0
- package/dist/migrations/Migration20240715102100.js +15 -0
- package/dist/migrations/Migration20240715102100.js.map +1 -0
- package/dist/migrations/Migration20240715174100.d.ts +5 -0
- package/dist/migrations/Migration20240715174100.d.ts.map +1 -0
- package/dist/migrations/Migration20240715174100.js +21 -0
- package/dist/migrations/Migration20240715174100.js.map +1 -0
- package/dist/migrations/Migration20240716081800.d.ts +5 -0
- package/dist/migrations/Migration20240716081800.d.ts.map +1 -0
- package/dist/migrations/Migration20240716081800.js +67 -0
- package/dist/migrations/Migration20240716081800.js.map +1 -0
- package/dist/migrations/Migration20240801085921.d.ts +5 -0
- package/dist/migrations/Migration20240801085921.d.ts.map +1 -0
- package/dist/migrations/Migration20240801085921.js +30 -0
- package/dist/migrations/Migration20240801085921.js.map +1 -0
- package/dist/migrations/Migration20240821164505.d.ts +6 -0
- package/dist/migrations/Migration20240821164505.d.ts.map +1 -0
- package/dist/migrations/Migration20240821164505.js +26 -0
- package/dist/migrations/Migration20240821164505.js.map +1 -0
- package/dist/migrations/Migration20240821170920.d.ts +6 -0
- package/dist/migrations/Migration20240821170920.d.ts.map +1 -0
- package/dist/migrations/Migration20240821170920.js +18 -0
- package/dist/migrations/Migration20240821170920.js.map +1 -0
- package/dist/migrations/Migration20240827133639.d.ts +6 -0
- package/dist/migrations/Migration20240827133639.d.ts.map +1 -0
- package/dist/migrations/Migration20240827133639.js +17 -0
- package/dist/migrations/Migration20240827133639.js.map +1 -0
- package/dist/migrations/Migration20240902195921.d.ts +6 -0
- package/dist/migrations/Migration20240902195921.d.ts.map +1 -0
- package/dist/migrations/Migration20240902195921.js +16 -0
- package/dist/migrations/Migration20240902195921.js.map +1 -0
- package/dist/migrations/Migration20240913092514.d.ts +6 -0
- package/dist/migrations/Migration20240913092514.d.ts.map +1 -0
- package/dist/migrations/Migration20240913092514.js +17 -0
- package/dist/migrations/Migration20240913092514.js.map +1 -0
- package/dist/models/address.d.ts +4 -3
- package/dist/models/address.d.ts.map +1 -0
- package/dist/models/address.js +22 -22
- package/dist/models/address.js.map +1 -1
- package/dist/models/adjustment-line.d.ts +5 -3
- package/dist/models/adjustment-line.d.ts.map +1 -0
- package/dist/models/adjustment-line.js +6 -1
- package/dist/models/adjustment-line.js.map +1 -1
- package/dist/models/claim-item-image.d.ts +19 -0
- package/dist/models/claim-item-image.d.ts.map +1 -0
- package/dist/models/claim-item-image.js +109 -0
- package/dist/models/claim-item-image.js.map +1 -0
- package/dist/models/claim-item.d.ts +29 -0
- package/dist/models/claim-item.d.ts.map +1 -0
- package/dist/models/claim-item.js +157 -0
- package/dist/models/claim-item.js.map +1 -0
- package/dist/models/claim.d.ts +37 -0
- package/dist/models/claim.d.ts.map +1 -0
- package/dist/models/claim.js +201 -0
- package/dist/models/claim.js.map +1 -0
- package/dist/models/exchange-item.d.ts +24 -0
- package/dist/models/exchange-item.d.ts.map +1 -0
- package/dist/models/exchange-item.js +138 -0
- package/dist/models/exchange-item.js.map +1 -0
- package/dist/models/exchange.d.ts +35 -0
- package/dist/models/exchange.d.ts.map +1 -0
- package/dist/models/exchange.js +194 -0
- package/dist/models/exchange.js.map +1 -0
- package/dist/models/index.d.ts +18 -9
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +26 -10
- package/dist/models/index.js.map +1 -1
- package/dist/models/line-item-adjustment.d.ts +5 -3
- package/dist/models/line-item-adjustment.d.ts.map +1 -0
- package/dist/models/line-item-adjustment.js +12 -12
- package/dist/models/line-item-adjustment.js.map +1 -1
- package/dist/models/line-item-tax-line.d.ts +5 -3
- package/dist/models/line-item-tax-line.d.ts.map +1 -0
- package/dist/models/line-item-tax-line.js +12 -12
- package/dist/models/line-item-tax-line.js.map +1 -1
- package/dist/models/line-item.d.ts +11 -8
- package/dist/models/line-item.d.ts.map +1 -0
- package/dist/models/line-item.js +58 -39
- package/dist/models/line-item.js.map +1 -1
- package/dist/models/order-change-action.d.ts +17 -6
- package/dist/models/order-change-action.d.ts.map +1 -0
- package/dist/models/order-change-action.js +110 -8
- package/dist/models/order-change-action.js.map +1 -1
- package/dist/models/order-change.d.ts +18 -6
- package/dist/models/order-change.d.ts.map +1 -0
- package/dist/models/order-change.js +108 -6
- package/dist/models/order-change.js.map +1 -1
- package/dist/models/order-item.d.ts +10 -7
- package/dist/models/order-item.d.ts.map +1 -0
- package/dist/models/order-item.js +29 -19
- package/dist/models/order-item.js.map +1 -1
- package/dist/models/order-shipping-method.d.ts +17 -7
- package/dist/models/order-shipping-method.d.ts.map +1 -0
- package/dist/models/order-shipping-method.js +113 -33
- package/dist/models/order-shipping-method.js.map +1 -1
- package/dist/models/order-summary.d.ts +7 -8
- package/dist/models/order-summary.d.ts.map +1 -0
- package/dist/models/order-summary.js +14 -10
- package/dist/models/order-summary.js.map +1 -1
- package/dist/models/order.d.ts +13 -11
- package/dist/models/order.d.ts.map +1 -0
- package/dist/models/order.js +12 -2
- package/dist/models/order.js.map +1 -1
- package/dist/models/return-item.d.ts +31 -0
- package/dist/models/return-item.d.ts.map +1 -0
- package/dist/models/return-item.js +180 -0
- package/dist/models/return-item.js.map +1 -0
- package/dist/models/return-reason.d.ts +22 -0
- package/dist/models/return-reason.d.ts.map +1 -0
- package/dist/models/return-reason.js +122 -0
- package/dist/models/return-reason.js.map +1 -0
- package/dist/models/return.d.ts +41 -0
- package/dist/models/return.d.ts.map +1 -0
- package/dist/models/return.js +227 -0
- package/dist/models/return.js.map +1 -0
- package/dist/models/shipping-method-adjustment.d.ts +5 -3
- package/dist/models/shipping-method-adjustment.d.ts.map +1 -0
- package/dist/models/shipping-method-adjustment.js +12 -12
- package/dist/models/shipping-method-adjustment.js.map +1 -1
- package/dist/models/shipping-method-tax-line.d.ts +5 -3
- package/dist/models/shipping-method-tax-line.d.ts.map +1 -0
- package/dist/models/shipping-method-tax-line.js +12 -12
- package/dist/models/shipping-method-tax-line.js.map +1 -1
- package/dist/models/shipping-method.d.ts +10 -7
- package/dist/models/shipping-method.d.ts.map +1 -0
- package/dist/models/shipping-method.js +42 -24
- package/dist/models/shipping-method.js.map +1 -1
- package/dist/models/tax-line.d.ts +4 -2
- package/dist/models/tax-line.d.ts.map +1 -0
- package/dist/models/tax-line.js +8 -1
- package/dist/models/tax-line.js.map +1 -1
- package/dist/models/transaction.d.ts +18 -6
- package/dist/models/transaction.d.ts.map +1 -0
- package/dist/models/transaction.js +133 -24
- package/dist/models/transaction.js.map +1 -1
- package/dist/repositories/claim.d.ts +9 -0
- package/dist/repositories/claim.d.ts.map +1 -0
- package/dist/repositories/claim.js +11 -0
- package/dist/repositories/claim.js.map +1 -0
- package/dist/repositories/exchange.d.ts +9 -0
- package/dist/repositories/exchange.d.ts.map +1 -0
- package/dist/repositories/exchange.js +11 -0
- package/dist/repositories/exchange.js.map +1 -0
- package/dist/repositories/index.d.ts +5 -2
- package/dist/repositories/index.d.ts.map +1 -0
- package/dist/repositories/index.js +8 -17
- package/dist/repositories/index.js.map +1 -1
- package/dist/repositories/order.d.ts +2 -4
- package/dist/repositories/order.d.ts.map +1 -0
- package/dist/repositories/order.js +3 -86
- package/dist/repositories/order.js.map +1 -1
- package/dist/repositories/return.d.ts +9 -0
- package/dist/repositories/return.d.ts.map +1 -0
- package/dist/repositories/return.js +11 -0
- package/dist/repositories/return.js.map +1 -0
- package/dist/schema/index.d.ts +3 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +556 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/services/actions/cancel-claim.d.ts +3 -0
- package/dist/services/actions/cancel-claim.d.ts.map +1 -0
- package/dist/services/actions/cancel-claim.js +85 -0
- package/dist/services/actions/cancel-claim.js.map +1 -0
- package/dist/services/actions/cancel-exchange.d.ts +3 -0
- package/dist/services/actions/cancel-exchange.d.ts.map +1 -0
- package/dist/services/actions/cancel-exchange.js +71 -0
- package/dist/services/actions/cancel-exchange.js.map +1 -0
- package/dist/services/actions/cancel-fulfillment.d.ts +3 -0
- package/dist/services/actions/cancel-fulfillment.d.ts.map +1 -0
- package/dist/services/actions/cancel-fulfillment.js +31 -0
- package/dist/services/actions/cancel-fulfillment.js.map +1 -0
- package/dist/services/actions/cancel-return.d.ts +3 -0
- package/dist/services/actions/cancel-return.d.ts.map +1 -0
- package/dist/services/actions/cancel-return.js +69 -0
- package/dist/services/actions/cancel-return.js.map +1 -0
- package/dist/services/actions/create-claim.d.ts +3 -0
- package/dist/services/actions/create-claim.d.ts.map +1 -0
- package/dist/services/actions/create-claim.js +225 -0
- package/dist/services/actions/create-claim.js.map +1 -0
- package/dist/services/actions/create-exchange.d.ts +3 -0
- package/dist/services/actions/create-exchange.d.ts.map +1 -0
- package/dist/services/actions/create-exchange.js +191 -0
- package/dist/services/actions/create-exchange.js.map +1 -0
- package/dist/services/actions/create-return.d.ts +3 -0
- package/dist/services/actions/create-return.d.ts.map +1 -0
- package/dist/services/actions/create-return.js +100 -0
- package/dist/services/actions/create-return.js.map +1 -0
- package/dist/services/actions/index.d.ts +12 -0
- package/dist/services/actions/index.d.ts.map +1 -0
- package/dist/services/actions/index.js +28 -0
- package/dist/services/actions/index.js.map +1 -0
- package/dist/services/actions/receive-return.d.ts +3 -0
- package/dist/services/actions/receive-return.d.ts.map +1 -0
- package/dist/services/actions/receive-return.js +71 -0
- package/dist/services/actions/receive-return.js.map +1 -0
- package/dist/services/actions/register-delivery.d.ts +3 -0
- package/dist/services/actions/register-delivery.d.ts.map +1 -0
- package/dist/services/actions/register-delivery.js +29 -0
- package/dist/services/actions/register-delivery.js.map +1 -0
- package/dist/services/actions/register-fulfillment.d.ts +3 -0
- package/dist/services/actions/register-fulfillment.d.ts.map +1 -0
- package/dist/services/actions/register-fulfillment.js +29 -0
- package/dist/services/actions/register-fulfillment.js.map +1 -0
- package/dist/services/actions/register-shipment.d.ts +3 -0
- package/dist/services/actions/register-shipment.d.ts.map +1 -0
- package/dist/services/actions/register-shipment.js +37 -0
- package/dist/services/actions/register-shipment.js.map +1 -0
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +1 -3
- package/dist/services/index.js.map +1 -1
- package/dist/services/order-module-service.d.ts +191 -109
- package/dist/services/order-module-service.d.ts.map +1 -0
- package/dist/services/order-module-service.js +1165 -425
- package/dist/services/order-module-service.js.map +1 -1
- package/dist/services/order-service.d.ts +6 -5
- package/dist/services/order-service.d.ts.map +1 -0
- package/dist/services/order-service.js +2 -2
- package/dist/services/order-service.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/address.d.ts +2 -1
- package/dist/types/address.d.ts.map +1 -0
- package/dist/types/index.d.ts +5 -2
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/line-item-adjustment.d.ts +2 -1
- package/dist/types/line-item-adjustment.d.ts.map +1 -0
- package/dist/types/line-item-tax-line.d.ts +1 -0
- package/dist/types/line-item-tax-line.d.ts.map +1 -0
- package/dist/types/line-item.d.ts +2 -1
- package/dist/types/line-item.d.ts.map +1 -0
- package/dist/types/order-change.d.ts +4 -0
- package/dist/types/order-change.d.ts.map +1 -0
- package/dist/types/order-change.js +3 -0
- package/dist/types/order-change.js.map +1 -0
- package/dist/types/order-detail.d.ts +3 -2
- package/dist/types/order-detail.d.ts.map +1 -0
- package/dist/types/order.d.ts +4 -3
- package/dist/types/order.d.ts.map +1 -0
- package/dist/types/return-reason.d.ts +5 -0
- package/dist/types/return-reason.d.ts.map +1 -0
- package/dist/types/return-reason.js +3 -0
- package/dist/types/return-reason.js.map +1 -0
- package/dist/types/shipping-method-adjustment.d.ts +2 -1
- package/dist/types/shipping-method-adjustment.d.ts.map +1 -0
- package/dist/types/shipping-method-tax-line.d.ts +1 -0
- package/dist/types/shipping-method-tax-line.d.ts.map +1 -0
- package/dist/types/shipping-method.d.ts +5 -1
- package/dist/types/shipping-method.d.ts.map +1 -0
- package/dist/types/tax-line.d.ts +2 -1
- package/dist/types/tax-line.d.ts.map +1 -0
- package/dist/types/transaction.d.ts +2 -1
- package/dist/types/transaction.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +41 -23
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/index.js +0 -1
- package/dist/types/utils/index.js.map +1 -1
- package/dist/utils/actions/cancel-item-fulfillment.d.ts +2 -0
- package/dist/utils/actions/cancel-item-fulfillment.d.ts.map +1 -0
- package/dist/utils/actions/cancel-item-fulfillment.js +34 -0
- package/dist/utils/actions/cancel-item-fulfillment.js.map +1 -0
- package/dist/utils/actions/cancel-return.d.ts +1 -0
- package/dist/utils/actions/cancel-return.d.ts.map +1 -0
- package/dist/utils/actions/cancel-return.js +9 -16
- package/dist/utils/actions/cancel-return.js.map +1 -1
- package/dist/utils/actions/deliver-item.d.ts +2 -0
- package/dist/utils/actions/deliver-item.d.ts.map +1 -0
- package/dist/utils/actions/deliver-item.js +38 -0
- package/dist/utils/actions/deliver-item.js.map +1 -0
- package/dist/utils/actions/fulfill-item.d.ts +1 -0
- package/dist/utils/actions/fulfill-item.d.ts.map +1 -0
- package/dist/utils/actions/fulfill-item.js +8 -12
- package/dist/utils/actions/fulfill-item.js.map +1 -1
- package/dist/utils/actions/index.d.ts +7 -1
- package/dist/utils/actions/index.d.ts.map +1 -0
- package/dist/utils/actions/index.js +6 -1
- package/dist/utils/actions/index.js.map +1 -1
- package/dist/utils/actions/item-add.d.ts +1 -0
- package/dist/utils/actions/item-add.d.ts.map +1 -0
- package/dist/utils/actions/item-add.js +17 -26
- package/dist/utils/actions/item-add.js.map +1 -1
- package/dist/utils/actions/item-remove.d.ts +1 -0
- package/dist/utils/actions/item-remove.d.ts.map +1 -0
- package/dist/utils/actions/item-remove.js +10 -30
- package/dist/utils/actions/item-remove.js.map +1 -1
- package/dist/utils/actions/item-update.d.ts +2 -0
- package/dist/utils/actions/item-update.d.ts.map +1 -0
- package/dist/utils/actions/item-update.js +37 -0
- package/dist/utils/actions/item-update.js.map +1 -0
- package/dist/utils/actions/receive-damaged-return-item.d.ts +1 -0
- package/dist/utils/actions/receive-damaged-return-item.d.ts.map +1 -0
- package/dist/utils/actions/receive-damaged-return-item.js +11 -37
- package/dist/utils/actions/receive-damaged-return-item.js.map +1 -1
- package/dist/utils/actions/receive-return-item.d.ts +1 -0
- package/dist/utils/actions/receive-return-item.d.ts.map +1 -0
- package/dist/utils/actions/receive-return-item.js +9 -38
- package/dist/utils/actions/receive-return-item.js.map +1 -1
- package/dist/utils/actions/reinstate-item.d.ts +2 -0
- package/dist/utils/actions/reinstate-item.d.ts.map +1 -0
- package/dist/utils/actions/reinstate-item.js +32 -0
- package/dist/utils/actions/reinstate-item.js.map +1 -0
- package/dist/utils/actions/return-item.d.ts +1 -0
- package/dist/utils/actions/return-item.d.ts.map +1 -0
- package/dist/utils/actions/return-item.js +10 -15
- package/dist/utils/actions/return-item.js.map +1 -1
- package/dist/utils/actions/ship-item.d.ts +1 -0
- package/dist/utils/actions/ship-item.d.ts.map +1 -0
- package/dist/utils/actions/ship-item.js +8 -12
- package/dist/utils/actions/ship-item.js.map +1 -1
- package/dist/utils/actions/shipping-add.d.ts +1 -0
- package/dist/utils/actions/shipping-add.d.ts.map +1 -0
- package/dist/utils/actions/shipping-add.js +18 -18
- package/dist/utils/actions/shipping-add.js.map +1 -1
- package/dist/utils/actions/shipping-remove.d.ts +2 -0
- package/dist/utils/actions/shipping-remove.d.ts.map +1 -0
- package/dist/utils/actions/shipping-remove.js +22 -0
- package/dist/utils/actions/shipping-remove.js.map +1 -0
- package/dist/utils/actions/write-off-item.d.ts +1 -0
- package/dist/utils/actions/write-off-item.d.ts.map +1 -0
- package/dist/utils/actions/write-off-item.js +8 -12
- package/dist/utils/actions/write-off-item.js.map +1 -1
- package/dist/utils/apply-order-changes.d.ts +18 -0
- package/dist/utils/apply-order-changes.d.ts.map +1 -0
- package/dist/utils/apply-order-changes.js +98 -0
- package/dist/utils/apply-order-changes.js.map +1 -0
- package/dist/utils/base-repository-find.d.ts +3 -0
- package/dist/utils/base-repository-find.d.ts.map +1 -0
- package/dist/utils/base-repository-find.js +154 -0
- package/dist/utils/base-repository-find.js.map +1 -0
- package/dist/utils/calculate-order-change.d.ts +12 -6
- package/dist/utils/calculate-order-change.d.ts.map +1 -0
- package/dist/utils/calculate-order-change.js +56 -187
- package/dist/utils/calculate-order-change.js.map +1 -1
- package/dist/utils/index.d.ts +4 -1
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +3 -1
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/set-action-reference.d.ts +2 -0
- package/dist/utils/set-action-reference.d.ts.map +1 -0
- package/dist/utils/set-action-reference.js +10 -0
- package/dist/utils/set-action-reference.js.map +1 -0
- package/dist/utils/transform-order.d.ts +5 -4
- package/dist/utils/transform-order.d.ts.map +1 -0
- package/dist/utils/transform-order.js +138 -21
- package/dist/utils/transform-order.js.map +1 -1
- package/package.json +25 -26
- package/dist/module-definition.d.ts +0 -2
- package/dist/module-definition.js +0 -59
- package/dist/module-definition.js.map +0 -1
- package/dist/scripts/bin/run-seed.d.ts +0 -3
- package/dist/scripts/bin/run-seed.js +0 -49
- package/dist/scripts/bin/run-seed.js.map +0 -1
- package/dist/services/order-change-service.d.ts +0 -15
- package/dist/services/order-change-service.js +0 -96
- package/dist/services/order-change-service.js.map +0 -1
- package/dist/utils/action-key.d.ts +0 -13
- package/dist/utils/action-key.js +0 -18
- package/dist/utils/action-key.js.map +0 -1
- package/dist/utils/actions/cancel.d.ts +0 -1
- package/dist/utils/actions/cancel.js +0 -8
- package/dist/utils/actions/cancel.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"calculate-order-change.js","sourceRoot":"","sources":["../../src/utils/calculate-order-change.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"calculate-order-change.js","sourceRoot":"","sources":["../../src/utils/calculate-order-change.ts"],"names":[],"mappings":";;;AAoNA,oDAuBC;AA1OD,qDAKkC;AAClC,mCAQe;AAOf,MAAa,qBAAqB;IAezB,MAAM,CAAC,kBAAkB,CAAC,GAAW,EAAE,IAA0B;QACtE,qBAAqB,CAAC,cAAc,CAAC,GAAG,CAAC,GAAG,IAAI,CAAA;IAClD,CAAC;IAED,YAAY,EACV,KAAK,EACL,YAAY,EACZ,OAAO,EACP,OAAO,GAMR;QApBO,YAAO,GAAmB,EAAE,CAAA;QAE5B,qBAAgB,GAAkD,EAAE,CAAA;QACpE,eAAU,GAAmC,EAAE,CAAA;QAkBrD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAA;QAC9C,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC,CAAA;QAClE,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAA;QACxD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QAEtB,IAAI,IAAI,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AS,CAAC,OAAO,CAAC,cAAc,CAAC;SACxB,CAAA;QAE/B,OAAO,YAAY,CAAA;IACrB,CAAC;IAEM,eAAe;QACpB,OAAO,IAAI,CAAC,KAAK,CAAA;IACnB,CAAC;;AA3LH,sDA4LC;AA3LgB,oCAAc,GAA4C,EAAE,AAA9C,CAA8C;AAC5D,mCAAa,GAAG;IAC7B,WAAW,EAAE,KAAK;CACnB,AAF2B,CAE3B;AA0LH,SAAgB,oBAAoB,CAAC,EACnC,KAAK,EACL,YAAY,GAAG,EAAE,EACjB,OAAO,GAAG,EAAE,EACZ,OAAO,GAAG,EAAE,GAMb;IACC,MAAM,IAAI,GAAG,IAAI,qBAAqB,CAAC;QACrC,KAAK;QACL,YAAY;QACZ,OAAO;QACP,OAAO;KACR,CAAC,CAAA;IACF,IAAI,CAAC,cAAc,EAAE,CAAA;IAErB,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE;QAC1B,KAAK,EAAE,IAAI,CAAC,eAAe,EAAE;KAC9B,CAAA;AACH,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AACxC,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA"}
|
package/dist/utils/index.js
CHANGED
@@ -14,7 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
15
15
|
};
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
|
-
__exportStar(require("./action-key"), exports);
|
18
17
|
__exportStar(require("./actions"), exports);
|
18
|
+
__exportStar(require("./apply-order-changes"), exports);
|
19
19
|
__exportStar(require("./calculate-order-change"), exports);
|
20
|
+
__exportStar(require("./set-action-reference"), exports);
|
21
|
+
__exportStar(require("./transform-order"), exports);
|
20
22
|
//# sourceMappingURL=index.js.map
|
package/dist/utils/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB;AACzB,wDAAqC;AACrC,2DAAwC;AACxC,yDAAsC;AACtC,oDAAiC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"set-action-reference.d.ts","sourceRoot":"","sources":["../../src/utils/set-action-reference.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CAAC,QAAQ,KAAA,EAAE,MAAM,KAAA,EAAE,OAAO,KAAA,QAK3D"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.setActionReference = setActionReference;
|
4
|
+
function setActionReference(existing, action, options) {
|
5
|
+
if (options?.addActionReferenceToObject) {
|
6
|
+
existing.actions ??= [];
|
7
|
+
existing.actions.push(action);
|
8
|
+
}
|
9
|
+
}
|
10
|
+
//# sourceMappingURL=set-action-reference.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"set-action-reference.js","sourceRoot":"","sources":["../../src/utils/set-action-reference.ts"],"names":[],"mappings":";;AAAA,gDAKC;AALD,SAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO;IAC1D,IAAI,OAAO,EAAE,0BAA0B,EAAE,CAAC;QACxC,QAAQ,CAAC,OAAO,KAAK,EAAE,CAAA;QACvB,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;IAC/B,CAAC;AACH,CAAC"}
|
@@ -1,5 +1,6 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
export declare function formatOrder<T = any>(order: any, options: {
|
2
|
+
entity: any;
|
3
3
|
includeTotals?: boolean;
|
4
|
-
}):
|
5
|
-
export declare function mapRepositoryToOrderModel(config: any): any;
|
4
|
+
}): T;
|
5
|
+
export declare function mapRepositoryToOrderModel(config: any, isRelatedEntity?: boolean): any;
|
6
|
+
//# sourceMappingURL=transform-order.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"transform-order.d.ts","sourceRoot":"","sources":["../../src/utils/transform-order.ts"],"names":[],"mappings":"AAUA,wBAAgB,WAAW,CAAC,CAAC,GAAG,GAAG,EACjC,KAAK,KAAA,EACL,OAAO,EAAE;IACP,MAAM,EAAE,GAAG,CAAA;IACX,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,GACA,CAAC,CAkFH;AAwFD,wBAAgB,yBAAyB,CAAC,MAAM,KAAA,EAAE,eAAe,UAAQ,OAwExE"}
|
@@ -1,12 +1,28 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
4
|
-
|
3
|
+
exports.formatOrder = formatOrder;
|
4
|
+
exports.mapRepositoryToOrderModel = mapRepositoryToOrderModel;
|
5
|
+
const utils_1 = require("@medusajs/framework/utils");
|
6
|
+
// Reshape the order object to match the OrderDTO
|
7
|
+
// This function is used to format the order object before returning to the main module methods
|
5
8
|
function formatOrder(order, options) {
|
6
9
|
const isArray = Array.isArray(order);
|
7
10
|
const orders = [...(isArray ? order : [order])];
|
8
11
|
orders.map((order) => {
|
9
|
-
|
12
|
+
let mainOrder = order;
|
13
|
+
const isRelatedEntity = options?.entity?.name !== "Order";
|
14
|
+
// If the entity is a related entity, the original order is located in the order property
|
15
|
+
if (isRelatedEntity) {
|
16
|
+
if (!order.order) {
|
17
|
+
return order;
|
18
|
+
}
|
19
|
+
mainOrder = order.order;
|
20
|
+
}
|
21
|
+
mainOrder.items = mainOrder.items?.map((orderItem) => {
|
22
|
+
const isFormatted = (0, utils_1.isDefined)(orderItem.detail?.fulfilled_quantity);
|
23
|
+
if (isFormatted) {
|
24
|
+
return orderItem;
|
25
|
+
}
|
10
26
|
const detail = { ...orderItem };
|
11
27
|
delete detail.order;
|
12
28
|
delete detail.item;
|
@@ -17,26 +33,108 @@ function formatOrder(order, options) {
|
|
17
33
|
detail,
|
18
34
|
};
|
19
35
|
});
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
36
|
+
if (isRelatedEntity) {
|
37
|
+
if (order.return) {
|
38
|
+
formatOrderReturn(order.return, mainOrder);
|
39
|
+
}
|
40
|
+
const entityName = options.entity.name;
|
41
|
+
if (entityName === "OrderClaim") {
|
42
|
+
formatClaim(order);
|
43
|
+
}
|
44
|
+
else if (entityName === "OrderExchange") {
|
45
|
+
formatExchange(order);
|
46
|
+
}
|
47
|
+
else if (entityName === "Return") {
|
48
|
+
formatReturn(order);
|
49
|
+
}
|
50
|
+
}
|
51
|
+
if (order.shipping_methods) {
|
52
|
+
order.shipping_methods = order.shipping_methods?.map((shippingMethod) => {
|
53
|
+
if (shippingMethod.detail) {
|
54
|
+
return shippingMethod;
|
55
|
+
}
|
56
|
+
const sm = { ...shippingMethod.shipping_method };
|
57
|
+
delete shippingMethod.shipping_method;
|
58
|
+
cleanNestedRelations(shippingMethod);
|
59
|
+
return {
|
60
|
+
...sm,
|
61
|
+
order_id: shippingMethod.order_id,
|
62
|
+
detail: {
|
63
|
+
...shippingMethod,
|
64
|
+
},
|
65
|
+
};
|
66
|
+
});
|
67
|
+
}
|
68
|
+
if (mainOrder.summary) {
|
69
|
+
mainOrder.summary = mainOrder.summary?.[0]?.totals;
|
70
|
+
}
|
71
|
+
return (0, utils_1.createRawPropertiesFromBigNumber)(options?.includeTotals ? (0, utils_1.decorateCartTotals)(order) : order);
|
35
72
|
});
|
36
73
|
return isArray ? orders : orders[0];
|
37
74
|
}
|
38
|
-
|
39
|
-
|
75
|
+
function cleanNestedRelations(obj) {
|
76
|
+
if (!(0, utils_1.isObject)(obj)) {
|
77
|
+
return;
|
78
|
+
}
|
79
|
+
const obj_ = obj;
|
80
|
+
delete obj_.order;
|
81
|
+
delete obj_.return;
|
82
|
+
delete obj_.claim;
|
83
|
+
delete obj_.exchange;
|
84
|
+
}
|
85
|
+
function formatOrderReturn(orderReturn, mainOrder) {
|
86
|
+
orderReturn.items?.forEach((orderItem) => {
|
87
|
+
const item = mainOrder.items?.find((item) => item.id === orderItem.item_id);
|
88
|
+
orderItem.detail = item?.detail;
|
89
|
+
});
|
90
|
+
}
|
91
|
+
function formatClaim(claim) {
|
92
|
+
if (claim.additional_items) {
|
93
|
+
claim.additional_items = claim.additional_items.filter((item) => item.is_additional_item);
|
94
|
+
claim.additional_items.forEach((orderItem) => {
|
95
|
+
const item = claim.order.items?.find((item) => item.id === orderItem.item_id);
|
96
|
+
cleanNestedRelations(item);
|
97
|
+
orderItem.detail = item?.detail;
|
98
|
+
});
|
99
|
+
}
|
100
|
+
if (!claim.claim_items) {
|
101
|
+
return;
|
102
|
+
}
|
103
|
+
claim.claim_items = claim.claim_items.filter((item) => !item.is_additional_item);
|
104
|
+
claim.claim_items.forEach((orderItem) => {
|
105
|
+
const item = claim.order.items?.find((item) => item.id === orderItem.item_id);
|
106
|
+
cleanNestedRelations(item);
|
107
|
+
orderItem.detail = item?.detail;
|
108
|
+
});
|
109
|
+
}
|
110
|
+
function formatExchange(exchange) {
|
111
|
+
if (!exchange.additional_items) {
|
112
|
+
return;
|
113
|
+
}
|
114
|
+
exchange.additional_items.forEach((orderItem) => {
|
115
|
+
const item = exchange.order.items?.find((item) => item.id === orderItem.item_id);
|
116
|
+
cleanNestedRelations(item);
|
117
|
+
orderItem.detail = item?.detail;
|
118
|
+
});
|
119
|
+
}
|
120
|
+
function formatReturn(returnOrder) {
|
121
|
+
if (!returnOrder.items) {
|
122
|
+
return;
|
123
|
+
}
|
124
|
+
returnOrder.items.forEach((orderItem) => {
|
125
|
+
const item = returnOrder.order.items?.find((item) => item.id === orderItem.item_id);
|
126
|
+
cleanNestedRelations(item);
|
127
|
+
orderItem.detail = item?.detail;
|
128
|
+
});
|
129
|
+
}
|
130
|
+
// Map the public order model to the repository model format
|
131
|
+
// As the public responses have a different shape than the repository responses, this function is used to map the public properties to the internal db entities
|
132
|
+
// e.g "items" is the relation between "line-item" and "order" + "version", The line item itself is in "items.item"
|
133
|
+
// This helper maps to the correct repository to query the DB, and the function "formatOrder" remap the response to the public shape
|
134
|
+
function mapRepositoryToOrderModel(config, isRelatedEntity = false) {
|
135
|
+
if (isRelatedEntity) {
|
136
|
+
return mapRepositoryToRelatedEntity(config);
|
137
|
+
}
|
40
138
|
const conf = { ...config };
|
41
139
|
function replace(obj, type) {
|
42
140
|
if (!(0, utils_1.isDefined)(obj[type])) {
|
@@ -93,5 +191,24 @@ function mapRepositoryToOrderModel(config) {
|
|
93
191
|
}
|
94
192
|
return conf;
|
95
193
|
}
|
96
|
-
|
194
|
+
// This function has the same purpose as "mapRepositoryToOrderModel" but for returns, claims and exchanges
|
195
|
+
function mapRepositoryToRelatedEntity(config) {
|
196
|
+
const conf = { ...config };
|
197
|
+
function replace(obj, type) {
|
198
|
+
if (!(0, utils_1.isDefined)(obj[type])) {
|
199
|
+
return;
|
200
|
+
}
|
201
|
+
return (0, utils_1.deduplicate)(obj[type].sort().map((rel) => {
|
202
|
+
if (rel.includes("shipping_methods") &&
|
203
|
+
!rel.includes("shipping_methods.shipping_method")) {
|
204
|
+
obj.populate.push("shipping_methods.shipping_method");
|
205
|
+
return rel.replace("shipping_methods", "shipping_methods.shipping_method");
|
206
|
+
}
|
207
|
+
return rel;
|
208
|
+
}));
|
209
|
+
}
|
210
|
+
conf.options.fields = replace(config.options, "fields");
|
211
|
+
conf.options.populate = replace(config.options, "populate");
|
212
|
+
return conf;
|
213
|
+
}
|
97
214
|
//# sourceMappingURL=transform-order.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transform-order.js","sourceRoot":"","sources":["../../src/utils/transform-order.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"transform-order.js","sourceRoot":"","sources":["../../src/utils/transform-order.ts"],"names":[],"mappings":";;AAUA,kCAwFC;AAwFD,8DAwEC;AAlQD,qDAMkC;AAElC,iDAAiD;AACjD,+FAA+F;AAC/F,SAAgB,WAAW,CACzB,KAAK,EACL,OAGC;IAED,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;IACpC,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAE/C,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACnB,IAAI,SAAS,GAAG,KAAK,CAAA;QAErB,MAAM,eAAe,GAAG,OAAO,EAAE,MAAM,EAAE,IAAI,KAAK,OAAO,CAAA;QAEzD,yFAAyF;QACzF,IAAI,eAAe,EAAE,CAAC;YACpB,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;gBACjB,OAAO,KAAK,CAAA;YACd,CAAC;YAED,SAAS,GAAG,KAAK,CAAC,KAAK,CAAA;QACzB,CAAC;QAED,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;YACnD,MAAM,WAAW,GAAG,IAAA,iBAAS,EAAC,SAAS,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAA;YACnE,IAAI,WAAW,EAAE,CAAC;gBAChB,OAAO,SAAS,CAAA;YAClB,CAAC;YAED,MAAM,MAAM,GAAG,EAAE,GAAG,SAAS,EAAE,CAAA;YAC/B,OAAO,MAAM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AAC,GAAG,CAAC,QAAQ,CAAC,kCAAkC,CAAC,EACjD,CAAC;gBACD,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAA;gBAErD,OAAO,GAAG,CAAC,OAAO,CAChB,kBAAkB,EAClB,kCAAkC,CACnC,CAAA;YACH,CAAC;YACD,OAAO,GAAG,CAAA;QACZ,CAAC,CAAC,CACH,CAAA;IACH,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAA;IACvD,IAAI,CAAC,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;IAE3D,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/package.json
CHANGED
@@ -1,17 +1,17 @@
|
|
1
1
|
{
|
2
2
|
"name": "@medusajs/order",
|
3
|
-
"version": "0.
|
3
|
+
"version": "1.0.0-rc-20241003153304",
|
4
4
|
"description": "Medusa Order module",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"types": "dist/index.d.ts",
|
7
7
|
"files": [
|
8
|
-
"dist"
|
8
|
+
"dist",
|
9
|
+
"!dist/**/__tests__",
|
10
|
+
"!dist/**/__mocks__",
|
11
|
+
"!dist/**/__fixtures__"
|
9
12
|
],
|
10
13
|
"engines": {
|
11
|
-
"node": ">=
|
12
|
-
},
|
13
|
-
"bin": {
|
14
|
-
"medusa-order-seed": "dist/scripts/bin/run-seed.js"
|
14
|
+
"node": ">=20"
|
15
15
|
},
|
16
16
|
"repository": {
|
17
17
|
"type": "git",
|
@@ -26,36 +26,35 @@
|
|
26
26
|
"scripts": {
|
27
27
|
"watch": "tsc --build --watch",
|
28
28
|
"watch:test": "tsc --build tsconfig.spec.json --watch",
|
29
|
-
"
|
30
|
-
"build": "rimraf dist && tsc --build &&
|
29
|
+
"resolve:aliases": "tsc --showConfig -p tsconfig.json > tsconfig.resolved.json && tsc-alias -p tsconfig.resolved.json && rimraf tsconfig.resolved.json",
|
30
|
+
"build": "rimraf dist && tsc --build && npm run resolve:aliases",
|
31
31
|
"test": "jest --runInBand --bail --forceExit -- src/**/__tests__/**/*.ts",
|
32
32
|
"test:integration": "jest --forceExit -- integration-tests/**/__tests__/**/*.ts",
|
33
|
-
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:generate",
|
34
|
-
"migration:initial": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:create --initial",
|
35
|
-
"migration:create": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:create",
|
36
|
-
"migration:up": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm migration:up",
|
37
|
-
"orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts mikro-orm cache:clear"
|
33
|
+
"migration:generate": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts medusa-mikro-orm migration:generate",
|
34
|
+
"migration:initial": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create --initial",
|
35
|
+
"migration:create": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts medusa-mikro-orm migration:create",
|
36
|
+
"migration:up": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts medusa-mikro-orm migration:up",
|
37
|
+
"orm:cache:clear": " MIKRO_ORM_CLI=./mikro-orm.config.dev.ts medusa-mikro-orm cache:clear"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
|
+
"@medusajs/framework": "1.0.0-rc-20241003153304",
|
40
41
|
"@mikro-orm/cli": "5.9.7",
|
41
|
-
"
|
42
|
-
"
|
43
|
-
"
|
42
|
+
"@mikro-orm/core": "5.9.7",
|
43
|
+
"@mikro-orm/migrations": "5.9.7",
|
44
|
+
"@mikro-orm/postgresql": "5.9.7",
|
45
|
+
"@swc/core": "^1.7.28",
|
46
|
+
"@swc/jest": "^0.2.36",
|
47
|
+
"jest": "^29.7.0",
|
48
|
+
"medusa-test-utils": "2.0.0-rc-20241003153304",
|
44
49
|
"rimraf": "^3.0.2",
|
45
|
-
"ts-jest": "^29.1.1",
|
46
|
-
"ts-node": "^10.9.1",
|
47
50
|
"tsc-alias": "^1.8.6",
|
48
|
-
"typescript": "^5.
|
51
|
+
"typescript": "^5.6.2"
|
49
52
|
},
|
50
|
-
"
|
51
|
-
"@medusajs/
|
52
|
-
"@medusajs/types": "^1.11.17",
|
53
|
-
"@medusajs/utils": "^1.11.10",
|
53
|
+
"peerDependencies": {
|
54
|
+
"@medusajs/framework": "1.0.0-rc-20241003153304",
|
54
55
|
"@mikro-orm/core": "5.9.7",
|
55
56
|
"@mikro-orm/migrations": "5.9.7",
|
56
57
|
"@mikro-orm/postgresql": "5.9.7",
|
57
|
-
"awilix": "^8.0.
|
58
|
-
"dotenv": "^16.4.5",
|
59
|
-
"knex": "2.4.2"
|
58
|
+
"awilix": "^8.0.1"
|
60
59
|
}
|
61
60
|
}
|
@@ -1,59 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
-
if (k2 === undefined) k2 = k;
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
-
}
|
8
|
-
Object.defineProperty(o, k2, desc);
|
9
|
-
}) : (function(o, m, k, k2) {
|
10
|
-
if (k2 === undefined) k2 = k;
|
11
|
-
o[k2] = m[k];
|
12
|
-
}));
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
-
}) : function(o, v) {
|
16
|
-
o["default"] = v;
|
17
|
-
});
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
-
if (mod && mod.__esModule) return mod;
|
20
|
-
var result = {};
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
-
__setModuleDefault(result, mod);
|
23
|
-
return result;
|
24
|
-
};
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.moduleDefinition = void 0;
|
27
|
-
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
28
|
-
const utils_1 = require("@medusajs/utils");
|
29
|
-
const Models = __importStar(require("./models"));
|
30
|
-
const ModuleModels = __importStar(require("./models"));
|
31
|
-
const ModuleRepositories = __importStar(require("./repositories"));
|
32
|
-
const ModuleServices = __importStar(require("./services"));
|
33
|
-
const _services_1 = require("./services");
|
34
|
-
const migrationScriptOptions = {
|
35
|
-
moduleName: modules_sdk_1.Modules.ORDER,
|
36
|
-
models: Models,
|
37
|
-
pathToMigrations: __dirname + "/migrations",
|
38
|
-
};
|
39
|
-
const runMigrations = utils_1.ModulesSdkUtils.buildMigrationScript(migrationScriptOptions);
|
40
|
-
const revertMigration = utils_1.ModulesSdkUtils.buildRevertMigrationScript(migrationScriptOptions);
|
41
|
-
const containerLoader = utils_1.ModulesSdkUtils.moduleContainerLoaderFactory({
|
42
|
-
moduleModels: ModuleModels,
|
43
|
-
moduleRepositories: ModuleRepositories,
|
44
|
-
moduleServices: ModuleServices,
|
45
|
-
});
|
46
|
-
const connectionLoader = utils_1.ModulesSdkUtils.mikroOrmConnectionLoaderFactory({
|
47
|
-
moduleName: modules_sdk_1.Modules.ORDER,
|
48
|
-
moduleModels: Object.values(Models),
|
49
|
-
migrationsPath: __dirname + "/migrations",
|
50
|
-
});
|
51
|
-
const service = _services_1.OrderModuleService;
|
52
|
-
const loaders = [containerLoader, connectionLoader];
|
53
|
-
exports.moduleDefinition = {
|
54
|
-
service,
|
55
|
-
loaders,
|
56
|
-
revertMigration,
|
57
|
-
runMigrations,
|
58
|
-
};
|
59
|
-
//# sourceMappingURL=module-definition.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"module-definition.js","sourceRoot":"","sources":["../src/module-definition.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAA+C;AAE/C,2CAAiD;AACjD,gDAAiC;AACjC,sDAAuC;AACvC,kEAAmD;AACnD,0DAA2C;AAC3C,yCAA8C;AAE9C,MAAM,sBAAsB,GAAG;IAC7B,UAAU,EAAE,qBAAO,CAAC,KAAK;IACzB,MAAM,EAAE,MAAM;IACd,gBAAgB,EAAE,SAAS,GAAG,aAAa;CAC5C,CAAA;AAED,MAAM,aAAa,GAAG,uBAAe,CAAC,oBAAoB,CACxD,sBAAsB,CACvB,CAAA;AAED,MAAM,eAAe,GAAG,uBAAe,CAAC,0BAA0B,CAChE,sBAAsB,CACvB,CAAA;AAED,MAAM,eAAe,GAAG,uBAAe,CAAC,4BAA4B,CAAC;IACnE,YAAY,EAAE,YAAY;IAC1B,kBAAkB,EAAE,kBAAkB;IACtC,cAAc,EAAE,cAAc;CAC/B,CAAC,CAAA;AAEF,MAAM,gBAAgB,GAAG,uBAAe,CAAC,+BAA+B,CAAC;IACvE,UAAU,EAAE,qBAAO,CAAC,KAAK;IACzB,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;IACnC,cAAc,EAAE,SAAS,GAAG,aAAa;CAC1C,CAAC,CAAA;AAEF,MAAM,OAAO,GAAG,8BAAkB,CAAA;AAClC,MAAM,OAAO,GAAG,CAAC,eAAe,EAAE,gBAAgB,CAAQ,CAAA;AAE7C,QAAA,gBAAgB,GAAkB;IAC7C,OAAO;IACP,OAAO;IACP,eAAe;IACf,aAAa;CACd,CAAA"}
|
@@ -1,49 +0,0 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
"use strict";
|
3
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
4
|
-
if (k2 === undefined) k2 = k;
|
5
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
6
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
8
|
-
}
|
9
|
-
Object.defineProperty(o, k2, desc);
|
10
|
-
}) : (function(o, m, k, k2) {
|
11
|
-
if (k2 === undefined) k2 = k;
|
12
|
-
o[k2] = m[k];
|
13
|
-
}));
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
16
|
-
}) : function(o, v) {
|
17
|
-
o["default"] = v;
|
18
|
-
});
|
19
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
20
|
-
if (mod && mod.__esModule) return mod;
|
21
|
-
var result = {};
|
22
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
23
|
-
__setModuleDefault(result, mod);
|
24
|
-
return result;
|
25
|
-
};
|
26
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
27
|
-
const modules_sdk_1 = require("@medusajs/modules-sdk");
|
28
|
-
const utils_1 = require("@medusajs/utils");
|
29
|
-
const Models = __importStar(require("../../models"));
|
30
|
-
const os_1 = require("os");
|
31
|
-
const args = process.argv;
|
32
|
-
const path = args.pop();
|
33
|
-
exports.default = (async () => {
|
34
|
-
const { config } = await Promise.resolve().then(() => __importStar(require("dotenv")));
|
35
|
-
config();
|
36
|
-
if (!path) {
|
37
|
-
throw new Error(`filePath is required.${os_1.EOL}Example: medusa-order-seed <filePath>`);
|
38
|
-
}
|
39
|
-
const run = utils_1.ModulesSdkUtils.buildSeedScript({
|
40
|
-
moduleName: modules_sdk_1.Modules.ORDER,
|
41
|
-
models: Models,
|
42
|
-
pathToMigrations: __dirname + "/../../migrations",
|
43
|
-
seedHandler: async ({ manager, data }) => {
|
44
|
-
// TODO: Add seed logic
|
45
|
-
},
|
46
|
-
});
|
47
|
-
await run({ path });
|
48
|
-
})();
|
49
|
-
//# sourceMappingURL=run-seed.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"run-seed.js","sourceRoot":"","sources":["../../../src/scripts/bin/run-seed.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,uDAA+C;AAC/C,2CAAiD;AACjD,gDAAiC;AACjC,2BAAwB;AAExB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;AACzB,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAY,CAAA;AAEjC,kBAAe,CAAC,KAAK,IAAI,EAAE;IACzB,MAAM,EAAE,MAAM,EAAE,GAAG,wDAAa,QAAQ,GAAC,CAAA;IACzC,MAAM,EAAE,CAAA;IACR,IAAI,CAAC,IAAI,EAAE;QACT,MAAM,IAAI,KAAK,CACb,wBAAwB,QAAG,uCAAuC,CACnE,CAAA;KACF;IAED,MAAM,GAAG,GAAG,uBAAe,CAAC,eAAe,CAAC;QAC1C,UAAU,EAAE,qBAAO,CAAC,KAAK;QACzB,MAAM,EAAE,MAAM;QACd,gBAAgB,EAAE,SAAS,GAAG,mBAAmB;QACjD,WAAW,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE;YACvC,uBAAuB;QACzB,CAAC;KACF,CAAC,CAAA;IACF,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAA;AACrB,CAAC,CAAC,EAAE,CAAA"}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { Context, DAL, FindConfig, OrderTypes, RepositoryService } from "@medusajs/types";
|
2
|
-
import { OrderChange } from "../models";
|
3
|
-
type InjectedDependencies = {
|
4
|
-
orderChangeRepository: DAL.RepositoryService;
|
5
|
-
};
|
6
|
-
declare const OrderChangeService_base: new <TEntity_1 extends object = any>(container: InjectedDependencies) => import("@medusajs/types").InternalModuleService<TEntity_1, InjectedDependencies>;
|
7
|
-
export default class OrderChangeService<TEntity extends OrderChange = OrderChange> extends OrderChangeService_base<TEntity> {
|
8
|
-
protected readonly orderChangeRepository_: RepositoryService<TEntity>;
|
9
|
-
constructor(container: InjectedDependencies);
|
10
|
-
listCurrentOrderChange<TEntityMethod = OrderTypes.OrderDTO>(orderId: string | string[], config?: FindConfig<TEntityMethod>, sharedContext?: Context): Promise<TEntity[]>;
|
11
|
-
isActive(orderChange: OrderChange): boolean;
|
12
|
-
create(data: Partial<TEntity>[], sharedContext?: Context): Promise<TEntity[]>;
|
13
|
-
create(data: Partial<TEntity>, sharedContext?: Context): Promise<TEntity>;
|
14
|
-
}
|
15
|
-
export {};
|