feat(oas): include /admin and /store in paths URLs (#3314)
## What Include `/admin` and `/store` in OAS paths URLs ## Why Allow for generating a combined OAS that include routes for both "admin" and "store" endpoint. Fix potential issues with code generator where routes are not prefixed with "admin" and "store" leading to 404 errors. ## Test * Run `yarn build` * Run `yarn openapi:generate` * Run `yarn redocly preview-docs docs/api/admin/openapi.yaml --config=./docs-util/redocly/config.yaml` * Expect paths to be prefixed with /admin. * Run `yarn redocly preview-docs docs/api/store/openapi.yaml --config=./docs-util/redocly/config.yaml` * Expect paths to be prefixed with /store.
This commit is contained in:
5
.changeset/nice-dryers-search.md
Normal file
5
.changeset/nice-dryers-search.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/medusa": patch
|
||||
---
|
||||
|
||||
feat(oas): include `/admin` and `/store` in paths URLs
|
||||
@@ -292,7 +292,7 @@ tags:
|
||||
- name: User
|
||||
description: User endpoints that allow handling users in Medusa.
|
||||
servers:
|
||||
- url: https://api.medusa-commerce.com/admin
|
||||
- url: https://api.medusa-commerce.com
|
||||
paths: { }
|
||||
components:
|
||||
responses:
|
||||
|
||||
@@ -237,7 +237,7 @@ tags:
|
||||
- name: Swap
|
||||
description: Swap endpoints that allow handling swaps in Medusa.
|
||||
servers:
|
||||
- url: https://api.medusa-commerce.com/store
|
||||
- url: https://api.medusa-commerce.com
|
||||
paths: { }
|
||||
components:
|
||||
responses:
|
||||
|
||||
@@ -4,7 +4,7 @@ import { OauthService } from "../../../../services"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [post] /apps/authorizations
|
||||
* @oas [post] /admin/apps/authorizations
|
||||
* operationId: "PostApps"
|
||||
* summary: "Generate Token for App"
|
||||
* description: "Generates a token for an application."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { OauthService } from "../../../../services"
|
||||
|
||||
/**
|
||||
* @oas [get] /apps
|
||||
* @oas [get] /admin/apps
|
||||
* operationId: "GetApps"
|
||||
* summary: "List Applications"
|
||||
* description: "Retrieve a list of applications."
|
||||
|
||||
@@ -8,7 +8,7 @@ import AuthService from "../../../../services/auth"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [post] /auth
|
||||
* @oas [post] /admin/auth
|
||||
* operationId: "PostAuth"
|
||||
* summary: "User Login"
|
||||
* x-authenticated: false
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @oas [delete] /auth
|
||||
* @oas [delete] /admin/auth
|
||||
* operationId: "DeleteAuth"
|
||||
* summary: "User Logout"
|
||||
* x-authenticated: true
|
||||
|
||||
@@ -2,7 +2,7 @@ import UserService from "../../../../services/user"
|
||||
import _ from "lodash"
|
||||
|
||||
/**
|
||||
* @oas [get] /auth
|
||||
* @oas [get] /admin/auth
|
||||
* operationId: "GetAuth"
|
||||
* summary: "Get Current User"
|
||||
* x-authenticated: true
|
||||
|
||||
@@ -2,7 +2,7 @@ import { BatchJobService } from "../../../../services"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /batch-jobs/{id}/cancel
|
||||
* @oas [post] /admin/batch-jobs/{id}/cancel
|
||||
* operationId: "PostBatchJobsBatchJobCancel"
|
||||
* summary: "Cancel a Batch Job"
|
||||
* description: "Marks a batch job as canceled"
|
||||
|
||||
@@ -2,7 +2,7 @@ import { BatchJobService } from "../../../../services"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /batch-jobs/{id}/confirm
|
||||
* @oas [post] /admin/batch-jobs/{id}/confirm
|
||||
* operationId: "PostBatchJobsBatchJobConfirmProcessing"
|
||||
* summary: "Confirm a Batch Job"
|
||||
* description: "Confirms that a previously requested batch job should be executed."
|
||||
|
||||
@@ -6,7 +6,7 @@ import { EntityManager } from "typeorm"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [post] /batch-jobs
|
||||
* @oas [post] /admin/batch-jobs
|
||||
* operationId: "PostBatchJobs"
|
||||
* summary: "Create a Batch Job"
|
||||
* description: "Creates a Batch Job."
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* @oas [get] /batch-jobs/{id}
|
||||
* @oas [get] /admin/batch-jobs/{id}
|
||||
* operationId: "GetBatchJobsBatchJob"
|
||||
* summary: "Get a Batch Job"
|
||||
* description: "Retrieves a Batch Job."
|
||||
|
||||
@@ -9,7 +9,7 @@ import { pickBy } from "lodash"
|
||||
import { isDefined } from "medusa-core-utils"
|
||||
|
||||
/**
|
||||
* @oas [get] /batch-jobs
|
||||
* @oas [get] /admin/batch-jobs
|
||||
* operationId: "GetBatchJobs"
|
||||
* summary: "List Batch Jobs"
|
||||
* description: "Retrieve a list of Batch Jobs."
|
||||
|
||||
@@ -5,7 +5,7 @@ import { EntityManager } from "typeorm"
|
||||
import ProductCollectionService from "../../../../services/product-collection"
|
||||
|
||||
/**
|
||||
* @oas [post] /collections/{id}/products/batch
|
||||
* @oas [post] /admin/collections/{id}/products/batch
|
||||
* operationId: "PostProductsToCollection"
|
||||
* summary: "Update Products"
|
||||
* description: "Updates products associated with a Product Collection"
|
||||
|
||||
@@ -4,7 +4,7 @@ import { Request, Response } from "express"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /collections
|
||||
* @oas [post] /admin/collections
|
||||
* operationId: "PostCollections"
|
||||
* summary: "Create a Collection"
|
||||
* description: "Creates a Product Collection."
|
||||
|
||||
@@ -4,7 +4,7 @@ import { EntityManager } from "typeorm"
|
||||
import ProductCollectionService from "../../../../services/product-collection"
|
||||
|
||||
/**
|
||||
* @oas [delete] /collections/{id}
|
||||
* @oas [delete] /admin/collections/{id}
|
||||
* operationId: "DeleteCollectionsCollection"
|
||||
* summary: "Delete a Collection"
|
||||
* description: "Deletes a Product Collection."
|
||||
|
||||
@@ -4,7 +4,7 @@ import ProductCollectionService from "../../../../services/product-collection"
|
||||
import { defaultAdminCollectionsRelations } from "."
|
||||
|
||||
/**
|
||||
* @oas [get] /collections/{id}
|
||||
* @oas [get] /admin/collections/{id}
|
||||
* operationId: "GetCollectionsCollection"
|
||||
* summary: "Get a Collection"
|
||||
* description: "Retrieves a Product Collection."
|
||||
|
||||
@@ -6,7 +6,7 @@ import ProductCollectionService from "../../../../services/product-collection"
|
||||
import { Type } from "class-transformer"
|
||||
|
||||
/**
|
||||
* @oas [get] /collections
|
||||
* @oas [get] /admin/collections
|
||||
* operationId: "GetCollections"
|
||||
* summary: "List Collections"
|
||||
* description: "Retrieve a list of Product Collection."
|
||||
|
||||
@@ -5,7 +5,7 @@ import { EntityManager } from "typeorm"
|
||||
import ProductCollectionService from "../../../../services/product-collection"
|
||||
|
||||
/**
|
||||
* @oas [delete] /collections/{id}/products/batch
|
||||
* @oas [delete] /admin/collections/{id}/products/batch
|
||||
* operationId: "DeleteProductsFromCollection"
|
||||
* summary: "Remove Product"
|
||||
* description: "Removes products associated with a Product Collection"
|
||||
|
||||
@@ -4,7 +4,7 @@ import { EntityManager } from "typeorm"
|
||||
import ProductCollectionService from "../../../../services/product-collection"
|
||||
|
||||
/**
|
||||
* @oas [post] /collections/{id}
|
||||
* @oas [post] /admin/collections/{id}
|
||||
* operationId: "PostCollectionsCollection"
|
||||
* summary: "Update a Collection"
|
||||
* description: "Updates a Product Collection."
|
||||
|
||||
@@ -7,7 +7,7 @@ import { ExtendedRequest } from "../../../../types/global"
|
||||
import { FeatureFlagDecorators } from "../../../../utils/feature-flag-decorators"
|
||||
|
||||
/**
|
||||
* @oas [get] /currencies
|
||||
* @oas [get] /admin/currencies
|
||||
* operationId: "GetCurrencies"
|
||||
* summary: "List Currency"
|
||||
* description: "Retrieves a list of Currency"
|
||||
|
||||
@@ -7,7 +7,7 @@ import TaxInclusivePricingFeatureFlag from "../../../../loaders/feature-flags/ta
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /currencies/{code}
|
||||
* @oas [post] /admin/currencies/{code}
|
||||
* operationId: "PostCurrenciesCurrency"
|
||||
* summary: "Update a Currency"
|
||||
* description: "Update a Currency"
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ValidateNested } from "class-validator"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [post] /customer-groups/{id}/customers/batch
|
||||
* @oas [post] /admin/customer-groups/{id}/customers/batch
|
||||
* operationId: "PostCustomerGroupsGroupCustomersBatch"
|
||||
* summary: "Add Customers"
|
||||
* description: "Adds a list of customers, represented by id's, to a customer group."
|
||||
|
||||
@@ -6,7 +6,7 @@ import { EntityManager } from "typeorm"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [post] /customer-groups
|
||||
* @oas [post] /admin/customer-groups
|
||||
* operationId: "PostCustomerGroups"
|
||||
* summary: "Create a Customer Group"
|
||||
* description: "Creates a CustomerGroup."
|
||||
|
||||
@@ -4,7 +4,7 @@ import { CustomerGroupService } from "../../../../services"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [delete] /customer-groups/{id}
|
||||
* @oas [delete] /admin/customer-groups/{id}
|
||||
* operationId: "DeleteCustomerGroupsCustomerGroup"
|
||||
* summary: "Delete a Customer Group"
|
||||
* description: "Deletes a CustomerGroup."
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ValidateNested } from "class-validator"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [delete] /customer-groups/{id}/customers/batch
|
||||
* @oas [delete] /admin/customer-groups/{id}/customers/batch
|
||||
* operationId: "DeleteCustomerGroupsGroupCustomerBatch"
|
||||
* summary: "Remove Customers"
|
||||
* description: "Removes a list of customers, represented by id's, from a customer group."
|
||||
|
||||
@@ -5,7 +5,7 @@ import { IsNumber, IsOptional, IsString } from "class-validator"
|
||||
import { Type } from "class-transformer"
|
||||
|
||||
/**
|
||||
* @oas [get] /customer-groups/{id}/customers
|
||||
* @oas [get] /admin/customer-groups/{id}/customers
|
||||
* operationId: "GetCustomerGroupsGroupCustomers"
|
||||
* summary: "List Customers"
|
||||
* description: "Retrieves a list of customers in a customer group"
|
||||
|
||||
@@ -4,7 +4,7 @@ import { CustomerGroupService } from "../../../../services"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
|
||||
/**
|
||||
* @oas [get] /customer-groups/{id}
|
||||
* @oas [get] /admin/customer-groups/{id}
|
||||
* operationId: "GetCustomerGroupsGroup"
|
||||
* summary: "Get a Customer Group"
|
||||
* description: "Retrieves a Customer Group."
|
||||
|
||||
@@ -6,7 +6,7 @@ import { FilterableCustomerGroupProps } from "../../../../types/customer-groups"
|
||||
import { Type } from "class-transformer"
|
||||
|
||||
/**
|
||||
* @oas [get] /customer-groups
|
||||
* @oas [get] /admin/customer-groups
|
||||
* operationId: "GetCustomerGroups"
|
||||
* summary: "List Customer Groups"
|
||||
* description: "Retrieve a list of customer groups."
|
||||
|
||||
@@ -8,7 +8,7 @@ import { defaultAdminCustomerGroupsRelations } from "."
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [post] /customer-groups/{id}
|
||||
* @oas [post] /admin/customer-groups/{id}
|
||||
* operationId: "PostCustomerGroupsGroup"
|
||||
* summary: "Update a Customer Group"
|
||||
* description: "Update a CustomerGroup."
|
||||
|
||||
@@ -5,7 +5,7 @@ import { validator } from "../../../../utils/validator"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /customers
|
||||
* @oas [post] /admin/customers
|
||||
* operationId: "PostCustomers"
|
||||
* summary: "Create a Customer"
|
||||
* description: "Creates a Customer."
|
||||
|
||||
@@ -4,7 +4,7 @@ import { defaultAdminCustomersRelations } from "."
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [get] /customers/{id}
|
||||
* @oas [get] /admin/customers/{id}
|
||||
* operationId: "GetCustomersCustomer"
|
||||
* summary: "Get a Customer"
|
||||
* description: "Retrieves a Customer."
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Type } from "class-transformer"
|
||||
import customerController from "../../../../controllers/customers"
|
||||
|
||||
/**
|
||||
* @oas [get] /customers
|
||||
* @oas [get] /admin/customers
|
||||
* operationId: "GetCustomers"
|
||||
* summary: "List Customers"
|
||||
* description: "Retrieves a list of Customers."
|
||||
|
||||
@@ -16,7 +16,7 @@ import { defaultAdminCustomersRelations } from "."
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [post] /customers/{id}
|
||||
* @oas [post] /admin/customers/{id}
|
||||
* operationId: "PostCustomersCustomer"
|
||||
* summary: "Update a Customer"
|
||||
* description: "Updates a Customer."
|
||||
|
||||
@@ -5,7 +5,7 @@ import DiscountService from "../../../../services/discount"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /discounts/{id}/regions/{region_id}
|
||||
* @oas [post] /admin/discounts/{id}/regions/{region_id}
|
||||
* operationId: "PostDiscountsDiscountRegionsRegion"
|
||||
* summary: "Add Region"
|
||||
* description: "Adds a Region to the list of Regions that a Discount can be used in."
|
||||
|
||||
@@ -10,7 +10,7 @@ import { IsArray } from "class-validator"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
|
||||
/**
|
||||
* @oas [post] /discounts/{discount_id}/conditions/{condition_id}/batch
|
||||
* @oas [post] /admin/discounts/{discount_id}/conditions/{condition_id}/batch
|
||||
* operationId: "PostDiscountsDiscountConditionsConditionBatch"
|
||||
* summary: "Add Batch Resources"
|
||||
* description: "Add a batch of resources to a discount condition."
|
||||
|
||||
@@ -9,7 +9,7 @@ import { EntityManager } from "typeorm"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
|
||||
/**
|
||||
* @oas [post] /discounts/{discount_id}/conditions
|
||||
* @oas [post] /admin/discounts/{discount_id}/conditions
|
||||
* operationId: "PostDiscountsDiscountConditions"
|
||||
* summary: "Create a Condition"
|
||||
* description: "Creates a DiscountCondition. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided."
|
||||
|
||||
@@ -26,7 +26,7 @@ import { Request, Response } from "express"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
|
||||
/**
|
||||
* @oas [post] /discounts
|
||||
* @oas [post] /admin/discounts
|
||||
* operationId: "PostDiscounts"
|
||||
* summary: "Creates a Discount"
|
||||
* x-authenticated: true
|
||||
|
||||
@@ -12,7 +12,7 @@ import DiscountService from "../../../../services/discount"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /discounts/{id}/dynamic-codes
|
||||
* @oas [post] /admin/discounts/{id}/dynamic-codes
|
||||
* operationId: "PostDiscountsDiscountDynamicCodes"
|
||||
* summary: "Create a Dynamic Code"
|
||||
* description: "Creates a dynamic unique code that can map to a parent Discount. This is useful if you want to automatically generate codes with the same behaviour."
|
||||
|
||||
@@ -5,7 +5,7 @@ import { MedusaError } from "medusa-core-utils"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
|
||||
/**
|
||||
* @oas [delete] /discounts/{discount_id}/conditions/{condition_id}
|
||||
* @oas [delete] /admin/discounts/{discount_id}/conditions/{condition_id}
|
||||
* operationId: "DeleteDiscountsDiscountConditionsCondition"
|
||||
* summary: "Delete a Condition"
|
||||
* description: "Deletes a DiscountCondition"
|
||||
|
||||
@@ -2,7 +2,7 @@ import DiscountService from "../../../../services/discount"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [delete] /discounts/{id}
|
||||
* @oas [delete] /admin/discounts/{id}
|
||||
* operationId: "DeleteDiscountsDiscount"
|
||||
* summary: "Delete a Discount"
|
||||
* description: "Deletes a Discount."
|
||||
|
||||
@@ -4,7 +4,7 @@ import DiscountService from "../../../../services/discount"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [delete] /discounts/{id}/dynamic-codes/{code}
|
||||
* @oas [delete] /admin/discounts/{id}/dynamic-codes/{code}
|
||||
* operationId: "DeleteDiscountsDiscountDynamicCodesCode"
|
||||
* summary: "Delete a Dynamic Code"
|
||||
* description: "Deletes a dynamic code from a Discount."
|
||||
|
||||
@@ -9,7 +9,7 @@ import { IsArray } from "class-validator"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
|
||||
/**
|
||||
* @oas [delete] /discounts/{discount_id}/conditions/{condition_id}/batch
|
||||
* @oas [delete] /admin/discounts/{discount_id}/conditions/{condition_id}/batch
|
||||
* operationId: "DeleteDiscountsDiscountConditionsConditionBatch"
|
||||
* summary: "Delete Batch Resources"
|
||||
* description: "Delete a batch of resources from a discount condition."
|
||||
|
||||
@@ -3,7 +3,7 @@ import DiscountConditionService from "../../../../services/discount-condition"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
|
||||
/**
|
||||
* @oas [get] /discounts/{discount_id}/conditions/{condition_id}
|
||||
* @oas [get] /admin/discounts/{discount_id}/conditions/{condition_id}
|
||||
* operationId: "GetDiscountsDiscountConditionsCondition"
|
||||
* summary: "Get a Condition"
|
||||
* description: "Gets a DiscountCondition"
|
||||
|
||||
@@ -3,7 +3,7 @@ import DiscountService from "../../../../services/discount"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
|
||||
/**
|
||||
* @oas [get] /discounts/code/{code}
|
||||
* @oas [get] /admin/discounts/code/{code}
|
||||
* operationId: "GetDiscountsDiscountCode"
|
||||
* summary: "Get Discount by Code"
|
||||
* description: "Retrieves a Discount by its discount code"
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Request, Response } from "express"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
|
||||
/**
|
||||
* @oas [get] /discounts/{id}
|
||||
* @oas [get] /admin/discounts/{id}
|
||||
* operationId: "GetDiscountsDiscount"
|
||||
* summary: "Get a Discount"
|
||||
* description: "Retrieves a Discount"
|
||||
|
||||
@@ -13,7 +13,7 @@ import { DiscountService } from "../../../../services"
|
||||
import { optionalBooleanMapper } from "../../../../utils/validators/is-boolean"
|
||||
|
||||
/**
|
||||
* @oas [get] /discounts
|
||||
* @oas [get] /admin/discounts
|
||||
* operationId: "GetDiscounts"
|
||||
* summary: "List Discounts"
|
||||
* x-authenticated: true
|
||||
|
||||
@@ -4,7 +4,7 @@ import DiscountService from "../../../../services/discount"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [delete] /discounts/{id}/regions/{region_id}
|
||||
* @oas [delete] /admin/discounts/{id}/regions/{region_id}
|
||||
* operationId: "DeleteDiscountsDiscountRegionsRegion"
|
||||
* summary: "Remove Region"
|
||||
* x-authenticated: true
|
||||
|
||||
@@ -6,7 +6,7 @@ import { EntityManager } from "typeorm"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
|
||||
/**
|
||||
* @oas [post] /discounts/{discount_id}/conditions/{condition_id}
|
||||
* @oas [post] /admin/discounts/{discount_id}/conditions/{condition_id}
|
||||
* operationId: "PostDiscountsDiscountConditionsCondition"
|
||||
* summary: "Update a Condition"
|
||||
* description: "Updates a DiscountCondition. Only one of `products`, `product_types`, `product_collections`, `product_tags`, and `customer_groups` should be provided."
|
||||
|
||||
@@ -23,7 +23,7 @@ import { Type } from "class-transformer"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
|
||||
/**
|
||||
* @oas [post] /discounts/{id}
|
||||
* @oas [post] /admin/discounts/{id}
|
||||
* operationId: "PostDiscountsDiscount"
|
||||
* summary: "Update a Discount"
|
||||
* description: "Updates a Discount with a given set of rules that define how the Discount behaves."
|
||||
|
||||
@@ -27,7 +27,7 @@ import { validator } from "../../../../utils/validator"
|
||||
import { IsType } from "../../../../utils/validators/is-type"
|
||||
|
||||
/**
|
||||
* @oas [post] /draft-orders
|
||||
* @oas [post] /admin/draft-orders
|
||||
* operationId: "PostDraftOrders"
|
||||
* summary: "Create a Draft Order"
|
||||
* description: "Creates a Draft Order"
|
||||
|
||||
@@ -15,7 +15,7 @@ import { MedusaError } from "medusa-core-utils"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [post] /draft-orders/{id}/line-items
|
||||
* @oas [post] /admin/draft-orders/{id}/line-items
|
||||
* operationId: "PostDraftOrdersDraftOrderLineItems"
|
||||
* summary: "Create a Line Item"
|
||||
* description: "Creates a Line Item for the Draft Order"
|
||||
|
||||
@@ -2,7 +2,7 @@ import { DraftOrderService } from "../../../../services"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [delete] /draft-orders/{id}
|
||||
* @oas [delete] /admin/draft-orders/{id}
|
||||
* operationId: DeleteDraftOrdersDraftOrder
|
||||
* summary: Delete a Draft Order
|
||||
* description: "Deletes a Draft Order"
|
||||
|
||||
@@ -10,7 +10,7 @@ import { EntityManager } from "typeorm"
|
||||
import { MedusaError } from "medusa-core-utils"
|
||||
|
||||
/**
|
||||
* @oas [delete] /draft-orders/{id}/line-items/{line_id}
|
||||
* @oas [delete] /admin/draft-orders/{id}/line-items/{line_id}
|
||||
* operationId: DeleteDraftOrdersDraftOrderLineItemsItem
|
||||
* summary: Delete a Line Item
|
||||
* description: "Removes a Line Item from a Draft Order."
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import { DraftOrder } from "../../../.."
|
||||
|
||||
/**
|
||||
* @oas [get] /draft-orders/{id}
|
||||
* @oas [get] /admin/draft-orders/{id}
|
||||
* operationId: "GetDraftOrdersDraftOrder"
|
||||
* summary: "Get a Draft Order"
|
||||
* description: "Retrieves a Draft Order."
|
||||
|
||||
@@ -12,7 +12,7 @@ import { Type } from "class-transformer"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [get] /draft-orders
|
||||
* @oas [get] /admin/draft-orders
|
||||
* operationId: "GetDraftOrders"
|
||||
* summary: "List Draft Orders"
|
||||
* description: "Retrieves an list of Draft Orders"
|
||||
|
||||
@@ -15,7 +15,7 @@ import { Order } from "../../../../models"
|
||||
import { MedusaError } from "medusa-core-utils"
|
||||
|
||||
/**
|
||||
* @oas [post] /draft-orders/{id}/pay
|
||||
* @oas [post] /admin/draft-orders/{id}/pay
|
||||
* summary: "Registers a Payment"
|
||||
* operationId: "PostDraftOrdersDraftOrderRegisterPayment"
|
||||
* description: "Registers a payment for a Draft Order."
|
||||
|
||||
@@ -21,7 +21,7 @@ import { validator } from "../../../../utils/validator"
|
||||
import { IsType } from "../../../../utils/validators/is-type"
|
||||
|
||||
/**
|
||||
* @oas [post] /draft-orders/{id}
|
||||
* @oas [post] /admin/draft-orders/{id}
|
||||
* operationId: PostDraftOrdersDraftOrder
|
||||
* summary: Update a Draft Order
|
||||
* description: "Updates a Draft Order."
|
||||
|
||||
@@ -13,7 +13,7 @@ import { MedusaError } from "medusa-core-utils"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [post] /draft-orders/{id}/line-items/{line_id}
|
||||
* @oas [post] /admin/draft-orders/{id}/line-items/{line_id}
|
||||
* operationId: "PostDraftOrdersDraftOrderLineItemsItem"
|
||||
* summary: "Update a Line Item"
|
||||
* description: "Updates a Line Item for a Draft Order"
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Type } from "class-transformer"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /gift-cards
|
||||
* @oas [post] /admin/gift-cards
|
||||
* operationId: "PostGiftCards"
|
||||
* summary: "Create a Gift Card"
|
||||
* description: "Creates a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [delete] /gift-cards/{id}
|
||||
* @oas [delete] /admin/gift-cards/{id}
|
||||
* operationId: "DeleteGiftCardsGiftCard"
|
||||
* summary: "Delete a Gift Card"
|
||||
* description: "Deletes a Gift Card"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { defaultAdminGiftCardFields, defaultAdminGiftCardRelations } from "./"
|
||||
|
||||
/**
|
||||
* @oas [get] /gift-cards/{id}
|
||||
* @oas [get] /admin/gift-cards/{id}
|
||||
* operationId: "GetGiftCardsGiftCard"
|
||||
* summary: "Get a Gift Card"
|
||||
* description: "Retrieves a Gift Card."
|
||||
|
||||
@@ -7,7 +7,7 @@ import { validator } from "../../../../utils/validator"
|
||||
import { isDefined } from "medusa-core-utils"
|
||||
|
||||
/**
|
||||
* @oas [get] /gift-cards
|
||||
* @oas [get] /admin/gift-cards
|
||||
* operationId: "GetGiftCards"
|
||||
* summary: "List Gift Cards"
|
||||
* description: "Retrieves a list of Gift Cards."
|
||||
|
||||
@@ -7,7 +7,7 @@ import { validator } from "../../../../utils/validator"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /gift-cards/{id}
|
||||
* @oas [post] /admin/gift-cards/{id}
|
||||
* operationId: "PostGiftCardsGiftCard"
|
||||
* summary: "Update a Gift Card"
|
||||
* description: "Update a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region."
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import { FindParams } from "../../../../types/common"
|
||||
|
||||
/**
|
||||
* @oas [post] /inventory-items/{id}/location-levels
|
||||
* @oas [post] /admin/inventory-items/{id}/location-levels
|
||||
* operationId: "PostInventoryItemsInventoryItemLocationLevels"
|
||||
* summary: "Create an Inventory Location Level for a given Inventory Item."
|
||||
* description: "Creates an Inventory Location Level for a given Inventory Item."
|
||||
|
||||
@@ -4,7 +4,7 @@ import { IInventoryService } from "../../../../interfaces"
|
||||
import { ProductVariantInventoryService } from "../../../../services"
|
||||
|
||||
/**
|
||||
* @oas [delete] /inventory-items/{id}
|
||||
* @oas [delete] /admin/inventory-items/{id}
|
||||
* operationId: "DeleteInventoryItemsInventoryItem"
|
||||
* summary: "Delete an Inventory Item"
|
||||
* description: "Delete an Inventory Item"
|
||||
|
||||
@@ -4,7 +4,7 @@ import { EntityManager } from "typeorm"
|
||||
import { IInventoryService } from "../../../../interfaces"
|
||||
|
||||
/**
|
||||
* @oas [delete] /inventory-items/{id}/location-levels/{location_id}
|
||||
* @oas [delete] /admin/inventory-items/{id}/location-levels/{location_id}
|
||||
* operationId: "DeleteInventoryItemsInventoryIteLocationLevelsLocation"
|
||||
* summary: "Delete a location level of an Inventory Item."
|
||||
* description: "Delete a location level of an Inventory Item."
|
||||
|
||||
@@ -4,7 +4,7 @@ import { FindParams } from "../../../../types/common"
|
||||
import { joinLevels } from "./utils/join-levels"
|
||||
|
||||
/**
|
||||
* @oas [get] /inventory-items/{id}
|
||||
* @oas [get] /admin/inventory-items/{id}
|
||||
* operationId: "GetInventoryItemsInventoryItem"
|
||||
* summary: "Retrive an Inventory Item."
|
||||
* description: "Retrives an Inventory Item."
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Request, Response } from "express"
|
||||
import { IsString, IsBoolean, IsOptional } from "class-validator"
|
||||
import { IsBoolean, IsOptional, IsString } from "class-validator"
|
||||
import { Transform } from "class-transformer"
|
||||
import { IsType } from "../../../../utils/validators/is-type"
|
||||
import { getLevelsByInventoryItemId } from "./utils/join-levels"
|
||||
@@ -14,13 +14,13 @@ import {
|
||||
import { IInventoryService } from "../../../../interfaces"
|
||||
import {
|
||||
extendedFindParamsMixin,
|
||||
StringComparisonOperator,
|
||||
NumericalComparisonOperator,
|
||||
StringComparisonOperator,
|
||||
} from "../../../../types/common"
|
||||
import { AdminInventoryItemsListWithVariantsAndLocationLevelsRes } from "."
|
||||
|
||||
/**
|
||||
* @oas [get] /inventory-items
|
||||
* @oas [get] /admin/inventory-items
|
||||
* operationId: "GetInventoryItems"
|
||||
* summary: "List inventory items."
|
||||
* description: "Lists inventory items."
|
||||
|
||||
@@ -4,7 +4,7 @@ import { IInventoryService } from "../../../../interfaces"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
|
||||
/**
|
||||
* @oas [get] /inventory-items/{id}/location-levels
|
||||
* @oas [get] /admin/inventory-items/{id}/location-levels
|
||||
* operationId: "GetInventoryItemsInventoryItemLocationLevels"
|
||||
* summary: "List stock levels of a given location."
|
||||
* description: "Lists stock levels of a given location."
|
||||
|
||||
@@ -6,7 +6,7 @@ import { FindParams } from "../../../../types/common"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /inventory-items/{id}
|
||||
* @oas [post] /admin/inventory-items/{id}
|
||||
* operationId: "PostInventoryItemsInventoryItem"
|
||||
* summary: "Update an Inventory Item."
|
||||
* description: "Updates an Inventory Item."
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Request, Response } from "express"
|
||||
import { IsOptional, IsNumber } from "class-validator"
|
||||
import { IsNumber, IsOptional } from "class-validator"
|
||||
|
||||
import { IInventoryService } from "../../../../interfaces"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /inventory-items/{id}/location-levels/{location_id}
|
||||
* @oas [post] /admin/inventory-items/{id}/location-levels/{location_id}
|
||||
* operationId: "PostInventoryItemsInventoryItemLocationLevelsLocationLevel"
|
||||
* summary: "Update an Inventory Location Level for a given Inventory Item."
|
||||
* description: "Updates an Inventory Location Level for a given Inventory Item."
|
||||
|
||||
@@ -6,7 +6,7 @@ import { validator } from "../../../../utils/validator"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /invites/accept
|
||||
* @oas [post] /admin/invites/accept
|
||||
* operationId: "PostInvitesInviteAccept"
|
||||
* summary: "Accept an Invite"
|
||||
* description: "Accepts an Invite and creates a corresponding user"
|
||||
|
||||
@@ -6,7 +6,7 @@ import { validator } from "../../../../utils/validator"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /invites
|
||||
* @oas [post] /admin/invites
|
||||
* operationId: "PostInvites"
|
||||
* summary: "Create an Invite"
|
||||
* description: "Creates an Invite and triggers an 'invite' created event"
|
||||
|
||||
@@ -2,7 +2,7 @@ import { EntityManager } from "typeorm"
|
||||
import InviteService from "../../../../services/invite"
|
||||
|
||||
/**
|
||||
* @oas [delete] /invites/{invite_id}
|
||||
* @oas [delete] /admin/invites/{invite_id}
|
||||
* operationId: "DeleteInvitesInvite"
|
||||
* summary: "Delete an Invite"
|
||||
* description: "Deletes an Invite"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import InviteService from "../../../../services/invite"
|
||||
|
||||
/**
|
||||
* @oas [get] /invites
|
||||
* @oas [get] /admin/invites
|
||||
* operationId: "GetInvites"
|
||||
* summary: "Lists Invites"
|
||||
* description: "Lists all Invites"
|
||||
|
||||
@@ -2,7 +2,7 @@ import InviteService from "../../../../services/invite"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /invites/{invite_id}/resend
|
||||
* @oas [post] /admin/invites/{invite_id}/resend
|
||||
* operationId: "PostInvitesInviteResend"
|
||||
* summary: "Resend an Invite"
|
||||
* description: "Resends an Invite by triggering the 'invite' created event again"
|
||||
|
||||
@@ -5,7 +5,7 @@ import { validator } from "../../../../utils/validator"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /notes
|
||||
* @oas [post] /admin/notes
|
||||
* operationId: "PostNotes"
|
||||
* summary: "Creates a Note"
|
||||
* description: "Creates a Note which can be associated with any resource as required."
|
||||
|
||||
@@ -2,7 +2,7 @@ import { EntityManager } from "typeorm"
|
||||
import NoteService from "../../../../services/note"
|
||||
|
||||
/**
|
||||
* @oas [delete] /notes/{id}
|
||||
* @oas [delete] /admin/notes/{id}
|
||||
* operationId: "DeleteNotesNote"
|
||||
* summary: "Delete a Note"
|
||||
* description: "Deletes a Note."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import NoteService from "../../../../services/note"
|
||||
|
||||
/**
|
||||
* @oas [get] /notes/{id}
|
||||
* @oas [get] /admin/notes/{id}
|
||||
* operationId: "GetNotesNote"
|
||||
* summary: "Get a Note"
|
||||
* description: "Retrieves a single note using its id"
|
||||
|
||||
@@ -6,7 +6,7 @@ import { selector } from "../../../../types/note"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [get] /notes
|
||||
* @oas [get] /admin/notes
|
||||
* operationId: "GetNotes"
|
||||
* summary: "List Notes"
|
||||
* x-authenticated: true
|
||||
|
||||
@@ -4,7 +4,7 @@ import { validator } from "../../../../utils/validator"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /notes/{id}
|
||||
* @oas [post] /admin/notes/{id}
|
||||
* operationId: "PostNotesNote"
|
||||
* summary: "Update a Note"
|
||||
* x-authenticated: true
|
||||
|
||||
@@ -12,7 +12,7 @@ import { pick } from "lodash"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [get] /notifications
|
||||
* @oas [get] /admin/notifications
|
||||
* operationId: "GetNotifications"
|
||||
* summary: "List Notifications"
|
||||
* description: "Retrieves a list of Notifications."
|
||||
|
||||
@@ -10,7 +10,7 @@ import { NotificationService } from "../../../../services"
|
||||
import { validator } from "../../../../utils/validator"
|
||||
|
||||
/**
|
||||
* @oas [post] /notifications/{id}/resend
|
||||
* @oas [post] /admin/notifications/{id}/resend
|
||||
* operationId: "PostNotificationsNotificationResend"
|
||||
* summary: "Resend Notification"
|
||||
* description: "Resends a previously sent notifications, with the same data but optionally to a different address"
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from "../../../../types/order-edit"
|
||||
|
||||
/**
|
||||
* @oas [post] /order-edits/{id}/items
|
||||
* @oas [post] /admin/order-edits/{id}/items
|
||||
* operationId: "PostOrderEditsEditLineItems"
|
||||
* summary: "Add a Line Item"
|
||||
* description: "Create an OrderEdit LineItem."
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from "../../../../types/order-edit"
|
||||
|
||||
/**
|
||||
* @oas [post] /order-edits/{id}/cancel
|
||||
* @oas [post] /admin/order-edits/{id}/cancel
|
||||
* operationId: "PostOrderEditsOrderEditCancel"
|
||||
* summary: "Cancel an OrderEdit"
|
||||
* description: "Cancels an OrderEdit."
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from "../../../../types/order-edit"
|
||||
|
||||
/**
|
||||
* @oas [post] /order-edits/{id}/confirm
|
||||
* @oas [post] /admin/order-edits/{id}/confirm
|
||||
* operationId: "PostOrderEditsOrderEditConfirm"
|
||||
* summary: "Confirms an OrderEdit"
|
||||
* description: "Confirms an OrderEdit."
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from "../../../../types/order-edit"
|
||||
|
||||
/**
|
||||
* @oas [post] /order-edits
|
||||
* @oas [post] /admin/order-edits
|
||||
* operationId: "PostOrderEdits"
|
||||
* summary: "Create an OrderEdit"
|
||||
* description: "Creates an OrderEdit."
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
} from "../../../../types/order-edit"
|
||||
|
||||
/**
|
||||
* @oas [delete] /order-edits/{id}/items/{item_id}
|
||||
* @oas [delete] /admin/order-edits/{id}/items/{item_id}
|
||||
* operationId: "DeleteOrderEditsOrderEditLineItemsLineItem"
|
||||
* summary: "Delete a Line Item"
|
||||
* description: "Delete line items from an order edit and create change item"
|
||||
|
||||
@@ -2,7 +2,7 @@ import { EntityManager } from "typeorm"
|
||||
import { OrderEditService } from "../../../../services"
|
||||
|
||||
/**
|
||||
* @oas [delete] /order-edits/{id}/changes/{change_id}
|
||||
* @oas [delete] /admin/order-edits/{id}/changes/{change_id}
|
||||
* operationId: "DeleteOrderEditsOrderEditItemChange"
|
||||
* summary: "Delete a Line Item Change"
|
||||
* description: "Deletes an Order Edit Item Change"
|
||||
|
||||
@@ -2,7 +2,7 @@ import { EntityManager } from "typeorm"
|
||||
import { OrderEditService } from "../../../../services"
|
||||
|
||||
/**
|
||||
* @oas [delete] /order-edits/{id}
|
||||
* @oas [delete] /admin/order-edits/{id}
|
||||
* operationId: "DeleteOrderEditsOrderEdit"
|
||||
* summary: "Delete an Order Edit"
|
||||
* description: "Delete an Order Edit"
|
||||
|
||||
@@ -3,7 +3,7 @@ import { OrderEditService } from "../../../../services"
|
||||
import { FindParams } from "../../../../types/common"
|
||||
|
||||
/**
|
||||
* @oas [get] /order-edits/{id}
|
||||
* @oas [get] /admin/order-edits/{id}
|
||||
* operationId: "GetOrderEditsOrderEdit"
|
||||
* summary: "Get an OrderEdit"
|
||||
* description: "Retrieves a OrderEdit."
|
||||
|
||||
@@ -4,7 +4,7 @@ import { extendedFindParamsMixin } from "../../../../types/common"
|
||||
import { IsOptional, IsString } from "class-validator"
|
||||
|
||||
/**
|
||||
* @oas [get] /order-edits
|
||||
* @oas [get] /admin/order-edits
|
||||
* operationId: "GetOrderEdits"
|
||||
* summary: "List OrderEdits"
|
||||
* description: "List OrderEdits."
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
} from "../../../../types/order-edit"
|
||||
|
||||
/**
|
||||
* @oas [post] /order-edits/{id}/request
|
||||
* @oas [post] /admin/order-edits/{id}/request
|
||||
* operationId: "PostOrderEditsOrderEditRequest"
|
||||
* summary: "Request Confirmation"
|
||||
* description: "Request customer confirmation of an Order Edit"
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
} from "../../../../types/order-edit"
|
||||
|
||||
/**
|
||||
* @oas [post] /order-edits/{id}/items/{item_id}
|
||||
* @oas [post] /admin/order-edits/{id}/items/{item_id}
|
||||
* operationId: "PostOrderEditsEditLineItemsLineItem"
|
||||
* summary: "Upsert Line Item Change"
|
||||
* description: "Create or update the order edit change holding the line item changes"
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
} from "../../../../types/order-edit"
|
||||
|
||||
/**
|
||||
* @oas [post] /order-edits/{id}
|
||||
* @oas [post] /admin/order-edits/{id}
|
||||
* operationId: "PostOrderEditsOrderEdit"
|
||||
* summary: "Update an OrderEdit"
|
||||
* description: "Updates a OrderEdit."
|
||||
|
||||
@@ -12,7 +12,7 @@ import { validator } from "../../../../utils/validator"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /orders/{id}/shipping-methods
|
||||
* @oas [post] /admin/orders/{id}/shipping-methods
|
||||
* operationId: "PostOrdersOrderShippingMethods"
|
||||
* summary: "Add a Shipping Method"
|
||||
* description: "Adds a Shipping Method to an Order. If another Shipping Method exists with the same Shipping Profile, the previous Shipping Method will be replaced."
|
||||
|
||||
@@ -2,7 +2,7 @@ import { OrderService } from "../../../../services"
|
||||
import { EntityManager } from "typeorm"
|
||||
|
||||
/**
|
||||
* @oas [post] /orders/{id}/archive
|
||||
* @oas [post] /admin/orders/{id}/archive
|
||||
* operationId: "PostOrdersOrderArchive"
|
||||
* summary: "Archive Order"
|
||||
* description: "Archives the order with the given id."
|
||||
|
||||
@@ -5,7 +5,7 @@ import { EntityManager } from "typeorm"
|
||||
import { MedusaError } from "medusa-core-utils"
|
||||
|
||||
/**
|
||||
* @oas [post] /orders/{id}/claims/{claim_id}/cancel
|
||||
* @oas [post] /admin/orders/{id}/claims/{claim_id}/cancel
|
||||
* operationId: "PostOrdersClaimCancel"
|
||||
* summary: "Cancel a Claim"
|
||||
* description: "Cancels a Claim"
|
||||
|
||||
@@ -9,7 +9,7 @@ import { EntityManager } from "typeorm"
|
||||
import { MedusaError } from "medusa-core-utils"
|
||||
|
||||
/**
|
||||
* @oas [post] /orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel
|
||||
* @oas [post] /admin/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel
|
||||
* operationId: "PostOrdersClaimFulfillmentsCancel"
|
||||
* summary: "Cancel Claim Fulfillment"
|
||||
* description: "Registers a claim's fulfillment as canceled."
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user