@vendure/core 1.4.6 → 1.5.1
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/cli/api/common/extract-session-token.d.ts +3 -0
- package/cli/api/common/extract-session-token.js +35 -0
- package/cli/api/common/extract-session-token.js.map +1 -0
- package/cli/api/common/get-api-type.d.ts +3 -0
- package/cli/api/common/get-api-type.js +12 -0
- package/cli/api/common/get-api-type.js.map +1 -0
- package/cli/api/common/graphql-value-transformer.d.ts +30 -0
- package/cli/api/common/graphql-value-transformer.js +199 -0
- package/cli/api/common/graphql-value-transformer.js.map +1 -0
- package/cli/api/common/id-codec.d.ts +11 -0
- package/cli/api/common/id-codec.js +94 -0
- package/cli/api/common/id-codec.js.map +1 -0
- package/cli/api/common/id-codec.service.d.ts +7 -0
- package/cli/api/common/id-codec.service.js +33 -0
- package/cli/api/common/id-codec.service.js.map +1 -0
- package/cli/api/common/parse-context.d.ts +16 -0
- package/cli/api/common/parse-context.js +39 -0
- package/cli/api/common/parse-context.js.map +1 -0
- package/cli/api/common/request-context.d.ts +55 -0
- package/cli/api/common/request-context.js +143 -0
- package/cli/api/common/request-context.js.map +1 -0
- package/cli/api/common/set-session-token.d.ts +9 -0
- package/cli/api/common/set-session-token.js +27 -0
- package/cli/api/common/set-session-token.js.map +1 -0
- package/cli/api/decorators/allow.decorator.d.ts +3 -0
- package/cli/api/decorators/allow.decorator.js +8 -0
- package/cli/api/decorators/allow.decorator.js.map +1 -0
- package/cli/api/decorators/api.decorator.d.ts +1 -0
- package/cli/api/decorators/api.decorator.js +10 -0
- package/cli/api/decorators/api.decorator.js.map +1 -0
- package/cli/api/decorators/request-context.decorator.d.ts +1 -0
- package/cli/api/decorators/request-context.decorator.js +14 -0
- package/cli/api/decorators/request-context.decorator.js.map +1 -0
- package/cli/api/decorators/transaction.decorator.d.ts +3 -0
- package/cli/api/decorators/transaction.decorator.js +11 -0
- package/cli/api/decorators/transaction.decorator.js.map +1 -0
- package/cli/api/index.d.ts +11 -0
- package/cli/api/index.js +23 -0
- package/cli/api/index.js.map +1 -0
- package/cli/api/middleware/auth-guard.d.ts +21 -0
- package/cli/api/middleware/auth-guard.js +151 -0
- package/cli/api/middleware/auth-guard.js.map +1 -0
- package/cli/api/middleware/exception-logger.filter.d.ts +6 -0
- package/cli/api/middleware/exception-logger.filter.js +82 -0
- package/cli/api/middleware/exception-logger.filter.js.map +1 -0
- package/cli/api/middleware/id-interceptor.d.ts +12 -0
- package/cli/api/middleware/id-interceptor.js +56 -0
- package/cli/api/middleware/id-interceptor.js.map +1 -0
- package/cli/api/middleware/transaction-interceptor.d.ts +12 -0
- package/cli/api/middleware/transaction-interceptor.js +46 -0
- package/cli/api/middleware/transaction-interceptor.js.map +1 -0
- package/cli/api/resolvers/admin/search.resolver.d.ts +17 -0
- package/cli/api/resolvers/admin/search.resolver.js +81 -0
- package/cli/api/resolvers/admin/search.resolver.js.map +1 -0
- package/cli/cache/index.d.ts +1 -0
- package/cli/cache/index.js +14 -0
- package/cli/cache/index.js.map +1 -0
- package/cli/cache/request-context-cache.service.d.ts +9 -0
- package/cli/cache/request-context-cache.service.js +39 -0
- package/cli/cache/request-context-cache.service.js.map +1 -0
- package/cli/cli/cli-utils.d.ts +1 -0
- package/cli/cli/cli-utils.js +8 -0
- package/cli/cli/cli-utils.js.map +1 -0
- package/cli/cli/index.d.ts +1 -0
- package/cli/cli/index.js +14 -0
- package/cli/cli/index.js.map +1 -0
- package/cli/cli/populate.d.ts +5 -0
- package/cli/cli/populate.js +106 -0
- package/cli/cli/populate.js.map +1 -0
- package/cli/cli/vendure-cli.d.ts +2 -0
- package/cli/cli/vendure-cli.js +119 -0
- package/cli/cli/vendure-cli.js.map +1 -0
- package/cli/common/async-queue.d.ts +17 -0
- package/cli/common/async-queue.js +56 -0
- package/cli/common/async-queue.js.map +1 -0
- package/cli/common/calculated-decorator.d.ts +12 -0
- package/cli/common/calculated-decorator.js +22 -0
- package/cli/common/calculated-decorator.js.map +1 -0
- package/cli/common/configurable-operation.d.ts +53 -0
- package/cli/common/configurable-operation.js +96 -0
- package/cli/common/configurable-operation.js.map +1 -0
- package/cli/common/constants.d.ts +7 -0
- package/cli/common/constants.js +66 -0
- package/cli/common/constants.js.map +1 -0
- package/cli/common/error/error-result.d.ts +8 -0
- package/cli/common/error/error-result.js +11 -0
- package/cli/common/error/error-result.js.map +1 -0
- package/cli/common/error/errors.d.ts +31 -0
- package/cli/common/error/errors.js +48 -0
- package/cli/common/error/errors.js.map +1 -0
- package/cli/common/error/generated-graphql-admin-errors.d.ts +309 -0
- package/cli/common/error/generated-graphql-admin-errors.js +446 -0
- package/cli/common/error/generated-graphql-admin-errors.js.map +1 -0
- package/cli/common/error/generated-graphql-shop-errors.d.ts +254 -0
- package/cli/common/error/generated-graphql-shop-errors.js +370 -0
- package/cli/common/error/generated-graphql-shop-errors.js.map +1 -0
- package/cli/common/finite-state-machine/finite-state-machine.d.ts +14 -0
- package/cli/common/finite-state-machine/finite-state-machine.js +55 -0
- package/cli/common/finite-state-machine/finite-state-machine.js.map +1 -0
- package/cli/common/finite-state-machine/merge-transition-definitions.d.ts +2 -0
- package/cli/common/finite-state-machine/merge-transition-definitions.js +27 -0
- package/cli/common/finite-state-machine/merge-transition-definitions.js.map +1 -0
- package/cli/common/finite-state-machine/types.d.ts +16 -0
- package/cli/common/finite-state-machine/types.js +3 -0
- package/cli/common/finite-state-machine/types.js.map +1 -0
- package/cli/common/finite-state-machine/validate-transition-definition.d.ts +5 -0
- package/cli/common/finite-state-machine/validate-transition-definition.js +41 -0
- package/cli/common/finite-state-machine/validate-transition-definition.js.map +1 -0
- package/cli/common/generate-public-id.d.ts +1 -0
- package/cli/common/generate-public-id.js +10 -0
- package/cli/common/generate-public-id.js.map +1 -0
- package/cli/common/index.d.ts +15 -0
- package/cli/common/index.js +28 -0
- package/cli/common/index.js.map +1 -0
- package/cli/common/injector.d.ts +8 -0
- package/cli/common/injector.js +16 -0
- package/cli/common/injector.js.map +1 -0
- package/cli/common/permission-definition.d.ts +23 -0
- package/cli/common/permission-definition.js +53 -0
- package/cli/common/permission-definition.js.map +1 -0
- package/cli/common/self-refreshing-cache.d.ts +15 -0
- package/cli/common/self-refreshing-cache.js +56 -0
- package/cli/common/self-refreshing-cache.js.map +1 -0
- package/cli/common/tax-utils.d.ts +4 -0
- package/cli/common/tax-utils.js +20 -0
- package/cli/common/tax-utils.js.map +1 -0
- package/cli/common/ttl-cache.d.ts +13 -0
- package/cli/common/ttl-cache.js +48 -0
- package/cli/common/ttl-cache.js.map +1 -0
- package/cli/common/types/adjustment-source.d.ts +14 -0
- package/cli/common/types/adjustment-source.js +18 -0
- package/cli/common/types/adjustment-source.js.map +1 -0
- package/cli/common/types/common-types.d.ts +97 -0
- package/cli/common/types/common-types.js +3 -0
- package/cli/common/types/common-types.js.map +1 -0
- package/cli/common/types/entity-relation-paths.d.ts +16 -0
- package/cli/common/types/entity-relation-paths.js +3 -0
- package/cli/common/types/entity-relation-paths.js.map +1 -0
- package/cli/common/types/injectable-strategy.d.ts +5 -0
- package/cli/common/types/injectable-strategy.js +3 -0
- package/cli/common/types/injectable-strategy.js.map +1 -0
- package/cli/common/types/locale-types.d.ts +43 -0
- package/cli/common/types/locale-types.js +3 -0
- package/cli/common/types/locale-types.js.map +1 -0
- package/cli/common/utils.d.ts +11 -0
- package/cli/common/utils.js +66 -0
- package/cli/common/utils.js.map +1 -0
- package/cli/config/asset-naming-strategy/asset-naming-strategy.d.ts +6 -0
- package/cli/config/asset-naming-strategy/asset-naming-strategy.js +3 -0
- package/cli/config/asset-naming-strategy/asset-naming-strategy.js.map +1 -0
- package/cli/config/asset-naming-strategy/default-asset-naming-strategy.d.ts +11 -0
- package/cli/config/asset-naming-strategy/default-asset-naming-strategy.js +55 -0
- package/cli/config/asset-naming-strategy/default-asset-naming-strategy.js.map +1 -0
- package/cli/config/asset-preview-strategy/asset-preview-strategy.d.ts +6 -0
- package/cli/config/asset-preview-strategy/asset-preview-strategy.js +3 -0
- package/cli/config/asset-preview-strategy/asset-preview-strategy.js.map +1 -0
- package/cli/config/asset-preview-strategy/no-asset-preview-strategy.d.ts +6 -0
- package/cli/config/asset-preview-strategy/no-asset-preview-strategy.js +11 -0
- package/cli/config/asset-preview-strategy/no-asset-preview-strategy.js.map +1 -0
- package/cli/config/asset-storage-strategy/asset-storage-strategy.d.ts +13 -0
- package/cli/config/asset-storage-strategy/asset-storage-strategy.js +3 -0
- package/cli/config/asset-storage-strategy/asset-storage-strategy.js.map +1 -0
- package/cli/config/asset-storage-strategy/no-asset-storage-strategy.d.ts +13 -0
- package/cli/config/asset-storage-strategy/no-asset-storage-strategy.js +30 -0
- package/cli/config/asset-storage-strategy/no-asset-storage-strategy.js.map +1 -0
- package/cli/config/auth/authentication-strategy.d.ts +10 -0
- package/cli/config/auth/authentication-strategy.js +3 -0
- package/cli/config/auth/authentication-strategy.js.map +1 -0
- package/cli/config/auth/bcrypt-password-hashing-strategy.d.ts +7 -0
- package/cli/config/auth/bcrypt-password-hashing-strategy.js +21 -0
- package/cli/config/auth/bcrypt-password-hashing-strategy.js.map +1 -0
- package/cli/config/auth/default-password-validation-strategy.d.ts +10 -0
- package/cli/config/auth/default-password-validation-strategy.js +24 -0
- package/cli/config/auth/default-password-validation-strategy.js.map +1 -0
- package/cli/config/auth/native-authentication-strategy.d.ts +21 -0
- package/cli/config/auth/native-authentication-strategy.js +87 -0
- package/cli/config/auth/native-authentication-strategy.js.map +1 -0
- package/cli/config/auth/password-hashing-strategy.d.ts +5 -0
- package/cli/config/auth/password-hashing-strategy.js +3 -0
- package/cli/config/auth/password-hashing-strategy.js.map +1 -0
- package/cli/config/auth/password-validation-strategy.d.ts +5 -0
- package/cli/config/auth/password-validation-strategy.js +3 -0
- package/cli/config/auth/password-validation-strategy.js.map +1 -0
- package/cli/config/catalog/collection-filter.d.ts +13 -0
- package/cli/config/catalog/collection-filter.js +15 -0
- package/cli/config/catalog/collection-filter.js.map +1 -0
- package/cli/config/catalog/default-collection-filters.d.ts +52 -0
- package/cli/config/catalog/default-collection-filters.js +112 -0
- package/cli/config/catalog/default-collection-filters.js.map +1 -0
- package/cli/config/catalog/default-product-variant-price-calculation-strategy.d.ts +8 -0
- package/cli/config/catalog/default-product-variant-price-calculation-strategy.js +31 -0
- package/cli/config/catalog/default-product-variant-price-calculation-strategy.js.map +1 -0
- package/cli/config/catalog/default-stock-display-strategy.d.ts +8 -0
- package/cli/config/catalog/default-stock-display-strategy.js +17 -0
- package/cli/config/catalog/default-stock-display-strategy.js.map +1 -0
- package/cli/config/catalog/product-variant-price-calculation-strategy.d.ts +13 -0
- package/cli/config/catalog/product-variant-price-calculation-strategy.js +3 -0
- package/cli/config/catalog/product-variant-price-calculation-strategy.js.map +1 -0
- package/cli/config/catalog/stock-display-strategy.d.ts +6 -0
- package/cli/config/catalog/stock-display-strategy.js +3 -0
- package/cli/config/catalog/stock-display-strategy.js.map +1 -0
- package/cli/config/config-helpers.d.ts +3 -0
- package/cli/config/config-helpers.js +15 -0
- package/cli/config/config-helpers.js.map +1 -0
- package/cli/config/config.module.d.ts +16 -0
- package/cli/config/config.module.js +120 -0
- package/cli/config/config.module.js.map +1 -0
- package/cli/config/config.service.d.ts +30 -0
- package/cli/config/config.service.js +86 -0
- package/cli/config/config.service.js.map +1 -0
- package/cli/config/custom-field/custom-field-types.d.ts +65 -0
- package/cli/config/custom-field/custom-field-types.js +3 -0
- package/cli/config/custom-field/custom-field-types.js.map +1 -0
- package/cli/config/default-config.d.ts +2 -0
- package/cli/config/default-config.js +174 -0
- package/cli/config/default-config.js.map +1 -0
- package/cli/config/entity-id-strategy/auto-increment-id-strategy.d.ts +6 -0
- package/cli/config/entity-id-strategy/auto-increment-id-strategy.js +17 -0
- package/cli/config/entity-id-strategy/auto-increment-id-strategy.js.map +1 -0
- package/cli/config/entity-id-strategy/entity-id-strategy.d.ts +7 -0
- package/cli/config/entity-id-strategy/entity-id-strategy.js +3 -0
- package/cli/config/entity-id-strategy/entity-id-strategy.js.map +1 -0
- package/cli/config/entity-id-strategy/uuid-id-strategy.d.ts +6 -0
- package/cli/config/entity-id-strategy/uuid-id-strategy.js +16 -0
- package/cli/config/entity-id-strategy/uuid-id-strategy.js.map +1 -0
- package/cli/config/fulfillment/custom-fulfillment-process.d.ts +9 -0
- package/cli/config/fulfillment/custom-fulfillment-process.js +3 -0
- package/cli/config/fulfillment/custom-fulfillment-process.js.map +1 -0
- package/cli/config/fulfillment/fulfillment-handler.d.ts +21 -0
- package/cli/config/fulfillment/fulfillment-handler.js +23 -0
- package/cli/config/fulfillment/fulfillment-handler.js.map +1 -0
- package/cli/config/fulfillment/manual-fulfillment-handler.d.ts +11 -0
- package/cli/config/fulfillment/manual-fulfillment-handler.js +26 -0
- package/cli/config/fulfillment/manual-fulfillment-handler.js.map +1 -0
- package/cli/config/index.d.ts +61 -0
- package/cli/config/index.js +74 -0
- package/cli/config/index.js.map +1 -0
- package/cli/config/job-queue/inspectable-job-queue-strategy.d.ts +12 -0
- package/cli/config/job-queue/inspectable-job-queue-strategy.js +11 -0
- package/cli/config/job-queue/inspectable-job-queue-strategy.js.map +1 -0
- package/cli/config/job-queue/job-queue-strategy.d.ts +8 -0
- package/cli/config/job-queue/job-queue-strategy.js +3 -0
- package/cli/config/job-queue/job-queue-strategy.js.map +1 -0
- package/cli/config/logger/default-logger.d.ts +24 -0
- package/cli/config/logger/default-logger.js +90 -0
- package/cli/config/logger/default-logger.js.map +1 -0
- package/cli/config/logger/noop-logger.d.ts +8 -0
- package/cli/config/logger/noop-logger.js +17 -0
- package/cli/config/logger/noop-logger.js.map +1 -0
- package/cli/config/logger/typeorm-logger.d.ts +15 -0
- package/cli/config/logger/typeorm-logger.js +74 -0
- package/cli/config/logger/typeorm-logger.js.map +1 -0
- package/cli/config/logger/vendure-logger.d.ts +32 -0
- package/cli/config/logger/vendure-logger.js +68 -0
- package/cli/config/logger/vendure-logger.js.map +1 -0
- package/cli/config/merge-config.d.ts +2 -0
- package/cli/config/merge-config.js +34 -0
- package/cli/config/merge-config.js.map +1 -0
- package/cli/config/order/changed-price-handling-strategy.d.ts +7 -0
- package/cli/config/order/changed-price-handling-strategy.js +3 -0
- package/cli/config/order/changed-price-handling-strategy.js.map +1 -0
- package/cli/config/order/custom-order-process.d.ts +9 -0
- package/cli/config/order/custom-order-process.js +3 -0
- package/cli/config/order/custom-order-process.js.map +1 -0
- package/cli/config/order/default-changed-price-handling-strategy.d.ts +6 -0
- package/cli/config/order/default-changed-price-handling-strategy.js +10 -0
- package/cli/config/order/default-changed-price-handling-strategy.js.map +1 -0
- package/cli/config/order/default-order-item-price-calculation-strategy.d.ts +7 -0
- package/cli/config/order/default-order-item-price-calculation-strategy.js +13 -0
- package/cli/config/order/default-order-item-price-calculation-strategy.js.map +1 -0
- package/cli/config/order/default-order-placed-strategy.d.ts +7 -0
- package/cli/config/order/default-order-placed-strategy.js +13 -0
- package/cli/config/order/default-order-placed-strategy.js.map +1 -0
- package/cli/config/order/default-stock-allocation-strategy.d.ts +7 -0
- package/cli/config/order/default-stock-allocation-strategy.js +11 -0
- package/cli/config/order/default-stock-allocation-strategy.js.map +1 -0
- package/cli/config/order/merge-orders-strategy.d.ts +7 -0
- package/cli/config/order/merge-orders-strategy.js +29 -0
- package/cli/config/order/merge-orders-strategy.js.map +1 -0
- package/cli/config/order/order-by-code-access-strategy.d.ts +11 -0
- package/cli/config/order/order-by-code-access-strategy.js +25 -0
- package/cli/config/order/order-by-code-access-strategy.js.map +1 -0
- package/cli/config/order/order-code-strategy.d.ts +8 -0
- package/cli/config/order/order-code-strategy.js +11 -0
- package/cli/config/order/order-code-strategy.js.map +1 -0
- package/cli/config/order/order-item-price-calculation-strategy.d.ts +9 -0
- package/cli/config/order/order-item-price-calculation-strategy.js +3 -0
- package/cli/config/order/order-item-price-calculation-strategy.js.map +1 -0
- package/cli/config/order/order-merge-strategy.d.ts +14 -0
- package/cli/config/order/order-merge-strategy.js +12 -0
- package/cli/config/order/order-merge-strategy.js.map +1 -0
- package/cli/config/order/order-placed-strategy.d.ts +7 -0
- package/cli/config/order/order-placed-strategy.js +3 -0
- package/cli/config/order/order-placed-strategy.js.map +1 -0
- package/cli/config/order/stock-allocation-strategy.d.ts +7 -0
- package/cli/config/order/stock-allocation-strategy.js +3 -0
- package/cli/config/order/stock-allocation-strategy.js.map +1 -0
- package/cli/config/order/use-existing-strategy.d.ts +6 -0
- package/cli/config/order/use-existing-strategy.js +11 -0
- package/cli/config/order/use-existing-strategy.js.map +1 -0
- package/cli/config/order/use-guest-if-existing-empty-strategy.d.ts +6 -0
- package/cli/config/order/use-guest-if-existing-empty-strategy.js +13 -0
- package/cli/config/order/use-guest-if-existing-empty-strategy.js.map +1 -0
- package/cli/config/order/use-guest-strategy.d.ts +6 -0
- package/cli/config/order/use-guest-strategy.js +11 -0
- package/cli/config/order/use-guest-strategy.js.map +1 -0
- package/cli/config/payment/custom-payment-process.d.ts +9 -0
- package/cli/config/payment/custom-payment-process.js +3 -0
- package/cli/config/payment/custom-payment-process.js.map +1 -0
- package/cli/config/payment/dummy-payment-method-handler.d.ts +17 -0
- package/cli/config/payment/dummy-payment-method-handler.js +74 -0
- package/cli/config/payment/dummy-payment-method-handler.js.map +1 -0
- package/cli/config/payment/example-payment-method-handler.d.ts +11 -0
- package/cli/config/payment/example-payment-method-handler.js +59 -0
- package/cli/config/payment/example-payment-method-handler.js.map +1 -0
- package/cli/config/payment/payment-method-eligibility-checker.d.ts +13 -0
- package/cli/config/payment/payment-method-eligibility-checker.js +15 -0
- package/cli/config/payment/payment-method-eligibility-checker.js.map +1 -0
- package/cli/config/payment/payment-method-handler.d.ts +73 -0
- package/cli/config/payment/payment-method-handler.js +36 -0
- package/cli/config/payment/payment-method-handler.js.map +1 -0
- package/cli/config/promotion/actions/buy-x-get-y-free-action.d.ts +37 -0
- package/cli/config/promotion/actions/buy-x-get-y-free-action.js +30 -0
- package/cli/config/promotion/actions/buy-x-get-y-free-action.js.map +1 -0
- package/cli/config/promotion/actions/facet-values-percentage-discount-action.d.ts +17 -0
- package/cli/config/promotion/actions/facet-values-percentage-discount-action.js +39 -0
- package/cli/config/promotion/actions/facet-values-percentage-discount-action.js.map +1 -0
- package/cli/config/promotion/actions/free-shipping-action.d.ts +2 -0
- package/cli/config/promotion/actions/free-shipping-action.js +14 -0
- package/cli/config/promotion/actions/free-shipping-action.js.map +1 -0
- package/cli/config/promotion/actions/order-fixed-discount-action.d.ts +9 -0
- package/cli/config/promotion/actions/order-fixed-discount-action.js +21 -0
- package/cli/config/promotion/actions/order-fixed-discount-action.js.map +1 -0
- package/cli/config/promotion/actions/order-percentage-discount-action.d.ts +10 -0
- package/cli/config/promotion/actions/order-percentage-discount-action.js +23 -0
- package/cli/config/promotion/actions/order-percentage-discount-action.js.map +1 -0
- package/cli/config/promotion/actions/product-percentage-discount-action.d.ts +22 -0
- package/cli/config/promotion/actions/product-percentage-discount-action.js +36 -0
- package/cli/config/promotion/actions/product-percentage-discount-action.js.map +1 -0
- package/cli/config/promotion/conditions/buy-x-get-y-free-condition.d.ts +37 -0
- package/cli/config/promotion/conditions/buy-x-get-y-free-condition.js +71 -0
- package/cli/config/promotion/conditions/buy-x-get-y-free-condition.js.map +1 -0
- package/cli/config/promotion/conditions/contains-products-condition.d.ts +19 -0
- package/cli/config/promotion/conditions/contains-products-condition.js +38 -0
- package/cli/config/promotion/conditions/contains-products-condition.js.map +1 -0
- package/cli/config/promotion/conditions/customer-group-condition.d.ts +14 -0
- package/cli/config/promotion/conditions/customer-group-condition.js +72 -0
- package/cli/config/promotion/conditions/customer-group-condition.js.map +1 -0
- package/cli/config/promotion/conditions/has-facet-values-condition.d.ts +14 -0
- package/cli/config/promotion/conditions/has-facet-values-condition.js +31 -0
- package/cli/config/promotion/conditions/has-facet-values-condition.js.map +1 -0
- package/cli/config/promotion/conditions/min-order-amount-condition.d.ts +14 -0
- package/cli/config/promotion/conditions/min-order-amount-condition.js +27 -0
- package/cli/config/promotion/conditions/min-order-amount-condition.js.map +1 -0
- package/cli/config/promotion/index.d.ts +170 -0
- package/cli/config/promotion/index.js +50 -0
- package/cli/config/promotion/index.js.map +1 -0
- package/cli/config/promotion/promotion-action.d.ts +56 -0
- package/cli/config/promotion/promotion-action.js +49 -0
- package/cli/config/promotion/promotion-action.js.map +1 -0
- package/cli/config/promotion/promotion-condition.d.ts +19 -0
- package/cli/config/promotion/promotion-condition.js +19 -0
- package/cli/config/promotion/promotion-condition.js.map +1 -0
- package/cli/config/promotion/utils/facet-value-checker.d.ts +9 -0
- package/cli/config/promotion/utils/facet-value-checker.js +31 -0
- package/cli/config/promotion/utils/facet-value-checker.js.map +1 -0
- package/cli/config/session-cache/in-memory-session-cache-strategy.d.ts +11 -0
- package/cli/config/session-cache/in-memory-session-cache-strategy.js +44 -0
- package/cli/config/session-cache/in-memory-session-cache-strategy.js.map +1 -0
- package/cli/config/session-cache/noop-session-cache-strategy.d.ts +7 -0
- package/cli/config/session-cache/noop-session-cache-strategy.js +19 -0
- package/cli/config/session-cache/noop-session-cache-strategy.js.map +1 -0
- package/cli/config/session-cache/session-cache-strategy.d.ts +25 -0
- package/cli/config/session-cache/session-cache-strategy.js +3 -0
- package/cli/config/session-cache/session-cache-strategy.js.map +1 -0
- package/cli/config/shipping-method/default-shipping-calculator.d.ts +51 -0
- package/cli/config/shipping-method/default-shipping-calculator.js +69 -0
- package/cli/config/shipping-method/default-shipping-calculator.js.map +1 -0
- package/cli/config/shipping-method/default-shipping-eligibility-checker.d.ts +19 -0
- package/cli/config/shipping-method/default-shipping-eligibility-checker.js +27 -0
- package/cli/config/shipping-method/default-shipping-eligibility-checker.js.map +1 -0
- package/cli/config/shipping-method/shipping-calculator.d.ts +20 -0
- package/cli/config/shipping-method/shipping-calculator.js +15 -0
- package/cli/config/shipping-method/shipping-calculator.js.map +1 -0
- package/cli/config/shipping-method/shipping-eligibility-checker.d.ts +19 -0
- package/cli/config/shipping-method/shipping-eligibility-checker.js +38 -0
- package/cli/config/shipping-method/shipping-eligibility-checker.js.map +1 -0
- package/cli/config/tax/default-tax-line-calculation-strategy.d.ts +5 -0
- package/cli/config/tax/default-tax-line-calculation-strategy.js +11 -0
- package/cli/config/tax/default-tax-line-calculation-strategy.js.map +1 -0
- package/cli/config/tax/default-tax-zone-strategy.d.ts +6 -0
- package/cli/config/tax/default-tax-zone-strategy.js +10 -0
- package/cli/config/tax/default-tax-zone-strategy.js.map +1 -0
- package/cli/config/tax/tax-line-calculation-strategy.d.ts +17 -0
- package/cli/config/tax/tax-line-calculation-strategy.js +3 -0
- package/cli/config/tax/tax-line-calculation-strategy.js.map +1 -0
- package/cli/config/tax/tax-zone-strategy.d.ts +6 -0
- package/cli/config/tax/tax-zone-strategy.js +3 -0
- package/cli/config/tax/tax-zone-strategy.js.map +1 -0
- package/cli/config/vendure-config.d.ts +192 -0
- package/cli/config/vendure-config.js +3 -0
- package/cli/config/vendure-config.js.map +1 -0
- package/cli/connection/connection.module.d.ts +7 -0
- package/cli/connection/connection.module.js +61 -0
- package/cli/connection/connection.module.js.map +1 -0
- package/cli/connection/transaction-subscriber.d.ts +19 -0
- package/cli/connection/transaction-subscriber.js +54 -0
- package/cli/connection/transaction-subscriber.js.map +1 -0
- package/cli/connection/transaction-wrapper.d.ts +9 -0
- package/cli/connection/transaction-wrapper.js +79 -0
- package/cli/connection/transaction-wrapper.js.map +1 -0
- package/cli/connection/transactional-connection.d.ts +25 -0
- package/cli/connection/transactional-connection.js +170 -0
- package/cli/connection/transactional-connection.js.map +1 -0
- package/cli/connection/types.d.ts +8 -0
- package/cli/connection/types.js +3 -0
- package/cli/connection/types.js.map +1 -0
- package/cli/entity/address/address.entity.d.ts +22 -0
- package/cli/entity/address/address.entity.js +80 -0
- package/cli/entity/address/address.entity.js.map +1 -0
- package/cli/entity/administrator/administrator.entity.d.ts +15 -0
- package/cli/entity/administrator/administrator.entity.js +52 -0
- package/cli/entity/administrator/administrator.entity.js.map +1 -0
- package/cli/entity/asset/asset.entity.d.ts +26 -0
- package/cli/entity/asset/asset.entity.js +79 -0
- package/cli/entity/asset/asset.entity.js.map +1 -0
- package/cli/entity/asset/orderable-asset.entity.d.ts +10 -0
- package/cli/entity/asset/orderable-asset.entity.js +34 -0
- package/cli/entity/asset/orderable-asset.entity.js.map +1 -0
- package/cli/entity/authentication-method/authentication-method.entity.d.ts +5 -0
- package/cli/entity/authentication-method/authentication-method.entity.js +27 -0
- package/cli/entity/authentication-method/authentication-method.entity.js.map +1 -0
- package/cli/entity/authentication-method/external-authentication-method.entity.d.ts +8 -0
- package/cli/entity/authentication-method/external-authentication-method.entity.js +37 -0
- package/cli/entity/authentication-method/external-authentication-method.entity.js.map +1 -0
- package/cli/entity/authentication-method/native-authentication-method.entity.d.ts +11 -0
- package/cli/entity/authentication-method/native-authentication-method.entity.js +49 -0
- package/cli/entity/authentication-method/native-authentication-method.entity.js.map +1 -0
- package/cli/entity/base/base.entity.d.ts +7 -0
- package/cli/entity/base/base.entity.js +37 -0
- package/cli/entity/base/base.entity.js.map +1 -0
- package/cli/entity/channel/channel.entity.d.ts +17 -0
- package/cli/entity/channel/channel.entity.js +67 -0
- package/cli/entity/channel/channel.entity.js.map +1 -0
- package/cli/entity/collection/collection-asset.entity.d.ts +8 -0
- package/cli/entity/collection/collection-asset.entity.js +34 -0
- package/cli/entity/collection/collection-asset.entity.js.map +1 -0
- package/cli/entity/collection/collection-translation.entity.d.ts +16 -0
- package/cli/entity/collection/collection-translation.entity.js +52 -0
- package/cli/entity/collection/collection-translation.entity.js.map +1 -0
- package/cli/entity/collection/collection.entity.d.ts +29 -0
- package/cli/entity/collection/collection.entity.js +81 -0
- package/cli/entity/collection/collection.entity.js.map +1 -0
- package/cli/entity/country/country-translation.entity.d.ts +14 -0
- package/cli/entity/country/country-translation.entity.js +44 -0
- package/cli/entity/country/country-translation.entity.js.map +1 -0
- package/cli/entity/country/country.entity.d.ts +13 -0
- package/cli/entity/country/country.entity.js +43 -0
- package/cli/entity/country/country.entity.js.map +1 -0
- package/cli/entity/custom-entity-fields.d.ts +68 -0
- package/cli/entity/custom-entity-fields.js +106 -0
- package/cli/entity/custom-entity-fields.js.map +1 -0
- package/cli/entity/customer/customer.entity.d.ts +25 -0
- package/cli/entity/customer/customer.entity.js +82 -0
- package/cli/entity/customer/customer.entity.js.map +1 -0
- package/cli/entity/customer-group/customer-group.entity.d.ts +11 -0
- package/cli/entity/customer-group/customer-group.entity.js +39 -0
- package/cli/entity/customer-group/customer-group.entity.js.map +1 -0
- package/cli/entity/entities.d.ts +124 -0
- package/cli/entity/entities.js +128 -0
- package/cli/entity/entities.js.map +1 -0
- package/cli/entity/entity-id.decorator.d.ts +18 -0
- package/cli/entity/entity-id.decorator.js +40 -0
- package/cli/entity/entity-id.decorator.js.map +1 -0
- package/cli/entity/facet/facet-translation.entity.d.ts +14 -0
- package/cli/entity/facet/facet-translation.entity.js +44 -0
- package/cli/entity/facet/facet-translation.entity.js.map +1 -0
- package/cli/entity/facet/facet.entity.d.ts +18 -0
- package/cli/entity/facet/facet.entity.js +54 -0
- package/cli/entity/facet/facet.entity.js.map +1 -0
- package/cli/entity/facet-value/facet-value-translation.entity.d.ts +13 -0
- package/cli/entity/facet-value/facet-value-translation.entity.js +44 -0
- package/cli/entity/facet-value/facet-value-translation.entity.js.map +1 -0
- package/cli/entity/facet-value/facet-value.entity.d.ts +17 -0
- package/cli/entity/facet-value/facet-value.entity.js +50 -0
- package/cli/entity/facet-value/facet-value.entity.js.map +1 -0
- package/cli/entity/fulfillment/fulfillment.entity.d.ts +15 -0
- package/cli/entity/fulfillment/fulfillment.entity.js +51 -0
- package/cli/entity/fulfillment/fulfillment.entity.js.map +1 -0
- package/cli/entity/global-settings/global-settings.entity.d.ts +12 -0
- package/cli/entity/global-settings/global-settings.entity.js +42 -0
- package/cli/entity/global-settings/global-settings.entity.js.map +1 -0
- package/cli/entity/history-entry/customer-history-entry.entity.d.ts +7 -0
- package/cli/entity/history-entry/customer-history-entry.entity.js +30 -0
- package/cli/entity/history-entry/customer-history-entry.entity.js.map +1 -0
- package/cli/entity/history-entry/history-entry.entity.d.ts +9 -0
- package/cli/entity/history-entry/history-entry.entity.js +40 -0
- package/cli/entity/history-entry/history-entry.entity.js.map +1 -0
- package/cli/entity/history-entry/order-history-entry.entity.d.ts +7 -0
- package/cli/entity/history-entry/order-history-entry.entity.js +30 -0
- package/cli/entity/history-entry/order-history-entry.entity.js.map +1 -0
- package/cli/entity/index.d.ts +52 -0
- package/cli/entity/index.js +65 -0
- package/cli/entity/index.js.map +1 -0
- package/cli/entity/order/order.entity.d.ts +48 -0
- package/cli/entity/order/order.entity.js +277 -0
- package/cli/entity/order/order.entity.js.map +1 -0
- package/cli/entity/order-item/order-item.entity.d.ts +35 -0
- package/cli/entity/order-item/order-item.entity.js +182 -0
- package/cli/entity/order-item/order-item.entity.js.map +1 -0
- package/cli/entity/order-line/order-line.entity.d.ts +44 -0
- package/cli/entity/order-line/order-line.entity.js +275 -0
- package/cli/entity/order-line/order-line.entity.js.map +1 -0
- package/cli/entity/order-modification/order-modification.entity.d.ts +21 -0
- package/cli/entity/order-modification/order-modification.entity.js +81 -0
- package/cli/entity/order-modification/order-modification.entity.js.map +1 -0
- package/cli/entity/payment/payment.entity.d.ts +17 -0
- package/cli/entity/payment/payment.entity.js +59 -0
- package/cli/entity/payment/payment.entity.js.map +1 -0
- package/cli/entity/payment-method/payment-method.entity.d.ts +18 -0
- package/cli/entity/payment-method/payment-method.entity.js +60 -0
- package/cli/entity/payment-method/payment-method.entity.js.map +1 -0
- package/cli/entity/product/product-asset.entity.d.ts +8 -0
- package/cli/entity/product/product-asset.entity.js +34 -0
- package/cli/entity/product/product-asset.entity.js.map +1 -0
- package/cli/entity/product/product-translation.entity.d.ts +16 -0
- package/cli/entity/product/product-translation.entity.js +52 -0
- package/cli/entity/product/product-translation.entity.js.map +1 -0
- package/cli/entity/product/product.entity.d.ts +28 -0
- package/cli/entity/product/product.entity.js +75 -0
- package/cli/entity/product/product.entity.js.map +1 -0
- package/cli/entity/product-option/product-option-translation.entity.d.ts +14 -0
- package/cli/entity/product-option/product-option-translation.entity.js +44 -0
- package/cli/entity/product-option/product-option-translation.entity.js.map +1 -0
- package/cli/entity/product-option/product-option.entity.d.ts +17 -0
- package/cli/entity/product-option/product-option.entity.js +53 -0
- package/cli/entity/product-option/product-option.entity.js.map +1 -0
- package/cli/entity/product-option-group/product-option-group-translation.entity.d.ts +14 -0
- package/cli/entity/product-option-group/product-option-group-translation.entity.js +44 -0
- package/cli/entity/product-option-group/product-option-group-translation.entity.js.map +1 -0
- package/cli/entity/product-option-group/product-option-group.entity.d.ts +18 -0
- package/cli/entity/product-option-group/product-option-group.entity.js +53 -0
- package/cli/entity/product-option-group/product-option-group.entity.js.map +1 -0
- package/cli/entity/product-variant/product-variant-asset.entity.d.ts +8 -0
- package/cli/entity/product-variant/product-variant-asset.entity.js +34 -0
- package/cli/entity/product-variant/product-variant-asset.entity.js.map +1 -0
- package/cli/entity/product-variant/product-variant-price.entity.d.ts +9 -0
- package/cli/entity/product-variant/product-variant-price.entity.js +39 -0
- package/cli/entity/product-variant/product-variant-price.entity.js.map +1 -0
- package/cli/entity/product-variant/product-variant-translation.entity.d.ts +14 -0
- package/cli/entity/product-variant/product-variant-translation.entity.js +44 -0
- package/cli/entity/product-variant/product-variant-translation.entity.js.map +1 -0
- package/cli/entity/product-variant/product-variant.entity.d.ts +49 -0
- package/cli/entity/product-variant/product-variant.entity.js +155 -0
- package/cli/entity/product-variant/product-variant.entity.js.map +1 -0
- package/cli/entity/promotion/promotion.entity.d.ts +56 -0
- package/cli/entity/promotion/promotion.entity.js +157 -0
- package/cli/entity/promotion/promotion.entity.js.map +1 -0
- package/cli/entity/refund/refund.entity.d.ts +21 -0
- package/cli/entity/refund/refund.entity.js +78 -0
- package/cli/entity/refund/refund.entity.js.map +1 -0
- package/cli/entity/role/role.entity.d.ts +12 -0
- package/cli/entity/role/role.entity.js +43 -0
- package/cli/entity/role/role.entity.js.map +1 -0
- package/cli/entity/session/anonymous-session.entity.d.ts +5 -0
- package/cli/entity/session/anonymous-session.entity.js +25 -0
- package/cli/entity/session/anonymous-session.entity.js.map +1 -0
- package/cli/entity/session/authenticated-session.entity.d.ts +8 -0
- package/cli/entity/session/authenticated-session.entity.js +34 -0
- package/cli/entity/session/authenticated-session.entity.js.map +1 -0
- package/cli/entity/session/session.entity.d.ts +13 -0
- package/cli/entity/session/session.entity.js +54 -0
- package/cli/entity/session/session.entity.js.map +1 -0
- package/cli/entity/shipping-line/shipping-line.entity.d.ts +24 -0
- package/cli/entity/shipping-line/shipping-line.entity.js +128 -0
- package/cli/entity/shipping-line/shipping-line.entity.js.map +1 -0
- package/cli/entity/shipping-method/shipping-method-translation.entity.d.ts +16 -0
- package/cli/entity/shipping-method/shipping-method-translation.entity.js +48 -0
- package/cli/entity/shipping-method/shipping-method-translation.entity.js.map +1 -0
- package/cli/entity/shipping-method/shipping-method.entity.d.ts +28 -0
- package/cli/entity/shipping-method/shipping-method.entity.js +92 -0
- package/cli/entity/shipping-method/shipping-method.entity.js.map +1 -0
- package/cli/entity/stock-movement/allocation.entity.d.ts +9 -0
- package/cli/entity/stock-movement/allocation.entity.js +32 -0
- package/cli/entity/stock-movement/allocation.entity.js.map +1 -0
- package/cli/entity/stock-movement/cancellation.entity.d.ts +9 -0
- package/cli/entity/stock-movement/cancellation.entity.js +32 -0
- package/cli/entity/stock-movement/cancellation.entity.js.map +1 -0
- package/cli/entity/stock-movement/release.entity.d.ts +9 -0
- package/cli/entity/stock-movement/release.entity.js +32 -0
- package/cli/entity/stock-movement/release.entity.js.map +1 -0
- package/cli/entity/stock-movement/sale.entity.d.ts +9 -0
- package/cli/entity/stock-movement/sale.entity.js +32 -0
- package/cli/entity/stock-movement/sale.entity.js.map +1 -0
- package/cli/entity/stock-movement/stock-adjustment.entity.d.ts +7 -0
- package/cli/entity/stock-movement/stock-adjustment.entity.js +27 -0
- package/cli/entity/stock-movement/stock-adjustment.entity.js.map +1 -0
- package/cli/entity/stock-movement/stock-movement.entity.d.ts +8 -0
- package/cli/entity/stock-movement/stock-movement.entity.js +36 -0
- package/cli/entity/stock-movement/stock-movement.entity.js.map +1 -0
- package/cli/entity/surcharge/surcharge.entity.d.ts +18 -0
- package/cli/entity/surcharge/surcharge.entity.js +82 -0
- package/cli/entity/surcharge/surcharge.entity.js.map +1 -0
- package/cli/entity/tag/tag.entity.d.ts +6 -0
- package/cli/entity/tag/tag.entity.js +29 -0
- package/cli/entity/tag/tag.entity.js.map +1 -0
- package/cli/entity/tax-category/tax-category.entity.d.ts +10 -0
- package/cli/entity/tax-category/tax-category.entity.js +38 -0
- package/cli/entity/tax-category/tax-category.entity.js.map +1 -0
- package/cli/entity/tax-rate/tax-rate.entity.d.ts +24 -0
- package/cli/entity/tax-rate/tax-rate.entity.js +81 -0
- package/cli/entity/tax-rate/tax-rate.entity.js.map +1 -0
- package/cli/entity/user/user.entity.d.ts +19 -0
- package/cli/entity/user/user.entity.js +69 -0
- package/cli/entity/user/user.entity.js.map +1 -0
- package/cli/entity/value-transformers.d.ts +5 -0
- package/cli/entity/value-transformers.js +13 -0
- package/cli/entity/value-transformers.js.map +1 -0
- package/cli/entity/zone/zone.entity.d.ts +11 -0
- package/cli/entity/zone/zone.entity.js +40 -0
- package/cli/entity/zone/zone.entity.js.map +1 -0
- package/cli/event-bus/event-bus.d.ts +15 -0
- package/cli/event-bus/event-bus.js +51 -0
- package/cli/event-bus/event-bus.js.map +1 -0
- package/cli/event-bus/event-bus.module.d.ts +2 -0
- package/cli/event-bus/event-bus.module.js +23 -0
- package/cli/event-bus/event-bus.module.js.map +1 -0
- package/cli/event-bus/events/account-registration-event.d.ts +8 -0
- package/cli/event-bus/events/account-registration-event.js +13 -0
- package/cli/event-bus/events/account-registration-event.js.map +1 -0
- package/cli/event-bus/events/account-verified-event.d.ts +8 -0
- package/cli/event-bus/events/account-verified-event.js +13 -0
- package/cli/event-bus/events/account-verified-event.js.map +1 -0
- package/cli/event-bus/events/administrator-event.d.ts +10 -0
- package/cli/event-bus/events/administrator-event.js +11 -0
- package/cli/event-bus/events/administrator-event.js.map +1 -0
- package/cli/event-bus/events/asset-channel-event.d.ts +11 -0
- package/cli/event-bus/events/asset-channel-event.js +15 -0
- package/cli/event-bus/events/asset-channel-event.js.map +1 -0
- package/cli/event-bus/events/asset-event.d.ts +11 -0
- package/cli/event-bus/events/asset-event.js +14 -0
- package/cli/event-bus/events/asset-event.js.map +1 -0
- package/cli/event-bus/events/attempted-login-event.d.ts +8 -0
- package/cli/event-bus/events/attempted-login-event.js +14 -0
- package/cli/event-bus/events/attempted-login-event.js.map +1 -0
- package/cli/event-bus/events/change-channel-event.d.ts +13 -0
- package/cli/event-bus/events/change-channel-event.js +16 -0
- package/cli/event-bus/events/change-channel-event.js.map +1 -0
- package/cli/event-bus/events/channel-event.d.ts +10 -0
- package/cli/event-bus/events/channel-event.js +11 -0
- package/cli/event-bus/events/channel-event.js.map +1 -0
- package/cli/event-bus/events/collection-event.d.ts +10 -0
- package/cli/event-bus/events/collection-event.js +11 -0
- package/cli/event-bus/events/collection-event.js.map +1 -0
- package/cli/event-bus/events/collection-modification-event.d.ts +10 -0
- package/cli/event-bus/events/collection-modification-event.js +14 -0
- package/cli/event-bus/events/collection-modification-event.js.map +1 -0
- package/cli/event-bus/events/country-event.d.ts +10 -0
- package/cli/event-bus/events/country-event.js +11 -0
- package/cli/event-bus/events/country-event.js.map +1 -0
- package/cli/event-bus/events/coupon-code-event.d.ts +10 -0
- package/cli/event-bus/events/coupon-code-event.js +15 -0
- package/cli/event-bus/events/coupon-code-event.js.map +1 -0
- package/cli/event-bus/events/customer-address-event.d.ts +15 -0
- package/cli/event-bus/events/customer-address-event.js +18 -0
- package/cli/event-bus/events/customer-address-event.js.map +1 -0
- package/cli/event-bus/events/customer-event.d.ts +13 -0
- package/cli/event-bus/events/customer-event.js +14 -0
- package/cli/event-bus/events/customer-event.js.map +1 -0
- package/cli/event-bus/events/customer-group-entity-event.d.ts +10 -0
- package/cli/event-bus/events/customer-group-entity-event.js +11 -0
- package/cli/event-bus/events/customer-group-entity-event.js.map +1 -0
- package/cli/event-bus/events/customer-group-event.d.ts +18 -0
- package/cli/event-bus/events/customer-group-event.js +25 -0
- package/cli/event-bus/events/customer-group-event.js.map +1 -0
- package/cli/event-bus/events/facet-event.d.ts +10 -0
- package/cli/event-bus/events/facet-event.js +11 -0
- package/cli/event-bus/events/facet-event.js.map +1 -0
- package/cli/event-bus/events/facet-value-event.d.ts +10 -0
- package/cli/event-bus/events/facet-value-event.js +11 -0
- package/cli/event-bus/events/facet-value-event.js.map +1 -0
- package/cli/event-bus/events/fulfillment-event.d.ts +14 -0
- package/cli/event-bus/events/fulfillment-event.js +11 -0
- package/cli/event-bus/events/fulfillment-event.js.map +1 -0
- package/cli/event-bus/events/fulfillment-state-transition-event.d.ts +11 -0
- package/cli/event-bus/events/fulfillment-state-transition-event.js +15 -0
- package/cli/event-bus/events/fulfillment-state-transition-event.js.map +1 -0
- package/cli/event-bus/events/global-settings-event.d.ts +7 -0
- package/cli/event-bus/events/global-settings-event.js +11 -0
- package/cli/event-bus/events/global-settings-event.js.map +1 -0
- package/cli/event-bus/events/history-entry-event.d.ts +14 -0
- package/cli/event-bus/events/history-entry-event.js +12 -0
- package/cli/event-bus/events/history-entry-event.js.map +1 -0
- package/cli/event-bus/events/identifier-change-event.d.ts +9 -0
- package/cli/event-bus/events/identifier-change-event.js +14 -0
- package/cli/event-bus/events/identifier-change-event.js.map +1 -0
- package/cli/event-bus/events/identifier-change-request-event.d.ts +8 -0
- package/cli/event-bus/events/identifier-change-request-event.js +13 -0
- package/cli/event-bus/events/identifier-change-request-event.js.map +1 -0
- package/cli/event-bus/events/login-event.d.ts +8 -0
- package/cli/event-bus/events/login-event.js +13 -0
- package/cli/event-bus/events/login-event.js.map +1 -0
- package/cli/event-bus/events/logout-event.d.ts +6 -0
- package/cli/event-bus/events/logout-event.js +12 -0
- package/cli/event-bus/events/logout-event.js.map +1 -0
- package/cli/event-bus/events/order-event.d.ts +9 -0
- package/cli/event-bus/events/order-event.js +14 -0
- package/cli/event-bus/events/order-event.js.map +1 -0
- package/cli/event-bus/events/order-line-event.d.ts +10 -0
- package/cli/event-bus/events/order-line-event.js +15 -0
- package/cli/event-bus/events/order-line-event.js.map +1 -0
- package/cli/event-bus/events/order-placed-event.d.ts +11 -0
- package/cli/event-bus/events/order-placed-event.js +15 -0
- package/cli/event-bus/events/order-placed-event.js.map +1 -0
- package/cli/event-bus/events/order-state-transition-event.d.ts +11 -0
- package/cli/event-bus/events/order-state-transition-event.js +15 -0
- package/cli/event-bus/events/order-state-transition-event.js.map +1 -0
- package/cli/event-bus/events/password-reset-event.d.ts +8 -0
- package/cli/event-bus/events/password-reset-event.js +13 -0
- package/cli/event-bus/events/password-reset-event.js.map +1 -0
- package/cli/event-bus/events/password-reset-verified-event.d.ts +8 -0
- package/cli/event-bus/events/password-reset-verified-event.js +13 -0
- package/cli/event-bus/events/password-reset-verified-event.js.map +1 -0
- package/cli/event-bus/events/payment-method-event.d.ts +10 -0
- package/cli/event-bus/events/payment-method-event.js +11 -0
- package/cli/event-bus/events/payment-method-event.js.map +1 -0
- package/cli/event-bus/events/payment-state-transition-event.d.ts +13 -0
- package/cli/event-bus/events/payment-state-transition-event.js +16 -0
- package/cli/event-bus/events/payment-state-transition-event.js.map +1 -0
- package/cli/event-bus/events/product-channel-event.d.ts +11 -0
- package/cli/event-bus/events/product-channel-event.js +15 -0
- package/cli/event-bus/events/product-channel-event.js.map +1 -0
- package/cli/event-bus/events/product-event.d.ts +11 -0
- package/cli/event-bus/events/product-event.js +14 -0
- package/cli/event-bus/events/product-event.js.map +1 -0
- package/cli/event-bus/events/product-option-event.d.ts +10 -0
- package/cli/event-bus/events/product-option-event.js +11 -0
- package/cli/event-bus/events/product-option-event.js.map +1 -0
- package/cli/event-bus/events/product-option-group-change-event.d.ts +11 -0
- package/cli/event-bus/events/product-option-group-change-event.js +15 -0
- package/cli/event-bus/events/product-option-group-change-event.js.map +1 -0
- package/cli/event-bus/events/product-option-group-event.d.ts +10 -0
- package/cli/event-bus/events/product-option-group-event.js +11 -0
- package/cli/event-bus/events/product-option-group-event.js.map +1 -0
- package/cli/event-bus/events/product-variant-channel-event.d.ts +11 -0
- package/cli/event-bus/events/product-variant-channel-event.js +15 -0
- package/cli/event-bus/events/product-variant-channel-event.js.map +1 -0
- package/cli/event-bus/events/product-variant-event.d.ts +11 -0
- package/cli/event-bus/events/product-variant-event.js +14 -0
- package/cli/event-bus/events/product-variant-event.js.map +1 -0
- package/cli/event-bus/events/promotion-event.d.ts +10 -0
- package/cli/event-bus/events/promotion-event.js +11 -0
- package/cli/event-bus/events/promotion-event.js.map +1 -0
- package/cli/event-bus/events/refund-state-transition-event.d.ts +13 -0
- package/cli/event-bus/events/refund-state-transition-event.js +16 -0
- package/cli/event-bus/events/refund-state-transition-event.js.map +1 -0
- package/cli/event-bus/events/role-change-event.d.ts +11 -0
- package/cli/event-bus/events/role-change-event.js +15 -0
- package/cli/event-bus/events/role-change-event.js.map +1 -0
- package/cli/event-bus/events/role-event.d.ts +10 -0
- package/cli/event-bus/events/role-event.js +11 -0
- package/cli/event-bus/events/role-event.js.map +1 -0
- package/cli/event-bus/events/shipping-method-event.d.ts +10 -0
- package/cli/event-bus/events/shipping-method-event.js +11 -0
- package/cli/event-bus/events/shipping-method-event.js.map +1 -0
- package/cli/event-bus/events/stock-movement-event.d.ts +10 -0
- package/cli/event-bus/events/stock-movement-event.js +15 -0
- package/cli/event-bus/events/stock-movement-event.js.map +1 -0
- package/cli/event-bus/events/tax-category-event.d.ts +10 -0
- package/cli/event-bus/events/tax-category-event.js +11 -0
- package/cli/event-bus/events/tax-category-event.js.map +1 -0
- package/cli/event-bus/events/tax-rate-event.d.ts +10 -0
- package/cli/event-bus/events/tax-rate-event.js +11 -0
- package/cli/event-bus/events/tax-rate-event.js.map +1 -0
- package/cli/event-bus/events/tax-rate-modification-event.d.ts +8 -0
- package/cli/event-bus/events/tax-rate-modification-event.js +13 -0
- package/cli/event-bus/events/tax-rate-modification-event.js.map +1 -0
- package/cli/event-bus/events/zone-event.d.ts +10 -0
- package/cli/event-bus/events/zone-event.js +11 -0
- package/cli/event-bus/events/zone-event.js.map +1 -0
- package/cli/event-bus/events/zone-members-event.d.ts +11 -0
- package/cli/event-bus/events/zone-members-event.js +15 -0
- package/cli/event-bus/events/zone-members-event.js.map +1 -0
- package/cli/event-bus/index.d.ts +55 -0
- package/cli/event-bus/index.js +68 -0
- package/cli/event-bus/index.js.map +1 -0
- package/cli/event-bus/vendure-entity-event.d.ts +9 -0
- package/cli/event-bus/vendure-entity-event.js +15 -0
- package/cli/event-bus/vendure-entity-event.js.map +1 -0
- package/cli/event-bus/vendure-event.d.ts +4 -0
- package/cli/event-bus/vendure-event.js +10 -0
- package/cli/event-bus/vendure-event.js.map +1 -0
- package/cli/health-check/constants.d.ts +1 -0
- package/cli/health-check/constants.js +5 -0
- package/cli/health-check/constants.js.map +1 -0
- package/cli/i18n/i18n-error.d.ts +13 -0
- package/cli/i18n/i18n-error.js +16 -0
- package/cli/i18n/i18n-error.js.map +1 -0
- package/cli/job-queue/constants.d.ts +1 -0
- package/cli/job-queue/constants.js +5 -0
- package/cli/job-queue/constants.js.map +1 -0
- package/cli/job-queue/in-memory-job-queue-strategy.d.ts +34 -0
- package/cli/job-queue/in-memory-job-queue-strategy.js +187 -0
- package/cli/job-queue/in-memory-job-queue-strategy.js.map +1 -0
- package/cli/job-queue/index.d.ts +11 -0
- package/cli/job-queue/index.js +24 -0
- package/cli/job-queue/index.js.map +1 -0
- package/cli/job-queue/injectable-job-queue-strategy.d.ts +12 -0
- package/cli/job-queue/injectable-job-queue-strategy.js +21 -0
- package/cli/job-queue/injectable-job-queue-strategy.js.map +1 -0
- package/cli/job-queue/job-buffer/in-memory-job-buffer-storage-strategy.d.ts +13 -0
- package/cli/job-queue/job-buffer/in-memory-job-buffer-storage-strategy.js +47 -0
- package/cli/job-queue/job-buffer/in-memory-job-buffer-storage-strategy.js.map +1 -0
- package/cli/job-queue/job-buffer/job-buffer-storage-strategy.d.ts +11 -0
- package/cli/job-queue/job-buffer/job-buffer-storage-strategy.js +3 -0
- package/cli/job-queue/job-buffer/job-buffer-storage-strategy.js.map +1 -0
- package/cli/job-queue/job-buffer/job-buffer.d.ts +7 -0
- package/cli/job-queue/job-buffer/job-buffer.js +3 -0
- package/cli/job-queue/job-buffer/job-buffer.js.map +1 -0
- package/cli/job-queue/job-buffer/job-buffer.service.d.ts +16 -0
- package/cli/job-queue/job-buffer/job-buffer.service.js +76 -0
- package/cli/job-queue/job-buffer/job-buffer.service.js.map +1 -0
- package/cli/job-queue/job-queue.d.ts +16 -0
- package/cli/job-queue/job-queue.js +59 -0
- package/cli/job-queue/job-queue.js.map +1 -0
- package/cli/job-queue/job-queue.service.d.ts +27 -0
- package/cli/job-queue/job-queue.service.js +84 -0
- package/cli/job-queue/job-queue.service.js.map +1 -0
- package/cli/job-queue/job.d.ts +41 -0
- package/cli/job-queue/job.js +160 -0
- package/cli/job-queue/job.js.map +1 -0
- package/cli/job-queue/polling-job-queue-strategy.d.ts +26 -0
- package/cli/job-queue/polling-job-queue-strategy.js +163 -0
- package/cli/job-queue/polling-job-queue-strategy.js.map +1 -0
- package/cli/job-queue/queue-name-process-storage.d.ts +7 -0
- package/cli/job-queue/queue-name-process-storage.js +40 -0
- package/cli/job-queue/queue-name-process-storage.js.map +1 -0
- package/cli/job-queue/subscribable-job.d.ts +13 -0
- package/cli/job-queue/subscribable-job.js +52 -0
- package/cli/job-queue/subscribable-job.js.map +1 -0
- package/cli/job-queue/types.d.ts +22 -0
- package/cli/job-queue/types.js +3 -0
- package/cli/job-queue/types.js.map +1 -0
- package/cli/populate.d.ts +4 -4
- package/cli/populate.js +38 -25
- package/cli/populate.js.map +1 -1
- package/cli/process-context/process-context.d.ts +7 -0
- package/cli/process-context/process-context.js +18 -0
- package/cli/process-context/process-context.js.map +1 -0
- package/cli/service/helpers/config-arg/config-arg.service.d.ts +31 -0
- package/cli/service/helpers/config-arg/config-arg.service.js +88 -0
- package/cli/service/helpers/config-arg/config-arg.service.js.map +1 -0
- package/cli/service/helpers/custom-field-relation/custom-field-relation.service.d.ts +18 -0
- package/cli/service/helpers/custom-field-relation/custom-field-relation.service.js +63 -0
- package/cli/service/helpers/custom-field-relation/custom-field-relation.service.js.map +1 -0
- package/cli/service/helpers/fulfillment-state-machine/fulfillment-state-machine.d.ts +21 -0
- package/cli/service/helpers/fulfillment-state-machine/fulfillment-state-machine.js +113 -0
- package/cli/service/helpers/fulfillment-state-machine/fulfillment-state-machine.js.map +1 -0
- package/cli/service/helpers/fulfillment-state-machine/fulfillment-state.d.ts +11 -0
- package/cli/service/helpers/fulfillment-state-machine/fulfillment-state.js +21 -0
- package/cli/service/helpers/fulfillment-state-machine/fulfillment-state.js.map +1 -0
- package/cli/service/helpers/list-query-builder/connection-utils.d.ts +10 -0
- package/cli/service/helpers/list-query-builder/connection-utils.js +26 -0
- package/cli/service/helpers/list-query-builder/connection-utils.js.map +1 -0
- package/cli/service/helpers/list-query-builder/get-calculated-columns.d.ts +3 -0
- package/cli/service/helpers/list-query-builder/get-calculated-columns.js +16 -0
- package/cli/service/helpers/list-query-builder/get-calculated-columns.js.map +1 -0
- package/cli/service/helpers/list-query-builder/list-query-builder.d.ts +30 -0
- package/cli/service/helpers/list-query-builder/list-query-builder.js +204 -0
- package/cli/service/helpers/list-query-builder/list-query-builder.js.map +1 -0
- package/cli/service/helpers/list-query-builder/parse-channel-param.d.ts +5 -0
- package/cli/service/helpers/list-query-builder/parse-channel-param.js +18 -0
- package/cli/service/helpers/list-query-builder/parse-channel-param.js.map +1 -0
- package/cli/service/helpers/list-query-builder/parse-filter-params.d.ts +13 -0
- package/cli/service/helpers/list-query-builder/parse-filter-params.js +155 -0
- package/cli/service/helpers/list-query-builder/parse-filter-params.js.map +1 -0
- package/cli/service/helpers/list-query-builder/parse-sort-params.d.ts +7 -0
- package/cli/service/helpers/list-query-builder/parse-sort-params.js +50 -0
- package/cli/service/helpers/list-query-builder/parse-sort-params.js.map +1 -0
- package/cli/service/helpers/order-calculator/order-calculator.d.ts +32 -0
- package/cli/service/helpers/order-calculator/order-calculator.js +311 -0
- package/cli/service/helpers/order-calculator/order-calculator.js.map +1 -0
- package/cli/service/helpers/order-calculator/prorate.d.ts +1 -0
- package/cli/service/helpers/order-calculator/prorate.js +35 -0
- package/cli/service/helpers/order-calculator/prorate.js.map +1 -0
- package/cli/service/helpers/order-merger/order-merger.d.ts +40 -0
- package/cli/service/helpers/order-merger/order-merger.js +97 -0
- package/cli/service/helpers/order-merger/order-merger.js.map +1 -0
- package/cli/service/helpers/order-modifier/order-modifier.d.ts +45 -0
- package/cli/service/helpers/order-modifier/order-modifier.js +423 -0
- package/cli/service/helpers/order-modifier/order-modifier.js.map +1 -0
- package/cli/service/helpers/order-state-machine/order-state-machine.d.ts +29 -0
- package/cli/service/helpers/order-state-machine/order-state-machine.js +240 -0
- package/cli/service/helpers/order-state-machine/order-state-machine.js.map +1 -0
- package/cli/service/helpers/order-state-machine/order-state.d.ts +9 -0
- package/cli/service/helpers/order-state-machine/order-state.js +64 -0
- package/cli/service/helpers/order-state-machine/order-state.js.map +1 -0
- package/cli/service/helpers/password-cipher/password-cipher.d.ts +7 -0
- package/cli/service/helpers/password-cipher/password-cipher.js +31 -0
- package/cli/service/helpers/password-cipher/password-cipher.js.map +1 -0
- package/cli/service/helpers/payment-state-machine/payment-state-machine.d.ts +20 -0
- package/cli/service/helpers/payment-state-machine/payment-state-machine.js +113 -0
- package/cli/service/helpers/payment-state-machine/payment-state-machine.js.map +1 -0
- package/cli/service/helpers/payment-state-machine/payment-state.d.ts +11 -0
- package/cli/service/helpers/payment-state-machine/payment-state.js +24 -0
- package/cli/service/helpers/payment-state-machine/payment-state.js.map +1 -0
- package/cli/service/helpers/product-price-applicator/product-price-applicator.d.ts +15 -0
- package/cli/service/helpers/product-price-applicator/product-price-applicator.js +64 -0
- package/cli/service/helpers/product-price-applicator/product-price-applicator.js.map +1 -0
- package/cli/service/helpers/refund-state-machine/refund-state-machine.d.ts +14 -0
- package/cli/service/helpers/refund-state-machine/refund-state-machine.js +65 -0
- package/cli/service/helpers/refund-state-machine/refund-state-machine.js.map +1 -0
- package/cli/service/helpers/refund-state-machine/refund-state.d.ts +11 -0
- package/cli/service/helpers/refund-state-machine/refund-state.js +15 -0
- package/cli/service/helpers/refund-state-machine/refund-state.js.map +1 -0
- package/cli/service/helpers/request-context/request-context.service.d.ts +29 -0
- package/{dist/api/common → cli/service/helpers/request-context}/request-context.service.js +50 -18
- package/cli/service/helpers/request-context/request-context.service.js.map +1 -0
- package/cli/service/helpers/shipping-calculator/shipping-calculator.d.ts +18 -0
- package/cli/service/helpers/shipping-calculator/shipping-calculator.js +50 -0
- package/cli/service/helpers/shipping-calculator/shipping-calculator.js.map +1 -0
- package/cli/service/helpers/translatable-saver/translatable-saver.d.ts +24 -0
- package/cli/service/helpers/translatable-saver/translatable-saver.js +64 -0
- package/cli/service/helpers/translatable-saver/translatable-saver.js.map +1 -0
- package/cli/service/helpers/translatable-saver/translation-differ.d.ts +17 -0
- package/cli/service/helpers/translatable-saver/translation-differ.js +65 -0
- package/cli/service/helpers/translatable-saver/translation-differ.js.map +1 -0
- package/cli/service/helpers/utils/address-to-line.d.ts +3 -0
- package/cli/service/helpers/utils/address-to-line.js +21 -0
- package/cli/service/helpers/utils/address-to-line.js.map +1 -0
- package/cli/service/helpers/utils/get-user-channels-permissions.d.ts +10 -0
- package/cli/service/helpers/utils/get-user-channels-permissions.js +26 -0
- package/cli/service/helpers/utils/get-user-channels-permissions.js.map +1 -0
- package/cli/service/helpers/utils/order-utils.d.ts +9 -0
- package/cli/service/helpers/utils/order-utils.js +64 -0
- package/cli/service/helpers/utils/order-utils.js.map +1 -0
- package/cli/service/helpers/utils/patch-entity.d.ts +5 -0
- package/cli/service/helpers/utils/patch-entity.js +17 -0
- package/cli/service/helpers/utils/patch-entity.js.map +1 -0
- package/cli/service/helpers/utils/samples-each.d.ts +1 -0
- package/cli/service/helpers/utils/samples-each.js +18 -0
- package/cli/service/helpers/utils/samples-each.js.map +1 -0
- package/cli/service/helpers/utils/translate-entity.d.ts +24 -0
- package/cli/service/helpers/utils/translate-entity.js +99 -0
- package/cli/service/helpers/utils/translate-entity.js.map +1 -0
- package/cli/service/helpers/verification-token-generator/verification-token-generator.d.ts +7 -0
- package/cli/service/helpers/verification-token-generator/verification-token-generator.js +44 -0
- package/cli/service/helpers/verification-token-generator/verification-token-generator.js.map +1 -0
- package/cli/service/services/administrator.service.d.ts +36 -0
- package/cli/service/services/administrator.service.js +230 -0
- package/cli/service/services/administrator.service.js.map +1 -0
- package/cli/service/services/asset.service.d.ts +63 -0
- package/cli/service/services/asset.service.js +478 -0
- package/cli/service/services/asset.service.js.map +1 -0
- package/cli/service/services/channel.service.d.ts +38 -0
- package/cli/service/services/channel.service.js +222 -0
- package/cli/service/services/channel.service.js.map +1 -0
- package/cli/service/services/country.service.d.ts +24 -0
- package/cli/service/services/country.service.js +119 -0
- package/cli/service/services/country.service.js.map +1 -0
- package/cli/service/services/customer.service.d.ts +62 -0
- package/cli/service/services/customer.service.js +662 -0
- package/cli/service/services/customer.service.js.map +1 -0
- package/cli/service/services/facet-value.service.d.ts +32 -0
- package/cli/service/services/facet-value.service.js +151 -0
- package/cli/service/services/facet-value.service.js.map +1 -0
- package/cli/service/services/fulfillment.service.d.ts +32 -0
- package/cli/service/services/fulfillment.service.js +106 -0
- package/cli/service/services/fulfillment.service.js.map +1 -0
- package/cli/service/services/global-settings.service.d.ts +17 -0
- package/cli/service/services/global-settings.service.js +74 -0
- package/cli/service/services/global-settings.service.js.map +1 -0
- package/cli/service/services/history.service.d.ts +139 -0
- package/cli/service/services/history.service.js +143 -0
- package/cli/service/services/history.service.js.map +1 -0
- package/cli/service/services/order.service.d.ts +136 -0
- package/cli/service/services/order.service.js +1158 -0
- package/cli/service/services/order.service.js.map +1 -0
- package/cli/service/services/payment-method.service.d.ts +37 -0
- package/cli/service/services/payment-method.service.js +178 -0
- package/cli/service/services/payment-method.service.js.map +1 -0
- package/cli/service/services/payment.service.d.ts +32 -0
- package/cli/service/services/payment.service.js +216 -0
- package/cli/service/services/payment.service.js.map +1 -0
- package/cli/service/services/product-variant.service.d.ts +70 -0
- package/cli/service/services/product-variant.service.js +560 -0
- package/cli/service/services/product-variant.service.js.map +1 -0
- package/cli/service/services/promotion.service.d.ts +41 -0
- package/cli/service/services/promotion.service.js +219 -0
- package/cli/service/services/promotion.service.js.map +1 -0
- package/cli/service/services/role.service.d.ts +39 -0
- package/cli/service/services/role.service.js +240 -0
- package/cli/service/services/role.service.js.map +1 -0
- package/cli/service/services/session.service.d.ts +38 -0
- package/cli/service/services/session.service.js +228 -0
- package/cli/service/services/session.service.js.map +1 -0
- package/cli/service/services/shipping-method.service.d.ts +36 -0
- package/cli/service/services/shipping-method.service.js +181 -0
- package/cli/service/services/shipping-method.service.js.map +1 -0
- package/cli/service/services/stock-movement.service.d.ts +39 -0
- package/cli/service/services/stock-movement.service.js +214 -0
- package/cli/service/services/stock-movement.service.js.map +1 -0
- package/cli/service/services/tag.service.d.ts +21 -0
- package/cli/service/services/tag.service.js +82 -0
- package/cli/service/services/tag.service.js.map +1 -0
- package/cli/service/services/tax-category.service.d.ts +16 -0
- package/cli/service/services/tax-category.service.js +95 -0
- package/cli/service/services/tax-category.service.js.map +1 -0
- package/cli/service/services/tax-rate.service.d.ts +28 -0
- package/cli/service/services/tax-rate.service.js +134 -0
- package/cli/service/services/tax-rate.service.js.map +1 -0
- package/cli/service/services/user.service.d.ts +37 -0
- package/cli/service/services/user.service.js +287 -0
- package/cli/service/services/user.service.js.map +1 -0
- package/cli/service/services/zone.service.d.ts +26 -0
- package/cli/service/services/zone.service.js +168 -0
- package/cli/service/services/zone.service.js.map +1 -0
- package/dist/api/api.module.js +0 -2
- package/dist/api/api.module.js.map +1 -1
- package/dist/api/common/parse-context.js +19 -16
- package/dist/api/common/parse-context.js.map +1 -1
- package/dist/api/common/request-context.d.ts +3 -1
- package/dist/api/common/request-context.js +3 -1
- package/dist/api/common/request-context.js.map +1 -1
- package/dist/api/config/configure-graphql-module.js +2 -0
- package/dist/api/config/configure-graphql-module.js.map +1 -1
- package/dist/api/config/generate-permissions.js +25 -0
- package/dist/api/config/generate-permissions.js.map +1 -1
- package/dist/api/config/generate-resolvers.js +4 -0
- package/dist/api/config/generate-resolvers.js.map +1 -1
- package/dist/api/config/graphql-custom-fields.js +148 -137
- package/dist/api/config/graphql-custom-fields.js.map +1 -1
- package/dist/api/middleware/auth-guard.d.ts +1 -1
- package/dist/api/middleware/auth-guard.js +1 -1
- package/dist/api/middleware/auth-guard.js.map +1 -1
- package/dist/api/resolvers/admin/channel.resolver.js +3 -3
- package/dist/api/resolvers/admin/channel.resolver.js.map +1 -1
- package/dist/api/resolvers/admin/global-settings.resolver.js +1 -1
- package/dist/api/resolvers/admin/global-settings.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/order-line-entity.resolver.d.ts +5 -3
- package/dist/api/resolvers/entity/order-line-entity.resolver.js +16 -2
- package/dist/api/resolvers/entity/order-line-entity.resolver.js.map +1 -1
- package/dist/api/resolvers/entity/product-entity.resolver.d.ts +1 -1
- package/dist/api/resolvers/entity/product-entity.resolver.js +12 -3
- package/dist/api/resolvers/entity/product-entity.resolver.js.map +1 -1
- package/dist/api/schema/admin-api/customer.api.graphql +4 -0
- package/dist/api/schema/admin-api/order.api.graphql +6 -0
- package/dist/api/schema/admin-api/product.api.graphql +1 -1
- package/dist/api/schema/common/common-enums.graphql +1 -0
- package/dist/api/schema/common/common-error-results.graphql +26 -4
- package/dist/api/schema/common/common-types.graphql +25 -0
- package/dist/api/schema/common/product-search.type.graphql +1 -1
- package/dist/api/schema/shop-api/shop-error-results.graphql +13 -35
- package/dist/api/schema/shop-api/shop.api.graphql +7 -5
- package/dist/bootstrap.js +6 -3
- package/dist/bootstrap.js.map +1 -1
- package/dist/common/error/generated-graphql-admin-errors.d.ts +22 -0
- package/dist/common/error/generated-graphql-admin-errors.js +33 -2
- package/dist/common/error/generated-graphql-admin-errors.js.map +1 -1
- package/dist/common/error/generated-graphql-shop-errors.d.ts +7 -0
- package/dist/common/error/generated-graphql-shop-errors.js +12 -2
- package/dist/common/error/generated-graphql-shop-errors.js.map +1 -1
- package/dist/common/finite-state-machine/finite-state-machine.js +2 -1
- package/dist/common/finite-state-machine/finite-state-machine.js.map +1 -1
- package/dist/common/types/common-types.d.ts +3 -0
- package/dist/common/types/entity-relation-paths.d.ts +1 -1
- package/dist/config/asset-storage-strategy/asset-storage-strategy.d.ts +2 -2
- package/dist/config/auth/default-password-validation-strategy.d.ts +23 -0
- package/dist/config/auth/default-password-validation-strategy.js +37 -0
- package/dist/config/auth/default-password-validation-strategy.js.map +1 -0
- package/dist/config/auth/password-validation-strategy.d.ts +22 -0
- package/dist/config/auth/password-validation-strategy.js +3 -0
- package/dist/config/auth/password-validation-strategy.js.map +1 -0
- package/dist/config/catalog/default-product-variant-price-calculation-strategy.js +0 -1
- package/dist/config/catalog/default-product-variant-price-calculation-strategy.js.map +1 -1
- package/dist/config/config.module.js +2 -1
- package/dist/config/config.module.js.map +1 -1
- package/dist/config/default-config.js +4 -0
- package/dist/config/default-config.js.map +1 -1
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.js +5 -0
- package/dist/config/index.js.map +1 -1
- package/dist/config/order/order-item-price-calculation-strategy.d.ts +9 -4
- package/dist/config/promotion/index.d.ts +4 -0
- package/dist/config/promotion/index.js +4 -0
- package/dist/config/promotion/index.js.map +1 -1
- package/dist/config/vendure-config.d.ts +53 -0
- package/dist/connection/connection.module.d.ts +1 -1
- package/dist/data-import/data-import.module.js +1 -1
- package/dist/data-import/data-import.module.js.map +1 -1
- package/dist/data-import/index.d.ts +3 -0
- package/dist/data-import/index.js +3 -0
- package/dist/data-import/index.js.map +1 -1
- package/dist/data-import/providers/asset-importer/asset-importer.d.ts +12 -1
- package/dist/data-import/providers/asset-importer/asset-importer.js +12 -2
- package/dist/data-import/providers/asset-importer/asset-importer.js.map +1 -1
- package/dist/data-import/providers/import-parser/import-parser.d.ts +59 -0
- package/dist/data-import/providers/import-parser/import-parser.js +12 -0
- package/dist/data-import/providers/import-parser/import-parser.js.map +1 -1
- package/dist/data-import/providers/importer/fast-importer.service.d.ts +21 -3
- package/dist/data-import/providers/importer/fast-importer.service.js +53 -17
- package/dist/data-import/providers/importer/fast-importer.service.js.map +1 -1
- package/dist/data-import/providers/importer/importer.d.ts +18 -0
- package/dist/data-import/providers/importer/importer.js +35 -19
- package/dist/data-import/providers/importer/importer.js.map +1 -1
- package/dist/data-import/providers/populator/populator.d.ts +13 -4
- package/dist/data-import/providers/populator/populator.js +32 -20
- package/dist/data-import/providers/populator/populator.js.map +1 -1
- package/dist/entity/order-line/order-line.entity.d.ts +6 -0
- package/dist/entity/order-line/order-line.entity.js +9 -1
- package/dist/entity/order-line/order-line.entity.js.map +1 -1
- package/dist/event-bus/events/order-event.d.ts +17 -0
- package/dist/event-bus/events/order-event.js +22 -0
- package/dist/event-bus/events/order-event.js.map +1 -0
- package/dist/event-bus/events/order-line-event.d.ts +18 -0
- package/dist/event-bus/events/order-line-event.js +23 -0
- package/dist/event-bus/events/order-line-event.js.map +1 -0
- package/dist/event-bus/index.d.ts +2 -0
- package/dist/event-bus/index.js +2 -0
- package/dist/event-bus/index.js.map +1 -1
- package/dist/i18n/messages/en.json +1 -0
- package/dist/job-queue/job-queue.service.js +3 -0
- package/dist/job-queue/job-queue.service.js.map +1 -1
- package/dist/job-queue/subscribable-job.js +1 -1
- package/dist/job-queue/subscribable-job.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-job-buffer/collection-job-buffer.js.map +1 -1
- package/dist/plugin/default-search-plugin/search-job-buffer/search-index-job-buffer.js +4 -3
- package/dist/plugin/default-search-plugin/search-job-buffer/search-index-job-buffer.js.map +1 -1
- package/dist/plugin/plugin-common.module.js +3 -0
- package/dist/plugin/plugin-common.module.js.map +1 -1
- package/dist/service/helpers/entity-hydrator/entity-hydrator.service.js.map +1 -1
- package/dist/service/helpers/list-query-builder/list-query-builder.d.ts +19 -2
- package/dist/service/helpers/list-query-builder/list-query-builder.js +1 -1
- package/dist/service/helpers/list-query-builder/list-query-builder.js.map +1 -1
- package/dist/service/helpers/list-query-builder/parse-filter-params.js +4 -1
- package/dist/service/helpers/list-query-builder/parse-filter-params.js.map +1 -1
- package/dist/service/helpers/order-calculator/order-calculator.d.ts +11 -1
- package/dist/service/helpers/order-calculator/order-calculator.js +10 -0
- package/dist/service/helpers/order-calculator/order-calculator.js.map +1 -1
- package/dist/service/helpers/order-calculator/prorate.js +1 -1
- package/dist/service/helpers/order-calculator/prorate.js.map +1 -1
- package/dist/service/helpers/order-modifier/order-modifier.d.ts +10 -1
- package/dist/service/helpers/order-modifier/order-modifier.js +86 -3
- package/dist/service/helpers/order-modifier/order-modifier.js.map +1 -1
- package/dist/service/helpers/request-context/request-context.service.d.ts +57 -0
- package/dist/service/helpers/request-context/request-context.service.js +155 -0
- package/dist/service/helpers/request-context/request-context.service.js.map +1 -0
- package/dist/service/helpers/utils/order-utils.js +1 -1
- package/dist/service/helpers/utils/order-utils.js.map +1 -1
- package/dist/service/index.d.ts +3 -0
- package/dist/service/index.js +3 -0
- package/dist/service/index.js.map +1 -1
- package/dist/service/service.module.js +2 -0
- package/dist/service/service.module.js.map +1 -1
- package/dist/service/services/asset.service.d.ts +1 -1
- package/dist/service/services/asset.service.js +5 -3
- package/dist/service/services/asset.service.js.map +1 -1
- package/dist/service/services/customer-group.service.d.ts +3 -1
- package/dist/service/services/customer-group.service.js +8 -3
- package/dist/service/services/customer-group.service.js.map +1 -1
- package/dist/service/services/customer.service.d.ts +3 -3
- package/dist/service/services/customer.service.js +32 -4
- package/dist/service/services/customer.service.js.map +1 -1
- package/dist/service/services/history.service.d.ts +1 -0
- package/dist/service/services/history.service.js.map +1 -1
- package/dist/service/services/order.service.d.ts +15 -0
- package/dist/service/services/order.service.js +84 -15
- package/dist/service/services/order.service.js.map +1 -1
- package/dist/service/services/product-variant.service.d.ts +1 -0
- package/dist/service/services/product-variant.service.js +16 -2
- package/dist/service/services/product-variant.service.js.map +1 -1
- package/dist/service/services/promotion.service.js +2 -1
- package/dist/service/services/promotion.service.js.map +1 -1
- package/dist/service/services/session.service.js +1 -2
- package/dist/service/services/session.service.js.map +1 -1
- package/dist/service/services/user.service.d.ts +5 -4
- package/dist/service/services/user.service.js +30 -3
- package/dist/service/services/user.service.js.map +1 -1
- package/package.json +3 -3
- package/dist/api/common/request-context.service.d.ts +0 -30
- package/dist/api/common/request-context.service.js.map +0 -1
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ProductPriceApplicator = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const request_context_cache_service_1 = require("../../../cache/request-context-cache.service");
|
|
15
|
+
const errors_1 = require("../../../common/error/errors");
|
|
16
|
+
const utils_1 = require("../../../common/utils");
|
|
17
|
+
const config_service_1 = require("../../../config/config.service");
|
|
18
|
+
const tax_rate_service_1 = require("../../services/tax-rate.service");
|
|
19
|
+
const zone_service_1 = require("../../services/zone.service");
|
|
20
|
+
let ProductPriceApplicator = class ProductPriceApplicator {
|
|
21
|
+
constructor(configService, taxRateService, zoneService, requestCache) {
|
|
22
|
+
this.configService = configService;
|
|
23
|
+
this.taxRateService = taxRateService;
|
|
24
|
+
this.zoneService = zoneService;
|
|
25
|
+
this.requestCache = requestCache;
|
|
26
|
+
}
|
|
27
|
+
async applyChannelPriceAndTax(variant, ctx, order) {
|
|
28
|
+
const channelPrice = variant.productVariantPrices.find(p => utils_1.idsAreEqual(p.channelId, ctx.channelId));
|
|
29
|
+
if (!channelPrice) {
|
|
30
|
+
throw new errors_1.InternalServerError(`error.no-price-found-for-channel`, {
|
|
31
|
+
variantId: variant.id,
|
|
32
|
+
channel: ctx.channel.code,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const { taxZoneStrategy } = this.configService.taxOptions;
|
|
36
|
+
const zones = await this.requestCache.get(ctx, 'allZones', () => this.zoneService.findAll(ctx));
|
|
37
|
+
const activeTaxZone = await this.requestCache.get(ctx, `activeTaxZone`, () => taxZoneStrategy.determineTaxZone(ctx, zones, ctx.channel, order));
|
|
38
|
+
if (!activeTaxZone) {
|
|
39
|
+
throw new errors_1.InternalServerError(`error.no-active-tax-zone`);
|
|
40
|
+
}
|
|
41
|
+
const applicableTaxRate = await this.requestCache.get(ctx, `applicableTaxRate-${activeTaxZone.id}-${variant.taxCategory.id}`, () => this.taxRateService.getApplicableTaxRate(ctx, activeTaxZone, variant.taxCategory));
|
|
42
|
+
const { productVariantPriceCalculationStrategy } = this.configService.catalogOptions;
|
|
43
|
+
const { price, priceIncludesTax } = await productVariantPriceCalculationStrategy.calculate({
|
|
44
|
+
inputPrice: channelPrice.price,
|
|
45
|
+
taxCategory: variant.taxCategory,
|
|
46
|
+
activeTaxZone,
|
|
47
|
+
ctx,
|
|
48
|
+
});
|
|
49
|
+
variant.listPrice = price;
|
|
50
|
+
variant.listPriceIncludesTax = priceIncludesTax;
|
|
51
|
+
variant.taxRateApplied = applicableTaxRate;
|
|
52
|
+
variant.currencyCode = ctx.channel.currencyCode;
|
|
53
|
+
return variant;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
ProductPriceApplicator = __decorate([
|
|
57
|
+
common_1.Injectable(),
|
|
58
|
+
__metadata("design:paramtypes", [config_service_1.ConfigService,
|
|
59
|
+
tax_rate_service_1.TaxRateService,
|
|
60
|
+
zone_service_1.ZoneService,
|
|
61
|
+
request_context_cache_service_1.RequestContextCacheService])
|
|
62
|
+
], ProductPriceApplicator);
|
|
63
|
+
exports.ProductPriceApplicator = ProductPriceApplicator;
|
|
64
|
+
//# sourceMappingURL=product-price-applicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"product-price-applicator.js","sourceRoot":"","sources":["../../../../src/service/helpers/product-price-applicator/product-price-applicator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAG5C,gGAA0F;AAC1F,yDAAmE;AACnE,iDAAoD;AACpD,mEAA+D;AAG/D,sEAAiE;AACjE,8DAA0D;AAQ1D,IAAa,sBAAsB,GAAnC,MAAa,sBAAsB;IAC/B,YACY,aAA4B,EAC5B,cAA8B,EAC9B,WAAwB,EACxB,YAAwC;QAHxC,kBAAa,GAAb,aAAa,CAAe;QAC5B,mBAAc,GAAd,cAAc,CAAgB;QAC9B,gBAAW,GAAX,WAAW,CAAa;QACxB,iBAAY,GAAZ,YAAY,CAA4B;IACjD,CAAC;IAMJ,KAAK,CAAC,uBAAuB,CACzB,OAAuB,EACvB,GAAmB,EACnB,KAAa;QAEb,MAAM,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,mBAAW,CAAC,CAAC,CAAC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;QACrG,IAAI,CAAC,YAAY,EAAE;YACf,MAAM,IAAI,4BAAmB,CAAC,kCAAkC,EAAE;gBAC9D,SAAS,EAAE,OAAO,CAAC,EAAE;gBACrB,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,IAAI;aAC5B,CAAC,CAAC;SACN;QACD,MAAM,EAAE,eAAe,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC;QAC1D,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;QAChG,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,CACzE,eAAe,CAAC,gBAAgB,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CACnE,CAAC;QACF,IAAI,CAAC,aAAa,EAAE;YAChB,MAAM,IAAI,4BAAmB,CAAC,0BAA0B,CAAC,CAAC;SAC7D;QACD,MAAM,iBAAiB,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,CACjD,GAAG,EACH,qBAAqB,aAAa,CAAC,EAAE,IAAI,OAAO,CAAC,WAAW,CAAC,EAAE,EAAE,EACjE,GAAG,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,oBAAoB,CAAC,GAAG,EAAE,aAAa,EAAE,OAAO,CAAC,WAAW,CAAC,CAC1F,CAAC;QAEF,MAAM,EAAE,sCAAsC,EAAE,GAAG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC;QACrF,MAAM,EAAE,KAAK,EAAE,gBAAgB,EAAE,GAAG,MAAM,sCAAsC,CAAC,SAAS,CAAC;YACvF,UAAU,EAAE,YAAY,CAAC,KAAK;YAC9B,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,aAAa;YACb,GAAG;SACN,CAAC,CAAC;QAEH,OAAO,CAAC,SAAS,GAAG,KAAK,CAAC;QAC1B,OAAO,CAAC,oBAAoB,GAAG,gBAAgB,CAAC;QAChD,OAAO,CAAC,cAAc,GAAG,iBAAiB,CAAC;QAC3C,OAAO,CAAC,YAAY,GAAG,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC;QAChD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ,CAAA;AApDY,sBAAsB;IADlC,mBAAU,EAAE;qCAGkB,8BAAa;QACZ,iCAAc;QACjB,0BAAW;QACV,0DAA0B;GAL3C,sBAAsB,CAoDlC;AApDY,wDAAsB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RequestContext } from '../../../api/common/request-context';
|
|
2
|
+
import { ConfigService } from '../../../config/config.service';
|
|
3
|
+
import { Order } from '../../../entity/order/order.entity';
|
|
4
|
+
import { Refund } from '../../../entity/refund/refund.entity';
|
|
5
|
+
import { HistoryService } from '../../services/history.service';
|
|
6
|
+
import { RefundState } from './refund-state';
|
|
7
|
+
export declare class RefundStateMachine {
|
|
8
|
+
private configService;
|
|
9
|
+
private historyService;
|
|
10
|
+
private readonly config;
|
|
11
|
+
constructor(configService: ConfigService, historyService: HistoryService);
|
|
12
|
+
getNextStates(refund: Refund): ReadonlyArray<RefundState>;
|
|
13
|
+
transition(ctx: RequestContext, order: Order, refund: Refund, state: RefundState): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RefundStateMachine = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const generated_types_1 = require("@vendure/common/lib/generated-types");
|
|
15
|
+
const errors_1 = require("../../../common/error/errors");
|
|
16
|
+
const finite_state_machine_1 = require("../../../common/finite-state-machine/finite-state-machine");
|
|
17
|
+
const config_service_1 = require("../../../config/config.service");
|
|
18
|
+
const history_service_1 = require("../../services/history.service");
|
|
19
|
+
const refund_state_1 = require("./refund-state");
|
|
20
|
+
let RefundStateMachine = class RefundStateMachine {
|
|
21
|
+
constructor(configService, historyService) {
|
|
22
|
+
this.configService = configService;
|
|
23
|
+
this.historyService = historyService;
|
|
24
|
+
this.config = {
|
|
25
|
+
transitions: refund_state_1.refundStateTransitions,
|
|
26
|
+
onTransitionStart: async (fromState, toState, data) => {
|
|
27
|
+
return true;
|
|
28
|
+
},
|
|
29
|
+
onTransitionEnd: async (fromState, toState, data) => {
|
|
30
|
+
await this.historyService.createHistoryEntryForOrder({
|
|
31
|
+
ctx: data.ctx,
|
|
32
|
+
orderId: data.order.id,
|
|
33
|
+
type: generated_types_1.HistoryEntryType.ORDER_REFUND_TRANSITION,
|
|
34
|
+
data: {
|
|
35
|
+
refundId: data.refund.id,
|
|
36
|
+
from: fromState,
|
|
37
|
+
to: toState,
|
|
38
|
+
reason: data.refund.reason,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
onError: (fromState, toState, message) => {
|
|
43
|
+
throw new errors_1.IllegalOperationError(message || 'error.cannot-transition-refund-from-to', {
|
|
44
|
+
fromState,
|
|
45
|
+
toState,
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
getNextStates(refund) {
|
|
51
|
+
const fsm = new finite_state_machine_1.FSM(this.config, refund.state);
|
|
52
|
+
return fsm.getNextStates();
|
|
53
|
+
}
|
|
54
|
+
async transition(ctx, order, refund, state) {
|
|
55
|
+
const fsm = new finite_state_machine_1.FSM(this.config, refund.state);
|
|
56
|
+
await fsm.transitionTo(state, { ctx, order, refund });
|
|
57
|
+
refund.state = state;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
RefundStateMachine = __decorate([
|
|
61
|
+
common_1.Injectable(),
|
|
62
|
+
__metadata("design:paramtypes", [config_service_1.ConfigService, history_service_1.HistoryService])
|
|
63
|
+
], RefundStateMachine);
|
|
64
|
+
exports.RefundStateMachine = RefundStateMachine;
|
|
65
|
+
//# sourceMappingURL=refund-state-machine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refund-state-machine.js","sourceRoot":"","sources":["../../../../src/service/helpers/refund-state-machine/refund-state-machine.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yEAAuE;AAGvE,yDAAqE;AACrE,oGAAgF;AAEhF,mEAA+D;AAG/D,oEAAgE;AAEhE,iDAA2F;AAG3F,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IA2B3B,YAAoB,aAA4B,EAAU,cAA8B;QAApE,kBAAa,GAAb,aAAa,CAAe;QAAU,mBAAc,GAAd,cAAc,CAAgB;QA1BvE,WAAM,GAA0D;YAC7E,WAAW,EAAE,qCAAsB;YACnC,iBAAiB,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;gBAClD,OAAO,IAAI,CAAC;YAChB,CAAC;YACD,eAAe,EAAE,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;gBAChD,MAAM,IAAI,CAAC,cAAc,CAAC,0BAA0B,CAAC;oBACjD,GAAG,EAAE,IAAI,CAAC,GAAG;oBACb,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE;oBACtB,IAAI,EAAE,kCAAgB,CAAC,uBAAuB;oBAC9C,IAAI,EAAE;wBACF,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE;wBACxB,IAAI,EAAE,SAAS;wBACf,EAAE,EAAE,OAAO;wBACX,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;qBAC7B;iBACJ,CAAC,CAAC;YACP,CAAC;YACD,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;gBACrC,MAAM,IAAI,8BAAqB,CAAC,OAAO,IAAI,wCAAwC,EAAE;oBACjF,SAAS;oBACT,OAAO;iBACV,CAAC,CAAC;YACP,CAAC;SACJ,CAAC;IAEyF,CAAC;IAE5F,aAAa,CAAC,MAAc;QACxB,MAAM,GAAG,GAAG,IAAI,0BAAG,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAC/C,OAAO,GAAG,CAAC,aAAa,EAAE,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,GAAmB,EAAE,KAAY,EAAE,MAAc,EAAE,KAAkB;QAClF,MAAM,GAAG,GAAG,IAAI,0BAAG,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;QAC/C,MAAM,GAAG,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;QACtD,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC;IACzB,CAAC;CACJ,CAAA;AAvCY,kBAAkB;IAD9B,mBAAU,EAAE;qCA4B0B,8BAAa,EAA0B,gCAAc;GA3B/E,kBAAkB,CAuC9B;AAvCY,gDAAkB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RequestContext } from '../../../api/common/request-context';
|
|
2
|
+
import { Transitions } from '../../../common/finite-state-machine/types';
|
|
3
|
+
import { Order } from '../../../entity/order/order.entity';
|
|
4
|
+
import { Refund } from '../../../entity/refund/refund.entity';
|
|
5
|
+
export declare type RefundState = 'Pending' | 'Settled' | 'Failed';
|
|
6
|
+
export declare const refundStateTransitions: Transitions<RefundState>;
|
|
7
|
+
export interface RefundTransitionData {
|
|
8
|
+
ctx: RequestContext;
|
|
9
|
+
order: Order;
|
|
10
|
+
refund: Refund;
|
|
11
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.refundStateTransitions = void 0;
|
|
4
|
+
exports.refundStateTransitions = {
|
|
5
|
+
Pending: {
|
|
6
|
+
to: ['Settled', 'Failed'],
|
|
7
|
+
},
|
|
8
|
+
Settled: {
|
|
9
|
+
to: [],
|
|
10
|
+
},
|
|
11
|
+
Failed: {
|
|
12
|
+
to: [],
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=refund-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refund-state.js","sourceRoot":"","sources":["../../../../src/service/helpers/refund-state-machine/refund-state.ts"],"names":[],"mappings":";;;AAca,QAAA,sBAAsB,GAA6B;IAC5D,OAAO,EAAE;QACL,EAAE,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC;KAC5B;IACD,OAAO,EAAE;QACL,EAAE,EAAE,EAAE;KACT;IACD,MAAM,EAAE;QACJ,EAAE,EAAE,EAAE;KACT;CACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { LanguageCode, Permission } from '@vendure/common/lib/generated-types';
|
|
2
|
+
import { ID } from '@vendure/common/lib/shared-types';
|
|
3
|
+
import { Request } from 'express';
|
|
4
|
+
import { GraphQLResolveInfo } from 'graphql';
|
|
5
|
+
import { ApiType } from '../../../api/common/get-api-type';
|
|
6
|
+
import { RequestContext } from '../../../api/common/request-context';
|
|
7
|
+
import { ConfigService } from '../../../config/config.service';
|
|
8
|
+
import { CachedSession } from '../../../config/session-cache/session-cache-strategy';
|
|
9
|
+
import { Channel } from '../../../entity/channel/channel.entity';
|
|
10
|
+
import { User } from '../../../entity/index';
|
|
11
|
+
import { ChannelService } from '../../services/channel.service';
|
|
12
|
+
export declare class RequestContextService {
|
|
13
|
+
private channelService;
|
|
14
|
+
private configService;
|
|
15
|
+
constructor(channelService: ChannelService, configService: ConfigService);
|
|
16
|
+
create(config: {
|
|
17
|
+
req?: Request;
|
|
18
|
+
apiType: ApiType;
|
|
19
|
+
channelOrToken?: Channel | string;
|
|
20
|
+
languageCode?: LanguageCode;
|
|
21
|
+
user?: User;
|
|
22
|
+
activeOrderId?: ID;
|
|
23
|
+
}): Promise<RequestContext>;
|
|
24
|
+
fromRequest(req: Request, info?: GraphQLResolveInfo, requiredPermissions?: Permission[], session?: CachedSession): Promise<RequestContext>;
|
|
25
|
+
private getChannelToken;
|
|
26
|
+
private getLanguageCode;
|
|
27
|
+
private userHasRequiredPermissionsOnChannel;
|
|
28
|
+
private arraysIntersect;
|
|
29
|
+
}
|
|
@@ -8,26 +8,65 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
15
|
exports.RequestContextService = void 0;
|
|
13
16
|
const common_1 = require("@nestjs/common");
|
|
14
17
|
const generated_types_1 = require("@vendure/common/lib/generated-types");
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
const ms_1 = __importDefault(require("ms"));
|
|
19
|
+
const get_api_type_1 = require("../../../api/common/get-api-type");
|
|
20
|
+
const request_context_1 = require("../../../api/common/request-context");
|
|
21
|
+
const utils_1 = require("../../../common/utils");
|
|
22
|
+
const config_service_1 = require("../../../config/config.service");
|
|
23
|
+
const channel_entity_1 = require("../../../entity/channel/channel.entity");
|
|
24
|
+
const channel_service_1 = require("../../services/channel.service");
|
|
25
|
+
const get_user_channels_permissions_1 = require("../utils/get-user-channels-permissions");
|
|
23
26
|
let RequestContextService = class RequestContextService {
|
|
24
27
|
constructor(channelService, configService) {
|
|
25
28
|
this.channelService = channelService;
|
|
26
29
|
this.configService = configService;
|
|
27
30
|
}
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
async create(config) {
|
|
32
|
+
const { req, apiType, channelOrToken, languageCode, user, activeOrderId } = config;
|
|
33
|
+
let channel;
|
|
34
|
+
if (channelOrToken instanceof channel_entity_1.Channel) {
|
|
35
|
+
channel = channelOrToken;
|
|
36
|
+
}
|
|
37
|
+
else if (typeof channelOrToken === 'string') {
|
|
38
|
+
channel = await this.channelService.getChannelFromToken(channelOrToken);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
channel = await this.channelService.getDefaultChannel();
|
|
42
|
+
}
|
|
43
|
+
let session;
|
|
44
|
+
if (user) {
|
|
45
|
+
const channelPermissions = user.roles ? get_user_channels_permissions_1.getUserChannelsPermissions(user) : [];
|
|
46
|
+
session = {
|
|
47
|
+
user: {
|
|
48
|
+
id: user.id,
|
|
49
|
+
identifier: user.identifier,
|
|
50
|
+
verified: user.verified,
|
|
51
|
+
channelPermissions,
|
|
52
|
+
},
|
|
53
|
+
id: '__dummy_session_id__',
|
|
54
|
+
token: '__dummy_session_token__',
|
|
55
|
+
expires: new Date(Date.now() + ms_1.default('1y')),
|
|
56
|
+
cacheExpiry: ms_1.default('1y'),
|
|
57
|
+
activeOrderId,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return new request_context_1.RequestContext({
|
|
61
|
+
req,
|
|
62
|
+
apiType,
|
|
63
|
+
channel,
|
|
64
|
+
languageCode,
|
|
65
|
+
session,
|
|
66
|
+
isAuthorized: true,
|
|
67
|
+
authorizedAsOwnerOnly: false,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
31
70
|
async fromRequest(req, info, requiredPermissions, session) {
|
|
32
71
|
const channelToken = this.getChannelToken(req);
|
|
33
72
|
const channel = await this.channelService.getChannelFromToken(channelToken);
|
|
@@ -64,10 +103,6 @@ let RequestContextService = class RequestContextService {
|
|
|
64
103
|
var _a, _b;
|
|
65
104
|
return ((_b = (_a = (req.query && req.query.languageCode)) !== null && _a !== void 0 ? _a : channel.defaultLanguageCode) !== null && _b !== void 0 ? _b : this.configService.defaultLanguageCode);
|
|
66
105
|
}
|
|
67
|
-
/**
|
|
68
|
-
* TODO: Deprecate and remove, since this function is now handled internally in the RequestContext.
|
|
69
|
-
* @private
|
|
70
|
-
*/
|
|
71
106
|
userHasRequiredPermissionsOnChannel(permissions = [], channel, user) {
|
|
72
107
|
if (!user || !channel) {
|
|
73
108
|
return false;
|
|
@@ -78,9 +113,6 @@ let RequestContextService = class RequestContextService {
|
|
|
78
113
|
}
|
|
79
114
|
return false;
|
|
80
115
|
}
|
|
81
|
-
/**
|
|
82
|
-
* Returns true if any element of arr1 appears in arr2.
|
|
83
|
-
*/
|
|
84
116
|
arraysIntersect(arr1, arr2) {
|
|
85
117
|
return arr1.reduce((intersects, role) => {
|
|
86
118
|
return intersects || arr2.includes(role);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-context.service.js","sourceRoot":"","sources":["../../../../src/service/helpers/request-context/request-context.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,yEAA+E;AAI/E,4CAAoB;AAEpB,mEAAuE;AACvE,yEAAqE;AACrE,iDAAoD;AACpD,mEAA+D;AAE/D,2EAAiE;AAEjE,oEAAgE;AAChE,0FAAoF;AASpF,IAAa,qBAAqB,GAAlC,MAAa,qBAAqB;IAE9B,YAAoB,cAA8B,EAAU,aAA4B;QAApE,mBAAc,GAAd,cAAc,CAAgB;QAAU,kBAAa,GAAb,aAAa,CAAe;IAAG,CAAC;IAU5F,KAAK,CAAC,MAAM,CAAC,MAOZ;QACG,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,MAAM,CAAC;QACnF,IAAI,OAAgB,CAAC;QACrB,IAAI,cAAc,YAAY,wBAAO,EAAE;YACnC,OAAO,GAAG,cAAc,CAAC;SAC5B;aAAM,IAAI,OAAO,cAAc,KAAK,QAAQ,EAAE;YAC3C,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;SAC3E;aAAM;YACH,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,iBAAiB,EAAE,CAAC;SAC3D;QACD,IAAI,OAAkC,CAAC;QACvC,IAAI,IAAI,EAAE;YACN,MAAM,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,0DAA0B,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC9E,OAAO,GAAG;gBACN,IAAI,EAAE;oBACF,EAAE,EAAE,IAAI,CAAC,EAAE;oBACX,UAAU,EAAE,IAAI,CAAC,UAAU;oBAC3B,QAAQ,EAAE,IAAI,CAAC,QAAQ;oBACvB,kBAAkB;iBACrB;gBACD,EAAE,EAAE,sBAAsB;gBAC1B,KAAK,EAAE,yBAAyB;gBAChC,OAAO,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,YAAE,CAAC,IAAI,CAAC,CAAC;gBACxC,WAAW,EAAE,YAAE,CAAC,IAAI,CAAC;gBACrB,aAAa;aAChB,CAAC;SACL;QACD,OAAO,IAAI,gCAAc,CAAC;YACtB,GAAG;YACH,OAAO;YACP,OAAO;YACP,YAAY;YACZ,OAAO;YACP,YAAY,EAAE,IAAI;YAClB,qBAAqB,EAAE,KAAK;SAC/B,CAAC,CAAC;IACP,CAAC;IAQD,KAAK,CAAC,WAAW,CACb,GAAY,EACZ,IAAyB,EACzB,mBAAkC,EAClC,OAAuB;QAEvB,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;QAC/C,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,YAAY,CAAC,CAAC;QAC5E,MAAM,OAAO,GAAG,yBAAU,CAAC,IAAI,CAAC,CAAC;QAEjC,MAAM,kBAAkB,GAAG,CAAC,CAAC,mBAAmB,IAAI,mBAAmB,CAAC,QAAQ,CAAC,4BAAU,CAAC,KAAK,CAAC,CAAC;QACnG,MAAM,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QACxD,MAAM,IAAI,GAAG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;QACrC,MAAM,YAAY,GAAG,IAAI,CAAC,mCAAmC,CAAC,mBAAmB,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QAClG,MAAM,qBAAqB,GAAG,CAAC,YAAY,IAAI,kBAAkB,CAAC;QAClE,MAAM,aAAa,GAAI,GAAW,CAAC,CAAC,CAAC;QACrC,OAAO,IAAI,gCAAc,CAAC;YACtB,GAAG;YACH,OAAO;YACP,OAAO;YACP,YAAY;YACZ,OAAO;YACP,YAAY;YACZ,qBAAqB;YACrB,aAAa;SAChB,CAAC,CAAC;IACP,CAAC;IAEO,eAAe,CAAC,GAAmD;QACvE,MAAM,QAAQ,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,eAAe,CAAC;QAC/D,IAAI,YAAY,GAAG,EAAE,CAAC;QAEtB,IAAI,GAAG,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;YACzC,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;SACtC;aAAM,IAAI,GAAG,IAAI,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACpD,YAAY,GAAG,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAW,CAAC;SAClD;QACD,OAAO,YAAY,CAAC;IACxB,CAAC;IAEO,eAAe,CAAC,GAAY,EAAE,OAAgB;;QAClD,OAAO,CACH,MAAA,MAAA,CAAC,GAAG,CAAC,KAAK,IAAK,GAAG,CAAC,KAAK,CAAC,YAA6B,CAAC,mCACvD,OAAO,CAAC,mBAAmB,mCAC3B,IAAI,CAAC,aAAa,CAAC,mBAAmB,CACzC,CAAC;IACN,CAAC;IAMO,mCAAmC,CACvC,cAA4B,EAAE,EAC9B,OAAiB,EACjB,IAAwB;QAExB,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,EAAE;YACnB,OAAO,KAAK,CAAC;SAChB;QACD,MAAM,oBAAoB,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,mBAAW,CAAC,CAAC,CAAC,EAAE,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9F,IAAI,oBAAoB,EAAE;YACtB,OAAO,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;SAC9E;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAKO,eAAe,CAAI,IAAS,EAAE,IAAS;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,IAAI,EAAE,EAAE;YACpC,OAAO,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC7C,CAAC,EAAE,KAAgB,CAAC,CAAC;IACzB,CAAC;CACJ,CAAA;AA1IY,qBAAqB;IADjC,mBAAU,EAAE;qCAG2B,gCAAc,EAAyB,8BAAa;GAF/E,qBAAqB,CA0IjC;AA1IY,sDAAqB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ID } from '@vendure/common/lib/shared-types';
|
|
2
|
+
import { RequestContext } from '../../../api/common/request-context';
|
|
3
|
+
import { ShippingCalculationResult } from '../../../config/shipping-method/shipping-calculator';
|
|
4
|
+
import { Order } from '../../../entity/order/order.entity';
|
|
5
|
+
import { ShippingMethod } from '../../../entity/shipping-method/shipping-method.entity';
|
|
6
|
+
import { ShippingMethodService } from '../../services/shipping-method.service';
|
|
7
|
+
declare type EligibleShippingMethod = {
|
|
8
|
+
method: ShippingMethod;
|
|
9
|
+
result: ShippingCalculationResult;
|
|
10
|
+
};
|
|
11
|
+
export declare class ShippingCalculator {
|
|
12
|
+
private shippingMethodService;
|
|
13
|
+
constructor(shippingMethodService: ShippingMethodService);
|
|
14
|
+
getEligibleShippingMethods(ctx: RequestContext, order: Order, skipIds?: ID[]): Promise<EligibleShippingMethod[]>;
|
|
15
|
+
getMethodIfEligible(ctx: RequestContext, order: Order, shippingMethodId: ID): Promise<ShippingMethod | undefined>;
|
|
16
|
+
private checkEligibilityByShippingMethod;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ShippingCalculator = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const shared_utils_1 = require("@vendure/common/lib/shared-utils");
|
|
15
|
+
const shipping_method_service_1 = require("../../services/shipping-method.service");
|
|
16
|
+
let ShippingCalculator = class ShippingCalculator {
|
|
17
|
+
constructor(shippingMethodService) {
|
|
18
|
+
this.shippingMethodService = shippingMethodService;
|
|
19
|
+
}
|
|
20
|
+
async getEligibleShippingMethods(ctx, order, skipIds = []) {
|
|
21
|
+
const shippingMethods = (await this.shippingMethodService.getActiveShippingMethods(ctx)).filter(method => !skipIds.includes(method.id));
|
|
22
|
+
const checkEligibilityPromises = shippingMethods.map(method => this.checkEligibilityByShippingMethod(ctx, order, method));
|
|
23
|
+
const eligibleMethods = await Promise.all(checkEligibilityPromises);
|
|
24
|
+
return eligibleMethods.filter(shared_utils_1.notNullOrUndefined).sort((a, b) => a.result.price - b.result.price);
|
|
25
|
+
}
|
|
26
|
+
async getMethodIfEligible(ctx, order, shippingMethodId) {
|
|
27
|
+
const method = await this.shippingMethodService.findOne(ctx, shippingMethodId);
|
|
28
|
+
if (method) {
|
|
29
|
+
const eligible = await method.test(ctx, order);
|
|
30
|
+
if (eligible) {
|
|
31
|
+
return method;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
async checkEligibilityByShippingMethod(ctx, order, method) {
|
|
36
|
+
const eligible = await method.test(ctx, order);
|
|
37
|
+
if (eligible) {
|
|
38
|
+
const result = await method.apply(ctx, order);
|
|
39
|
+
if (result) {
|
|
40
|
+
return { method, result };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
ShippingCalculator = __decorate([
|
|
46
|
+
common_1.Injectable(),
|
|
47
|
+
__metadata("design:paramtypes", [shipping_method_service_1.ShippingMethodService])
|
|
48
|
+
], ShippingCalculator);
|
|
49
|
+
exports.ShippingCalculator = ShippingCalculator;
|
|
50
|
+
//# sourceMappingURL=shipping-calculator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shipping-calculator.js","sourceRoot":"","sources":["../../../../src/service/helpers/shipping-calculator/shipping-calculator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAE5C,mEAAsE;AAMtE,oFAA+E;AAQ/E,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAC3B,YAAoB,qBAA4C;QAA5C,0BAAqB,GAArB,qBAAqB,CAAuB;IAAG,CAAC;IAQpE,KAAK,CAAC,0BAA0B,CAC5B,GAAmB,EACnB,KAAY,EACZ,UAAgB,EAAE;QAElB,MAAM,eAAe,GAAG,CAAC,MAAM,IAAI,CAAC,qBAAqB,CAAC,wBAAwB,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAC3F,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CACzC,CAAC;QAEF,MAAM,wBAAwB,GAAG,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAC1D,IAAI,CAAC,gCAAgC,CAAC,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAC5D,CAAC;QACF,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QAEpE,OAAO,eAAe,CAAC,MAAM,CAAC,iCAAkB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACtG,CAAC;IAED,KAAK,CAAC,mBAAmB,CACrB,GAAmB,EACnB,KAAY,EACZ,gBAAoB;QAEpB,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,GAAG,EAAE,gBAAgB,CAAC,CAAC;QAC/E,IAAI,MAAM,EAAE;YACR,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC/C,IAAI,QAAQ,EAAE;gBACV,OAAO,MAAM,CAAC;aACjB;SACJ;IACL,CAAC;IAEO,KAAK,CAAC,gCAAgC,CAC1C,GAAmB,EACnB,KAAY,EACZ,MAAsB;QAEtB,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC/C,IAAI,QAAQ,EAAE;YACV,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAC9C,IAAI,MAAM,EAAE;gBACR,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;aAC7B;SACJ;IACL,CAAC;CACJ,CAAA;AArDY,kBAAkB;IAD9B,mBAAU,EAAE;qCAEkC,+CAAqB;GADvD,kBAAkB,CAqD9B;AArDY,gDAAkB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ID, Type } from '@vendure/common/lib/shared-types';
|
|
2
|
+
import { RequestContext } from '../../../api/common/request-context';
|
|
3
|
+
import { Translatable, TranslatedInput, Translation } from '../../../common/types/locale-types';
|
|
4
|
+
import { TransactionalConnection } from '../../../connection/transactional-connection';
|
|
5
|
+
import { VendureEntity } from '../../../entity/base/base.entity';
|
|
6
|
+
export interface CreateTranslatableOptions<T extends Translatable> {
|
|
7
|
+
ctx: RequestContext;
|
|
8
|
+
entityType: Type<T>;
|
|
9
|
+
translationType: Type<Translation<T>>;
|
|
10
|
+
input: TranslatedInput<T>;
|
|
11
|
+
beforeSave?: (newEntity: T) => any | Promise<any>;
|
|
12
|
+
typeOrmSubscriberData?: any;
|
|
13
|
+
}
|
|
14
|
+
export interface UpdateTranslatableOptions<T extends Translatable> extends CreateTranslatableOptions<T> {
|
|
15
|
+
input: TranslatedInput<T> & {
|
|
16
|
+
id: ID;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare class TranslatableSaver {
|
|
20
|
+
private connection;
|
|
21
|
+
constructor(connection: TransactionalConnection);
|
|
22
|
+
create<T extends Translatable & VendureEntity>(options: CreateTranslatableOptions<T>): Promise<T>;
|
|
23
|
+
update<T extends Translatable & VendureEntity>(options: UpdateTranslatableOptions<T>): Promise<T>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TranslatableSaver = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const omit_1 = require("@vendure/common/lib/omit");
|
|
15
|
+
const transactional_connection_1 = require("../../../connection/transactional-connection");
|
|
16
|
+
const patch_entity_1 = require("../utils/patch-entity");
|
|
17
|
+
const translation_differ_1 = require("./translation-differ");
|
|
18
|
+
let TranslatableSaver = class TranslatableSaver {
|
|
19
|
+
constructor(connection) {
|
|
20
|
+
this.connection = connection;
|
|
21
|
+
}
|
|
22
|
+
async create(options) {
|
|
23
|
+
const { ctx, entityType, translationType, input, beforeSave, typeOrmSubscriberData } = options;
|
|
24
|
+
const entity = new entityType(input);
|
|
25
|
+
const translations = [];
|
|
26
|
+
if (input.translations) {
|
|
27
|
+
for (const translationInput of input.translations) {
|
|
28
|
+
const translation = new translationType(translationInput);
|
|
29
|
+
translations.push(translation);
|
|
30
|
+
await this.connection.getRepository(ctx, translationType).save(translation);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
entity.translations = translations;
|
|
34
|
+
if (typeof beforeSave === 'function') {
|
|
35
|
+
await beforeSave(entity);
|
|
36
|
+
}
|
|
37
|
+
return await this.connection
|
|
38
|
+
.getRepository(ctx, entityType)
|
|
39
|
+
.save(entity, { data: typeOrmSubscriberData });
|
|
40
|
+
}
|
|
41
|
+
async update(options) {
|
|
42
|
+
const { ctx, entityType, translationType, input, beforeSave, typeOrmSubscriberData } = options;
|
|
43
|
+
const existingTranslations = await this.connection.getRepository(ctx, translationType).find({
|
|
44
|
+
where: { base: input.id },
|
|
45
|
+
relations: ['base'],
|
|
46
|
+
});
|
|
47
|
+
const differ = new translation_differ_1.TranslationDiffer(translationType, this.connection);
|
|
48
|
+
const diff = differ.diff(existingTranslations, input.translations);
|
|
49
|
+
const entity = await differ.applyDiff(ctx, new entityType(Object.assign(Object.assign({}, input), { translations: existingTranslations })), diff);
|
|
50
|
+
const updatedEntity = patch_entity_1.patchEntity(entity, omit_1.omit(input, ['translations']));
|
|
51
|
+
if (typeof beforeSave === 'function') {
|
|
52
|
+
await beforeSave(entity);
|
|
53
|
+
}
|
|
54
|
+
return this.connection
|
|
55
|
+
.getRepository(ctx, entityType)
|
|
56
|
+
.save(updatedEntity, { data: typeOrmSubscriberData });
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
TranslatableSaver = __decorate([
|
|
60
|
+
common_1.Injectable(),
|
|
61
|
+
__metadata("design:paramtypes", [transactional_connection_1.TransactionalConnection])
|
|
62
|
+
], TranslatableSaver);
|
|
63
|
+
exports.TranslatableSaver = TranslatableSaver;
|
|
64
|
+
//# sourceMappingURL=translatable-saver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translatable-saver.js","sourceRoot":"","sources":["../../../../src/service/helpers/translatable-saver/translatable-saver.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,mDAAgD;AAKhD,2FAAuF;AAGvF,wDAAoD;AAEpD,6DAAyD;AAmBzD,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAC1B,YAAoB,UAAmC;QAAnC,eAAU,GAAV,UAAU,CAAyB;IAAG,CAAC;IAM3D,KAAK,CAAC,MAAM,CAAyC,OAAqC;QACtF,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,GAAG,OAAO,CAAC;QAE/F,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;QACrC,MAAM,YAAY,GAA0B,EAAE,CAAC;QAE/C,IAAI,KAAK,CAAC,YAAY,EAAE;YACpB,KAAK,MAAM,gBAAgB,IAAI,KAAK,CAAC,YAAY,EAAE;gBAC/C,MAAM,WAAW,GAAG,IAAI,eAAe,CAAC,gBAAgB,CAAC,CAAC;gBAC1D,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;gBAC/B,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,WAAkB,CAAC,CAAC;aACtF;SACJ;QAED,MAAM,CAAC,YAAY,GAAG,YAAY,CAAC;QACnC,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;YAClC,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;SAC5B;QACD,OAAO,MAAM,IAAI,CAAC,UAAU;aACvB,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC;aAC9B,IAAI,CAAC,MAAa,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAC9D,CAAC;IAMD,KAAK,CAAC,MAAM,CAAyC,OAAqC;QACtF,MAAM,EAAE,GAAG,EAAE,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,EAAE,qBAAqB,EAAE,GAAG,OAAO,CAAC;QAC/F,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC;YACxF,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE;YACzB,SAAS,EAAE,CAAC,MAAM,CAAC;SACtB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,IAAI,sCAAiB,CAAC,eAAe,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QACvE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,oBAAoB,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC;QACnE,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,SAAS,CACjC,GAAG,EACH,IAAI,UAAU,iCAAM,KAAK,KAAE,YAAY,EAAE,oBAAoB,IAAG,EAChE,IAAI,CACP,CAAC;QACF,MAAM,aAAa,GAAG,0BAAW,CAAC,MAAa,EAAE,WAAI,CAAC,KAAK,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;QAChF,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;YAClC,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;SAC5B;QACD,OAAO,IAAI,CAAC,UAAU;aACjB,aAAa,CAAC,GAAG,EAAE,UAAU,CAAC;aAC9B,IAAI,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAC9D,CAAC;CACJ,CAAA;AAxDY,iBAAiB;IAD7B,mBAAU,EAAE;qCAEuB,kDAAuB;GAD9C,iBAAiB,CAwD7B;AAxDY,8CAAiB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DeepPartial } from '@vendure/common/lib/shared-types';
|
|
2
|
+
import { RequestContext } from '../../../api/common/request-context';
|
|
3
|
+
import { Translatable, Translation, TranslationInput } from '../../../common/types/locale-types';
|
|
4
|
+
import { TransactionalConnection } from '../../../connection/transactional-connection';
|
|
5
|
+
export declare type TranslationContructor<T> = new (input?: DeepPartial<TranslationInput<T>> | DeepPartial<Translation<T>>) => Translation<T>;
|
|
6
|
+
export interface TranslationDiff<T> {
|
|
7
|
+
toUpdate: Array<Translation<T>>;
|
|
8
|
+
toAdd: Array<Translation<T>>;
|
|
9
|
+
}
|
|
10
|
+
export declare class TranslationDiffer<Entity extends Translatable> {
|
|
11
|
+
private translationCtor;
|
|
12
|
+
private connection;
|
|
13
|
+
constructor(translationCtor: TranslationContructor<Entity>, connection: TransactionalConnection);
|
|
14
|
+
diff(existing: Array<Translation<Entity>>, updated?: Array<TranslationInput<Entity>> | null): TranslationDiff<Entity>;
|
|
15
|
+
applyDiff(ctx: RequestContext, entity: Entity, { toUpdate, toAdd }: TranslationDiff<Entity>): Promise<Entity>;
|
|
16
|
+
private translationInputsToEntities;
|
|
17
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TranslationDiffer = void 0;
|
|
4
|
+
const errors_1 = require("../../../common/error/errors");
|
|
5
|
+
const utils_1 = require("../../../common/utils");
|
|
6
|
+
class TranslationDiffer {
|
|
7
|
+
constructor(translationCtor, connection) {
|
|
8
|
+
this.translationCtor = translationCtor;
|
|
9
|
+
this.connection = connection;
|
|
10
|
+
}
|
|
11
|
+
diff(existing, updated) {
|
|
12
|
+
if (updated) {
|
|
13
|
+
const translationEntities = this.translationInputsToEntities(updated, existing);
|
|
14
|
+
const toAdd = translationEntities.filter(utils_1.not(utils_1.foundIn(existing, 'languageCode')));
|
|
15
|
+
const toUpdate = translationEntities.filter(utils_1.foundIn(existing, 'languageCode'));
|
|
16
|
+
return { toUpdate, toAdd };
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return {
|
|
20
|
+
toUpdate: [],
|
|
21
|
+
toAdd: [],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
async applyDiff(ctx, entity, { toUpdate, toAdd }) {
|
|
26
|
+
if (toUpdate.length) {
|
|
27
|
+
for (const translation of toUpdate) {
|
|
28
|
+
const updated = await this.connection
|
|
29
|
+
.getRepository(ctx, this.translationCtor)
|
|
30
|
+
.save(translation);
|
|
31
|
+
const index = entity.translations.findIndex(t => t.languageCode === updated.languageCode);
|
|
32
|
+
entity.translations.splice(index, 1, updated);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (toAdd.length) {
|
|
36
|
+
for (const translation of toAdd) {
|
|
37
|
+
translation.base = entity;
|
|
38
|
+
let newTranslation;
|
|
39
|
+
try {
|
|
40
|
+
newTranslation = await this.connection
|
|
41
|
+
.getRepository(ctx, this.translationCtor)
|
|
42
|
+
.save(translation);
|
|
43
|
+
}
|
|
44
|
+
catch (err) {
|
|
45
|
+
throw new errors_1.InternalServerError(err.message);
|
|
46
|
+
}
|
|
47
|
+
entity.translations.push(newTranslation);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return entity;
|
|
51
|
+
}
|
|
52
|
+
translationInputsToEntities(inputs, existing) {
|
|
53
|
+
return inputs.map(input => {
|
|
54
|
+
const counterpart = existing.find(e => e.languageCode === input.languageCode);
|
|
55
|
+
const entity = new this.translationCtor(input);
|
|
56
|
+
if (counterpart) {
|
|
57
|
+
entity.id = counterpart.id;
|
|
58
|
+
entity.base = counterpart.base;
|
|
59
|
+
}
|
|
60
|
+
return entity;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.TranslationDiffer = TranslationDiffer;
|
|
65
|
+
//# sourceMappingURL=translation-differ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translation-differ.js","sourceRoot":"","sources":["../../../../src/service/helpers/translatable-saver/translation-differ.ts"],"names":[],"mappings":";;;AAGA,yDAAmE;AAEnE,iDAAqD;AAerD,MAAa,iBAAiB;IAC1B,YACY,eAA8C,EAC9C,UAAmC;QADnC,oBAAe,GAAf,eAAe,CAA+B;QAC9C,eAAU,GAAV,UAAU,CAAyB;IAC5C,CAAC;IAMJ,IAAI,CACA,QAAoC,EACpC,OAAgD;QAEhD,IAAI,OAAO,EAAE;YACT,MAAM,mBAAmB,GAAG,IAAI,CAAC,2BAA2B,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YAChF,MAAM,KAAK,GAAG,mBAAmB,CAAC,MAAM,CAAC,WAAG,CAAC,eAAO,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;YACjF,MAAM,QAAQ,GAAG,mBAAmB,CAAC,MAAM,CAAC,eAAO,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC;YAE/E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;SAC9B;aAAM;YACH,OAAO;gBACH,QAAQ,EAAE,EAAE;gBACZ,KAAK,EAAE,EAAE;aACZ,CAAC;SACL;IACL,CAAC;IAED,KAAK,CAAC,SAAS,CACX,GAAmB,EACnB,MAAc,EACd,EAAE,QAAQ,EAAE,KAAK,EAA2B;QAE5C,IAAI,QAAQ,CAAC,MAAM,EAAE;YACjB,KAAK,MAAM,WAAW,IAAI,QAAQ,EAAE;gBAEhC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU;qBAChC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC;qBACxC,IAAI,CAAC,WAAkB,CAAC,CAAC;gBAC9B,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;gBAC1F,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC;aACjD;SACJ;QAED,IAAI,KAAK,CAAC,MAAM,EAAE;YACd,KAAK,MAAM,WAAW,IAAI,KAAK,EAAE;gBAC7B,WAAW,CAAC,IAAI,GAAG,MAAM,CAAC;gBAC1B,IAAI,cAAmB,CAAC;gBACxB,IAAI;oBACA,cAAc,GAAG,MAAM,IAAI,CAAC,UAAU;yBACjC,aAAa,CAAC,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC;yBACxC,IAAI,CAAC,WAAkB,CAAC,CAAC;iBACjC;gBAAC,OAAO,GAAG,EAAE;oBACV,MAAM,IAAI,4BAAmB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;iBAC9C;gBACD,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;aAC5C;SACJ;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAEO,2BAA2B,CAC/B,MAAuC,EACvC,QAAoC;QAEpC,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;YACtB,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,KAAK,KAAK,CAAC,YAAY,CAAC,CAAC;YAE9E,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,eAAe,CAAC,KAAY,CAAC,CAAC;YACtD,IAAI,WAAW,EAAE;gBACb,MAAM,CAAC,EAAE,GAAG,WAAW,CAAC,EAAE,CAAC;gBAC3B,MAAM,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;aAClC;YACD,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AA7ED,8CA6EC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addressToLine = void 0;
|
|
4
|
+
function addressToLine(address) {
|
|
5
|
+
const propsToInclude = ['streetLine1', 'postalCode', 'country'];
|
|
6
|
+
let result = address.streetLine1 || '';
|
|
7
|
+
if (address.postalCode) {
|
|
8
|
+
result += ', ' + address.postalCode;
|
|
9
|
+
}
|
|
10
|
+
if (address.country) {
|
|
11
|
+
if (typeof address.country === 'string') {
|
|
12
|
+
result += ', ' + address.country;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
result += ', ' + address.country.name;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return result;
|
|
19
|
+
}
|
|
20
|
+
exports.addressToLine = addressToLine;
|
|
21
|
+
//# sourceMappingURL=address-to-line.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"address-to-line.js","sourceRoot":"","sources":["../../../../src/service/helpers/utils/address-to-line.ts"],"names":[],"mappings":";;;AAQA,SAAgB,aAAa,CAAC,OAA+B;IACzD,MAAM,cAAc,GAA0C,CAAC,aAAa,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;IACvG,IAAI,MAAM,GAAG,OAAO,CAAC,WAAW,IAAI,EAAE,CAAC;IACvC,IAAI,OAAO,CAAC,UAAU,EAAE;QACpB,MAAM,IAAI,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC;KACvC;IACD,IAAI,OAAO,CAAC,OAAO,EAAE;QACjB,IAAI,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ,EAAE;YACrC,MAAM,IAAI,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC;SACpC;aAAM;YACH,MAAM,IAAI,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC;SACzC;KACJ;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAdD,sCAcC"}
|