chore(types): add note in TSDocs of list and retrieve methods (#12364)

This commit is contained in:
Shahed Nasser
2025-05-06 09:52:06 +03:00
committed by GitHub
parent 94b7ee99b7
commit ffd323a2a9
15 changed files with 1080 additions and 18 deletions

View File

@@ -49,11 +49,61 @@ export interface IAuthModuleService extends IModuleService {
providerData: AuthenticationInput
): Promise<AuthenticationResponse>
/**
* This method is used to register a user using a provider. The `register` method of the
* underlying provider is called, passing it the `providerData` parameter as a parameter. The method
* returns the data returned by the provider.
*
* Refer to [this guide](https://docs.medusajs.com/resources/commerce-modules/auth/authentication-route) to learn more about the authentication flows.
*
* @param {string} provider - The ID of the provider to register the user with.
* @param {AuthenticationInput} providerData - The data to pass to the provider to register the user.
* @returns {Promise<AuthenticationResponse>} The details of the registration result.
*
* @example
* The following example is in the context of an API route, where
* `req` is an instance of the `MedusaRequest` object:
*
* ```ts
* const { success, authIdentity, location, error } =
* await authModuleService.register("emailpass", {
* url: req.url,
* headers: req.headers,
* query: req.query,
* body: req.body,
* protocol: req.protocol,
* } as AuthenticationInput)
* ```
*/
register(
provider: string,
providerData: AuthenticationInput
): Promise<AuthenticationResponse>
/**
* This method updates an auth identity's details using the provider that created it. It uses the `update` method of the
* underlying provider, passing it the `providerData` parameter as a parameter. The method
* returns the data returned by the provider.
*
* @param {string} provider - The ID of the provider to update the auth identity with.
* @param {Record<string, unknown>} providerData - The data to pass to the provider to update the auth identity.
* @returns {Promise<AuthenticationResponse>} The details of the update result.
*
* @example
* The following example is in the context of an API route, where
* `req` is an instance of the `MedusaRequest` object:
*
* ```ts
* const { success, authIdentity, location, error } =
* await authModuleService.updateProvider("emailpass", {
* email: "user@example.com",
* password: "password",
* // The ID of a user, customer, or custom actor type that is being updated.
* // For example, `user_123`.
* entity_id: req.auth_context.actor_id,
* })
* ```
*/
updateProvider(
provider: string,
providerData: Record<string, unknown>

View File

@@ -66,6 +66,13 @@ export interface ICartModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const cart = await cartModuleService.retrieveCart("cart_123", {
* relations: ["shipping_address"],
@@ -98,6 +105,13 @@ export interface ICartModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the carts:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const carts = await cartModuleService.listCarts(
* {
@@ -150,6 +164,13 @@ export interface ICartModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the carts:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [carts, count] = await cartModuleService.listAndCountCarts(
* {
@@ -477,6 +498,13 @@ export interface ICartModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const lineItem = await cartModuleService.retrieveLineItem(
* "cali_123",
@@ -512,6 +540,13 @@ export interface ICartModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the line items:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const lineItems = await cartModuleService.listLineItems(
* {
@@ -737,6 +772,13 @@ export interface ICartModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping methods:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingMethods =
* await cartModuleService.listShippingMethods(
@@ -904,6 +946,13 @@ export interface ICartModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the line item adjustments:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const lineItemAdjustments =
* await cartModuleService.listLineItemAdjustments(
@@ -1068,6 +1117,13 @@ export interface ICartModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping method adjustments:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingMethodAdjustments =
* await cartModuleService.listShippingMethodAdjustments(
@@ -1238,6 +1294,13 @@ export interface ICartModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the line item tax lines:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const lineItemTaxLines =
* await cartModuleService.listLineItemTaxLines(
@@ -1384,6 +1447,13 @@ export interface ICartModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping method tax lines:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingMethodTaxLines =
* await cartModuleService.listShippingMethodTaxLines(

View File

@@ -80,6 +80,9 @@ export interface FindConfig<Entity> {
/**
* An array of strings, each being relation names of the entity to retrieve in the result.
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*/
relations?: string[]

View File

@@ -45,6 +45,13 @@ export interface ICustomerModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const customer = await customerModuleService.retrieveCustomer(
* "cus_123",
@@ -666,6 +673,13 @@ export interface ICustomerModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the addresses:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const addresses = await customerModuleService.listCustomerAddresses(
* {
@@ -719,6 +733,13 @@ export interface ICustomerModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the addresses:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [addresses, count] =
* await customerModuleService.listAndCountCustomerAddresses(
@@ -774,6 +795,13 @@ export interface ICustomerModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the customer-group relations:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const customerGroupCustomerRels =
* await customerModuleService.listCustomerGroupCustomers(
@@ -828,6 +856,13 @@ export interface ICustomerModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the customers:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const customers = await customerModuleService.listCustomers(
* {
@@ -880,6 +915,13 @@ export interface ICustomerModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the customers:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [customers, count] = await customerModuleService.listAndCountCustomers(
* {
@@ -933,6 +975,13 @@ export interface ICustomerModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the customer groups:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const customerGroups =
* await customerModuleService.listCustomerGroups(
@@ -988,6 +1037,13 @@ export interface ICustomerModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the customer groups:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [customerGroups, count] =
* await customerModuleService.listCustomerGroups(

View File

@@ -73,6 +73,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const fulfillmentSet = await fulfillmentModuleService.retrieveFulfillmentSet(
* "fuset_123",
@@ -108,6 +115,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the fulfillment set:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const fulfillmentSets = await fulfillmentModuleService.listFulfillmentSets(
* {
@@ -161,6 +175,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the fulfillment set:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [fulfillmentSets, count] =
* await fulfillmentModuleService.listAndCountFulfillmentSets(
@@ -374,6 +395,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const serviceZone =
* await fulfillmentModuleService.retrieveServiceZone(
@@ -411,6 +439,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the service zone:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const serviceZones =
* await fulfillmentModuleService.listServiceZones(
@@ -466,6 +501,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the service zone:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [serviceZones, count] =
* await fulfillmentModuleService.listAndCountServiceZones(
@@ -725,6 +767,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const geoZone =
* await fulfillmentModuleService.retrieveGeoZone("fgz_123", {
@@ -758,6 +807,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the geo zone:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const geoZones = await fulfillmentModuleService.listGeoZones(
* {
@@ -811,6 +867,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the geo zone:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [geoZones, count] =
* await fulfillmentModuleService.listAndCountGeoZones(
@@ -1032,6 +1095,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingOption =
* await fulfillmentModuleService.retrieveShippingOption(
@@ -1069,6 +1139,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping option:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingOptions =
* await fulfillmentModuleService.listShippingOptions(
@@ -1130,6 +1207,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping option:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingOptions =
* await fulfillmentModuleService.listShippingOptionsForContext(
@@ -1192,6 +1276,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping option:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [shippingOptions, count] =
* await fulfillmentModuleService.listAndCountShippingOptions(
@@ -1485,6 +1576,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingProfile =
* await fulfillmentModuleService.retrieveShippingProfile(
@@ -1522,6 +1620,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping profile:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingProfiles =
* await fulfillmentModuleService.listShippingProfiles(
@@ -1579,6 +1684,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping profile:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [shippingProfiles, count] =
* await fulfillmentModuleService.listAndCountShippingProfiles(
@@ -1843,6 +1955,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingOptionRule =
* await fulfillmentModuleService.retrieveShippingOptionRule(
@@ -1880,6 +1999,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping option rule:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingOptionRules =
* await fulfillmentModuleService.listShippingOptionRules(
@@ -1937,6 +2063,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping option rule:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [shippingOptionRules, count] =
* await fulfillmentModuleService.listAndCountShippingOptionRules(
@@ -2119,6 +2252,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingOptionType =
* await fulfillmentModuleService.retrieveShippingOptionType(
@@ -2156,6 +2296,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping option type:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingOptionTypes =
* await fulfillmentModuleService.listShippingOptionTypes(
@@ -2213,6 +2360,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping option type:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [shippingOptionTypes, count] =
* await fulfillmentModuleService.listAndCountShippingOptionTypes(
@@ -2300,6 +2454,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const fulfillment =
* await fulfillmentModuleService.retrieveFulfillment(
@@ -2337,6 +2498,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the fulfillment:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const fulfillments =
* await fulfillmentModuleService.listFulfillments(
@@ -2399,6 +2567,13 @@ export interface IFulfillmentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the fulfillment:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [fulfillments, count] =
* await fulfillmentModuleService.listAndCountFulfillments(

View File

@@ -45,6 +45,13 @@ export interface IInventoryService extends IModuleService {
*
* To specify relations that should be retrieved within the inventory items:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const inventoryItems = await inventoryModuleService.listInventoryItems(
* {
@@ -98,6 +105,13 @@ export interface IInventoryService extends IModuleService {
*
* To specify relations that should be retrieved within the inventory items:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [inventoryItems, count] =
* await inventoryModuleService.listAndCountInventoryItems(
@@ -153,6 +167,13 @@ export interface IInventoryService extends IModuleService {
*
* To specify relations that should be retrieved within the reservation items:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const reservationItems =
* await inventoryModuleService.listReservationItems(
@@ -208,6 +229,13 @@ export interface IInventoryService extends IModuleService {
*
* To specify relations that should be retrieved within the reservation items:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [reservationItems, count] =
* await inventoryModuleService.listAndCountReservationItems(
@@ -263,6 +291,13 @@ export interface IInventoryService extends IModuleService {
*
* To specify relations that should be retrieved within the inventory levels:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const inventoryLevels =
* await inventoryModuleService.listInventoryLevels(
@@ -325,6 +360,13 @@ export interface IInventoryService extends IModuleService {
*
* To specify relations that should be retrieved within the inventory levels:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [inventoryLevels, count] =
* await inventoryModuleService.listAndCountInventoryLevels(
@@ -371,6 +413,13 @@ export interface IInventoryService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const inventoryItem = await inventoryModuleService.retrieveInventoryItem(
* "iitem_123",
@@ -428,6 +477,13 @@ export interface IInventoryService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const inventoryLevel =
* await inventoryModuleService.retrieveInventoryLevel(
@@ -465,6 +521,13 @@ export interface IInventoryService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const reservationItem =
* await inventoryModuleService.retrieveReservationItem(

View File

@@ -70,6 +70,13 @@ export interface INotificationModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const notification = await notificationModuleService.retrieveNotification(
* "noti_123",
@@ -106,6 +113,13 @@ export interface INotificationModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the notifications:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const notifications = await notificationModuleService.listNotifications(
* {
@@ -160,6 +174,13 @@ export interface INotificationModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the notifications:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [notifications, count] =
* await notificationModuleService.listAndCountNotifications(

View File

@@ -120,6 +120,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const order = await orderModuleService.retrieveOrder(
* "123",
@@ -156,6 +163,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the order:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const orders = await orderModuleService.listOrders({
* id: ["123", "321"]
@@ -203,6 +217,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the order:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [orders, count] = await orderModuleService.listAndCountOrders({
* id: ["123", "321"]
@@ -250,6 +271,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const orderReturn = await orderModuleService.retrieveReturn(
* "123",
@@ -285,6 +313,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the return:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const returns = await orderModuleService.listReturns({
* id: ["123", "321"]
@@ -331,6 +366,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the return:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [returns, count] = await orderModuleService.listAndCountReturns({
* id: ["123", "321"]
@@ -377,6 +419,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const claim = await orderModuleService.retrieveOrderClaim(
* "123",
@@ -412,6 +461,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the claim:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const claims = await orderModuleService.listOrderClaims({
* id: ["123", "321"]
@@ -458,6 +514,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the claim:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [claims, count] = await orderModuleService.listAndCountOrderClaims({
* id: ["123", "321"]
@@ -504,6 +567,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const exchange = await orderModuleService.retrieveOrderExchange(
* "123",
@@ -539,6 +609,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the exchange:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const exchanges = await orderModuleService.listOrderExchanges({
* id: ["123", "321"]
@@ -585,6 +662,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the exchange:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [exchanges, count] = await orderModuleService.listOrderExchanges({
* id: ["123", "321"]
@@ -984,6 +1068,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const lineItem = await orderModuleService.retrieveOrderLineItem(
* "123",
@@ -1020,6 +1111,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the line item:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const lineItems = await orderModuleService.listOrderLineItems({
* id: ["123", "321"]
@@ -1318,6 +1416,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping method:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingMethods = await orderModuleService.listOrderShippingMethods({
* id: ["123", "321"]
@@ -1512,6 +1617,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the line item adjustment:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const lineItemAdjustment = await orderModuleService.listOrderLineItemAdjustments({
* id: ["123", "321"]
@@ -1723,6 +1835,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping method adjustment:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingMethodAdjustments = await orderModuleService
* .listOrderShippingMethodAdjustments({
@@ -1956,6 +2075,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the line item tax line:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const lineItemTaxLines = await orderModuleService
* .listOrderLineItemTaxLines({
@@ -2172,6 +2298,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping method tax line:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const shippingMethodTaxLines = await orderModuleService
* .listOrderShippingMethodTaxLines({
@@ -2402,6 +2535,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the exchange:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const orderChanges = await orderModuleService.listOrderChanges({
* id: ["123", "321"]
@@ -2448,6 +2588,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const orderChange = await orderModuleService.retrieveOrderChange(
* "123",
@@ -2958,6 +3105,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the shipping method tax line:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const orderChangeActions = await orderModuleService.listOrderChangeActions({
* id: ["123", "321"]
@@ -3005,6 +3159,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const orderChangeAction = await orderModuleService.retrieveOrderChangeAction(
* "123",
@@ -3588,6 +3749,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the transaction:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const transactions = await orderModuleService.listOrderTransactions({
* id: ["123", "321"]
@@ -3740,6 +3908,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const returnReason = await orderModuleService.retrieveReturnReason(
* "123",
@@ -3775,6 +3950,13 @@ export interface IOrderModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the return reason:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const returnReasons = await orderModuleService.listReturnReasons({
* id: ["123", "321"]

View File

@@ -110,6 +110,13 @@ export interface IPaymentModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const paymentCollection =
* await paymentModuleService.retrievePaymentCollection(
@@ -149,6 +156,13 @@ export interface IPaymentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the payment collection:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const paymentCollections =
* await paymentModuleService.listPaymentCollections(
@@ -206,6 +220,13 @@ export interface IPaymentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the payment collection:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const paymentCollections =
* await paymentModuleService.listAndCountPaymentCollections(
@@ -560,6 +581,13 @@ export interface IPaymentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the payment session:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const paymentSessions =
* await paymentModuleService.listPaymentSessions(
@@ -616,6 +644,13 @@ export interface IPaymentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the payment:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const payments = await paymentModuleService.listPayments(
* {
@@ -776,6 +811,13 @@ export interface IPaymentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the payment providers:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [paymentProviders, count] =
* await paymentModuleService.listAndCountPaymentProviders(
@@ -1060,6 +1102,13 @@ export interface IPaymentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the capture:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const captures = await paymentModuleService.listCaptures(
* {
@@ -1127,6 +1176,13 @@ export interface IPaymentModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the refund:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const refunds = await paymentModuleService.listRefunds(
* {
@@ -1332,7 +1388,14 @@ export interface IPaymentModuleService extends IModuleService {
* })
* ```
*
* To specify relations that should be retrieved within the refund :
* To specify relations that should be retrieved within the refund reasons:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const refundReasons =

View File

@@ -125,6 +125,13 @@ export interface IPricingModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const priceSet = await pricingModuleService.retrievePriceSet(
* "pset_123",
@@ -162,6 +169,13 @@ export interface IPricingModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the price sets:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const priceSets = await pricingModuleService.listPriceSets(
* {
@@ -217,6 +231,13 @@ export interface IPricingModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the price sets:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [priceSets, count] =
* await pricingModuleService.listAndCountPriceSets(
@@ -606,6 +627,13 @@ export interface IPricingModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the prices:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const prices = await pricingModuleService.listPrices(
* {
@@ -713,6 +741,13 @@ export interface IPricingModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the prices:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [prices, count] = await pricingModuleService.listPrices(
* {
@@ -765,6 +800,13 @@ export interface IPricingModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const priceRule =
* await pricingModuleService.retrievePriceRule("prule_123", {
@@ -800,6 +842,13 @@ export interface IPricingModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the price rules:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const priceRules = await pricingModuleService.listPriceRules(
* {
@@ -855,6 +904,13 @@ export interface IPricingModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the price rules:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [priceRules, count] =
* await pricingModuleService.listAndCountPriceListRules(
@@ -970,6 +1026,13 @@ export interface IPricingModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const priceList =
* await pricingModuleService.retrievePriceList("plist_123", {
@@ -1005,6 +1068,13 @@ export interface IPricingModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the price lists:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const priceLists = await pricingModuleService.listPriceLists(
* {
@@ -1060,6 +1130,13 @@ export interface IPricingModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the price lists:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [priceLists, count] =
* await pricingModuleService.listAndCountPriceLists(
@@ -1235,6 +1312,13 @@ export interface IPricingModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const priceListRule =
* await pricingModuleService.retrievePriceListRule(
@@ -1274,6 +1358,13 @@ export interface IPricingModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the price list rules:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const priceListRules =
* await pricingModuleService.listPriceListRules(
@@ -1331,6 +1422,13 @@ export interface IPricingModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the price list rules:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [priceListRules, count] =
* await pricingModuleService.listAndCountPriceListRules(
@@ -1540,8 +1638,6 @@ export interface IPricingModuleService extends IModuleService {
* })
* ```
*
* To specify relations that should be retrieved within the price preferences:
*
* By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
*
* ```ts

View File

@@ -69,6 +69,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const product = await productModuleService.retrieveProduct(
* "prod_123",
@@ -105,6 +112,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the products:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const products = await productModuleService.listProducts(
* {
@@ -159,6 +173,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the products:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [products, count] =
* await productModuleService.listAndCountProducts(
@@ -399,6 +420,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const tag = await productModuleService.retrieveProductTag(
* "ptag_123",
@@ -435,6 +463,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the product tags:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const tags = await productModuleService.listProductTags(
* {
@@ -489,6 +524,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the product tags:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [tags, count] =
* await productModuleService.listAndCountProductTags(
@@ -1039,6 +1081,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const option = await productModuleService.retrieveProductOption(
* "opt_123",
@@ -1075,6 +1124,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the product options:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const options = await productModuleService.listProductOptions(
* {
@@ -1128,7 +1184,14 @@ export interface IProductModuleService extends IModuleService {
* })
* ```
*
* To specify relations that should be retrieved within the product types:
* To specify relations that should be retrieved within the product options:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [options, count] =
@@ -1391,6 +1454,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the product option values:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const options = await productModuleService.listProductOptionValues(
* {
@@ -1440,13 +1510,23 @@ export interface IProductModuleService extends IModuleService {
* })
* ```
*
* To specify relations that should be retrieved within the product types:
* To specify relations that should be retrieved within the product option values:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [options, count] =
* await productModuleService.listAndCountProductOptionValues(
* {
* id: ["optval_123", "optval_321"],
* },
* {
* relations: ["option"],
* }
* )
* ```
@@ -1654,6 +1734,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const variant = await productModuleService.retrieveProductVariant(
* "variant_123",
@@ -1690,6 +1777,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the product variants:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const variants = await productModuleService.listProductVariants(
* {
@@ -1744,6 +1838,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the product variants:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [variants, count] =
* await productModuleService.listAndCountProductVariants(
@@ -2011,6 +2112,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const collection =
* await productModuleService.retrieveProductCollection("pcol_123", {
@@ -2046,6 +2154,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the product collections:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const collections =
* await productModuleService.listProductCollections(
@@ -2102,6 +2217,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the product collections:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [collections, count] =
* await productModuleService.listAndCountProductCollections(
@@ -2358,6 +2480,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const category = await productModuleService.retrieveProductCategory(
* "pcat_123",
@@ -2394,6 +2523,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the product categories:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const categories = await productModuleService.listProductCategories(
* {
@@ -2448,6 +2584,13 @@ export interface IProductModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the product categories:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [categories, count] =
* await productModuleService.listAndCountProductCategories(

View File

@@ -277,6 +277,13 @@ export interface IPromotionModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the promotions:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const promotions = await promotionModuleService.listPromotions(
* {
@@ -330,6 +337,13 @@ export interface IPromotionModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the promotions:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [promotions, count] =
* await promotionModuleService.listAndCountPromotions(
@@ -383,6 +397,13 @@ export interface IPromotionModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const promotion = await promotionModuleService.retrievePromotion(
* "promo_123",
@@ -724,6 +745,13 @@ export interface IPromotionModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the promotion rules:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const promotionRules =
* await promotionModuleService.listPromotionRules(
@@ -799,6 +827,13 @@ export interface IPromotionModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the campaigns:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const campaigns = await promotionModuleService.listCampaigns(
* {
@@ -852,6 +887,13 @@ export interface IPromotionModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the campaigns:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [campaigns, count] =
* await promotionModuleService.listAndCountCampaigns(
@@ -905,6 +947,13 @@ export interface IPromotionModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const campaign =
* await promotionModuleService.retrieveCampaign(

View File

@@ -186,6 +186,13 @@ export interface IRegionModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const region = await regionModuleService.retrieveRegion("reg_123", {
* relations: ["countries"],
@@ -218,6 +225,13 @@ export interface IRegionModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the regions:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const regions = await regionModuleService.listRegions(
* {
@@ -271,6 +285,13 @@ export interface IRegionModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the regions:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [regions, count] =
* await regionModuleService.listAndCountRegions(
@@ -324,6 +345,13 @@ export interface IRegionModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const country = await regionModuleService.retrieveCountry(
* "us",
@@ -359,6 +387,13 @@ export interface IRegionModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the countries:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const countries = await regionModuleService.listCountries(
* {
@@ -412,6 +447,13 @@ export interface IRegionModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the countries:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [countries, count] =
* await regionModuleService.listAndCountCountries(

View File

@@ -37,6 +37,13 @@ export interface IStockLocationService extends IModuleService {
*
* To specify relations that should be retrieved within the stock locations:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const stockLocations = await stockLocationModuleService.listStockLocations(
* {
@@ -90,6 +97,13 @@ export interface IStockLocationService extends IModuleService {
*
* To specify relations that should be retrieved within the stock locations:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [stockLocations, count] =
* await stockLocationModuleService.listandCountStockLocations(

View File

@@ -46,6 +46,13 @@ export interface ITaxModuleService extends IModuleService {
*
* To specify relations that should be retrieved:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const taxRate = await taxModuleService.retrieveTaxRate("txr_123", {
* relations: ["tax_region"],
@@ -78,6 +85,13 @@ export interface ITaxModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the tax rate:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const taxRates = await taxModuleService.listTaxRates(
* {
@@ -132,6 +146,13 @@ export interface ITaxModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the tax rate:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const [taxRates, count] = await taxModuleService.listAndCountTaxRates(
* {
@@ -499,6 +520,13 @@ export interface ITaxModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the tax region:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const taxRegions = await taxModuleService.listTaxRegions(
* {
@@ -632,6 +660,13 @@ export interface ITaxModuleService extends IModuleService {
*
* To specify relations that should be retrieved within the tax rate rule:
*
* :::note
*
* You can only retrieve data models defined in the same module. To retrieve linked data models
* from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.
*
* :::
*
* ```ts
* const taxRateRules = await taxModuleService.listTaxRateRules(
* {