diff --git a/docs-util/packages/typedoc-config/inventory.js b/docs-util/packages/typedoc-config/inventory.js new file mode 100644 index 0000000000..0d3d2129ed --- /dev/null +++ b/docs-util/packages/typedoc-config/inventory.js @@ -0,0 +1,47 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +const modulesConfig = require("./_modules") + +module.exports = modulesConfig({ + entryPointPath: "packages/types/src/inventory/service.ts", + outPath: "www/apps/docs/content/references/inventory", + moduleName: "Inventory Module Reference", + documentsToFormat: [ + { + pattern: "*", + useDefaults: true, + additionalFormatting: { + frontmatterData: { + displayed_sidebar: "inventoryReference", + }, + }, + }, + { + pattern: "IInventoryService/methods", + additionalFormatting: { + reflectionDescription: + "This documentation provides a reference to the `{{alias}}` {{kind}}. This belongs to the Inventory Module.", + frontmatterData: { + displayed_sidebar: "inventoryReference", + slug: "/references/inventory/{{alias}}", + sidebar_label: "{{alias}}", + }, + reflectionTitle: { + kind: false, + typeParameters: false, + suffix: "- Inventory Module Reference", + }, + }, + }, + { + pattern: "IInventoryService.md", + additionalFormatting: { + reflectionDescription: + "This section of the documentation provides a reference to the `IInventoryService` interface’s methods. This is the interface developers use to use the functionalities provided by the Inventory Module.", + frontmatterData: { + displayed_sidebar: "inventoryReference", + slug: "/references/inventory", + }, + }, + }, + ], +}) diff --git a/docs-util/packages/typedoc-config/stock-location.js b/docs-util/packages/typedoc-config/stock-location.js new file mode 100644 index 0000000000..dba20e2231 --- /dev/null +++ b/docs-util/packages/typedoc-config/stock-location.js @@ -0,0 +1,47 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +const modulesConfig = require("./_modules") + +module.exports = modulesConfig({ + entryPointPath: "packages/types/src/stock-location/service.ts", + outPath: "www/apps/docs/content/references/stock-location", + moduleName: "Stock Location Module Reference", + documentsToFormat: [ + { + pattern: "*", + useDefaults: true, + additionalFormatting: { + frontmatterData: { + displayed_sidebar: "stockLocationReference", + }, + }, + }, + { + pattern: "IStockLocationService/methods", + additionalFormatting: { + reflectionDescription: + "This documentation provides a reference to the `{{alias}}` {{kind}}. This belongs to the Stock Location Module.", + frontmatterData: { + displayed_sidebar: "stockLocationReference", + slug: "/references/stock-location/{{alias}}", + sidebar_label: "{{alias}}", + }, + reflectionTitle: { + kind: false, + typeParameters: false, + suffix: "- Stock Location Module Reference", + }, + }, + }, + { + pattern: "IStockLocationService.md", + additionalFormatting: { + reflectionDescription: + "This section of the documentation provides a reference to the `IStockLocationService` interface’s methods. This is the interface developers use to use the functionalities provided by the Stock Location Module.", + frontmatterData: { + displayed_sidebar: "stockLocationReference", + slug: "/references/stock-location", + }, + }, + }, + ], +}) diff --git a/packages/types/src/shared-context.ts b/packages/types/src/shared-context.ts index a5d61fdcb5..949a1c37a8 100644 --- a/packages/types/src/shared-context.ts +++ b/packages/types/src/shared-context.ts @@ -1,12 +1,19 @@ import { EntityManager } from "typeorm" +/** + * @interface + * + * A shared context object that is used to share resources between the application and the module. + * + * @prop transactionManager - An instance of a transaction manager. + * @prop manager - An instance of an entity manager. + */ export type SharedContext = { transactionManager?: EntityManager manager?: EntityManager } /** - * @internal The interface tag is used to ensure that the type is documented similar to interfaces. * @interface * * A shared context object that is used to share resources between the application and the module. diff --git a/www/apps/docs/content/references/inventory/.nojekyll b/www/apps/docs/content/references/inventory/.nojekyll new file mode 100644 index 0000000000..e2ac6616ad --- /dev/null +++ b/www/apps/docs/content/references/inventory/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.adjustInventory.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.adjustInventory.mdx new file mode 100644 index 0000000000..3e9921db47 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.adjustInventory.mdx @@ -0,0 +1,212 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/adjustInventory +sidebar_label: adjustInventory +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# adjustInventory - Inventory Module Reference + +This documentation provides a reference to the `adjustInventory` method. This belongs to the Inventory Module. + +This method is used to adjust the inventory level's stocked quantity. The inventory level is identified by the IDs of its associated inventory item and location. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function adjustInventory ( + inventoryItemId: string, + locationId: string, + adjustment: number +) { + const inventoryModule = await initializeInventoryModule({}) + + const inventoryLevel = await inventoryModule.adjustInventory( + inventoryItemId, + locationId, + adjustment + ) + + // do something with the inventory level or return it. +} +``` + +## Parameters + + + +## Returns + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "reserved_quantity", + "type": "`number`", + "description": "the reserved stock quantity of an inventory item at the given location ID", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "stocked_quantity", + "type": "`number`", + "description": "the total stock quantity of an inventory item at the given location ID", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.confirmInventory.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.confirmInventory.mdx new file mode 100644 index 0000000000..0297e7f89d --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.confirmInventory.mdx @@ -0,0 +1,119 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/confirmInventory +sidebar_label: confirmInventory +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# confirmInventory - Inventory Module Reference + +This documentation provides a reference to the `confirmInventory` method. This belongs to the Inventory Module. + +This method is used to confirm whether the specified quantity of an inventory item is available in the specified locations. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function confirmInventory ( + inventoryItemId: string, + locationIds: string[], + quantity: number +) { + const inventoryModule = await initializeInventoryModule({}) + + return await inventoryModule.confirmInventory( + inventoryItemId, + locationIds, + quantity + ) +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createInventoryItem.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createInventoryItem.mdx new file mode 100644 index 0000000000..e5014f9455 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createInventoryItem.mdx @@ -0,0 +1,390 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/createInventoryItem +sidebar_label: createInventoryItem +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# createInventoryItem - Inventory Module Reference + +This documentation provides a reference to the `createInventoryItem` method. This belongs to the Inventory Module. + +This method is used to create an inventory item. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function createInventoryItem (item: { + sku: string, + requires_shipping: boolean +}) { + const inventoryModule = await initializeInventoryModule({}) + + const inventoryItem = await inventoryModule.createInventoryItem( + item + ) + + // do something with the inventory item or return it +} +``` + +## Parameters + +`", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID code of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "requires_shipping", + "type": "`boolean`", + "description": "", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The thumbnail of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "title", + "type": "``null`` \\| `string`", + "description": "The title of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "context", + "type": "[SharedContext](../../interfaces/SharedContext.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [ + { + "name": "manager", + "type": "EntityManager", + "description": "An instance of an entity manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "transactionManager", + "type": "EntityManager", + "description": "An instance of a transaction manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } +]} /> + +## Returns + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "mid_code", + "type": "`string` \\| ``null``", + "description": "The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "origin_country", + "type": "`string` \\| ``null``", + "description": "The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "requires_shipping", + "type": "`boolean`", + "description": "Whether the item requires shipping.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "sku", + "type": "`string` \\| ``null``", + "description": "The Stock Keeping Unit (SKU) code of the Inventory Item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "thumbnail", + "type": "`string` \\| ``null``", + "description": "Thumbnail for the inventory item", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "title", + "type": "`string` \\| ``null``", + "description": "Title of the inventory item", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "weight", + "type": "`number` \\| ``null``", + "description": "The weight of the Inventory Item. May be used in shipping rate calculations.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "width", + "type": "`number` \\| ``null``", + "description": "The width of the Inventory Item. May be used in shipping rate calculations.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createInventoryItems.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createInventoryItems.mdx new file mode 100644 index 0000000000..5f21a0ce91 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createInventoryItems.mdx @@ -0,0 +1,237 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/createInventoryItems +sidebar_label: createInventoryItems +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# createInventoryItems - Inventory Module Reference + +This documentation provides a reference to the `createInventoryItems` method. This belongs to the Inventory Module. + +This method is used to create inventory items. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function createInventoryItems (items: { + sku: string, + requires_shipping: boolean +}[]) { + const inventoryModule = await initializeInventoryModule({}) + + const inventoryItems = await inventoryModule.createInventoryItems( + items + ) + + // do something with the inventory items or return them +} +``` + +## Parameters + +`", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID code of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "requires_shipping", + "type": "`boolean`", + "description": "", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The thumbnail of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "title", + "type": "``null`` \\| `string`", + "description": "The title of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "context", + "type": "[SharedContext](../../interfaces/SharedContext.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [ + { + "name": "manager", + "type": "EntityManager", + "description": "An instance of an entity manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "transactionManager", + "type": "EntityManager", + "description": "An instance of a transaction manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } +]} /> + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createInventoryLevel.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createInventoryLevel.mdx new file mode 100644 index 0000000000..27588c1259 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createInventoryLevel.mdx @@ -0,0 +1,238 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/createInventoryLevel +sidebar_label: createInventoryLevel +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# createInventoryLevel - Inventory Module Reference + +This documentation provides a reference to the `createInventoryLevel` method. This belongs to the Inventory Module. + +This method is used to create inventory level. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function createInventoryLevel (item: { + inventory_item_id: string + location_id: string + stocked_quantity: number +}) { + const inventoryModule = await initializeInventoryModule({}) + + const inventoryLevel = await inventoryModule.createInventoryLevel( + item + ) + + // do something with the inventory level or return it +} +``` + +## Parameters + + + +## Returns + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "reserved_quantity", + "type": "`number`", + "description": "the reserved stock quantity of an inventory item at the given location ID", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "stocked_quantity", + "type": "`number`", + "description": "the total stock quantity of an inventory item at the given location ID", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createInventoryLevels.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createInventoryLevels.mdx new file mode 100644 index 0000000000..ecac1f5dbc --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createInventoryLevels.mdx @@ -0,0 +1,157 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/createInventoryLevels +sidebar_label: createInventoryLevels +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# createInventoryLevels - Inventory Module Reference + +This documentation provides a reference to the `createInventoryLevels` method. This belongs to the Inventory Module. + +This method is used to create inventory levels. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function createInventoryLevels (items: { + inventory_item_id: string + location_id: string + stocked_quantity: number +}[]) { + const inventoryModule = await initializeInventoryModule({}) + + const inventoryLevels = await inventoryModule.createInventoryLevels( + items + ) + + // do something with the inventory levels or return them +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createReservationItem.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createReservationItem.mdx new file mode 100644 index 0000000000..63f5c745cd --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createReservationItem.mdx @@ -0,0 +1,274 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/createReservationItem +sidebar_label: createReservationItem +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# createReservationItem - Inventory Module Reference + +This documentation provides a reference to the `createReservationItem` method. This belongs to the Inventory Module. + +This method is used to create a reservation item. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function createReservationItem (item: { + inventory_item_id: string, + location_id: string, + quantity: number +}) { + const inventoryModule = await initializeInventoryModule({}) + + const reservationItem = await inventoryModule.createReservationItems( + item + ) + + // do something with the reservation item or return them +} +``` + +## Parameters + +`", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "quantity", + "type": "`number`", + "description": "The reserved quantity.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "context", + "type": "[SharedContext](../../interfaces/SharedContext.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [ + { + "name": "manager", + "type": "EntityManager", + "description": "An instance of an entity manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "transactionManager", + "type": "EntityManager", + "description": "An instance of a transaction manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } +]} /> + +## Returns + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "quantity", + "type": "`number`", + "description": "The id of the reservation item", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createReservationItems.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createReservationItems.mdx new file mode 100644 index 0000000000..e76d4bc342 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.createReservationItems.mdx @@ -0,0 +1,184 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/createReservationItems +sidebar_label: createReservationItems +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# createReservationItems - Inventory Module Reference + +This documentation provides a reference to the `createReservationItems` method. This belongs to the Inventory Module. + +This method is used to create reservation items. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function createReservationItems (items: { + inventory_item_id: string, + location_id: string, + quantity: number +}[]) { + const inventoryModule = await initializeInventoryModule({}) + + const reservationItems = await inventoryModule.createReservationItems( + items + ) + + // do something with the reservation items or return them +} +``` + +## Parameters + +`", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "quantity", + "type": "`number`", + "description": "The reserved quantity.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "context", + "type": "[SharedContext](../../interfaces/SharedContext.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [ + { + "name": "manager", + "type": "EntityManager", + "description": "An instance of an entity manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "transactionManager", + "type": "EntityManager", + "description": "An instance of a transaction manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } +]} /> + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteInventoryItem.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteInventoryItem.mdx new file mode 100644 index 0000000000..a78ccb9a9d --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteInventoryItem.mdx @@ -0,0 +1,88 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/deleteInventoryItem +sidebar_label: deleteInventoryItem +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# deleteInventoryItem - Inventory Module Reference + +This documentation provides a reference to the `deleteInventoryItem` method. This belongs to the Inventory Module. + +This method is used to delete an inventory item or multiple inventory items. The inventory items are only soft deleted and can be restored using the +[restoreInventoryItem](IInventoryService.restoreInventoryItem.mdx) method. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function deleteInventoryItem ( + inventoryItems: string[] +) { + const inventoryModule = await initializeInventoryModule({}) + + await inventoryModule.deleteInventoryItem( + inventoryItems + ) +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteInventoryItemLevelByLocationId.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteInventoryItemLevelByLocationId.mdx new file mode 100644 index 0000000000..068aa861a0 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteInventoryItemLevelByLocationId.mdx @@ -0,0 +1,87 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/deleteInventoryItemLevelByLocationId +sidebar_label: deleteInventoryItemLevelByLocationId +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# deleteInventoryItemLevelByLocationId - Inventory Module Reference + +This documentation provides a reference to the `deleteInventoryItemLevelByLocationId` method. This belongs to the Inventory Module. + +This method deletes the inventory item level(s) for the ID(s) of associated location(s). + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function deleteInventoryItemLevelByLocationId ( + locationIds: string[] +) { + const inventoryModule = await initializeInventoryModule({}) + + await inventoryModule.deleteInventoryItemLevelByLocationId( + locationIds + ) +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteInventoryLevel.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteInventoryLevel.mdx new file mode 100644 index 0000000000..051113b41b --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteInventoryLevel.mdx @@ -0,0 +1,98 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/deleteInventoryLevel +sidebar_label: deleteInventoryLevel +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# deleteInventoryLevel - Inventory Module Reference + +This documentation provides a reference to the `deleteInventoryLevel` method. This belongs to the Inventory Module. + +This method is used to delete an inventory level. The inventory level is identified by the IDs of its associated inventory item and location. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function deleteInventoryLevel ( + inventoryItemId: string, + locationId: string +) { + const inventoryModule = await initializeInventoryModule({}) + + await inventoryModule.deleteInventoryLevel( + inventoryItemId, + locationId + ) +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteReservationItem.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteReservationItem.mdx new file mode 100644 index 0000000000..e148d79e14 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteReservationItem.mdx @@ -0,0 +1,87 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/deleteReservationItem +sidebar_label: deleteReservationItem +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# deleteReservationItem - Inventory Module Reference + +This documentation provides a reference to the `deleteReservationItem` method. This belongs to the Inventory Module. + +This method is used to delete a reservation item or multiple reservation items by their IDs. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function deleteReservationItems ( + reservationItemIds: string[] +) { + const inventoryModule = await initializeInventoryModule({}) + + await inventoryModule.deleteReservationItem( + reservationItemIds + ) +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteReservationItemByLocationId.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteReservationItemByLocationId.mdx new file mode 100644 index 0000000000..2be9d02df4 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteReservationItemByLocationId.mdx @@ -0,0 +1,87 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/deleteReservationItemByLocationId +sidebar_label: deleteReservationItemByLocationId +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# deleteReservationItemByLocationId - Inventory Module Reference + +This documentation provides a reference to the `deleteReservationItemByLocationId` method. This belongs to the Inventory Module. + +This method deletes reservation item(s) by the ID(s) of associated location(s). + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function deleteReservationItemByLocationId ( + locationIds: string[] +) { + const inventoryModule = await initializeInventoryModule({}) + + await inventoryModule.deleteReservationItemByLocationId( + locationIds + ) +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteReservationItemsByLineItem.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteReservationItemsByLineItem.mdx new file mode 100644 index 0000000000..983d6a9660 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.deleteReservationItemsByLineItem.mdx @@ -0,0 +1,87 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/deleteReservationItemsByLineItem +sidebar_label: deleteReservationItemsByLineItem +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# deleteReservationItemsByLineItem - Inventory Module Reference + +This documentation provides a reference to the `deleteReservationItemsByLineItem` method. This belongs to the Inventory Module. + +This method is used to delete the reservation items associated with a line item or multiple line items. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function deleteReservationItemsByLineItem ( + lineItemIds: string[] +) { + const inventoryModule = await initializeInventoryModule({}) + + await inventoryModule.deleteReservationItemsByLineItem( + lineItemIds + ) +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.listInventoryItems.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.listInventoryItems.mdx new file mode 100644 index 0000000000..6475fbaf3a --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.listInventoryItems.mdx @@ -0,0 +1,288 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/listInventoryItems +sidebar_label: listInventoryItems +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listInventoryItems - Inventory Module Reference + +This documentation provides a reference to the `listInventoryItems` method. This belongs to the Inventory Module. + +This method is used to retrieve a paginated list of inventory items along with the total count of available inventory items satisfying the provided filters. + +## Example + +To retrieve a list of inventory items using their IDs: + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveInventoryItems (ids: string[]) { + const inventoryModule = await initializeInventoryModule({}) + + const [inventoryItems, count] = await inventoryModule.listInventoryItems({ + id: ids + }) + + // do something with the inventory items or return them +} +``` + +To specify relations that should be retrieved within the inventory items: + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveInventoryItems (ids: string[]) { + const inventoryModule = await initializeInventoryModule({}) + + const [inventoryItems, count] = await inventoryModule.listInventoryItems({ + id: ids + }, { + relations: ["inventory_level"] + }) + + // do something with the inventory items or return them +} +``` + +By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveInventoryItems (ids: string[], skip: number, take: number) { + const inventoryModule = await initializeInventoryModule({}) + + const [inventoryItems, count] = await inventoryModule.listInventoryItems({ + id: ids + }, { + relations: ["inventory_level"], + skip, + take + }) + + // do something with the inventory items or return them +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.listInventoryLevels.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.listInventoryLevels.mdx new file mode 100644 index 0000000000..835645eacb --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.listInventoryLevels.mdx @@ -0,0 +1,270 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/listInventoryLevels +sidebar_label: listInventoryLevels +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listInventoryLevels - Inventory Module Reference + +This documentation provides a reference to the `listInventoryLevels` method. This belongs to the Inventory Module. + +This method is used to retrieve a paginated list of inventory levels along with the total count of available inventory levels satisfying the provided filters. + +## Example + +To retrieve a list of inventory levels using their IDs: + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveInventoryLevels (inventoryItemIds: string[]) { + const inventoryModule = await initializeInventoryModule({}) + + const [inventoryLevels, count] = await inventoryModule.listInventoryLevels({ + inventory_item_id: inventoryItemIds + }) + + // do something with the inventory levels or return them +} +``` + +To specify relations that should be retrieved within the inventory levels: + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveInventoryLevels (inventoryItemIds: string[]) { + const inventoryModule = await initializeInventoryModule({}) + + const [inventoryLevels, count] = await inventoryModule.listInventoryLevels({ + inventory_item_id: inventoryItemIds + }, { + relations: ["inventory_item"] + }) + + // do something with the inventory levels or return them +} +``` + +By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveInventoryLevels (inventoryItemIds: string[], skip: number, take: number) { + const inventoryModule = await initializeInventoryModule({}) + + const [inventoryLevels, count] = await inventoryModule.listInventoryLevels({ + inventory_item_id: inventoryItemIds + }, { + relations: ["inventory_item"], + skip, + take + }) + + // do something with the inventory levels or return them +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.listReservationItems.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.listReservationItems.mdx new file mode 100644 index 0000000000..293ad61e81 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.listReservationItems.mdx @@ -0,0 +1,288 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/listReservationItems +sidebar_label: listReservationItems +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listReservationItems - Inventory Module Reference + +This documentation provides a reference to the `listReservationItems` method. This belongs to the Inventory Module. + +This method is used to retrieve a paginated list of reservation items along with the total count of available reservation items satisfying the provided filters. + +## Example + +To retrieve a list of reservation items using their IDs: + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveReservationItems (ids: string[]) { + const inventoryModule = await initializeInventoryModule({}) + + const [reservationItems, count] = await inventoryModule.listReservationItems({ + id: ids + }) + + // do something with the reservation items or return them +} +``` + +To specify relations that should be retrieved within the reservation items: + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveReservationItems (ids: string[]) { + const inventoryModule = await initializeInventoryModule({}) + + const [reservationItems, count] = await inventoryModule.listReservationItems({ + id: ids + }, { + relations: ["inventory_item"] + }) + + // do something with the reservation items or return them +} +``` + +By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveReservationItems (ids: string[], skip: number, take: number) { + const inventoryModule = await initializeInventoryModule({}) + + const [reservationItems, count] = await inventoryModule.listReservationItems({ + id: ids + }, { + relations: ["inventory_item"], + skip, + take + }) + + // do something with the reservation items or return them +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.restoreInventoryItem.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.restoreInventoryItem.mdx new file mode 100644 index 0000000000..97f2f7ce68 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.restoreInventoryItem.mdx @@ -0,0 +1,87 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/restoreInventoryItem +sidebar_label: restoreInventoryItem +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# restoreInventoryItem - Inventory Module Reference + +This documentation provides a reference to the `restoreInventoryItem` method. This belongs to the Inventory Module. + +This method is used to restore an inventory item or multiple inventory items that were previously deleted using the [deleteInventoryItem](IInventoryService.deleteInventoryItem.mdx) method. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function restoreInventoryItem ( + inventoryItems: string[] +) { + const inventoryModule = await initializeInventoryModule({}) + + await inventoryModule.restoreInventoryItem( + inventoryItems + ) +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveAvailableQuantity.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveAvailableQuantity.mdx new file mode 100644 index 0000000000..f1639f2832 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveAvailableQuantity.mdx @@ -0,0 +1,110 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/retrieveAvailableQuantity +sidebar_label: retrieveAvailableQuantity +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# retrieveAvailableQuantity - Inventory Module Reference + +This documentation provides a reference to the `retrieveAvailableQuantity` method. This belongs to the Inventory Module. + +This method is used to retrieve the available quantity of an inventory item within the specified locations. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveAvailableQuantity ( + inventoryItemId: string, + locationIds: string[], +) { + const inventoryModule = await initializeInventoryModule({}) + + const quantity = await inventoryModule.retrieveAvailableQuantity( + inventoryItemId, + locationIds, + ) + + // do something with the quantity or return it +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveInventoryItem.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveInventoryItem.mdx new file mode 100644 index 0000000000..0bb21c6f49 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveInventoryItem.mdx @@ -0,0 +1,352 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/retrieveInventoryItem +sidebar_label: retrieveInventoryItem +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# retrieveInventoryItem - Inventory Module Reference + +This documentation provides a reference to the `retrieveInventoryItem` method. This belongs to the Inventory Module. + +This method is used to retrieve an inventory item by its ID + +## Example + +A simple example that retrieves a inventory item by its ID: + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveInventoryItem (id: string) { + const inventoryModule = await initializeInventoryModule({}) + + const inventoryItem = await inventoryModule.retrieveInventoryItem(id) + + // do something with the inventory item or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveInventoryItem (id: string) { + const inventoryModule = await initializeInventoryModule({}) + + const inventoryItem = await inventoryModule.retrieveInventoryItem(id, { + relations: ["inventory_level"] + }) + + // do something with the inventory item or return it +} +``` + +## Parameters + + + +## Returns + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "mid_code", + "type": "`string` \\| ``null``", + "description": "The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "origin_country", + "type": "`string` \\| ``null``", + "description": "The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "requires_shipping", + "type": "`boolean`", + "description": "Whether the item requires shipping.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "sku", + "type": "`string` \\| ``null``", + "description": "The Stock Keeping Unit (SKU) code of the Inventory Item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "thumbnail", + "type": "`string` \\| ``null``", + "description": "Thumbnail for the inventory item", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "title", + "type": "`string` \\| ``null``", + "description": "Title of the inventory item", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "weight", + "type": "`number` \\| ``null``", + "description": "The weight of the Inventory Item. May be used in shipping rate calculations.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "width", + "type": "`number` \\| ``null``", + "description": "The width of the Inventory Item. May be used in shipping rate calculations.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveInventoryLevel.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveInventoryLevel.mdx new file mode 100644 index 0000000000..78edf645ec --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveInventoryLevel.mdx @@ -0,0 +1,201 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/retrieveInventoryLevel +sidebar_label: retrieveInventoryLevel +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# retrieveInventoryLevel - Inventory Module Reference + +This documentation provides a reference to the `retrieveInventoryLevel` method. This belongs to the Inventory Module. + +This method is used to retrieve an inventory level for an inventory item and a location. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveInventoryLevel ( + inventoryItemId: string, + locationId: string +) { + const inventoryModule = await initializeInventoryModule({}) + + const inventoryLevel = await inventoryModule.retrieveInventoryLevel( + inventoryItemId, + locationId + ) + + // do something with the inventory level or return it +} +``` + +## Parameters + + + +## Returns + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "reserved_quantity", + "type": "`number`", + "description": "the reserved stock quantity of an inventory item at the given location ID", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "stocked_quantity", + "type": "`number`", + "description": "the total stock quantity of an inventory item at the given location ID", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveReservationItem.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveReservationItem.mdx new file mode 100644 index 0000000000..64f4bc8960 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveReservationItem.mdx @@ -0,0 +1,195 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/retrieveReservationItem +sidebar_label: retrieveReservationItem +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# retrieveReservationItem - Inventory Module Reference + +This documentation provides a reference to the `retrieveReservationItem` method. This belongs to the Inventory Module. + +This method is used to retrieve a reservation item by its ID. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveReservationItem (id: string) { + const inventoryModule = await initializeInventoryModule({}) + + const reservationItem = await inventoryModule.retrieveReservationItem(id) + + // do something with the reservation item or return it +} +``` + +## Parameters + + + +## Returns + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "quantity", + "type": "`number`", + "description": "The id of the reservation item", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveReservedQuantity.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveReservedQuantity.mdx new file mode 100644 index 0000000000..b4b754f6f8 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveReservedQuantity.mdx @@ -0,0 +1,110 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/retrieveReservedQuantity +sidebar_label: retrieveReservedQuantity +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# retrieveReservedQuantity - Inventory Module Reference + +This documentation provides a reference to the `retrieveReservedQuantity` method. This belongs to the Inventory Module. + +This method is used to retrieve the reserved quantity of an inventory item within the specified locations. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveReservedQuantity ( + inventoryItemId: string, + locationIds: string[], +) { + const inventoryModule = await initializeInventoryModule({}) + + const quantity = await inventoryModule.retrieveReservedQuantity( + inventoryItemId, + locationIds, + ) + + // do something with the quantity or return it +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveStockedQuantity.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveStockedQuantity.mdx new file mode 100644 index 0000000000..e52b71bc78 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.retrieveStockedQuantity.mdx @@ -0,0 +1,110 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/retrieveStockedQuantity +sidebar_label: retrieveStockedQuantity +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# retrieveStockedQuantity - Inventory Module Reference + +This documentation provides a reference to the `retrieveStockedQuantity` method. This belongs to the Inventory Module. + +This method is used to retrieve the stocked quantity of an inventory item within the specified locations. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function retrieveStockedQuantity ( + inventoryItemId: string, + locationIds: string[], +) { + const inventoryModule = await initializeInventoryModule({}) + + const quantity = await inventoryModule.retrieveStockedQuantity( + inventoryItemId, + locationIds, + ) + + // do something with the quantity or return it +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.updateInventoryItem.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.updateInventoryItem.mdx new file mode 100644 index 0000000000..8408f1924e --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.updateInventoryItem.mdx @@ -0,0 +1,402 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/updateInventoryItem +sidebar_label: updateInventoryItem +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# updateInventoryItem - Inventory Module Reference + +This documentation provides a reference to the `updateInventoryItem` method. This belongs to the Inventory Module. + +This method is used to update an inventory item. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function updateInventoryItem ( + inventoryItemId: string, + sku: string +) { + const inventoryModule = await initializeInventoryModule({}) + + const inventoryItem = await inventoryModule.updateInventoryItem( + inventoryItemId, + { + sku + } + ) + + // do something with the inventory item or return it +} +``` + +## Parameters + +`", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID code of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "requires_shipping", + "type": "`boolean`", + "description": "", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The thumbnail of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "title", + "type": "``null`` \\| `string`", + "description": "The title of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "context", + "type": "[SharedContext](../../interfaces/SharedContext.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [ + { + "name": "manager", + "type": "EntityManager", + "description": "An instance of an entity manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "transactionManager", + "type": "EntityManager", + "description": "An instance of a transaction manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } +]} /> + +## Returns + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "mid_code", + "type": "`string` \\| ``null``", + "description": "The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "origin_country", + "type": "`string` \\| ``null``", + "description": "The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "requires_shipping", + "type": "`boolean`", + "description": "Whether the item requires shipping.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "sku", + "type": "`string` \\| ``null``", + "description": "The Stock Keeping Unit (SKU) code of the Inventory Item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "thumbnail", + "type": "`string` \\| ``null``", + "description": "Thumbnail for the inventory item", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "title", + "type": "`string` \\| ``null``", + "description": "Title of the inventory item", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "weight", + "type": "`number` \\| ``null``", + "description": "The weight of the Inventory Item. May be used in shipping rate calculations.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "width", + "type": "`number` \\| ``null``", + "description": "The width of the Inventory Item. May be used in shipping rate calculations.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.updateInventoryLevel.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.updateInventoryLevel.mdx new file mode 100644 index 0000000000..b638e5782c --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.updateInventoryLevel.mdx @@ -0,0 +1,233 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/updateInventoryLevel +sidebar_label: updateInventoryLevel +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# updateInventoryLevel - Inventory Module Reference + +This documentation provides a reference to the `updateInventoryLevel` method. This belongs to the Inventory Module. + +This method is used to update an inventory level. The inventory level is identified by the IDs of its associated inventory item and location. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function updateInventoryLevel ( + inventoryItemId: string, + locationId: string, + stockedQuantity: number +) { + const inventoryModule = await initializeInventoryModule({}) + + const inventoryLevel = await inventoryModule.updateInventoryLevels( + inventoryItemId, + locationId, + { + stocked_quantity: stockedQuantity + } + ) + + // do something with the inventory level or return it +} +``` + +## Parameters + + + +## Returns + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "reserved_quantity", + "type": "`number`", + "description": "the reserved stock quantity of an inventory item at the given location ID", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "stocked_quantity", + "type": "`number`", + "description": "the total stock quantity of an inventory item at the given location ID", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.updateInventoryLevels.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.updateInventoryLevels.mdx new file mode 100644 index 0000000000..83b15a0a15 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.updateInventoryLevels.mdx @@ -0,0 +1,148 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/updateInventoryLevels +sidebar_label: updateInventoryLevels +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# updateInventoryLevels - Inventory Module Reference + +This documentation provides a reference to the `updateInventoryLevels` method. This belongs to the Inventory Module. + +This method is used to update inventory levels. Each inventory level is identified by the IDs of its associated inventory item and location. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function updateInventoryLevels (items: { + inventory_item_id: string, + location_id: string, + stocked_quantity: number +}[]) { + const inventoryModule = await initializeInventoryModule({}) + + const inventoryLevels = await inventoryModule.updateInventoryLevels( + items + ) + + // do something with the inventory levels or return them +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.updateReservationItem.mdx b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.updateReservationItem.mdx new file mode 100644 index 0000000000..5667f822d8 --- /dev/null +++ b/www/apps/docs/content/references/inventory/IInventoryService/methods/IInventoryService.updateReservationItem.mdx @@ -0,0 +1,249 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory/updateReservationItem +sidebar_label: updateReservationItem +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# updateReservationItem - Inventory Module Reference + +This documentation provides a reference to the `updateReservationItem` method. This belongs to the Inventory Module. + +This method is used to update a reservation item. + +## Example + +```ts +import { + initialize as initializeInventoryModule, +} from "@medusajs/inventory" + +async function updateReservationItem ( + reservationItemId: string, + quantity: number +) { + const inventoryModule = await initializeInventoryModule({}) + + const reservationItem = await inventoryModule.updateReservationItem( + reservationItemId, + { + quantity + } + ) + + // do something with the reservation item or return it +} +``` + +## Parameters + +`", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "quantity", + "type": "`number`", + "description": "The reserved quantity.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "context", + "type": "[SharedContext](../../interfaces/SharedContext.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [ + { + "name": "manager", + "type": "EntityManager", + "description": "An instance of an entity manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "transactionManager", + "type": "EntityManager", + "description": "An instance of a transaction manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } +]} /> + +## Returns + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "quantity", + "type": "`number`", + "description": "The id of the reservation item", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/index.md b/www/apps/docs/content/references/inventory/index.md new file mode 100644 index 0000000000..811d939deb --- /dev/null +++ b/www/apps/docs/content/references/inventory/index.md @@ -0,0 +1,40 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Inventory Module Reference Reference + +## Interfaces + +- [BulkUpdateInventoryLevelInput](interfaces/BulkUpdateInventoryLevelInput.mdx) +- [CreateInventoryItemInput](interfaces/CreateInventoryItemInput.mdx) +- [CreateInventoryLevelInput](interfaces/CreateInventoryLevelInput.mdx) +- [CreateReservationItemInput](interfaces/CreateReservationItemInput.mdx) +- [FilterableInventoryItemProps](interfaces/FilterableInventoryItemProps.mdx) +- [FilterableInventoryLevelProps](interfaces/FilterableInventoryLevelProps.mdx) +- [FilterableReservationItemProps](interfaces/FilterableReservationItemProps.mdx) +- [FindConfig](interfaces/FindConfig.mdx) +- [IInventoryService](interfaces/IInventoryService.mdx) +- [JoinerServiceConfig](interfaces/JoinerServiceConfig.mdx) +- [JoinerServiceConfigAlias](interfaces/JoinerServiceConfigAlias.mdx) +- [NumericalComparisonOperator](interfaces/NumericalComparisonOperator.mdx) +- [SharedContext](interfaces/SharedContext.mdx) +- [StringComparisonOperator](interfaces/StringComparisonOperator.mdx) +- [UpdateInventoryLevelInput](interfaces/UpdateInventoryLevelInput.mdx) +- [UpdateReservationItemInput](interfaces/UpdateReservationItemInput.mdx) + +## Type Aliases + +- [Exclude](types/Exclude.mdx) +- [InventoryItemDTO](types/InventoryItemDTO.mdx) +- [InventoryLevelDTO](types/InventoryLevelDTO.mdx) +- [JoinerRelationship](types/JoinerRelationship.mdx) +- [ModuleJoinerConfig](types/ModuleJoinerConfig.mdx) +- [ModuleJoinerRelationship](types/ModuleJoinerRelationship.mdx) +- [Omit](types/Omit.mdx) +- [Partial](types/Partial.mdx) +- [Pick](types/Pick.mdx) +- [Record](types/Record.mdx) +- [ReservationItemDTO](types/ReservationItemDTO.mdx) diff --git a/www/apps/docs/content/references/inventory/interfaces/BulkUpdateInventoryLevelInput.mdx b/www/apps/docs/content/references/inventory/interfaces/BulkUpdateInventoryLevelInput.mdx new file mode 100644 index 0000000000..14ad253a09 --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/BulkUpdateInventoryLevelInput.mdx @@ -0,0 +1,50 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# BulkUpdateInventoryLevelInput + +The attributes to update in an inventory level. The inventory level is identified by the IDs of its associated inventory item and location. + +## Properties + + diff --git a/www/apps/docs/content/references/inventory/interfaces/CreateInventoryItemInput.mdx b/www/apps/docs/content/references/inventory/interfaces/CreateInventoryItemInput.mdx new file mode 100644 index 0000000000..07a381d601 --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/CreateInventoryItemInput.mdx @@ -0,0 +1,140 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateInventoryItemInput + +The details of the inventory item to be created. + +## Properties + +`", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "mid_code", + "type": "``null`` \\| `string`", + "description": "The MID code of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "origin_country", + "type": "``null`` \\| `string`", + "description": "The origin country of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "requires_shipping", + "type": "`boolean`", + "description": "", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "sku", + "type": "``null`` \\| `string`", + "description": "The SKU of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "thumbnail", + "type": "``null`` \\| `string`", + "description": "The thumbnail of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "title", + "type": "``null`` \\| `string`", + "description": "The title of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "weight", + "type": "``null`` \\| `number`", + "description": "The weight of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "width", + "type": "``null`` \\| `number`", + "description": "The width of the inventory item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/interfaces/CreateInventoryLevelInput.mdx b/www/apps/docs/content/references/inventory/interfaces/CreateInventoryLevelInput.mdx new file mode 100644 index 0000000000..a486b2c676 --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/CreateInventoryLevelInput.mdx @@ -0,0 +1,59 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateInventoryLevelInput + +The details of the inventory level to be created. + +## Properties + + diff --git a/www/apps/docs/content/references/inventory/interfaces/CreateReservationItemInput.mdx b/www/apps/docs/content/references/inventory/interfaces/CreateReservationItemInput.mdx new file mode 100644 index 0000000000..4de0ee761f --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/CreateReservationItemInput.mdx @@ -0,0 +1,86 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateReservationItemInput + +The details of the reservation item to be created. + +## Properties + +`", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "quantity", + "type": "`number`", + "description": "The reserved quantity.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/interfaces/FilterableInventoryItemProps.mdx b/www/apps/docs/content/references/inventory/interfaces/FilterableInventoryItemProps.mdx new file mode 100644 index 0000000000..e1c7123522 --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/FilterableInventoryItemProps.mdx @@ -0,0 +1,77 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableInventoryItemProps + +The filters to apply on retrieved inventory items. + +## Properties + + diff --git a/www/apps/docs/content/references/inventory/interfaces/FilterableInventoryLevelProps.mdx b/www/apps/docs/content/references/inventory/interfaces/FilterableInventoryLevelProps.mdx new file mode 100644 index 0000000000..dcea3d6f53 --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/FilterableInventoryLevelProps.mdx @@ -0,0 +1,59 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableInventoryLevelProps + +The filters to apply on retrieved inventory levels. + +## Properties + + diff --git a/www/apps/docs/content/references/inventory/interfaces/FilterableReservationItemProps.mdx b/www/apps/docs/content/references/inventory/interfaces/FilterableReservationItemProps.mdx new file mode 100644 index 0000000000..897cb71e90 --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/FilterableReservationItemProps.mdx @@ -0,0 +1,77 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableReservationItemProps + +The filters to apply on retrieved reservation items. + +## Properties + + diff --git a/www/apps/docs/content/references/inventory/interfaces/FindConfig.mdx b/www/apps/docs/content/references/inventory/interfaces/FindConfig.mdx new file mode 100644 index 0000000000..f7308d7a49 --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/FindConfig.mdx @@ -0,0 +1,93 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FindConfig + +An object that is used to configure how an entity is retrieved from the database. It accepts as a typed parameter an `Entity` class, +which provides correct typing of field names in its properties. + +## Type parameters + + + +## Properties + + diff --git a/www/apps/docs/content/references/inventory/interfaces/IInventoryService.mdx b/www/apps/docs/content/references/inventory/interfaces/IInventoryService.mdx new file mode 100644 index 0000000000..5c18bb2fc3 --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/IInventoryService.mdx @@ -0,0 +1,41 @@ +--- +displayed_sidebar: inventoryReference +slug: /references/inventory +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# IInventoryService Reference + +This section of the documentation provides a reference to the `IInventoryService` interface’s methods. This is the interface developers use to use the functionalities provided by the Inventory Module. + +## Methods + +- [adjustInventory](../IInventoryService/methods/IInventoryService.adjustInventory.mdx) +- [confirmInventory](../IInventoryService/methods/IInventoryService.confirmInventory.mdx) +- [createInventoryItem](../IInventoryService/methods/IInventoryService.createInventoryItem.mdx) +- [createInventoryItems](../IInventoryService/methods/IInventoryService.createInventoryItems.mdx) +- [createInventoryLevel](../IInventoryService/methods/IInventoryService.createInventoryLevel.mdx) +- [createInventoryLevels](../IInventoryService/methods/IInventoryService.createInventoryLevels.mdx) +- [createReservationItem](../IInventoryService/methods/IInventoryService.createReservationItem.mdx) +- [createReservationItems](../IInventoryService/methods/IInventoryService.createReservationItems.mdx) +- [deleteInventoryItem](../IInventoryService/methods/IInventoryService.deleteInventoryItem.mdx) +- [deleteInventoryItemLevelByLocationId](../IInventoryService/methods/IInventoryService.deleteInventoryItemLevelByLocationId.mdx) +- [deleteInventoryLevel](../IInventoryService/methods/IInventoryService.deleteInventoryLevel.mdx) +- [deleteReservationItem](../IInventoryService/methods/IInventoryService.deleteReservationItem.mdx) +- [deleteReservationItemByLocationId](../IInventoryService/methods/IInventoryService.deleteReservationItemByLocationId.mdx) +- [deleteReservationItemsByLineItem](../IInventoryService/methods/IInventoryService.deleteReservationItemsByLineItem.mdx) +- [listInventoryItems](../IInventoryService/methods/IInventoryService.listInventoryItems.mdx) +- [listInventoryLevels](../IInventoryService/methods/IInventoryService.listInventoryLevels.mdx) +- [listReservationItems](../IInventoryService/methods/IInventoryService.listReservationItems.mdx) +- [restoreInventoryItem](../IInventoryService/methods/IInventoryService.restoreInventoryItem.mdx) +- [retrieveAvailableQuantity](../IInventoryService/methods/IInventoryService.retrieveAvailableQuantity.mdx) +- [retrieveInventoryItem](../IInventoryService/methods/IInventoryService.retrieveInventoryItem.mdx) +- [retrieveInventoryLevel](../IInventoryService/methods/IInventoryService.retrieveInventoryLevel.mdx) +- [retrieveReservationItem](../IInventoryService/methods/IInventoryService.retrieveReservationItem.mdx) +- [retrieveReservedQuantity](../IInventoryService/methods/IInventoryService.retrieveReservedQuantity.mdx) +- [retrieveStockedQuantity](../IInventoryService/methods/IInventoryService.retrieveStockedQuantity.mdx) +- [updateInventoryItem](../IInventoryService/methods/IInventoryService.updateInventoryItem.mdx) +- [updateInventoryLevel](../IInventoryService/methods/IInventoryService.updateInventoryLevel.mdx) +- [updateInventoryLevels](../IInventoryService/methods/IInventoryService.updateInventoryLevels.mdx) +- [updateReservationItem](../IInventoryService/methods/IInventoryService.updateReservationItem.mdx) diff --git a/www/apps/docs/content/references/inventory/interfaces/JoinerServiceConfig.mdx b/www/apps/docs/content/references/inventory/interfaces/JoinerServiceConfig.mdx new file mode 100644 index 0000000000..6591a4773f --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/JoinerServiceConfig.mdx @@ -0,0 +1,240 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# JoinerServiceConfig + +## Properties + +`", + "description": "Extra arguments to pass to the remoteFetchData callback", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "extends", + "type": "`{ relationship: [JoinerRelationship](../types/JoinerRelationship.mdx) ; serviceName: string }`[]", + "description": "", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [ + { + "name": "relationship", + "type": "[JoinerRelationship](../types/JoinerRelationship.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [ + { + "name": "alias", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "args", + "type": "`Record`", + "description": "Extra arguments to pass to the remoteFetchData callback", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "foreignKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "inverse", + "type": "`boolean`", + "description": "In an inverted relationship the foreign key is on the other service and the primary key is on the current service", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "isInternalService", + "type": "`boolean`", + "description": "If true, the relationship is an internal service from the medusa core TODO: Remove when there are no more \"internal\" services", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "isList", + "type": "`boolean`", + "description": "Force the relationship to return a list", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "primaryKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "serviceName", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "serviceName", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "fieldAlias", + "type": "`Record`", + "description": "alias for deeper nested relationships (e.g. { 'price': 'prices.calculated\\_price\\_set.amount' })", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "primaryKeys", + "type": "`string`[]", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "relationships", + "type": "[JoinerRelationship](../types/JoinerRelationship.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [ + { + "name": "alias", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "args", + "type": "`Record`", + "description": "Extra arguments to pass to the remoteFetchData callback", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "foreignKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "inverse", + "type": "`boolean`", + "description": "In an inverted relationship the foreign key is on the other service and the primary key is on the current service", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "isInternalService", + "type": "`boolean`", + "description": "If true, the relationship is an internal service from the medusa core TODO: Remove when there are no more \"internal\" services", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "isList", + "type": "`boolean`", + "description": "Force the relationship to return a list", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "primaryKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "serviceName", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "serviceName", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/interfaces/JoinerServiceConfigAlias.mdx b/www/apps/docs/content/references/inventory/interfaces/JoinerServiceConfigAlias.mdx new file mode 100644 index 0000000000..b3404e92e6 --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/JoinerServiceConfigAlias.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# JoinerServiceConfigAlias + +## Properties + +`", + "description": "Extra arguments to pass to the remoteFetchData callback", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "name", + "type": "`string` \\| `string`[]", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/interfaces/NumericalComparisonOperator.mdx b/www/apps/docs/content/references/inventory/interfaces/NumericalComparisonOperator.mdx new file mode 100644 index 0000000000..f281605879 --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/NumericalComparisonOperator.mdx @@ -0,0 +1,48 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# NumericalComparisonOperator + +## Properties + + diff --git a/www/apps/docs/content/references/inventory/interfaces/SharedContext.mdx b/www/apps/docs/content/references/inventory/interfaces/SharedContext.mdx new file mode 100644 index 0000000000..4d6d2e115d --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/SharedContext.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# SharedContext + +A shared context object that is used to share resources between the application and the module. + +## Properties + + diff --git a/www/apps/docs/content/references/inventory/interfaces/StringComparisonOperator.mdx b/www/apps/docs/content/references/inventory/interfaces/StringComparisonOperator.mdx new file mode 100644 index 0000000000..f301baddef --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/StringComparisonOperator.mdx @@ -0,0 +1,75 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# StringComparisonOperator + +## Properties + + diff --git a/www/apps/docs/content/references/inventory/interfaces/UpdateInventoryLevelInput.mdx b/www/apps/docs/content/references/inventory/interfaces/UpdateInventoryLevelInput.mdx new file mode 100644 index 0000000000..191d6afee3 --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/UpdateInventoryLevelInput.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateInventoryLevelInput + +The attributes to update in an inventory level. + +## Properties + + diff --git a/www/apps/docs/content/references/inventory/interfaces/UpdateReservationItemInput.mdx b/www/apps/docs/content/references/inventory/interfaces/UpdateReservationItemInput.mdx new file mode 100644 index 0000000000..192be1cd39 --- /dev/null +++ b/www/apps/docs/content/references/inventory/interfaces/UpdateReservationItemInput.mdx @@ -0,0 +1,50 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateReservationItemInput + +The attributes to update in a reservation item. + +## Properties + +`", + "description": "Holds custom data in key-value pairs.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "quantity", + "type": "`number`", + "description": "The reserved quantity.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/types/Exclude.mdx b/www/apps/docs/content/references/inventory/types/Exclude.mdx new file mode 100644 index 0000000000..ad34e309ff --- /dev/null +++ b/www/apps/docs/content/references/inventory/types/Exclude.mdx @@ -0,0 +1,34 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Exclude + + **Exclude**``: T extends U ? never : T + +Exclude from T those types that are assignable to U + +### Type parameters + + diff --git a/www/apps/docs/content/references/inventory/types/InventoryItemDTO.mdx b/www/apps/docs/content/references/inventory/types/InventoryItemDTO.mdx new file mode 100644 index 0000000000..2e50d2b7c7 --- /dev/null +++ b/www/apps/docs/content/references/inventory/types/InventoryItemDTO.mdx @@ -0,0 +1,176 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# InventoryItemDTO + + **InventoryItemDTO**: `Object` + +### Type declaration + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "mid_code", + "type": "`string` \\| ``null``", + "description": "The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "origin_country", + "type": "`string` \\| ``null``", + "description": "The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "requires_shipping", + "type": "`boolean`", + "description": "Whether the item requires shipping.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "sku", + "type": "`string` \\| ``null``", + "description": "The Stock Keeping Unit (SKU) code of the Inventory Item.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "thumbnail", + "type": "`string` \\| ``null``", + "description": "Thumbnail for the inventory item", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "title", + "type": "`string` \\| ``null``", + "description": "Title of the inventory item", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "weight", + "type": "`number` \\| ``null``", + "description": "The weight of the Inventory Item. May be used in shipping rate calculations.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "width", + "type": "`number` \\| ``null``", + "description": "The width of the Inventory Item. May be used in shipping rate calculations.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/types/InventoryLevelDTO.mdx b/www/apps/docs/content/references/inventory/types/InventoryLevelDTO.mdx new file mode 100644 index 0000000000..d4dc0847d1 --- /dev/null +++ b/www/apps/docs/content/references/inventory/types/InventoryLevelDTO.mdx @@ -0,0 +1,104 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# InventoryLevelDTO + + **InventoryLevelDTO**: `Object` + +### Type declaration + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "reserved_quantity", + "type": "`number`", + "description": "the reserved stock quantity of an inventory item at the given location ID", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "stocked_quantity", + "type": "`number`", + "description": "the total stock quantity of an inventory item at the given location ID", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/types/JoinerRelationship.mdx b/www/apps/docs/content/references/inventory/types/JoinerRelationship.mdx new file mode 100644 index 0000000000..efb6ce93dc --- /dev/null +++ b/www/apps/docs/content/references/inventory/types/JoinerRelationship.mdx @@ -0,0 +1,86 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# JoinerRelationship + + **JoinerRelationship**: `Object` + +### Type declaration + +`", + "description": "Extra arguments to pass to the remoteFetchData callback", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "foreignKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "inverse", + "type": "`boolean`", + "description": "In an inverted relationship the foreign key is on the other service and the primary key is on the current service", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "isInternalService", + "type": "`boolean`", + "description": "If true, the relationship is an internal service from the medusa core TODO: Remove when there are no more \"internal\" services", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "isList", + "type": "`boolean`", + "description": "Force the relationship to return a list", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "primaryKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "serviceName", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/inventory/types/ModuleJoinerConfig.mdx b/www/apps/docs/content/references/inventory/types/ModuleJoinerConfig.mdx new file mode 100644 index 0000000000..de4da66a88 --- /dev/null +++ b/www/apps/docs/content/references/inventory/types/ModuleJoinerConfig.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ModuleJoinerConfig + + **ModuleJoinerConfig**: [Omit](Omit.mdx)<[JoinerServiceConfig](../interfaces/JoinerServiceConfig.mdx), `"serviceName"` \| `"primaryKeys"` \| `"relationships"` \| `"extends"`> & { databaseConfig?: { extraFields?: Record<string, { defaultValue?: string ; nullable?: boolean ; options?: Record<string, unknown> ; type: `"date"` \| `"time"` \| `"datetime"` \| `"bigint"` \| `"blob"` \| `"uint8array"` \| `"array"` \| `"enumArray"` \| `"enum"` \| `"json"` \| `"integer"` \| `"smallint"` \| `"tinyint"` \| `"mediumint"` \| `"float"` \| `"double"` \| `"boolean"` \| `"decimal"` \| `"string"` \| `"uuid"` \| `"text"` }> ; idPrefix?: string ; tableName?: string } ; extends?: { fieldAlias?: Record<string, string \| { forwardArgumentsOnPath: string[] ; path: string }> ; relationship: [ModuleJoinerRelationship](ModuleJoinerRelationship.mdx) ; serviceName: string }[] ; isLink?: boolean ; isReadOnlyLink?: boolean ; linkableKeys?: Record<string, string> ; primaryKeys?: string[] ; relationships?: [ModuleJoinerRelationship](ModuleJoinerRelationship.mdx)[] ; schema?: string ; serviceName?: string } diff --git a/www/apps/docs/content/references/inventory/types/ModuleJoinerRelationship.mdx b/www/apps/docs/content/references/inventory/types/ModuleJoinerRelationship.mdx new file mode 100644 index 0000000000..e85f23d080 --- /dev/null +++ b/www/apps/docs/content/references/inventory/types/ModuleJoinerRelationship.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ModuleJoinerRelationship + + **ModuleJoinerRelationship**: [JoinerRelationship](JoinerRelationship.mdx) & { deleteCascade?: boolean ; isInternalService?: boolean } diff --git a/www/apps/docs/content/references/inventory/types/Omit.mdx b/www/apps/docs/content/references/inventory/types/Omit.mdx new file mode 100644 index 0000000000..fa1376bc6c --- /dev/null +++ b/www/apps/docs/content/references/inventory/types/Omit.mdx @@ -0,0 +1,34 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Omit + + **Omit**``: [Pick](Pick.mdx)<T, [Exclude](Exclude.mdx)<keyof T, K>> + +Construct a type with the properties of T except for those in type K. + +### Type parameters + + diff --git a/www/apps/docs/content/references/inventory/types/Partial.mdx b/www/apps/docs/content/references/inventory/types/Partial.mdx new file mode 100644 index 0000000000..3252d07246 --- /dev/null +++ b/www/apps/docs/content/references/inventory/types/Partial.mdx @@ -0,0 +1,25 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Partial + + **Partial**``: { [P in keyof T]?: T[P] } + +Make all properties in T optional + +### Type parameters + + diff --git a/www/apps/docs/content/references/inventory/types/Pick.mdx b/www/apps/docs/content/references/inventory/types/Pick.mdx new file mode 100644 index 0000000000..02d5bfba6d --- /dev/null +++ b/www/apps/docs/content/references/inventory/types/Pick.mdx @@ -0,0 +1,34 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Pick + + **Pick**``: { [P in K]: T[P] } + +From T, pick a set of properties whose keys are in the union K + +### Type parameters + + diff --git a/www/apps/docs/content/references/inventory/types/Record.mdx b/www/apps/docs/content/references/inventory/types/Record.mdx new file mode 100644 index 0000000000..5896847569 --- /dev/null +++ b/www/apps/docs/content/references/inventory/types/Record.mdx @@ -0,0 +1,34 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Record + + **Record**``: { [P in K]: T } + +Construct a type with a set of properties K of type T + +### Type parameters + + diff --git a/www/apps/docs/content/references/inventory/types/ReservationItemDTO.mdx b/www/apps/docs/content/references/inventory/types/ReservationItemDTO.mdx new file mode 100644 index 0000000000..1b039b69cc --- /dev/null +++ b/www/apps/docs/content/references/inventory/types/ReservationItemDTO.mdx @@ -0,0 +1,115 @@ +--- +displayed_sidebar: inventoryReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ReservationItemDTO + + **ReservationItemDTO**: `Object` + +Represents a reservation of an inventory item at a stock location + +### Type declaration + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "quantity", + "type": "`number`", + "description": "The id of the reservation item", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/stock-location/.nojekyll b/www/apps/docs/content/references/stock-location/.nojekyll new file mode 100644 index 0000000000..e2ac6616ad --- /dev/null +++ b/www/apps/docs/content/references/stock-location/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.create.mdx b/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.create.mdx new file mode 100644 index 0000000000..33755a0c81 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.create.mdx @@ -0,0 +1,207 @@ +--- +displayed_sidebar: stockLocationReference +slug: /references/stock-location/create +sidebar_label: create +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# create - Stock Location Module Reference + +This documentation provides a reference to the `create` method. This belongs to the Stock Location Module. + +This method is used to create a stock location. + +## Example + +```ts +import { + initialize as initializeStockLocationModule, +} from "@medusajs/stock-location" + +async function createStockLocation (name: string) { + const stockLocationModule = await initializeStockLocationModule({}) + + const stockLocation = await stockLocationModule.create({ + name + }) + + // do something with the stock location or return it +} +``` + +## Parameters + +`", + "description": "An optional key-value map with additional details", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The stock location name", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "context", + "type": "[SharedContext](../../interfaces/SharedContext.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [ + { + "name": "manager", + "type": "EntityManager", + "description": "An instance of an entity manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "transactionManager", + "type": "EntityManager", + "description": "An instance of a transaction manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } +]} /> + +## Returns + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the stock location", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.delete.mdx b/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.delete.mdx new file mode 100644 index 0000000000..97d77d43b9 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.delete.mdx @@ -0,0 +1,83 @@ +--- +displayed_sidebar: stockLocationReference +slug: /references/stock-location/delete +sidebar_label: delete +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# delete - Stock Location Module Reference + +This documentation provides a reference to the `delete` method. This belongs to the Stock Location Module. + +This method is used to delete a stock location. + +## Example + +```ts +import { + initialize as initializeStockLocationModule, +} from "@medusajs/stock-location" + +async function deleteStockLocation (id:string) { + const stockLocationModule = await initializeStockLocationModule({}) + + await stockLocationModule.delete(id) +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.list.mdx b/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.list.mdx new file mode 100644 index 0000000000..41ec1e0037 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.list.mdx @@ -0,0 +1,244 @@ +--- +displayed_sidebar: stockLocationReference +slug: /references/stock-location/list +sidebar_label: list +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# list - Stock Location Module Reference + +This documentation provides a reference to the `list` method. This belongs to the Stock Location Module. + +This method is used to retrieve a paginated list of stock locations based on optional filters and configuration. + +## Example + +To retrieve a list of stock locations using their IDs: + +```ts +import { + initialize as initializeStockLocationModule, +} from "@medusajs/stock-location" + +async function listStockLocations (ids: string[]) { + const stockLocationModule = await initializeStockLocationModule({}) + + const stockLocations = await stockLocationModule.list({ + id: ids + }) + + // do something with the stock locations or return them +} +``` + +To specify relations that should be retrieved within the stock locations: + +```ts +import { + initialize as initializeStockLocationModule, +} from "@medusajs/stock-location" + +async function listStockLocations (ids: string[]) { + const stockLocationModule = await initializeStockLocationModule({}) + + const stockLocations = await stockLocationModule.list({ + id: ids + }, { + relations: ["address"] + }) + + // do something with the stock locations or return them +} +``` + +By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeStockLocationModule, +} from "@medusajs/stock-location" + +async function listStockLocations (ids: string[], skip: number, take: number) { + const stockLocationModule = await initializeStockLocationModule({}) + + const stockLocations = await stockLocationModule.list({ + id: ids + }, { + relations: ["address"], + skip, + take + }) + + // do something with the stock locations or return them +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.listAndCount.mdx b/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.listAndCount.mdx new file mode 100644 index 0000000000..8062cde463 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.listAndCount.mdx @@ -0,0 +1,243 @@ +--- +displayed_sidebar: stockLocationReference +slug: /references/stock-location/listAndCount +sidebar_label: listAndCount +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# listAndCount - Stock Location Module Reference + +This documentation provides a reference to the `listAndCount` method. This belongs to the Stock Location Module. + +This method is used to retrieve a paginated list of stock locations along with the total count of available stock locations satisfying the provided filters. + +## Example + +To retrieve a list of stock locations using their IDs: + +```ts +import { + initialize as initializeStockLocationModule, +} from "@medusajs/stock-location" + +async function listStockLocations (ids: string[]) { + const stockLocationModule = await initializeStockLocationModule({}) + + const [stockLocations, count] = await stockLocationModule.listAndCount({ + id: ids + }) + + // do something with the stock locations or return them +} +``` + +To specify relations that should be retrieved within the stock locations: + +```ts +import { + initialize as initializeStockLocationModule, +} from "@medusajs/stock-location" + +async function listStockLocations (ids: string[]) { + const stockLocationModule = await initializeStockLocationModule({}) + + const [stockLocations, count] = await stockLocationModule.listAndCount({ + id: ids + }, { + relations: ["address"] + }) + + // do something with the stock locations or return them +} +``` + +By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter: + +```ts +import { + initialize as initializeStockLocationModule, +} from "@medusajs/stock-location" + +async function listStockLocations (ids: string[], skip: number, take: number) { + const stockLocationModule = await initializeStockLocationModule({}) + + const [stockLocations, count] = await stockLocationModule.listAndCount({ + id: ids + }, { + relations: ["address"], + skip, + take + }) + + // do something with the stock locations or return them +} +``` + +## Parameters + + + +## Returns + + diff --git a/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.retrieve.mdx b/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.retrieve.mdx new file mode 100644 index 0000000000..042a42f74c --- /dev/null +++ b/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.retrieve.mdx @@ -0,0 +1,262 @@ +--- +displayed_sidebar: stockLocationReference +slug: /references/stock-location/retrieve +sidebar_label: retrieve +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# retrieve - Stock Location Module Reference + +This documentation provides a reference to the `retrieve` method. This belongs to the Stock Location Module. + +This method is used to retrieve a stock location by its ID + +## Example + +A simple example that retrieves a inventory item by its ID: + +```ts +import { + initialize as initializeStockLocationModule, +} from "@medusajs/stock-location" + +async function retrieveStockLocation (id: string) { + const stockLocationModule = await initializeStockLocationModule({}) + + const stockLocation = await stockLocationModule.retrieve(id) + + // do something with the stock location or return it +} +``` + +To specify relations that should be retrieved: + +```ts +import { + initialize as initializeStockLocationModule, +} from "@medusajs/stock-location" + +async function retrieveStockLocation (id: string) { + const stockLocationModule = await initializeStockLocationModule({}) + + const stockLocation = await stockLocationModule.retrieve(id, { + relations: ["address"] + }) + + // do something with the stock location or return it +} +``` + +## Parameters + + + +## Returns + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the stock location", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.update.mdx b/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.update.mdx new file mode 100644 index 0000000000..dfc7f9d994 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/IStockLocationService/methods/IStockLocationService.update.mdx @@ -0,0 +1,289 @@ +--- +displayed_sidebar: stockLocationReference +slug: /references/stock-location/update +sidebar_label: update +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# update - Stock Location Module Reference + +This documentation provides a reference to the `update` method. This belongs to the Stock Location Module. + +This method is used to update a stock location. + +## Example + +```ts +import { + initialize as initializeStockLocationModule, +} from "@medusajs/stock-location" + +async function updateStockLocation (id:string, name: string) { + const stockLocationModule = await initializeStockLocationModule({}) + + const stockLocation = await stockLocationModule.update(id, { + name + }) + + // do something with the stock location or return it +} +``` + +## Parameters + +`", + "description": "An optional key-value map with additional details", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "phone", + "type": "`string`", + "description": "Stock location address' phone number", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "postal_code", + "type": "`string`", + "description": "Stock location address' postal code", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "province", + "type": "`string`", + "description": "Stock location address' province", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "address_id", + "type": "`string`", + "description": "The Stock location address ID", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "metadata", + "type": "`Record`", + "description": "An optional key-value map with additional details", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The stock location name", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "context", + "type": "[SharedContext](../../interfaces/SharedContext.mdx)", + "description": "A context used to share resources, such as transaction manager, between the application and the module.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [ + { + "name": "manager", + "type": "EntityManager", + "description": "An instance of an entity manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "transactionManager", + "type": "EntityManager", + "description": "An instance of a transaction manager.", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } +]} /> + +## Returns + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the stock location", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + } + ] + } +]} /> diff --git a/www/apps/docs/content/references/stock-location/index.md b/www/apps/docs/content/references/stock-location/index.md new file mode 100644 index 0000000000..9f1a18c8a4 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/index.md @@ -0,0 +1,32 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Stock Location Module Reference Reference + +## Interfaces + +- [FilterableStockLocationProps](interfaces/FilterableStockLocationProps.mdx) +- [FindConfig](interfaces/FindConfig.mdx) +- [IStockLocationService](interfaces/IStockLocationService.mdx) +- [JoinerServiceConfig](interfaces/JoinerServiceConfig.mdx) +- [JoinerServiceConfigAlias](interfaces/JoinerServiceConfigAlias.mdx) +- [SharedContext](interfaces/SharedContext.mdx) +- [StringComparisonOperator](interfaces/StringComparisonOperator.mdx) + +## Type Aliases + +- [CreateStockLocationInput](types/CreateStockLocationInput.mdx) +- [Exclude](types/Exclude.mdx) +- [JoinerRelationship](types/JoinerRelationship.mdx) +- [ModuleJoinerConfig](types/ModuleJoinerConfig.mdx) +- [ModuleJoinerRelationship](types/ModuleJoinerRelationship.mdx) +- [Omit](types/Omit.mdx) +- [Pick](types/Pick.mdx) +- [Record](types/Record.mdx) +- [StockLocationAddressDTO](types/StockLocationAddressDTO.mdx) +- [StockLocationAddressInput](types/StockLocationAddressInput.mdx) +- [StockLocationDTO](types/StockLocationDTO.mdx) +- [UpdateStockLocationInput](types/UpdateStockLocationInput.mdx) diff --git a/www/apps/docs/content/references/stock-location/interfaces/FilterableStockLocationProps.mdx b/www/apps/docs/content/references/stock-location/interfaces/FilterableStockLocationProps.mdx new file mode 100644 index 0000000000..b4b432d4e2 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/interfaces/FilterableStockLocationProps.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FilterableStockLocationProps + +The filters to apply on the retrieved stock locations. + +## Properties + + diff --git a/www/apps/docs/content/references/stock-location/interfaces/FindConfig.mdx b/www/apps/docs/content/references/stock-location/interfaces/FindConfig.mdx new file mode 100644 index 0000000000..570eac81f6 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/interfaces/FindConfig.mdx @@ -0,0 +1,93 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# FindConfig + +An object that is used to configure how an entity is retrieved from the database. It accepts as a typed parameter an `Entity` class, +which provides correct typing of field names in its properties. + +## Type parameters + + + +## Properties + + diff --git a/www/apps/docs/content/references/stock-location/interfaces/IStockLocationService.mdx b/www/apps/docs/content/references/stock-location/interfaces/IStockLocationService.mdx new file mode 100644 index 0000000000..9f894a9a99 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/interfaces/IStockLocationService.mdx @@ -0,0 +1,19 @@ +--- +displayed_sidebar: stockLocationReference +slug: /references/stock-location +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# IStockLocationService Reference + +This section of the documentation provides a reference to the `IStockLocationService` interface’s methods. This is the interface developers use to use the functionalities provided by the Stock Location Module. + +## Methods + +- [create](../IStockLocationService/methods/IStockLocationService.create.mdx) +- [delete](../IStockLocationService/methods/IStockLocationService.delete.mdx) +- [list](../IStockLocationService/methods/IStockLocationService.list.mdx) +- [listAndCount](../IStockLocationService/methods/IStockLocationService.listAndCount.mdx) +- [retrieve](../IStockLocationService/methods/IStockLocationService.retrieve.mdx) +- [update](../IStockLocationService/methods/IStockLocationService.update.mdx) diff --git a/www/apps/docs/content/references/stock-location/interfaces/JoinerServiceConfig.mdx b/www/apps/docs/content/references/stock-location/interfaces/JoinerServiceConfig.mdx new file mode 100644 index 0000000000..ebdcae936b --- /dev/null +++ b/www/apps/docs/content/references/stock-location/interfaces/JoinerServiceConfig.mdx @@ -0,0 +1,240 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# JoinerServiceConfig + +## Properties + +`", + "description": "Extra arguments to pass to the remoteFetchData callback", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "extends", + "type": "`{ relationship: [JoinerRelationship](../types/JoinerRelationship.mdx) ; serviceName: string }`[]", + "description": "", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [ + { + "name": "relationship", + "type": "[JoinerRelationship](../types/JoinerRelationship.mdx)", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [ + { + "name": "alias", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "args", + "type": "`Record`", + "description": "Extra arguments to pass to the remoteFetchData callback", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "foreignKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "inverse", + "type": "`boolean`", + "description": "In an inverted relationship the foreign key is on the other service and the primary key is on the current service", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "isInternalService", + "type": "`boolean`", + "description": "If true, the relationship is an internal service from the medusa core TODO: Remove when there are no more \"internal\" services", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "isList", + "type": "`boolean`", + "description": "Force the relationship to return a list", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "primaryKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "serviceName", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "serviceName", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "fieldAlias", + "type": "`Record`", + "description": "alias for deeper nested relationships (e.g. { 'price': 'prices.calculated\\_price\\_set.amount' })", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "primaryKeys", + "type": "`string`[]", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "relationships", + "type": "[JoinerRelationship](../types/JoinerRelationship.mdx)[]", + "description": "", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [ + { + "name": "alias", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "args", + "type": "`Record`", + "description": "Extra arguments to pass to the remoteFetchData callback", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "foreignKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "inverse", + "type": "`boolean`", + "description": "In an inverted relationship the foreign key is on the other service and the primary key is on the current service", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "isInternalService", + "type": "`boolean`", + "description": "If true, the relationship is an internal service from the medusa core TODO: Remove when there are no more \"internal\" services", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "isList", + "type": "`boolean`", + "description": "Force the relationship to return a list", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "primaryKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "serviceName", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "serviceName", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/stock-location/interfaces/JoinerServiceConfigAlias.mdx b/www/apps/docs/content/references/stock-location/interfaces/JoinerServiceConfigAlias.mdx new file mode 100644 index 0000000000..fedd2fb897 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/interfaces/JoinerServiceConfigAlias.mdx @@ -0,0 +1,30 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# JoinerServiceConfigAlias + +## Properties + +`", + "description": "Extra arguments to pass to the remoteFetchData callback", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "name", + "type": "`string` \\| `string`[]", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/stock-location/interfaces/SharedContext.mdx b/www/apps/docs/content/references/stock-location/interfaces/SharedContext.mdx new file mode 100644 index 0000000000..c2304c6e8c --- /dev/null +++ b/www/apps/docs/content/references/stock-location/interfaces/SharedContext.mdx @@ -0,0 +1,32 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# SharedContext + +A shared context object that is used to share resources between the application and the module. + +## Properties + + diff --git a/www/apps/docs/content/references/stock-location/interfaces/StringComparisonOperator.mdx b/www/apps/docs/content/references/stock-location/interfaces/StringComparisonOperator.mdx new file mode 100644 index 0000000000..ce8da1e3a4 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/interfaces/StringComparisonOperator.mdx @@ -0,0 +1,75 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# StringComparisonOperator + +## Properties + + diff --git a/www/apps/docs/content/references/stock-location/types/CreateStockLocationInput.mdx b/www/apps/docs/content/references/stock-location/types/CreateStockLocationInput.mdx new file mode 100644 index 0000000000..3d47b4f8ce --- /dev/null +++ b/www/apps/docs/content/references/stock-location/types/CreateStockLocationInput.mdx @@ -0,0 +1,52 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# CreateStockLocationInput + + **CreateStockLocationInput**: `Object` + +Represents the Input to create a Stock Location + +### Type declaration + +`", + "description": "An optional key-value map with additional details", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The stock location name", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/stock-location/types/Exclude.mdx b/www/apps/docs/content/references/stock-location/types/Exclude.mdx new file mode 100644 index 0000000000..32178ecb71 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/types/Exclude.mdx @@ -0,0 +1,34 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Exclude + + **Exclude**``: T extends U ? never : T + +Exclude from T those types that are assignable to U + +### Type parameters + + diff --git a/www/apps/docs/content/references/stock-location/types/JoinerRelationship.mdx b/www/apps/docs/content/references/stock-location/types/JoinerRelationship.mdx new file mode 100644 index 0000000000..a8b9b0bb87 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/types/JoinerRelationship.mdx @@ -0,0 +1,86 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# JoinerRelationship + + **JoinerRelationship**: `Object` + +### Type declaration + +`", + "description": "Extra arguments to pass to the remoteFetchData callback", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "foreignKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "inverse", + "type": "`boolean`", + "description": "In an inverted relationship the foreign key is on the other service and the primary key is on the current service", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "isInternalService", + "type": "`boolean`", + "description": "If true, the relationship is an internal service from the medusa core TODO: Remove when there are no more \"internal\" services", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "isList", + "type": "`boolean`", + "description": "Force the relationship to return a list", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "primaryKey", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "serviceName", + "type": "`string`", + "description": "", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/stock-location/types/ModuleJoinerConfig.mdx b/www/apps/docs/content/references/stock-location/types/ModuleJoinerConfig.mdx new file mode 100644 index 0000000000..8c03e537d0 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/types/ModuleJoinerConfig.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ModuleJoinerConfig + + **ModuleJoinerConfig**: [Omit](Omit.mdx)<[JoinerServiceConfig](../interfaces/JoinerServiceConfig.mdx), `"serviceName"` \| `"primaryKeys"` \| `"relationships"` \| `"extends"`> & { databaseConfig?: { extraFields?: Record<string, { defaultValue?: string ; nullable?: boolean ; options?: Record<string, unknown> ; type: `"date"` \| `"time"` \| `"datetime"` \| `"bigint"` \| `"blob"` \| `"uint8array"` \| `"array"` \| `"enumArray"` \| `"enum"` \| `"json"` \| `"integer"` \| `"smallint"` \| `"tinyint"` \| `"mediumint"` \| `"float"` \| `"double"` \| `"boolean"` \| `"decimal"` \| `"string"` \| `"uuid"` \| `"text"` }> ; idPrefix?: string ; tableName?: string } ; extends?: { fieldAlias?: Record<string, string \| { forwardArgumentsOnPath: string[] ; path: string }> ; relationship: [ModuleJoinerRelationship](ModuleJoinerRelationship.mdx) ; serviceName: string }[] ; isLink?: boolean ; isReadOnlyLink?: boolean ; linkableKeys?: Record<string, string> ; primaryKeys?: string[] ; relationships?: [ModuleJoinerRelationship](ModuleJoinerRelationship.mdx)[] ; schema?: string ; serviceName?: string } diff --git a/www/apps/docs/content/references/stock-location/types/ModuleJoinerRelationship.mdx b/www/apps/docs/content/references/stock-location/types/ModuleJoinerRelationship.mdx new file mode 100644 index 0000000000..84391270af --- /dev/null +++ b/www/apps/docs/content/references/stock-location/types/ModuleJoinerRelationship.mdx @@ -0,0 +1,9 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# ModuleJoinerRelationship + + **ModuleJoinerRelationship**: [JoinerRelationship](JoinerRelationship.mdx) & { deleteCascade?: boolean ; isInternalService?: boolean } diff --git a/www/apps/docs/content/references/stock-location/types/Omit.mdx b/www/apps/docs/content/references/stock-location/types/Omit.mdx new file mode 100644 index 0000000000..a32b525a7d --- /dev/null +++ b/www/apps/docs/content/references/stock-location/types/Omit.mdx @@ -0,0 +1,34 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Omit + + **Omit**``: [Pick](Pick.mdx)<T, [Exclude](Exclude.mdx)<keyof T, K>> + +Construct a type with the properties of T except for those in type K. + +### Type parameters + + diff --git a/www/apps/docs/content/references/stock-location/types/Pick.mdx b/www/apps/docs/content/references/stock-location/types/Pick.mdx new file mode 100644 index 0000000000..e2e347e369 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/types/Pick.mdx @@ -0,0 +1,34 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Pick + + **Pick**``: { [P in K]: T[P] } + +From T, pick a set of properties whose keys are in the union K + +### Type parameters + + diff --git a/www/apps/docs/content/references/stock-location/types/Record.mdx b/www/apps/docs/content/references/stock-location/types/Record.mdx new file mode 100644 index 0000000000..dbd7641d4e --- /dev/null +++ b/www/apps/docs/content/references/stock-location/types/Record.mdx @@ -0,0 +1,34 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# Record + + **Record**``: { [P in K]: T } + +Construct a type with a set of properties K of type T + +### Type parameters + + diff --git a/www/apps/docs/content/references/stock-location/types/StockLocationAddressDTO.mdx b/www/apps/docs/content/references/stock-location/types/StockLocationAddressDTO.mdx new file mode 100644 index 0000000000..ac0faede1d --- /dev/null +++ b/www/apps/docs/content/references/stock-location/types/StockLocationAddressDTO.mdx @@ -0,0 +1,133 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# StockLocationAddressDTO + + **StockLocationAddressDTO**: `Object` + +Represents a Stock Location Address + +### Type declaration + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "phone", + "type": "`string` \\| ``null``", + "description": "Stock location address' phone number", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "postal_code", + "type": "`string` \\| ``null``", + "description": "Stock location address' postal code", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "province", + "type": "`string` \\| ``null``", + "description": "Stock location address' province", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/stock-location/types/StockLocationAddressInput.mdx b/www/apps/docs/content/references/stock-location/types/StockLocationAddressInput.mdx new file mode 100644 index 0000000000..14feb2d877 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/types/StockLocationAddressInput.mdx @@ -0,0 +1,88 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# StockLocationAddressInput + + **StockLocationAddressInput**: `Object` + +Represents a Stock Location Address Input + +### Type declaration + +`", + "description": "An optional key-value map with additional details", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "phone", + "type": "`string`", + "description": "Stock location address' phone number", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "postal_code", + "type": "`string`", + "description": "Stock location address' postal code", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "province", + "type": "`string`", + "description": "Stock location address' province", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/stock-location/types/StockLocationDTO.mdx b/www/apps/docs/content/references/stock-location/types/StockLocationDTO.mdx new file mode 100644 index 0000000000..74b383fb5d --- /dev/null +++ b/www/apps/docs/content/references/stock-location/types/StockLocationDTO.mdx @@ -0,0 +1,206 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# StockLocationDTO + + **StockLocationDTO**: `Object` + +Represents a Stock Location + +### Type declaration + +` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "phone", + "type": "`string` \\| ``null``", + "description": "Stock location address' phone number", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "postal_code", + "type": "`string` \\| ``null``", + "description": "Stock location address' postal code", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "province", + "type": "`string` \\| ``null``", + "description": "Stock location address' province", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "address_id", + "type": "`string`", + "description": "Stock location address' ID", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "created_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was created.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "deleted_at", + "type": "`string` \\| `Date` \\| ``null``", + "description": "The date with timezone at which the resource was deleted.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "id", + "type": "`string`", + "description": "The stock location's ID", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "metadata", + "type": "`Record` \\| ``null``", + "description": "An optional key-value map with additional details", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The name of the stock location", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "updated_at", + "type": "`string` \\| `Date`", + "description": "The date with timezone at which the resource was updated.", + "optional": false, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/content/references/stock-location/types/UpdateStockLocationInput.mdx b/www/apps/docs/content/references/stock-location/types/UpdateStockLocationInput.mdx new file mode 100644 index 0000000000..556c8171b7 --- /dev/null +++ b/www/apps/docs/content/references/stock-location/types/UpdateStockLocationInput.mdx @@ -0,0 +1,125 @@ +--- +displayed_sidebar: stockLocationReference +--- + +import ParameterTypes from "@site/src/components/ParameterTypes" + +# UpdateStockLocationInput + + **UpdateStockLocationInput**: `Object` + +Represents the Input to update a Stock Location + +### Type declaration + +`", + "description": "An optional key-value map with additional details", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "phone", + "type": "`string`", + "description": "Stock location address' phone number", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "postal_code", + "type": "`string`", + "description": "Stock location address' postal code", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "province", + "type": "`string`", + "description": "Stock location address' province", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } + ] + }, + { + "name": "address_id", + "type": "`string`", + "description": "The Stock location address ID", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "metadata", + "type": "`Record`", + "description": "An optional key-value map with additional details", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + }, + { + "name": "name", + "type": "`string`", + "description": "The stock location name", + "optional": true, + "defaultValue": "", + "expandable": false, + "children": [] + } +]} /> diff --git a/www/apps/docs/sidebars.js b/www/apps/docs/sidebars.js index c912160b62..c5ddbb56ce 100644 --- a/www/apps/docs/sidebars.js +++ b/www/apps/docs/sidebars.js @@ -917,6 +917,23 @@ module.exports = { id: "modules/multiwarehouse/stock-location-module", label: "Stock Location Module", }, + { + type: "html", + value: "References", + customProps: { + sidebar_is_group_divider: true, + }, + }, + { + type: "ref", + id: "references/inventory/interfaces/IInventoryService", + label: "Inventory Module Interface Reference", + }, + { + type: "ref", + id: "references/stock-location/interfaces/IStockLocationService", + label: "Stock Location Module Interface Reference", + }, { type: "html", value: "How-to", @@ -3074,4 +3091,72 @@ module.exports = { ], }, ], + inventoryReference: [ + { + type: "ref", + id: "modules/overview", + label: "Back to Commerce Modules", + customProps: { + sidebar_is_back_link: true, + sidebar_icon: "back-arrow", + }, + }, + { + type: "doc", + id: "references/inventory/interfaces/IInventoryService", + label: "Inventory Module Interface Reference", + customProps: { + sidebar_is_title: true, + sidebar_icon: "folder-open", + }, + }, + { + type: "category", + label: "Methods", + collapsible: false, + customProps: { + sidebar_is_group_headline: true, + }, + items: [ + { + type: "autogenerated", + dirName: "references/inventory/IInventoryService/methods", + }, + ], + }, + ], + stockLocationReference: [ + { + type: "ref", + id: "modules/overview", + label: "Back to Commerce Modules", + customProps: { + sidebar_is_back_link: true, + sidebar_icon: "back-arrow", + }, + }, + { + type: "doc", + id: "references/stock-location/interfaces/IStockLocationService", + label: "Stock Location Module Interface Reference", + customProps: { + sidebar_is_title: true, + sidebar_icon: "folder-open", + }, + }, + { + type: "category", + label: "Methods", + collapsible: false, + customProps: { + sidebar_is_group_headline: true, + }, + items: [ + { + type: "autogenerated", + dirName: "references/stock-location/IStockLocationService/methods", + }, + ], + }, + ], }